From b99d753ff962827d442241433c88c9423b147ec9 Mon Sep 17 00:00:00 2001 From: Brian Lycett Date: Fri, 8 Feb 2019 13:02:06 +0000 Subject: [PATCH] Fix for issue adding accounts with an email address --- www/includes/ldap_functions.inc.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/www/includes/ldap_functions.inc.php b/www/includes/ldap_functions.inc.php index d713a30..eee19be 100644 --- a/www/includes/ldap_functions.inc.php +++ b/www/includes/ldap_functions.inc.php @@ -385,7 +385,7 @@ function ldap_get_gid_of_group($ldap_connection,$group_name) { function ldap_new_account($ldap_connection,$first_name,$last_name,$username,$password,$email) { - global $log_prefix, $LDAP, $DEFAULT_USER_SHELL, $DEFAULT_USER_GROUP, $EMAIL_DOMAIN; + global $log_prefix, $LDAP, $DEFAULT_USER_SHELL, $DEFAULT_USER_GROUP; if (isset($first_name) and isset($last_name) and isset($username) and isset($password)) { @@ -421,13 +421,10 @@ function ldap_new_account($ldap_connection,$first_name,$last_name,$username,$pas 'gidNumber' => $gid, 'loginShell' => $DEFAULT_USER_SHELL, 'homeDirectory' => "/home/$username", - 'userPassword' => $hashed_pass + 'userPassword' => $hashed_pass, + 'mail' => $email ); - if (isset($email) and $email != "") { - array_push($user_info, ['mail' => $email]); - } - $add_account = ldap_add($ldap_connection, "${LDAP['account_attribute']}=$username,${LDAP['user_dn']}", $user_info