Commit e48dc6ba authored by Robert Ricci's avatar Robert Ricci

Check for an account on boss with the submitted username - this will

prevent people from asking for 'root', 'toor', etc. as usernames, and
will hopefully help with new installations, which may have created
accounts by hand. Note that this checks boss only, not ops.

Also fixed a bug in newproject.php3 that was incorrectly letting
through duplicate usernames.
parent 6e4aa4d2
......@@ -413,7 +413,8 @@ if (! $returning) {
elseif (!TBvalid_uid($formfields[joining_uid])) {
$errors["UserName"] = TBFieldErrorString();
}
elseif (TBCurrentUser($formfields[joining_uid])) {
elseif (TBCurrentUser($formfields[joining_uid]) ||
posix_getpwnam($formfields[joining_uid])) {
$errors["UserName"] = "Already in use. Pick another";
}
if (!isset($formfields[usr_title]) ||
......
......@@ -568,7 +568,8 @@ if (! $returning) {
elseif (!TBvalid_uid($formfields[proj_head_uid])) {
$errors["UserName"] = TBFieldErrorString();
}
elseif (TBCurrentUser($formfields[joining_uid])) {
elseif (TBCurrentUser($formfields[proj_head_uid]) ||
posix_getpwnam($formfields[proj_head_uid])) {
$errors["UserName"] = "Already in use. Pick another";
}
if (!isset($formfields[usr_title]) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment