Fix saml vs internal user add

This commit is contained in:
Josh North 2021-05-07 14:40:05 -04:00
parent bb9bdd7056
commit 37806023dc

View File

@ -178,6 +178,8 @@
header('Location: ' . $_SERVER['PHP_SELF']);
endif;
if (Registry::AUTHMETHOD == 'INTERNAL') {
if (!empty($_POST['newuser'])): // NEW USER INTERNAL
require_once("src/Misc/PasswordHash.php");
if (empty($_POST['username'])): $errors['username'] = $transLang['USERNAME_NOTEMPTY']; endif;
@ -200,6 +202,8 @@
$Users->addUser($_POST['firstname'], $_POST['lastname'], $_POST['username'], $timezone, $password, $_POST['email'], $_POST['usertype']);
header('Location: ' . $_SERVER['PHP_SELF']);
endif;
} elseif (Registry::AUTHMETHOD == 'SAML') {
if (!empty($_POST['newuser'])): // NEW USER SAML
$email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
@ -213,7 +217,7 @@
$Users->addSAMLUser($timezone, $_POST['email'], $_POST['usertype']);
header('Location: ' . $_SERVER['PHP_SELF']);
endif;
};
if (!empty($_POST['editusercomplete'])): // EDIT USER
require_once("src/Misc/PasswordHash.php");