From 97844e1babaa349103cec5a8a4697f0e5854391b Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 13 Dec 2017 12:05:31 +0100 Subject: [PATCH] Revert "Use Exceptions for User::create" --- ldapauth/ldapauth.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ldapauth/ldapauth.php b/ldapauth/ldapauth.php index 63ccbe91..a0b270e3 100644 --- a/ldapauth/ldapauth.php +++ b/ldapauth/ldapauth.php @@ -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"); -- 2.39.5