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

File:
1 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} 
Note: See TracChangeset for help on using the changeset viewer.