Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:1 to 5 of 5
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'));
> }
SELECT UserID FROM LUM_User u WHERE u.Name = 'test' and u.UserID <> 8
SELECT UserID FROM LUM_User u WHERE u.Name = '' and u.UserID <> 81 to 5 of 5