Changeset 69 for trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
- Timestamp:
- 09/19/07 17:33:03 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
r68 r69 33 33 ldap_set_option($ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3); 34 34 ldap_set_option($ldap_connection, LDAP_OPT_REFERRALS, true); 35 if ( ($GLOBALS['phpgw_info']['expresso']['cc_ldap_server']['acc'] != '') && ($GLOBALS['phpgw_info']['expresso']['cc_ldap_server']['pw'] != '') ) 36 ldap_bind($ldap_connection, $GLOBALS['phpgw_info']['expresso']['cc_ldap_server']['acc'], $GLOBALS['phpgw_info']['expresso']['cc_ldap_server']['pw']); 35 36 if ( ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'] != '') && ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw'] != '') ) 37 ldap_bind($ldap_connection, $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'], $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw']); 37 38 $context = $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['dn']; 38 39 } … … 84 85 $filter = "(&(|(phpgwAccountType=u)(phpgwAccountType=l))(uid=$uid))"; 85 86 } 86 $justthese = array("uid" );87 $justthese = array("uid", "mail", "cn"); 87 88 $search = ldap_search($ldap_connection, $context, $filter, $justthese); 88 89 $count_entries = ldap_count_entries($ldap_connection,$search); 89 90 if ($count_entries > 0) 90 91 { 92 $entries = ldap_get_entries($ldap_connection, $search); 93 94 for ($i=0; $i<$entries['count']; $i++) 95 { 96 $users .= $entries[$i]['cn'][0] . ' - ' . $entries[$i]['mail'][0] . "\n"; 97 } 98 91 99 $result['status'] = false; 92 $result['msg'] = 'LOGIN já está sendo utilizado.';100 $result['msg'] = "LOGIN já está sendo utilizado por:\n" . $users; 93 101 return $result; 94 102 } … … 855 863 $return[$uid]['mail'] = $result[$uid]['mail']; 856 864 } 857 } 865 } 858 866 return $return; 859 867 } … … 921 929 if($entry[0]['memberuid']) { 922 930 // Retira o count do array 923 array_shift($entry[0]['memberuid']); 931 array_shift($entry[0]['memberuid']); 924 932 // Vemos a diferença 925 933 $array_diff = array_diff($entry[0]['memberuid'], $tmp_array);
Note: See TracChangeset
for help on using the changeset viewer.