Ignore:
Timestamp:
03/12/09 11:32:55 (15 years ago)
Author:
niltonneto
Message:

Fechamento das ocorrências referentes à versão 0.7.11

File:
1 edited

Legend:

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

    r622 r697  
    112112        } 
    113113         
     114        public final function getGroupsBlocked() 
     115        { 
     116                $return = ""; 
     117                 
     118                if( $this->db ) 
     119                { 
     120                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';";         
     121                         
     122                        if($this->db->query($query)) 
     123                        { 
     124 
     125                                if ( $this->db->query($query) ) 
     126                                {        
     127                                        while($this->db->next_record()) 
     128                                                $result[] = $this->db->row(); 
     129                                } 
     130                                 
     131                                if( count($result) > 0 ) 
     132                                        $return = $result[0]['config_value']; 
     133                        } 
     134                } 
     135                 
     136                return $return; 
     137        } 
     138         
    114139        public final function getPreferences() 
    115140        { 
     
    126151                } 
    127152 
    128                 return "openWindowJabberit:true;openWindowJabberitPopUp:false"; 
    129  
     153                return "openWindowJabberit:true;openWindowJabberitPopUp:false;flagAwayIM:5"; 
     154                //return "openWindowJabberit:true;openWindowJabberitPopUp:false";                
    130155        } 
    131156 
    132157        public final function setPreferences($pParam) 
    133158        { 
    134                 $preferences = $preferences1 = $pParam['preferences1']; 
     159                $preferences = $pParam['preferences1']; 
    135160                 
    136161                if(isset($pParam['preferences2'])) 
    137                 { 
    138                         $preferences2 = $pParam['preferences2']; 
    139                         $preferences .= ";". $preferences2; 
    140                 } 
     162                        $preferences .= ";". $pParam['preferences2']; 
     163                 
     164                if(isset($pParam['preferences3'])) 
     165                        $preferences .= ";". $pParam['preferences3']; 
    141166                 
    142167                $user_id  = $this->user_id; 
     
    291316        } 
    292317         
     318        public final function setOuGroupsLocked($pGroup) 
     319        { 
     320                $group = $pGroup['group']; 
     321                $gidnumber = $pGroup['gidnumber']; 
     322                $organization = strtoupper($pGroup['ou']); 
     323 
     324                if( $this->db ) 
     325                { 
     326                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';";         
     327                         
     328                        if($this->db->query($query)) 
     329                        { 
     330 
     331                                if ( $this->db->query($query) ) 
     332                                {        
     333                                        while($this->db->next_record()) 
     334                                                $result[] = $this->db->row(); 
     335                                } 
     336 
     337                                $groupsLocked = explode(";",$result[0]['config_value']); 
     338                                         
     339                                foreach( $groupsLocked as $tmp ) 
     340                                { 
     341                                        $aux = explode(":", $tmp); 
     342                                        if(($group.":".$gidnumber) == ($aux[0].":".$aux[1])) 
     343                                        { 
     344                                                if( $aux[2] ) 
     345                                                { 
     346                                                        $ou_groups = explode(",",$aux[2]); 
     347                                                        natcasesort($ou_groups); 
     348                                                        $key = array_search($organization, $ou_groups); 
     349                                                         
     350                                                        if( $key === false ) 
     351                                                                array_push($ou_groups, $organization); 
     352                                                         
     353                                                        $groups .= $group.":".$gidnumber.":"; 
     354                                                         
     355                                                        $return = "<return>";                                            
     356                                                         
     357                                                        foreach($ou_groups as $tmp) 
     358                                                        { 
     359                                                                $return .= "<ou attr='".$tmp."'>".$tmp."</ou>"; 
     360                                                                $groups .= $tmp .",";    
     361                                                        } 
     362                                                         
     363                                                        $return .= "</return>"; 
     364                                                         
     365                                                        $groups  = substr($groups,0,strlen($groups)-1); 
     366                                                        $groups .= ";"; 
     367                                                } 
     368                                                else 
     369                                                { 
     370                                                        $groups .= $group.":".$gidnumber.":".$organization.";"; 
     371                                                        $return = "<return><ou attr='".$organization."'>".$organization."</ou></return>"; 
     372                                                } 
     373                                        } 
     374                                        else 
     375                                                $groups .= $tmp . ";" ; 
     376                                } 
     377 
     378                                $groups = substr($groups,0,strlen($groups)-1); 
     379 
     380                                $query = "UPDATE phpgw_config SET config_value = '".trim($groups)."' WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';"; 
     381                                $this->db->query($query); 
     382                                 
     383                                return $return; 
     384                        } 
     385                } 
     386                 
     387                return false; 
     388        } 
     389         
    293390        public final function setUseParticipantsExternal($pFlag) 
    294391        { 
     
    377474        } 
    378475         
     476        public final function removeOuGroupsLocked($pGroup) 
     477        { 
     478                $group = $pGroup['group']; 
     479                $gidnumber = $pGroup['gidnumber']; 
     480                $organization = strtoupper($pGroup['ou']); 
     481                $return = false; 
     482                 
     483                if( $this->db ) 
     484                { 
     485                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';";         
     486                         
     487                        if($this->db->query($query)) 
     488                        { 
     489 
     490                                if ( $this->db->query($query) ) 
     491                                {        
     492                                        while($this->db->next_record()) 
     493                                                $result[] = $this->db->row(); 
     494                                } 
     495 
     496                                $groupsLocked = explode(";",$result[0]['config_value']); 
     497                                 
     498                                foreach( $groupsLocked as $tmp ) 
     499                                { 
     500                                        $aux = explode(":",$tmp); 
     501                                         
     502                                        if(($group.":".$gidnumber) == ($aux[0].":".$aux[1])) 
     503                                        { 
     504                                                $ous = explode(",", $aux[2]); 
     505                                                $key = array_search($organization, $ous); 
     506 
     507                                                if( $key !== false ) 
     508                                                        unset($ous[$key]); 
     509 
     510                                                $groups .= $group.":".$gidnumber.":"; 
     511                                                 
     512                                                foreach($ous as $ouTmp) 
     513                                                        $groups .= $ouTmp .",";  
     514                                                 
     515                                                $groups  = substr($groups,0,strlen($groups)-1); 
     516                                                $groups .= ";"; 
     517                                        } 
     518                                        else 
     519                                                $groups .= $tmp . ";" ;                                                                  
     520                                } 
     521                                         
     522                                $groups  = substr($groups,0,strlen($groups)-1); 
     523                         
     524                                $query = "UPDATE phpgw_config SET config_value = '".trim($groups)."' WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';"; 
     525 
     526                                if( $this->db->query($query)) 
     527                                        $return = true; 
     528                        } 
     529                }        
     530                 
     531                return $return; 
     532        } 
     533         
    379534        public final function removeAttributesLdap($pOrg) 
    380535        { 
Note: See TracChangeset for help on using the changeset viewer.