Changeset 69 for trunk/expressoAdmin1_2


Ignore:
Timestamp:
09/19/07 17:33:03 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

Location:
trunk/expressoAdmin1_2/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php

    r68 r69  
    3333                                ldap_set_option($ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3); 
    3434                                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']); 
    3738                                $context = $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['dn']; 
    3839                        } 
     
    8485                                $filter = "(&(|(phpgwAccountType=u)(phpgwAccountType=l))(uid=$uid))"; 
    8586                        } 
    86                         $justthese = array("uid"); 
     87                        $justthese = array("uid", "mail", "cn"); 
    8788                        $search = ldap_search($ldap_connection, $context, $filter, $justthese); 
    8889                        $count_entries = ldap_count_entries($ldap_connection,$search); 
    8990                        if ($count_entries > 0) 
    9091                        { 
     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                                 
    9199                                $result['status'] = false; 
    92                                 $result['msg'] = 'LOGIN já está sendo utilizado.'; 
     100                                $result['msg'] = "LOGIN já está sendo utilizado por:\n" . $users; 
    93101                                return $result; 
    94102                        } 
     
    855863                                $return[$uid]['mail']           = $result[$uid]['mail']; 
    856864                } 
    857         }        
     865        } 
    858866                return $return; 
    859867        } 
     
    921929                                if($entry[0]['memberuid']) { 
    922930                                        // Retira o count do array 
    923                                         array_shift($entry[0]['memberuid']);                                     
     931                                        array_shift($entry[0]['memberuid']); 
    924932                                        // Vemos a diferença 
    925933                                        $array_diff = array_diff($entry[0]['memberuid'], $tmp_array); 
  • trunk/expressoAdmin1_2/inc/class.user.inc.php

    r64 r69  
    5151                                } 
    5252                         
    53                                 // Leio o ID a ser usado na criação do objecto. 
     53                                // Leio o ID a ser usado na criação do objecto. Esta função já incrementa o ID no BD. 
    5454                                $next_id = ($this->db_functions->get_next_id('accounts')); 
    5555                                if ((!is_numeric($next_id['id'])) || (!$next_id['status'])) 
     
    6363                                        $id = $next_id['id']; 
    6464                                } 
    65                                 // Incrementa o id no BD. 
    66                                 //$this->db_functions->increment_id($id,'accounts'); 
    6765                         
    6866                                // Cria array para incluir no LDAP 
Note: See TracChangeset for help on using the changeset viewer.