Revert "Use Exceptions for User::create" #477

Merged
tobiasd merged 1 commit from revert-475-task/4041-fix-register into master 2017-12-13 12:13:17 +01:00

View file

@ -177,12 +177,11 @@ function ldap_autocreateaccount($ldap_autocreateaccount, $username, $password, $
if (empty($results)) {
if (strlen($email) > 0 && strlen($name) > 0) {
$arr = array('username' => $name, 'nickname' => $username, 'email' => $email, 'password' => $password, 'verified' => 1);
try {
User::create($arr);
$result = User::create($arr);
if ($result['success']) {
logger("ldapauth: account " . $username . " created");
} catch (Exception $ex) {
logger("ldapauth: account " . $username . " was not created ! : " . $ex->getMessage());
} else {
logger("ldapauth: account " . $username . " was not created ! : " . implode($result));
}
} else {
logger("ldapauth: unable to create account, no email or nickname found");