- Timestamp:
- 07/27/09 14:04:22 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/jabberit_messenger/inc/class.ldap_im.inc.php
r988 r1198 22 22 private $ldap; 23 23 private $ldap_context; 24 private $ldap_ dn;24 private $ldap_user; 25 25 private $ldap_host; 26 26 private $ldap_org; … … 52 52 $GLOBALS['phpgw_info']['server']['ldap_version3'] = true; 53 53 54 $this->ldap = $this->common->ldapConnect( $this->ldap_host, $this->ldap_ dn, $this->ldap_pass, false );54 $this->ldap = $this->common->ldapConnect( $this->ldap_host, $this->ldap_user . "," . $this->ldap_context , $this->ldap_pass, false ); 55 55 } 56 56 … … 59 59 $this->ldap_host = (isset($_SESSION['phpgw_info']['jabberit_messenger']['server_ldap_jabberit'])) ? $_SESSION['phpgw_info']['jabberit_messenger']['server_ldap_jabberit'] : $GLOBALS['phpgw_info']['server']['ldap_host']; 60 60 $this->ldap_context = (isset($_SESSION['phpgw_info']['jabberit_messenger']['context_ldap_jabberit'])) ? $_SESSION['phpgw_info']['jabberit_messenger']['context_ldap_jabberit'] : $GLOBALS['phpgw_info']['server']['ldap_context']; 61 $this->ldap_ dn= (isset($_SESSION['phpgw_info']['jabberit_messenger']['user_ldap_jabberit'])) ? $_SESSION['phpgw_info']['jabberit_messenger']['user_ldap_jabberit'] : $GLOBALS['phpgw_info']['server']['ldap_root_dn'];61 $this->ldap_user = (isset($_SESSION['phpgw_info']['jabberit_messenger']['user_ldap_jabberit'])) ? $_SESSION['phpgw_info']['jabberit_messenger']['user_ldap_jabberit'] : $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 62 62 $this->ldap_pass = (isset($_SESSION['phpgw_info']['jabberit_messenger']['password_ldap_jabberit'])) ? $_SESSION['phpgw_info']['jabberit_messenger']['password_ldap_jabberit'] : $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 63 63 … … 83 83 84 84 // Bind as Admin 85 if($this->ldap_ dn && $this->ldap_pass && !ldap_bind($conn, $this->ldap_dn, $this->ldap_pass))85 if($this->ldap_user && $this->ldap_pass && !ldap_bind($conn, $this->ldap_user . "," .$this->ldap_context, $this->ldap_pass)) 86 86 return false; 87 87 88 88 // Bind as Anonymous 89 if(!$this->ldap_ dn&& !$this->ldap_pass && !@ldap_bind($conn))90 return false; 91 89 if(!$this->ldap_user && !$this->ldap_pass && !@ldap_bind($conn)) 90 return false; 91 92 92 return $conn; 93 93 } … … 96 96 { 97 97 $this->ldapRoot(); 98 99 if( $this->ldap ) 98 $result_groups = ""; 99 100 if( $this->ldap && $pOrg['ou'] != "-1") 100 101 { 101 102 $organization = 'ou=' . $pOrg['ou'] .",". $this->ldap_context; … … 114 115 $result_groups .= "</ldap>"; 115 116 } 116 } 117 117 118 return $result_groups; 119 } 120 118 121 return $result_groups; 119 122 } … … 140 143 { 141 144 $this->ldapRoot(); 142 145 143 146 if( $this->ldap ) 144 147 { … … 168 171 $this->ldap_host = $confHosts[$i]['serverLdap']; 169 172 $this->ldap_context = $confHosts[$i]['contextLdap']; 170 $this->ldap_ dn= $confHosts[$i]['user'];173 $this->ldap_user = $confHosts[$i]['user']; 171 174 $this->ldap_org = $confHosts[$i]['org']; 172 175 $this->ldap_pass = $confHosts[$i]['password']; … … 179 182 $justthese = array("uid","uidNumber","cn","mail","phpgwAccountVisible","dn","jpegPhoto"); 180 183 $searchRoot = ( $this->ldap_org != "*" ) ? "ou=".$this->ldap_org.",".$this->ldap_context : $this->ldap_context; 184 181 185 $search1 = @ldap_search($conn, $searchRoot, $filter, $justthese, 0, $this->max_result + 1); 182 186 $entry1 = @ldap_get_entries( $conn, $search1 ); 183 187 $result = $this->resultArray($entry1, $conn ); 184 188 185 189 if( count($return) > 0 ) 186 190 $return = array_merge($return, $result);
Note: See TracChangeset
for help on using the changeset viewer.