Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthornp
    • CommentTimeAug 21st 2008
     # 1
    When $Configuration['ALLOW_NAME_CHANGE'] = '0', updating personal info doesn't work. The username control isn't placed on the form, but the code is still expecting it to be there when the PHP is doing the name uniqueness check.

    The fix is to only perform the uniqueness check when ALLOW_NAME_CHANGE = 1. Here is a patch to People.Class.UserManager.php.

    1062,1070c1062,1071
    < // Ensure the username isn't taken already
    < $s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'SqlBuilder');
    < $s->SetMainTable('User', 'u');
    < $s->AddSelect('UserID', 'u');
    < $s->AddWhere('u', 'Name', '', $SafeUser->Name, '=');
    < if ($User->UserID > 0) $s->AddWhere('u', 'UserID', '', $User->UserID, '<>');
    < $MatchCount = 0;
    < $result = $this->Context->Database->Select($s, $this->Name, 'ValidateUser', 'A fatal error occurred while validating your input.');
    < $MatchCount = $this->Context->Database->RowCount($result);
    ---
    > if ($this->Context->Configuration['ALLOW_NAME_CHANGE'] == '1') {
    > // Ensure the username isn't taken already
    > $s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'SqlBuilder');
    > $s->SetMainTable('User', 'u');
    > $s->AddSelect('UserID', 'u');
    > $s->AddWhere('u', 'Name', '', $SafeUser->Name, '=');
    > if ($User->UserID > 0) $s->AddWhere('u', 'UserID', '', $User->UserID, '<>');
    > $MatchCount = 0;
    > $result = $this->Context->Database->Select($s, $this->Name, 'ValidateUser', 'A fatal error occurred while validating your input.');
    > $MatchCount = $this->Context->Database->RowCount($result);
    1072c1073,1074
    < //if ($MatchCount > 0) $this->Context->WarningCollector->Add($this->Context->GetDefinition('ErrUsernameTaken'));
    ---
    > if ($MatchCount > 0) $this->Context->WarningCollector->Add($this->Context->GetDefinition('ErrUsernameTaken'));
    > }
    •  
      CommentAuthorWallPhone
    • CommentTimeAug 22nd 2008
     # 2
    What version of PHP do you see this bug in?

    I'm not able to reproduce it... works fine every try.
    •  
      CommentAuthorWallPhone
    • CommentTimeAug 22nd 2008
     # 3
    Actually, also tell what version of MySQL you see this in--the query is already written to eliminate the existing user account... and this could be the piece that fails:
    SELECT UserID FROM LUM_User u WHERE u.Name = 'test' and u.UserID <> 8
    • CommentAuthornp
    • CommentTimeAug 22nd 2008
     # 4
    Yes, that piece fails because there is no user name being passed in by the form because ALLOW_NAME_CHANGE = 0. The resulting query is
    SELECT UserID FROM LUM_User u WHERE u.Name = '' and u.UserID <> 8
    and I already have an empty-string named user in my database.
    •  
      CommentAuthorWallPhone
    • CommentTimeAug 23rd 2008
     # 5
    Fixed!

    Just in time to see this in 1.1.5
Add your comments
    Username Password
  • Format comments as