hasGlobalAdmin()) {
include 'includes/error-no-perm.inc.php';
} elseif (Auth::user()->isDemoUser()) {
demo_account();
} else {
echo '
Add User
';
echo '
';
$pagetitle[] = 'Add user';
if (Auth::get()->canManageUsers()) {
if ($_POST['action'] == 'add') {
if ($_POST['new_username']) {
if (!Auth::get()->userExists($_POST['new_username'])) {
if (isset($_POST['can_modify_passwd'])) {
$_POST['can_modify_passwd'] = 1;
} else {
$_POST['can_modify_passwd'] = 0;
}
// FIXME: missing email field here on the form
if (Auth::get()->addUser($_POST['new_username'], $_POST['new_password'], $_POST['new_level'], $_POST['new_email'], $_POST['new_realname'], $_POST['can_modify_passwd'])) {
echo 'User '.$_POST['new_username'].' added!';
}
} else {
echo 'User with this name already exists!
';
}
} else {
echo 'Please enter a username!
';
}//end if
}//end if
echo "';
} else {
echo 'Auth module does not allow user management!
';
}//end if
}//end if