Fixed a bug where reinvoking www_createAccountSave could produce duplicate usernames in the database.
This commit is contained in:
parent
11f1ead334
commit
880e48f75f
2 changed files with 4 additions and 2 deletions
|
|
@ -13,7 +13,8 @@
|
||||||
- Templatized the HttpProxy wobject. (Thanks to Len Kranendonk.)
|
- Templatized the HttpProxy wobject. (Thanks to Len Kranendonk.)
|
||||||
- Added a "Search for" and "Stop at" option to HttpProxy. (Thanks to Len Kranendonk.)
|
- Added a "Search for" and "Stop at" option to HttpProxy. (Thanks to Len Kranendonk.)
|
||||||
- Enhanced HTMLArea editor to include table editing. (Thanks to Irving Carrion.)
|
- Enhanced HTMLArea editor to include table editing. (Thanks to Irving Carrion.)
|
||||||
|
- Fixed a bug where reinvoking www_createAccountSave could produce duplicate
|
||||||
|
usernames in the database. (Thanks to Martin Kamerbeek.)
|
||||||
|
|
||||||
5.4.4
|
5.4.4
|
||||||
- Updated Finnish translation. (Thanks to Markus Hynna.)
|
- Updated Finnish translation. (Thanks to Markus Hynna.)
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ sub _accountOptions {
|
||||||
sub _checkForDuplicateUsername {
|
sub _checkForDuplicateUsername {
|
||||||
my $username = $_[0];
|
my $username = $_[0];
|
||||||
my ($otherUser) = WebGUI::SQL->quickArray("select count(*) from users where username=".quote($username));
|
my ($otherUser) = WebGUI::SQL->quickArray("select count(*) from users where username=".quote($username));
|
||||||
if ($otherUser && $username ne $session{user}{username}) {
|
if ($otherUser) {
|
||||||
return '<li>'.WebGUI::International::get(77).' "'.$username.'too", "'.$username.'2", '
|
return '<li>'.WebGUI::International::get(77).' "'.$username.'too", "'.$username.'2", '
|
||||||
.'"'.$username.'_'.WebGUI::DateTime::epochToHuman(time(),"%y").'"';
|
.'"'.$username.'_'.WebGUI::DateTime::epochToHuman(time(),"%y").'"';
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -185,6 +185,7 @@ sub www_createAccount {
|
||||||
sub www_createAccountSave {
|
sub www_createAccountSave {
|
||||||
my ($profile, $u, $username, $uri, $temp, $ldap, $port, %args, $search, $cmd,
|
my ($profile, $u, $username, $uri, $temp, $ldap, $port, %args, $search, $cmd,
|
||||||
$connectDN, $auth, $output, $error, $uid, $encryptedPassword, $fieldName);
|
$connectDN, $auth, $output, $error, $uid, $encryptedPassword, $fieldName);
|
||||||
|
return www_displayAccount() if ($session{user}{userId} != 1);
|
||||||
($username, $error) = WebGUI::Authentication::registrationFormValidate();
|
($username, $error) = WebGUI::Authentication::registrationFormValidate();
|
||||||
($profile, $temp) = _validateProfileData();
|
($profile, $temp) = _validateProfileData();
|
||||||
$error .= $temp;
|
$error .= $temp;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue