mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-25 16:23:16 +00:00
Merge pull request #478 from friendica/revert-477-revert-475-task/4041-fix-register
Revert "Revert "Use Exceptions for User::create""
This commit is contained in:
commit
cb9926c93a
1 changed files with 5 additions and 4 deletions
|
@ -177,11 +177,12 @@ function ldap_autocreateaccount($ldap_autocreateaccount, $username, $password, $
|
||||||
if (empty($results)) {
|
if (empty($results)) {
|
||||||
if (strlen($email) > 0 && strlen($name) > 0) {
|
if (strlen($email) > 0 && strlen($name) > 0) {
|
||||||
$arr = array('username' => $name, 'nickname' => $username, 'email' => $email, 'password' => $password, 'verified' => 1);
|
$arr = array('username' => $name, 'nickname' => $username, 'email' => $email, 'password' => $password, 'verified' => 1);
|
||||||
$result = User::create($arr);
|
|
||||||
if ($result['success']) {
|
try {
|
||||||
|
User::create($arr);
|
||||||
logger("ldapauth: account " . $username . " created");
|
logger("ldapauth: account " . $username . " created");
|
||||||
} else {
|
} catch (Exception $ex) {
|
||||||
logger("ldapauth: account " . $username . " was not created ! : " . implode($result));
|
logger("ldapauth: account " . $username . " was not created ! : " . $ex->getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger("ldapauth: unable to create account, no email or nickname found");
|
logger("ldapauth: unable to create account, no email or nickname found");
|
||||||
|
|
Loading…
Reference in a new issue