Changeset 227 for trunk/instant_messenger/inc
- Timestamp:
- 03/18/08 08:52:27 (17 years ago)
- Location:
- trunk/instant_messenger/inc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/inc/Jabber.abstract.php
r216 r227 61 61 62 62 if ( $this->write($xml) === false ) 63 throw new Exception('[connect] #4 it isn\'t possible connect in the server beca se 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__); 64 64 } 65 65 … … 91 91 if ( ($xml = $this->read()) === false ) 92 92 throw new Exception('[connect] #1 it isn\'t possible read the socket. File: ' . __FILE__ . ' :: ' . __LINE__); 93 93 94 94 95 if ( preg_match('/(<starttls .*<required\/><\/starttls>)/', $xml, $matches) ) -
trunk/instant_messenger/inc/Jabberd2.abstract.php
r216 r227 71 71 if ( $this->writeSocket($this->iq('set', $addid, NULL, NULL, "jabber:iq:roster", $newcontact)) ) 72 72 $this->getContacts(); 73 echo "OK"; 73 74 } 74 75 } … … 87 88 { 88 89 $jid = ( trim($pJid['jid']) == "this" ) ? $this->_user . '@' . $this->_server : $pJid['jid']; 89 90 $vcard = (trim($pJid['jid']) == "this") ? 'vCard_user' : 'vCard'; 91 90 92 if ( !$this->connected ) 93 { 91 94 echo "disconnected"; 95 } 92 96 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 } 94 100 } 95 101 else … … 106 112 echo "disconnected"; 107 113 else 114 { 108 115 $this->writeSocket($this->iq('set', $id, NULL, NULL, "vcard-temp", "<vCard xmlns='vcard-temp'>".$NewVcard['vcard']."</vCard>")); 116 echo "OK"; 117 } 109 118 } 110 119 … … 151 160 } 152 161 162 final function setStatus() 163 { 164 $this->setPresence(array("type" => "unavailable")); 165 $this->setPresence(array("type" => "available")); 166 } 167 153 168 final function updateContact($pContact) 154 169 { -
trunk/instant_messenger/inc/class.Ujabber.inc.php
r216 r227 117 117 } 118 118 119 //Linha abaixo dentro do padr ão xmpp, entretanto clientes como120 //o PSI n ão seguem o padrão assim ocorre problemas de comunicação119 //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 121 121 //descomentar e retirar a seguinte para voltar ao padrão assim 122 //que poss Ãvel123 //24/10/2007 - problema verificado por usu ários do SERPRO na124 //plataforma Windows ocorrendo tamb ém no cliente Linux122 //que possível 123 //24/10/2007 - problema verificado por usuários do SERPRO na 124 //plataforma Windows ocorrendo também no cliente Linux 125 125 //por Alexandre e Rodrigo 126 126 -
trunk/instant_messenger/inc/im_acl.inc.php
r216 r227 2 2 $size_of_ACL = sizeof($GLOBALS['phpgw_info']['user']['acl']); 3 3 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 : '/'; 4 for ( $i = 0; $i < $size_of_ACL && $GLOBALS['phpgw_info']['user']['acl'][$i]['appname'] == 'instant_messenger'; $i++ ); 9 5 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 : '/'; 12 8 13 $webserver_url = $webserver_url . 'instant_messenger/'; 9 if ( strrpos($webserver_url, '/') === false || strrpos($webserver_url, '/') != (strlen($webserver_url)-1) ) 10 $webserver_url .= '/'; 14 11 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/'; 24 13 25 $DOCUMENT_ROOT = PHPGW_SERVER_ROOT .'/instant_messenger/'; 14 session_start(); 15 require_once PHPGW_SERVER_ROOT . '/instant_messenger/inc/im_sessions.inc.php'; 16 require_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']; 22 session_write_close(); 26 23 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/'; 43 25 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 ); 45 42 46 foreach ( $js as $key => $val ) 47 print '<script src="' . $webserver_url . $val . '?' . filemtime($DOCUMENT_ROOT . $val) . '"></script>'; 43 print '<script type="text/javascript">var path_im = "'.$webserver_url.'";</script>'; 48 44 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">'; 45 foreach ( $js as $key => $val ) 46 print '<script src="' . $webserver_url . $val . '?' . filemtime($DOCUMENT_ROOT . $val) . '"></script>'; 52 47 53 require_once $DOCUMENT_ROOT . 'inc/class.Ujabber.inc.php'; 48 print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/window.css">'; 49 print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/chat.css">'; 50 print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/common.css">'; 54 51 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 } 52 print '<script type="text/javascript">setTimeout("client()",2000);</script>'; 61 53 ?>
Note: See TracChangeset
for help on using the changeset viewer.