Changeset View
Changeset View
Standalone View
Standalone View
src/app/Backends/LDAP.php
Show First 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | public static function createUser(User $user): void | ||||
], | ], | ||||
'mail' => $user->email, | 'mail' => $user->email, | ||||
'uid' => $user->email, | 'uid' => $user->email, | ||||
'nsroledn' => [] | 'nsroledn' => [] | ||||
]; | ]; | ||||
if (!self::getUserEntry($ldap, $user->email, $dn)) { | if (!self::getUserEntry($ldap, $user->email, $dn)) { | ||||
if (empty($dn)) { | if (empty($dn)) { | ||||
self::throwException($ldap, "Failed to create user {$user->email} in LDAP"); | self::throwException($ldap, "Failed to create user {$user->email} in LDAP (" . __LINE__ . ")"); | ||||
} | } | ||||
self::setUserAttributes($user, $entry); | self::setUserAttributes($user, $entry); | ||||
$result = $ldap->add_entry($dn, $entry); | $result = $ldap->add_entry($dn, $entry); | ||||
if (!$result) { | if (!$result) { | ||||
self::throwException( | self::throwException( | ||||
▲ Show 20 Lines • Show All 467 Lines • Show Last 20 Lines |