]> git.mxchange.org Git - friendica-addons.git/commitdiff
Revert "Use Exceptions for User::create"
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Wed, 13 Dec 2017 11:05:31 +0000 (12:05 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Dec 2017 11:05:31 +0000 (12:05 +0100)
ldapauth/ldapauth.php

index 63ccbe91598790d57f986ecfc6bdf771934456d2..a0b270e38842adbc1cae6322bf7efe82c12ee230 100644 (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");