getUserType() != 1) header("Location: $maintdir"); // If we get past here, we're logged in require("$catdir/constants.php3"); require("$classdir/User.php3"); if ($new_id != "" && $new_gecos != "" && $new_password != "" && $new_email != "") { $u = new User_lsc(""); $u->setID($new_id); $u->setGecos($new_gecos); srand(time()); $salt = ""; for ($i = 0; $i < 2; $i++) { if (rand() % 2 == 1) $base = 65; else $base = 97; $salt .= chr((rand() % 26) + $base); } $u->setPassword(crypt($new_password, $salt)); $u->setEmail($new_email); if ($new_admin == 1) $u->setUserType("1"); else $u->setUserType("0"); $u->save(); } header("Location: ./");