Changeset 7846 for sandbox


Ignore:
Timestamp:
02/04/13 16:48:20 (11 years ago)
Author:
alexandrecorreia
Message:

Ticket #2507 - Correção da codificação para os clientes que utilizam o REST

Location:
sandbox/webservice/api/adapters
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sandbox/webservice/api/adapters/ExpressoAdapter.php

    r7577 r7846  
    1313                $GLOBALS['phpgw_info'] = array( 
    1414                                'flags' => array( 
    15                                                 'currentapp'            => 'login', 
    16                                                 'noheader'              => True, 
    17                                                 'disable_Template_class' => True 
     15                                                'currentapp'                    => 'login', 
     16                                                'noheader'                      => True, 
     17                                                'disable_Template_class'        => True 
    1818                                ) 
    1919                ); 
    2020                 
    21                 include_once(apiDirectory.'/../../header.inc.php'); 
     21                include_once(API_DIRECTORY.'/../../header.inc.php'); 
    2222                $this->expressoVersion = substr($GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],0,3); 
    2323                $this->setCannotModifyHeader(false); 
     
    147147                        Errors::runException("LOGIN_NOT_LOGGED_IN");                     
    148148                }                
    149         }        
    150                          
     149        } 
     150 
     151        protected function getUserApps(){ 
     152                // Load Granted Apps for Web Service 
     153                $config = parse_ini_file( __DIR__ . '/../config/user.ini',true); 
     154                $apps   = $config['Applications.mapping']; 
     155         
     156                // Load Granted Apps for User 
     157                $contactApps = array(); 
     158                $acl    = CreateObject('phpgwapi.acl'); 
     159                $user_id = $GLOBALS['phpgw_info']['user']['account_id']['acl']; 
     160                foreach($acl->get_user_applications($user_id) as $app => $value){ 
     161                        $enabledApp = array_search($app, $apps); 
     162                        if($enabledApp !== FALSE) 
     163                                $contactApps[] = $enabledApp; 
     164                } 
     165         
     166                return $contactApps; 
     167        } 
     168                                 
    151169} 
  • sandbox/webservice/api/adapters/MailAdapter.php

    r6666 r7846  
    156156                $msg['msgSubject']  = ($info_msg['subject'] ? mb_convert_encoding($info_msg['subject'],"UTF8", "ISO_8859-1") : "");              
    157157                $msg['msgHasAttachments'] = "0"; 
     158 
    158159                if(count($info_msg['attachments']) > 0) { 
    159160                        $msg['msgAttachments'] = array(); 
     
    162163                                        'attachmentID'                  => "".$attachment['pid'], 
    163164                                        'attachmentIndex'               => "".$i, 
    164                                         'attachmentName'                => $attachment['name'], 
     165                                        'attachmentName'                => "".mb_convert_encoding($attachment['name'],"UTF8", "ISO_8859-1"), 
    165166                                        'attachmentSize'                => "".$attachment['fsize'], 
    166167                                        'attachmentEncoding'    => $attachment['encoding'] 
Note: See TracChangeset for help on using the changeset viewer.