Changeset 459 for trunk/jabberit_messenger/inc
- Timestamp:
- 09/22/08 17:02:02 (16 years ago)
- Location:
- trunk/jabberit_messenger/inc
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/inc/Controller.class.php
r417 r459 164 164 $obj = new ReflectionClass($class); 165 165 166 if ( $pRequest['classCo structor'] )166 if ( $pRequest['classConstructor'] ) 167 167 { 168 $obj = $obj->newInstance($pRequest['classCo structor']);169 unset($pRequest['classCo structor']);168 $obj = $obj->newInstance($pRequest['classConstructor']); 169 unset($pRequest['classConstructor']); 170 170 } 171 171 else -
trunk/jabberit_messenger/inc/class.jabber.inc.php
r382 r459 103 103 $this->SendPacket("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>\n"); 104 104 105 sleep( 2);105 sleep(1); 106 106 107 107 if ($this->_check_connected()) … … 304 304 305 305 306 307 306 function StripJID($jid = NULL) 308 307 { … … 310 309 return ($temp[1] != "") ? $temp[1] : $jid; 311 310 } 312 313 311 314 312 … … 383 381 } 384 382 } 385 386 387 383 388 384 function SendError($to, $id = NULL, $error_number, $error_message = NULL) … … 399 395 } 400 396 401 397 function RosterGroups() 398 { 399 $roster_request_id = "roster_" . time(); 400 $incoming_array = $this->SendIq(NULL, 'get', $roster_request_id, "jabber:iq:roster"); 401 $groups = array(); 402 403 if (is_array($incoming_array)) 404 { 405 if ($incoming_array['iq']['@']['type'] == 'result' 406 && $incoming_array['iq']['@']['id'] == $roster_request_id 407 && $incoming_array['iq']['#']['query']['0']['@']['xmlns'] == "jabber:iq:roster") 408 { 409 $number_of_contacts = count($incoming_array['iq']['#']['query'][0]['#']['item']); 410 $this->roster = array(); 411 412 for ($a = 0; $a < $number_of_contacts; $a++) 413 $groups[] = $incoming_array['iq']['#']['query'][0]['#']['item'][$a]['#']['group'][0]['#']; 414 415 return $groups; 416 } 417 else 418 { 419 $this->AddToLog("ERROR: RosterGroups() #1"); 420 return FALSE; 421 } 422 } 423 else 424 { 425 $this->AddToLog("ERROR: RosterGroups() #2"); 426 return FALSE; 427 } 428 429 } 402 430 403 431 function RosterUpdate() … … 990 1018 991 1019 $this->SendPacket("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>\n"); 992 sleep( 2);1020 sleep(1); 993 1021 $incoming_array = $this->_listen_incoming(); 994 1022 … … 1018 1046 $this->SendPacket("<?xml version='1.0' encoding='UTF-8' ?" . ">\n"); 1019 1047 $this->SendPacket("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>\n"); 1020 sleep( 2);1048 sleep(1); 1021 1049 1022 1050 if (!$this->_check_connected()) … … 1753 1781 } 1754 1782 1755 1756 1757 1783 function AddPacketDetails($string, $value = NULL) 1758 1784 { … … 1777 1803 eval("\$this->nodes$node = \"" . htmlspecialchars($value) . "\";"); 1778 1804 } 1779 1780 1781 1805 1782 1806 function BuildPacket($array = NULL) -
trunk/jabberit_messenger/inc/class.ujabber.inc.php
r417 r459 28 28 } 29 29 30 function connect()30 private final function connect() 31 31 { 32 32 if(!$this->jabber->Connect()) … … 44 44 } 45 45 46 function disconnect()46 private final function disconnect() 47 47 { 48 48 … … 50 50 } 51 51 52 function AddNewContact($pNewUser)52 public final function AddNewContact($pNewUser) 53 53 { 54 54 $this->connect(); … … 60 60 if($this->jabber->RosterAddUser($jid,$id,$name,$group)) 61 61 { 62 $_SESSION['phpgw_info']['jabberit_messenger']['groups_user'][] = $group; 63 $_SESSION['phpgw_info']['jabberit_messenger']['groups_user'] = array_unique($_SESSION['phpgw_info']['jabberit_messenger']['groups_user']); 64 62 65 if($this->jabber->Subscribe($jid)) 63 66 return true; … … 70 73 $this->disconnect(); 71 74 } 75 76 public final function getGroupsJabber() 77 { 78 $groups = array(); 79 $return = ''; 80 81 if(!isset($_SESSION['phpgw_info']['jabberit_messenger']['groups_user'])) 82 { 83 $this->connect(); 84 $groups = $this->jabber->RosterGroups(); 85 $this->disconnect(); 86 87 $groups = array_unique($groups); 88 $_SESSION['phpgw_info']['jabberit_messenger']['groups_user'] = $groups; 89 90 }else 91 $groups = $_SESSION['phpgw_info']['jabberit_messenger']['groups_user']; 92 93 natcasesort($groups); 94 95 foreach($groups as $tmp) 96 $return .= $tmp . ";"; 97 98 if( trim($return) != '' ) 99 $return = substr( $return, 0, strlen($return)-1 ); 100 101 return $return; 102 } 72 103 } 73 ?> 104 ?> -
trunk/jabberit_messenger/inc/controller.xml
r439 r459 17 17 <controller-sections> 18 18 <css></css> 19 <js path="/var/www/expresso/jabberit_messenger/js" suffix=".js" debug=" true">19 <js path="/var/www/expresso/jabberit_messenger/js" suffix=".js" debug="false"> 20 20 <item ref="connector" js="connector" /> 21 21 <item ref="xtools" js="xtools" /> … … 26 26 <item ref="images" js="images" /> 27 27 <item ref="show_hidden" js="show_hidden" /> 28 <item ref="editSelect" js="editSelect" /> 28 29 <item ref="setup" js="setup" path="/var/www/expresso/jabberit_messenger/templates/celepar/"/> 29 30 </js> … … 35 36 <item ref="ldap_im" alias="photo_ldap" class="ldap_im" method="photo_ldap" prefix="class." suffix=".inc.php"/> 36 37 <item ref="ujabber" alias="AddNewContact" class="ujabber" method="AddNewContact" prefix="class." suffix=".inc.php"/> 38 <item ref="ujabber" alias="getGroupsJabber" class="ujabber" method="getGroupsJabber" prefix="class." suffix=".inc.php"/> 37 39 <item ref="FileDefine" alias="getParams" class="FileDefine" method="getParams" prefix="class." suffix=".inc.php"/> 38 40 </php> -
trunk/jabberit_messenger/inc/jabberit_acl.inc.php
r423 r459 57 57 'show_hidden', 58 58 'load', 59 'editSelect' 59 60 ); 60 61 … … 73 74 print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/celepar/css/window.css">'; 74 75 print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/celepar/css/common.css">'; 76 print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/celepar/css/selectEditStyle.css">'; 75 77 76 78 break; -
trunk/jabberit_messenger/inc/login.php
r417 r459 17 17 { 18 18 $path = $_SESSION['phpgw_info']['jabberit_messenger']['webserver_url']; 19 $SERVER_EXPRESSO = gethostbyaddr($_SERVER['SERVER_ADDR']). $path;20 19 $SERVER_EXPRESSO = $_SERVER['HTTP_HOST'] . $path; 20 21 21 $template = new Template('templates/celepar'); 22 22 $template->set_var("path", $path);
Note: See TracChangeset
for help on using the changeset viewer.