Changeset 305 for trunk/instant_messenger/inc/class.ldap_im.inc.php
- Timestamp:
- 06/06/08 13:54:09 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/inc/class.ldap_im.inc.php
r287 r305 2 2 class ldap_im 3 3 { 4 var$ldap_host;5 var$ldap_context;6 var$conn;7 var$user;8 var$jid;9 var$password;4 private $ldap_host; 5 private $ldap_context; 6 private $conn; 7 private $user; 8 private $jid; 9 private $password; 10 10 11 11 function __construct() … … 13 13 session_start(); 14 14 $this->ldap_host = $_SESSION['phpgw_info']['instant_messenger']['server_ldap_jabber']; 15 $this->ldap_context 15 $this->ldap_context = $_SESSION['phpgw_info']['instant_messenger']['context_ldap_jabber']; 16 16 $this->user = $_SESSION['phpgw_info']['instant_messenger']['user_ldap_jabber']; 17 17 $this->password = $_SESSION['phpgw_info']['instant_messenger']['password_ldap_jabber']; 18 $this->jid = $_SESSION['phpgw_info']['instant_messenger']['user'];19 $this->connect_ldap( true);18 $this->jid = $_SESSION['phpgw_info']['instant_messenger']['user']; 19 $this->connect_ldap(false); 20 20 session_write_close(); 21 21 } 22 23 function valor() 24 { 25 26 if ($this->conn) 27 { 28 $filter="ou=*"; 29 $justthese = array("ou"); 30 $search = ldap_list($this->conn,$this->ldap_context, $filter, $justthese); 31 return ldap_get_entries($this->conn, $search); 32 33 $entry = ldap_get_entries($this->conn, $search); 34 } 35 36 } 37 22 38 23 function __destruct() 39 24 { … … 54 39 function get_photo_ldap($pUser,$getPhoto) 55 40 { 56 $user = ( $pUser == "im_ _avatar" ) ? $this->jid : $pUser ;41 $user = ( $pUser == "im_avatar" ) ? $this->jid : $pUser ; 57 42 58 43 if ($this->conn) … … 94 79 function photo_ldap($user) 95 80 { 96 $uid = ( $user['uid'] == "im_ _avatar" ) ? $this->jid : $user['uid'] ;81 $uid = ( $user['uid'] == "im_avatar" ) ? $this->jid : $user['uid'] ; 97 82 return $this->get_photo_ldap($uid,false); 98 83 } … … 176 161 177 162 foreach($entry as $tmp) 178 if( trim($tmp['ou'][0])!= "")163 if($tmp['ou'][0] != "") 179 164 $result_org .= "<ou>" . $tmp['ou'][0] . "</ou>"; 180 165 181 166 $result_org .= "</organizations>"; 182 167 183 168 return $result_org; 184 169 }
Note: See TracChangeset
for help on using the changeset viewer.