Skip to content

Commit

Permalink
Item11212: Don't report groups that were not updated
Browse files Browse the repository at this point in the history
Most of this task was fixed under Item11208 and Item10815.
The Mapper throws errors and doesn't update the prohibited groups, but
the UI still reported the groups back to the user.

git-svn-id: http://svn.foswiki.org/trunk@12924 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Oct 29, 2011
1 parent b0e2322 commit d3c3a46
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/lib/Foswiki/UI/Register.pm
Expand Up @@ -896,11 +896,15 @@ sub _complete {
}
}

my @addedTo;

if ( ($enableAddToGroup) and ( $data->{AddToGroups} ) ) {
foreach my $groupName ( split( /,/, $data->{AddToGroups} ) ) {
$session->{user} = $regoAgent;
try {
$users->addUserToGroup( $cUID, $groupName );
push @addedTo, $groupName;
print STDERR "Fell through adding $groupName\n";
}
catch Error::Simple with {
my $e = shift;
Expand All @@ -912,6 +916,8 @@ sub _complete {
};
}
}

$data->{AddToGroups} = join(',', @addedTo);
}
catch Error::Simple with {
my $e = shift;
Expand Down Expand Up @@ -1225,6 +1231,10 @@ sub _buildConfirmationEmail {
foreach my $fd ( @{ $data->{form} } ) {
my $name = $fd->{name};
my $value = $fd->{value};

# Override value - Group list might have changed
$value = $data->{AddToGroups} if ( $name eq 'AddToGroups' );

if ( ( $name eq 'Password' ) && ($hidePassword) ) {
$value = '*******';
}
Expand Down

0 comments on commit d3c3a46

Please sign in to comment.