Skip to content
Permalink
Browse files

Item11373: Need to delimit the check for duplicate

If a wikiname was contained within another wikiname, it could not be
added to a group.

git-svn-id: http://svn.foswiki.org/trunk@13469 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information...
GeorgeClark GeorgeClark
GeorgeClark authored and GeorgeClark committed Dec 19, 2011
1 parent 6098ae7 commit 017aa8cea60825d663a629409446e65ec2f125ac
@@ -908,7 +908,7 @@ sub addUserToGroup {

my $wikiName = $usersObj->getWikiName($cuid);

if ( $membersString !~ m/$wikiName/ ) {
if ( $membersString !~ m/\b$wikiName\b/ ) {
$membersString .= ', ' if ( $membersString ne '' );
$membersString .= $wikiName;
}
@@ -1495,12 +1495,22 @@ sub verify_addToGroup {
$this->assert( Foswiki::Func::isGroupMember( 'ZeeGroup', 'UserZ' ) );

$this->assert( !Foswiki::Func::isGroupMember( 'ZeeGroup', 'UserA' ) );
$this->assert( Foswiki::Func::addUserToGroup( 'UserA86', 'ZeeGroup' ) );

# Force a re-read

$this->createNewFoswikiSession( $Foswiki::cfg{AdminUserLogin} );

$this->assert( Foswiki::Func::isGroupMember( 'ZeeGroup', 'UserA86' ) );
$this->assert( !Foswiki::Func::isGroupMember( 'ZeeGroup', 'UserA' ) );

$this->assert( Foswiki::Func::addUserToGroup( 'UserA', 'ZeeGroup' ) );

# Force a re-read

$this->createNewFoswikiSession( $Foswiki::cfg{AdminUserLogin} );

$this->assert( Foswiki::Func::isGroupMember( 'ZeeGroup', 'UserA86' ) );
$this->assert( Foswiki::Func::isGroupMember( 'ZeeGroup', 'UserA' ) );

$this->assert(

0 comments on commit 017aa8c

Please sign in to comment.
You can’t perform that action at this time.