diff --git a/docs/changelog/5.x.x.txt b/docs/changelog/5.x.x.txt index abdd6f3fd..4bd176ca4 100644 --- a/docs/changelog/5.x.x.txt +++ b/docs/changelog/5.x.x.txt @@ -13,7 +13,8 @@ - Templatized the HttpProxy wobject. (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.) - + - Fixed a bug where reinvoking www_createAccountSave could produce duplicate + usernames in the database. (Thanks to Martin Kamerbeek.) 5.4.4 - Updated Finnish translation. (Thanks to Markus Hynna.) diff --git a/lib/WebGUI/Operation/Account.pm b/lib/WebGUI/Operation/Account.pm index be6139386..157125d49 100644 --- a/lib/WebGUI/Operation/Account.pm +++ b/lib/WebGUI/Operation/Account.pm @@ -69,7 +69,7 @@ sub _accountOptions { sub _checkForDuplicateUsername { my $username = $_[0]; my ($otherUser) = WebGUI::SQL->quickArray("select count(*) from users where username=".quote($username)); - if ($otherUser && $username ne $session{user}{username}) { + if ($otherUser) { return '
  • '.WebGUI::International::get(77).' "'.$username.'too", "'.$username.'2", ' .'"'.$username.'_'.WebGUI::DateTime::epochToHuman(time(),"%y").'"'; } else { @@ -185,6 +185,7 @@ sub www_createAccount { sub www_createAccountSave { my ($profile, $u, $username, $uri, $temp, $ldap, $port, %args, $search, $cmd, $connectDN, $auth, $output, $error, $uid, $encryptedPassword, $fieldName); + return www_displayAccount() if ($session{user}{userId} != 1); ($username, $error) = WebGUI::Authentication::registrationFormValidate(); ($profile, $temp) = _validateProfileData(); $error .= $temp;