Changeset 275 for trunk/instant_messenger/inc/class.ldap_im.inc.php
- Timestamp:
- 04/30/08 17:15:14 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/inc/class.ldap_im.inc.php
r260 r275 2 2 class ldap_im 3 3 { 4 private$ldap_host;5 private$ldap_context;6 private$conn;7 private$user;8 private$jid;9 private$password;4 var $ldap_host; 5 var $ldap_context; 6 var $conn; 7 var $user; 8 var $jid; 9 var $password; 10 10 11 11 function __construct() … … 17 17 $this->password = $_SESSION['phpgw_info']['instant_messenger']['password_ldap_jabber']; 18 18 $this->jid = $_SESSION['phpgw_info']['instant_messenger']['user']; 19 $this->connect_ldap( false);19 $this->connect_ldap(true); 20 20 session_write_close(); 21 21 } 22 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 23 38 function __destruct() 24 39 { … … 39 54 function get_photo_ldap($pUser,$getPhoto) 40 55 { 41 $user = ( $pUser == "im_ avatar" ) ? $this->jid : $pUser ;56 $user = ( $pUser == "im__avatar" ) ? $this->jid : $pUser ; 42 57 43 58 if ($this->conn) … … 79 94 function photo_ldap($user) 80 95 { 81 $uid = ( $user['uid'] == "im_ avatar" ) ? $this->jid : $user['uid'] ;96 $uid = ( $user['uid'] == "im__avatar" ) ? $this->jid : $user['uid'] ; 82 97 return $this->get_photo_ldap($uid,false); 83 98 } … … 150 165 function list_organizations_ldap() 151 166 { 152 $result_org = "<organizations> <ou></ou>";167 $result_org = "<organizations>"; 153 168 154 169 if ($this->conn) … … 161 176 162 177 foreach($entry as $tmp) 163 if( $tmp['ou'][0]!= "")178 if(trim($tmp['ou'][0]) != "") 164 179 $result_org .= "<ou>" . $tmp['ou'][0] . "</ou>"; 165 180 166 181 $result_org .= "</organizations>"; 167 182 168 183 return $result_org; 169 184 }
Note: See TracChangeset
for help on using the changeset viewer.