Changeset 459
- Timestamp:
- 09/22/08 17:02:02 (16 years ago)
- Location:
- trunk/jabberit_messenger
- Files:
-
- 11 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); -
trunk/jabberit_messenger/js/ldap.js
r382 r459 39 39 _status.innerHTML = ''; 40 40 _name.previousSibling.style.color = "#000"; 41 _group.previousSibling.style.color = "#000";42 41 43 42 if ( !_jid ) … … 64 63 if ( !(_group.value) ) 65 64 { 66 _group.previousSibling.style.color = "#f00";67 65 _status.innerHTML += '<br/>** Informe um "GRUPO" para o contato.'; 68 66 } … … 77 75 _uid = _jid.substr(0, (_jid.indexOf('@') - 1)); 78 76 77 79 78 _name.parentNode.style.display = 'none'; 80 79 _name.parentNode.nextSibling.style.display = 'none'; … … 86 85 { 87 86 _status.innerHTML = '<br/>Contato adicionado !<br/>'; 87 setTimeout('cleanStatusAddContactIM();',2500); 88 88 }, 89 89 'uid='+_uid+'&name='+_name.value+'&group='+_group.value … … 92 92 _name.value = ''; 93 93 _group.value = ''; 94 94 95 } 95 96 } … … 158 159 return false; 159 160 161 document.getElementById('__span_load_im_group').style.display = 'block'; 160 162 document.getElementById('im_jid').value = m.substr(0, m.indexOf(';')); 161 163 document.getElementById('im_uid').value = m.substr((m.indexOf(';')+1)); 162 164 163 165 var _name = document.getElementById('im_name'); 164 _name.value = m.substr(0, m.indexOf('@')); 165 _name.previousSibling.style.color = "#000"; 166 167 _name.parentNode.style.display = 'block'; 168 _name.parentNode.nextSibling.style.display = 'block'; 169 _name.parentNode.nextSibling.nextSibling.innerHTML = ''; 170 171 var _group = document.getElementById('im_group'); 172 _group.value = ''; 173 _group.focus(); 166 _name.value = document.getElementById(m).innerHTML; 167 _name.previousSibling.style.color = "#000"; 168 169 _name.parentNode.style.display = 'block'; 170 _name.parentNode.nextSibling.style.display = 'block'; 171 _name.parentNode.nextSibling.nextSibling.innerHTML = ''; 172 173 _conn.go('$this.ujabber.getGroupsJabber', 174 function(data) 175 { 176 if( data = data.replace(/(^\s*)|(\s*$)/g,'')) 177 { 178 var _group = document.getElementById('im_group'); 179 var _groupOptions = ''; 180 181 _group.setAttribute('selectBoxOptions', data); 182 if( document.getElementById('selectBox0') == null) 183 editS.create(document.getElementById('im_group')); 184 } 185 document.getElementById('__span_load_im_group').style.display = 'none'; 186 }); 187 188 document.getElementById('im_group').value = ''; 189 document.getElementById('im_group').focus(); 174 190 } 175 191 176 192 var _member = _target.firstChild; 193 177 194 while ( _member ) 178 195 { … … 205 222 } 206 223 )(); 224 225 function cleanStatusAddContactIM() 226 { 227 document.getElementById('im_status_add').innerHTML = ''; 228 } -
trunk/jabberit_messenger/languages/jeti_pt_BR.properties
r417 r459 456 456 main.popup.{0}_was_last_seen_on_{1}={0} foi visto em {1} 457 457 main.popup.Add_{0}_to=Adicionar {0} para \: 458 main.popup.Add_to_roster=Adicionar para roster458 main.popup.Add_to_roster=Adicionar 459 459 main.popup.Change_{0}_from_{1}_to=Trocar {0} para {1} to \: 460 460 main.popup.Chat_with=Bate-papo com 461 461 main.popup.Chat_with_who?=Bate-papo com quem? 462 main.popup.Deny_subscription=Negar registrar462 main.popup.Deny_subscription=Negar 463 463 main.popup.Enter_the_text_to_search_for=Entre o texto de pesquisa para 464 464 main.popup.Find=Procurar -
trunk/jabberit_messenger/templates/celepar/css/common.css
r417 r459 65 65 div.add_action 66 66 { 67 padding-top: 30px; 67 68 padding-bottom: 30px; 68 69 margin-left: 83px; -
trunk/jabberit_messenger/xsl/add_user.xsl
r382 r459 32 32 <br/><br style="line-height:4px"/> 33 33 <span><xsl:value-of select="$lang5"/> :</span> 34 <input id="im_group" type="text" size="50" maxlength="50" class="add_user" onclick="this.select();"/> 34 <input id="im_group" type="text" size="50" maxlength="50" selectBoxOptions="" onclick="this.select();"/> 35 <span id="__span_load_im_group" style="background-color:#cc4444;color:white;display:none;width:auto;margin:2 0 5 83px;">Carregando Grupos .....</span> 35 36 </div> 36 37 37 38 <div class="add_action"> 38 39 <span><xsl:value-of select="$lang6"/></span> -
trunk/jabberit_messenger/xsl/list_ldap_contacts.xsl
r382 r459 24 24 <xsl:sort select="cn"/> 25 25 <span value="{mail};{uid}" photo="{photo}"> 26 <span id="{mail};{uid}" style="display:none;"><xsl:value-of select="cn" /></span> 26 27 <b><xsl:value-of select="name(..)"/></b> 27 28 <br/><xsl:value-of select="cn" />
Note: See TracChangeset
for help on using the changeset viewer.