Ignore:
Timestamp:
09/22/08 17:02:02 (16 years ago)
Author:
niltonneto
Message:

Alterações feitas por Alexandre Correia.
Vide alterações 0.79 (Trac).
Email: alexandrecorreia@…

Location:
trunk/jabberit_messenger/inc
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/jabberit_messenger/inc/Controller.class.php

    r417 r459  
    164164                $obj = new ReflectionClass($class); 
    165165 
    166                 if ( $pRequest['classCostructor'] ) 
     166                if ( $pRequest['classConstructor'] ) 
    167167                { 
    168                         $obj = $obj->newInstance($pRequest['classCostructor']); 
    169                         unset($pRequest['classCostructor']); 
     168                        $obj = $obj->newInstance($pRequest['classConstructor']); 
     169                        unset($pRequest['classConstructor']); 
    170170                } 
    171171                else 
  • trunk/jabberit_messenger/inc/class.jabber.inc.php

    r382 r459  
    103103                        $this->SendPacket("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>\n"); 
    104104 
    105                         sleep(2); 
     105                        sleep(1); 
    106106 
    107107                        if ($this->_check_connected()) 
     
    304304 
    305305 
    306  
    307306        function StripJID($jid = NULL) 
    308307        { 
     
    310309                return ($temp[1] != "") ? $temp[1] : $jid; 
    311310        } 
    312  
    313311 
    314312 
     
    383381                } 
    384382        } 
    385  
    386  
    387383 
    388384        function SendError($to, $id = NULL, $error_number, $error_message = NULL) 
     
    399395        } 
    400396 
    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        } 
    402430 
    403431        function RosterUpdate() 
     
    9901018 
    9911019                $this->SendPacket("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>\n"); 
    992                 sleep(2); 
     1020                sleep(1); 
    9931021                $incoming_array = $this->_listen_incoming(); 
    9941022 
     
    10181046                $this->SendPacket("<?xml version='1.0' encoding='UTF-8' ?" . ">\n"); 
    10191047                $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); 
    10211049 
    10221050                if (!$this->_check_connected()) 
     
    17531781        } 
    17541782 
    1755  
    1756  
    17571783        function AddPacketDetails($string, $value = NULL) 
    17581784        { 
     
    17771803                eval("\$this->nodes$node = \"" . htmlspecialchars($value) . "\";"); 
    17781804        } 
    1779  
    1780  
    17811805 
    17821806        function BuildPacket($array = NULL) 
  • trunk/jabberit_messenger/inc/class.ujabber.inc.php

    r417 r459  
    2828        }        
    2929         
    30         function connect() 
     30        private final function connect() 
    3131        { 
    3232                if(!$this->jabber->Connect()) 
     
    4444        } 
    4545         
    46         function disconnect() 
     46        private final function disconnect() 
    4747        { 
    4848                 
     
    5050        } 
    5151         
    52         function AddNewContact($pNewUser) 
     52        public final function AddNewContact($pNewUser) 
    5353        { 
    5454                $this->connect(); 
     
    6060                if($this->jabber->RosterAddUser($jid,$id,$name,$group)) 
    6161                { 
     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                         
    6265                        if($this->jabber->Subscribe($jid)) 
    6366                                return true; 
     
    7073                $this->disconnect(); 
    7174        } 
     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        } 
    72103} 
    73 ?>       
     104?> 
  • trunk/jabberit_messenger/inc/controller.xml

    r439 r459  
    1717        <controller-sections> 
    1818                <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"> 
    2020                        <item ref="connector" js="connector" /> 
    2121                        <item ref="xtools" js="xtools" /> 
     
    2626                        <item ref="images" js="images" /> 
    2727                        <item ref="show_hidden" js="show_hidden" /> 
     28                        <item ref="editSelect" js="editSelect" /> 
    2829                        <item ref="setup" js="setup" path="/var/www/expresso/jabberit_messenger/templates/celepar/"/> 
    2930                </js> 
     
    3536                        <item ref="ldap_im" alias="photo_ldap" class="ldap_im" method="photo_ldap" prefix="class." suffix=".inc.php"/> 
    3637                        <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"/>                         
    3739                        <item ref="FileDefine" alias="getParams" class="FileDefine" method="getParams" prefix="class." suffix=".inc.php"/>                       
    3840                </php> 
  • trunk/jabberit_messenger/inc/jabberit_acl.inc.php

    r423 r459  
    5757                                'show_hidden', 
    5858                                'load', 
     59                                'editSelect' 
    5960                                ); 
    6061 
     
    7374                print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/celepar/css/window.css">'; 
    7475                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">';          
    7577 
    7678                break; 
  • trunk/jabberit_messenger/inc/login.php

    r417 r459  
    1717    { 
    1818                $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                 
    2121                $template = new Template('templates/celepar'); 
    2222                $template->set_var("path", $path); 
Note: See TracChangeset for help on using the changeset viewer.