Ignore:
Timestamp:
08/16/07 08:06:05 (17 years ago)
Author:
niltonneto
Message:

Nova versão do Instant Messenger.

File:
1 edited

Legend:

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

    r41 r55  
    1414        var $db_pass; 
    1515        var $db_type; 
     16        var $teste; 
    1617         
    1718        function db_im(){ 
     
    2728        } 
    2829 
    29         function get_contacts_im($pFrom = false, $pTo) 
    30         {                
    31                 $result = array(); 
    32                 $from = explode("/",$pFrom); 
    33                 $to = explode("/",$pTo); 
    34                 if($pFrom) 
    35                         $query = "select im_from, im_to from phpgw_im_auth_user where im_from = '".$from[0]."' and im_to = '".$to[0]."'"; 
    36                 else 
    37                         $query = "select im_from, im_to from phpgw_im_auth_user where im_to = '".$to[0]."' order by im_from";                    
    38          
    39         if (!$this->db->query($query)) 
    40                 return null; 
    41                  
    42                 while($this->db->next_record()) 
    43                         $result[] = $this->db->row(); 
    44  
    45                 return $result; 
    46         } 
    47          
    48         function insert_contacts($pFrom, $pTo) 
    49         { 
    50                 $from = explode("/",$pFrom); 
    51                 $to = explode("/",$pTo); 
    52                 $query = "insert into phpgw_im_auth_user values('".$from[0]."','".$to[0]."')"; 
    53                 return $this->query_db($query);          
    54         } 
    55          
    56         function delete_contacts($pFrom, $pTo) 
    57         { 
    58                 $from = explode("/",$pFrom); 
    59                 $to = explode("/",$pTo); 
    60                 $query = "delete from phpgw_im_auth_user where im_from = '".$from[0]."' and im_to = '".$to[0]."'"; 
    61                 return $this->query_db($query); 
    62         } 
    63          
    6430        function get_accounts_acl() 
    6531        { 
     
    8854                $preferences = $param['preferences']; 
    8955                $user_id  = $_SESSION['phpgw_info']['instant_messenger']['user_id'];  
    90                 $app_name = "instant_messenger"; 
     56                $app_name = $this->name_app(); 
    9157 
    9258                $query = "insert into phpgw_preferences values('".$user_id."','".$app_name."','".serialize($preferences)."')"; 
    9359                 
    94                 if($this->query_db($query)){  
    95                         return 1; 
    96                 }else{ 
     60                if($this->query_db($query))       
     61                        return "true"; 
     62                else{ 
    9763                        $query = "update phpgw_preferences set preference_value = '".serialize($preferences)."' where preference_app='".$app_name."' and preference_owner='".$user_id."'"; 
    9864                        if($this->query_db($query)) 
    99                                 return 1; 
     65                                return "true"; 
    10066                        else 
    101                                 return 0;                        
     67                                return "false";                  
    10268                }                
    10369        } 
     
    10773                $result = array(); 
    10874                $user_id  = $_SESSION['phpgw_info']['instant_messenger']['user_id']; 
    109                 $app_name = "instant_messenger"; 
     75                $app_name = $this->name_app(); 
    11076                 
    11177                $query = "select * from phpgw_preferences where preference_owner = '".$user_id."' and preference_app = '".$app_name."'"; 
     
    12086                        return unserialize($result[0]['preference_value']); 
    12187                }else{ 
    122                         return "ch_time:true;ch_offline:true;ch_contacts:false;rd_nm:true;rd_al:false;rd_ch:false"; 
     88                        return "ch_offline:true;in_time:1;rd_nm:true;rd_ch:false"; 
    12389                } 
    124                  
     90        } 
     91         
     92        function name_app() 
     93        { 
     94                return "instant_messenger"; 
    12595        } 
    12696} 
Note: See TracChangeset for help on using the changeset viewer.