Ignore:
Timestamp:
04/30/08 17:15:14 (16 years ago)
Author:
niltonneto
Message:
 
Location:
trunk/instant_messenger/inc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/instant_messenger/inc/Jabberd2.abstract.php

    r260 r275  
    160160        } 
    161161 
     162        final function get_last_access_user($pUser) 
     163        { 
     164                $id = "last_time_user"; 
     165                $jid = ( trim($pUser['jid']) == "this" ) ? $this->_user . '@' . $this->_server : $pUser['jid']; 
     166                $this->writeSocket($this->iq('get', $id, $jid, NULL, "jabber:iq:last")); 
     167        } 
     168 
    162169        final function setStatus() 
    163170        { 
  • trunk/instant_messenger/inc/class.Ujabber.inc.php

    r265 r275  
    55class Ujabber extends Jabberd2 
    66{ 
     7        private $set_presence; 
     8         
    79        public final function __construct() 
    810        {        
     
    3537                return $this->connected; 
    3638        } 
    37          
     39 
    3840        public final function listen() 
    3941        { 
    4042                if ( !$this->isConnected() ) 
    4143                        return "disconnected"; 
     44 
     45                $this->get_last_access_user(array("jid" => "this"));     
    4246 
    4347                if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) 
     
    5761                        while ( ( connection_aborted() === 0 ) && time() - $init < 50 ) 
    5862                        { 
     63                                 
    5964                                # read from server and write in the client 
    6065                                $xml = $this->readSocket(); 
     
    6974        } 
    7075 
    71         public final function SendMessage($pSendMessage) 
    72         { 
     76    public final function SendMessage($pSendMessage) 
     77    { 
    7378                if ( !$this->isConnected() ) 
    7479                        return "disconnected"; 
  • trunk/instant_messenger/inc/class.ldap_im.inc.php

    r260 r275  
    22class ldap_im 
    33{ 
    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; 
    1010         
    1111        function __construct() 
     
    1717                $this->password                 = $_SESSION['phpgw_info']['instant_messenger']['password_ldap_jabber']; 
    1818                $this->jid                              = $_SESSION['phpgw_info']['instant_messenger']['user']; 
    19                 $this->connect_ldap(false); 
     19                $this->connect_ldap(true); 
    2020                session_write_close(); 
    2121        } 
    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                 
    2338        function __destruct() 
    2439        { 
     
    3954        function get_photo_ldap($pUser,$getPhoto) 
    4055        { 
    41                 $user = ( $pUser == "im_avatar" ) ? $this->jid : $pUser ; 
     56                $user = ( $pUser == "im__avatar" ) ? $this->jid : $pUser ; 
    4257                 
    4358                if ($this->conn)  
     
    7994        function photo_ldap($user) 
    8095        { 
    81                 $uid = ( $user['uid'] == "im_avatar" ) ? $this->jid : $user['uid'] ; 
     96                $uid = ( $user['uid'] == "im__avatar" ) ? $this->jid : $user['uid'] ; 
    8297                return $this->get_photo_ldap($uid,false); 
    8398        } 
     
    150165        function list_organizations_ldap() 
    151166        { 
    152                 $result_org = "<organizations><ou></ou>"; 
     167                $result_org = "<organizations>"; 
    153168 
    154169                if ($this->conn)  
     
    161176                 
    162177                foreach($entry as $tmp) 
    163                         if($tmp['ou'][0] != "") 
     178                        if(trim($tmp['ou'][0]) != "") 
    164179                                $result_org .= "<ou>" . $tmp['ou'][0] . "</ou>";   
    165180 
    166181                $result_org .= "</organizations>"; 
    167                  
     182 
    168183                return $result_org; 
    169184        } 
Note: See TracChangeset for help on using the changeset viewer.