Ignore:
Timestamp:
03/18/08 08:52:27 (17 years ago)
Author:
niltonneto
Message:
 
Location:
trunk/instant_messenger/inc
Files:
4 edited

Legend:

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

    r216 r227  
    6161 
    6262                                if ( $this->write($xml) === false ) 
    63                                         throw new Exception('[connect] #4 it isn\'t possible connect in the server becase exists a client connected with same user. File: ' . __FILE__ . '  ::  ' . __LINE__); 
     63                                        throw new Exception('[connect] #4 it isn\'t possible connect in the server because exists a client connected with same user. File: ' . __FILE__ . '  ::  ' . __LINE__); 
    6464                        } 
    6565 
     
    9191                                if ( ($xml = $this->read()) === false ) 
    9292                                        throw new Exception('[connect] #1 it isn\'t possible read the socket. File: ' . __FILE__ . '  ::  ' . __LINE__); 
     93 
    9394 
    9495                                if ( preg_match('/(<starttls .*<required\/><\/starttls>)/', $xml, $matches) ) 
  • trunk/instant_messenger/inc/Jabberd2.abstract.php

    r216 r227  
    7171                        if ( $this->writeSocket($this->iq('set', $addid, NULL, NULL, "jabber:iq:roster", $newcontact)) ) 
    7272                                $this->getContacts(); 
     73                                echo "OK"; 
    7374                } 
    7475        } 
     
    8788                { 
    8889                        $jid = ( trim($pJid['jid']) == "this" ) ? $this->_user . '@' . $this->_server : $pJid['jid']; 
    89  
     90                        $vcard = (trim($pJid['jid']) == "this") ? 'vCard_user' : 'vCard'; 
     91                         
    9092                        if ( !$this->connected ) 
     93                        { 
    9194                                echo "disconnected"; 
     95                        } 
    9296                        else 
    93                                 $this->writeSocket($this->iq('get', 'vCard', $jid, NULL, "vcard-temp", "<vCard xmlns='vcard-temp'/>")); 
     97                        { 
     98                                $this->writeSocket($this->iq('get', $vcard, $jid, NULL, "vcard-temp", "<vCard xmlns='vcard-temp'/>")); 
     99                        } 
    94100                } 
    95101                else 
     
    106112                        echo "disconnected"; 
    107113                else 
     114                { 
    108115                        $this->writeSocket($this->iq('set', $id, NULL, NULL, "vcard-temp", "<vCard xmlns='vcard-temp'>".$NewVcard['vcard']."</vCard>")); 
     116                        echo "OK"; 
     117                } 
    109118        } 
    110119 
     
    151160        } 
    152161 
     162        final function setStatus() 
     163        { 
     164                $this->setPresence(array("type" => "unavailable")); 
     165                $this->setPresence(array("type" => "available"));        
     166        } 
     167 
    153168        final function updateContact($pContact) 
    154169        { 
  • trunk/instant_messenger/inc/class.Ujabber.inc.php

    r216 r227  
    117117                        } 
    118118 
    119                         //Linha abaixo dentro do padrão xmpp, entretanto clientes como 
    120                         //o PSI não seguem o padrão assim ocorre problemas de comunicação 
     119                        //Linha abaixo dentro do padrão xmpp, entretanto clientes como 
     120                        //o PSI não seguem o padrão assim ocorre problemas de comunicação 
    121121                        //descomentar e retirar a seguinte para voltar ao padrão assim 
    122                         //que possível 
    123                         //24/10/2007 - problema verificado por usuários do SERPRO na 
    124                         //plataforma Windows ocorrendo também no cliente Linux 
     122                        //que possí­vel 
     123                        //24/10/2007 - problema verificado por usuários do SERPRO na 
     124                        //plataforma Windows ocorrendo também no cliente Linux 
    125125                        //por Alexandre e Rodrigo 
    126126 
  • trunk/instant_messenger/inc/im_acl.inc.php

    r216 r227  
    22$size_of_ACL = sizeof($GLOBALS['phpgw_info']['user']['acl']); 
    33 
    4 for ( $i = 0; $i < $size_of_ACL; $i++ ) 
    5         if ( $GLOBALS['phpgw_info']['user']['acl'][$i]['appname'] == 'instant_messenger' ) 
    6         { 
    7                 $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; 
    8                 $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/'; 
     4for ( $i = 0; $i < $size_of_ACL && $GLOBALS['phpgw_info']['user']['acl'][$i]['appname'] == 'instant_messenger'; $i++ ); 
    95 
    10                 if ( strrpos($webserver_url, '/') === false || strrpos($webserver_url, '/') != (strlen($webserver_url)-1) ) 
    11                         $webserver_url .= '/'; 
     6$webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; 
     7$webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/'; 
    128 
    13                 $webserver_url = $webserver_url . 'instant_messenger/'; 
     9if ( strrpos($webserver_url, '/') === false || strrpos($webserver_url, '/') != (strlen($webserver_url)-1) ) 
     10        $webserver_url .= '/'; 
    1411 
    15                 session_start(); 
    16                 require_once PHPGW_SERVER_ROOT . '/instant_messenger/inc/im_sessions.inc.php'; 
    17                 require_once PHPGW_SERVER_ROOT . '/instant_messenger/inc/load_lang.php'; 
    18                 $_user     = $_SESSION['phpgw_info']['instant_messenger']['user']; 
    19                 $_pass     = $_SESSION['phpgw_info']['instant_messenger']['passwd']; 
    20                 $_server   = $_SESSION['phpgw_info']['instant_messenger']['name_jabber']; 
    21                 $_port     = $_SESSION['phpgw_info']['instant_messenger']['port_jabber']; 
    22                 $_resource = $_SESSION['phpgw_info']['instant_messenger']['resource_jabber']; 
    23                 session_write_close(); 
     12$webserver_url = $webserver_url . 'instant_messenger/'; 
    2413 
    25                 $DOCUMENT_ROOT = PHPGW_SERVER_ROOT .'/instant_messenger/'; 
     14session_start(); 
     15require_once PHPGW_SERVER_ROOT . '/instant_messenger/inc/im_sessions.inc.php'; 
     16require_once PHPGW_SERVER_ROOT . '/instant_messenger/inc/load_lang.php'; 
     17$_user     = $_SESSION['phpgw_info']['instant_messenger']['user']; 
     18$_pass     = $_SESSION['phpgw_info']['instant_messenger']['passwd']; 
     19$_server   = $_SESSION['phpgw_info']['instant_messenger']['name_jabber']; 
     20$_port     = $_SESSION['phpgw_info']['instant_messenger']['port_jabber']; 
     21$_resource = $_SESSION['phpgw_info']['instant_messenger']['resource_jabber']; 
     22session_write_close(); 
    2623 
    27                 $js = array( 
    28                         'js/connector.js', 
    29                         'js/xtools.js', 
    30                         'js/jabber.js', 
    31                         'js/client.js', 
    32                         'js/images.js', 
    33                         'js/dragdrop.js', 
    34                         'js/build_win.js', 
    35                         'js/templates.js', 
    36                         'js/fcommon.js', 
    37                         'js/menu_action.js', 
    38                         'js/functions.js', 
    39                         'js/images.js', 
    40                         'js/cookies_im.js', 
    41                         'js/load.js', 
    42                 ); 
     24$DOCUMENT_ROOT = PHPGW_SERVER_ROOT .'/instant_messenger/'; 
    4325 
    44                 print '<script type="text/javascript">var path_im = "'.$webserver_url.'";</script>'; 
     26$js = array( 
     27        'js/connector.js', 
     28        'js/xtools.js', 
     29        'js/jabber.js', 
     30        'js/client.js', 
     31        'js/images.js', 
     32        'js/dragdrop.js', 
     33        'js/build_win.js', 
     34        'js/templates.js', 
     35        'js/fcommon.js', 
     36        'js/menu_action.js', 
     37        'js/functions.js', 
     38        'js/images.js', 
     39        'js/cookies_im.js', 
     40        'js/load.js', 
     41); 
    4542 
    46                 foreach ( $js as $key => $val ) 
    47                         print '<script src="' . $webserver_url . $val . '?' . filemtime($DOCUMENT_ROOT . $val) . '"></script>'; 
     43print '<script type="text/javascript">var path_im = "'.$webserver_url.'";</script>'; 
    4844 
    49                 print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/window.css">'; 
    50                 print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/chat.css">'; 
    51                 print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/common.css">'; 
     45foreach ( $js as $key => $val ) 
     46        print '<script src="' . $webserver_url . $val . '?' . filemtime($DOCUMENT_ROOT . $val) . '"></script>'; 
    5247 
    53                 require_once  $DOCUMENT_ROOT . 'inc/class.Ujabber.inc.php'; 
     48print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/window.css">'; 
     49print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/chat.css">'; 
     50print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/common.css">'; 
    5451 
    55                 $jabber = new Ujabber; 
    56                 $jabber->connect($_user . '@' . $_server . '/' . $_resource . ':' . $_port, $_pass, 'read/write'); 
    57  
    58                 print '<script type="text/javascript">setTimeout("client()",2000);</script>'; 
    59                 $i = $size_of_ACL; 
    60         } 
     52print '<script type="text/javascript">setTimeout("client()",2000);</script>'; 
    6153?> 
Note: See TracChangeset for help on using the changeset viewer.