diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 2d2d045cd43..a258ae7cc79 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -184,7 +184,7 @@ print ''; print ''.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").''; -print ' '; +print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FIRSTNAME)?' checked':'').">"; print ''; // Login unix @@ -232,7 +232,7 @@ print ''; print ''.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").''; -print ' '; +print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PHONE)?' checked':'').">"; print ''; // Mobile @@ -240,7 +240,7 @@ print ''; print ''.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").''; -print ' '; +print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MOBILE)?' checked':'').">"; print ''; // Skype @@ -256,7 +256,7 @@ print ''; print ''.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").''; -print ' '; +print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FAX)?' checked':'').">"; print ''; // Title diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 64e6f9fd5ef..00630321b26 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -1241,7 +1241,7 @@ class Ldap $this->firstname = $this->convToOutputCharset($result[0][$this->attr_firstname][0],$this->ldapcharset); $this->login = $this->convToOutputCharset($result[0][$this->attr_login][0],$this->ldapcharset); $this->phone = $this->convToOutputCharset($result[0][$this->attr_phone][0],$this->ldapcharset); - $this->skype = $this->convToOutputCharset($result[0][$this->attr_skype][0],$this->ldapcharset); + $this->skype = $this->convToOutputCharset($result[0][$this->attr_skype][0],$this->ldapcharset); $this->fax = $this->convToOutputCharset($result[0][$this->attr_fax][0],$this->ldapcharset); $this->mail = $this->convToOutputCharset($result[0][$this->attr_mail][0],$this->ldapcharset); $this->mobile = $this->convToOutputCharset($result[0][$this->attr_mobile][0],$this->ldapcharset); @@ -1298,27 +1298,29 @@ class Ldap function parseUACF($uacf) { //All flags array - $flags = array( "TRUSTED_TO_AUTH_FOR_DELEGATION" => 16777216, - "PASSWORD_EXPIRED" => 8388608, - "DONT_REQ_PREAUTH" => 4194304, - "USE_DES_KEY_ONLY" => 2097152, - "NOT_DELEGATED" => 1048576, - "TRUSTED_FOR_DELEGATION" => 524288, - "SMARTCARD_REQUIRED" => 262144, - "MNS_LOGON_ACCOUNT" => 131072, - "DONT_EXPIRE_PASSWORD" => 65536, - "SERVER_TRUST_ACCOUNT" => 8192, - "WORKSTATION_TRUST_ACCOUNT" => 4096, - "INTERDOMAIN_TRUST_ACCOUNT" => 2048, - "NORMAL_ACCOUNT" => 512, - "TEMP_DUPLICATE_ACCOUNT" => 256, - "ENCRYPTED_TEXT_PWD_ALLOWED" => 128, - "PASSWD_CANT_CHANGE" => 64, - "PASSWD_NOTREQD" => 32, - "LOCKOUT" => 16, - "HOMEDIR_REQUIRED" => 8, - "ACCOUNTDISABLE" => 2, - "SCRIPT" => 1); + $flags = array( + "TRUSTED_TO_AUTH_FOR_DELEGATION" => 16777216, + "PASSWORD_EXPIRED" => 8388608, + "DONT_REQ_PREAUTH" => 4194304, + "USE_DES_KEY_ONLY" => 2097152, + "NOT_DELEGATED" => 1048576, + "TRUSTED_FOR_DELEGATION" => 524288, + "SMARTCARD_REQUIRED" => 262144, + "MNS_LOGON_ACCOUNT" => 131072, + "DONT_EXPIRE_PASSWORD" => 65536, + "SERVER_TRUST_ACCOUNT" => 8192, + "WORKSTATION_TRUST_ACCOUNT" => 4096, + "INTERDOMAIN_TRUST_ACCOUNT" => 2048, + "NORMAL_ACCOUNT" => 512, + "TEMP_DUPLICATE_ACCOUNT" => 256, + "ENCRYPTED_TEXT_PWD_ALLOWED" => 128, + "PASSWD_CANT_CHANGE" => 64, + "PASSWD_NOTREQD" => 32, + "LOCKOUT" => 16, + "HOMEDIR_REQUIRED" => 8, + "ACCOUNTDISABLE" => 2, + "SCRIPT" => 1 + ); //Parse flags to text $retval = array(); @@ -1341,13 +1343,15 @@ class Ldap */ function parseSAT($samtype) { - $stypes = array( 805306368 => "NORMAL_ACCOUNT", - 805306369 => "WORKSTATION_TRUST", - 805306370 => "INTERDOMAIN_TRUST", - 268435456 => "SECURITY_GLOBAL_GROUP", - 268435457 => "DISTRIBUTION_GROUP", - 536870912 => "SECURITY_LOCAL_GROUP", - 536870913 => "DISTRIBUTION_LOCAL_GROUP"); + $stypes = array( + 805306368 => "NORMAL_ACCOUNT", + 805306369 => "WORKSTATION_TRUST", + 805306370 => "INTERDOMAIN_TRUST", + 268435456 => "SECURITY_GLOBAL_GROUP", + 268435457 => "DISTRIBUTION_GROUP", + 536870912 => "SECURITY_LOCAL_GROUP", + 536870913 => "DISTRIBUTION_LOCAL_GROUP" + ); $retval = ""; while (list($sat, $val) = each($stypes)) { @@ -1422,7 +1426,7 @@ class Ldap $search='('.$conf->global->$keygroup.'=*)'; $result = $this->search($this->groups,$search); - if($result) + if ($result) { $c = $result['count']; $gids = array(); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 62ffc2700e2..28774edacf7 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2276,8 +2276,12 @@ class User extends CommonObject $ldapkey = array( 'LDAP_FIELD_FULLNAME' => 'fullname', 'LDAP_FIELD_NAME' => 'lastname', + 'LDAP_FIELD_FIRSTNAME' => 'firstname', 'LDAP_FIELD_LOGIN' => 'login', 'LDAP_FIELD_LOGIN_SAMBA' => 'login', + 'LDAP_FIELD_PHONE' => 'office_phone', + 'LDAP_FIELD_MOBILE' => 'user_mobile', + 'LDAP_FIELD_FAX' => 'office_fax', 'LDAP_FIELD_MAIL' => 'email', 'LDAP_FIELD_SID' => 'ldap_sid', 'LDAP_FIELD_SKYPE' => 'skype' @@ -2297,13 +2301,9 @@ class User extends CommonObject } } } - if ($this->firstname && ! empty($conf->global->LDAP_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = $this->firstname; if ($this->address && ! empty($conf->global->LDAP_FIELD_ADDRESS)) $info[$conf->global->LDAP_FIELD_ADDRESS] = $this->address; if ($this->zip && ! empty($conf->global->LDAP_FIELD_ZIP)) $info[$conf->global->LDAP_FIELD_ZIP] = $this->zip; if ($this->town && ! empty($conf->global->LDAP_FIELD_TOWN)) $info[$conf->global->LDAP_FIELD_TOWN] = $this->town; - if ($this->office_phone && ! empty($conf->global->LDAP_FIELD_PHONE)) $info[$conf->global->LDAP_FIELD_PHONE] = $this->office_phone; - if ($this->user_mobile && ! empty($conf->global->LDAP_FIELD_MOBILE)) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->user_mobile; - if ($this->office_fax && ! empty($conf->global->LDAP_FIELD_FAX)) $info[$conf->global->LDAP_FIELD_FAX] = $this->office_fax; if ($this->note_public && ! empty($conf->global->LDAP_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note_public; if ($this->socid > 0) {