Skip to content

Commit 4e63200

Browse files
committed
Fixed issue where user fails to be added to dns-ui if LDAP server
doesn't return an e-mail address for the user.
1 parent fb591d7 commit 4e63200

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

model/user.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ public function get_details_from_ldap() {
156156
$this->auth_realm = 'LDAP';
157157
$this->uid = $ldapuser[strtolower($config['ldap']['user_id'])];
158158
$this->name = $ldapuser[strtolower($config['ldap']['user_name'])];
159-
$this->email = $ldapuser[strtolower($config['ldap']['user_email'])];
159+
if (isset($ldapuser[strtolower($config['ldap']['user_email'])])) {
160+
$this->email = $ldapuser[strtolower($config['ldap']['user_email'])];
161+
} else {
162+
$this->email = '';
163+
}
160164
if(isset($config['ldap']['user_active'])) {
161165
$this->active = 0;
162166
if(isset($config['ldap']['user_active_true'])) {

0 commit comments

Comments
 (0)