Changeset 6239 for sandbox/webservice/api/rest/core/LoginResource.php
- Timestamp:
- 05/18/12 17:18:41 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/webservice/api/rest/core/LoginResource.php
r6165 r6239 4 4 5 5 private function getUserProfile(){ 6 $user_id = $GLOBALS['phpgw_info']['user']['account_id']['acl'];7 $acl = CreateObject('phpgwapi.acl');8 $apps = $acl->get_user_applications($user_id);9 $contactApps = array();10 foreach($apps as $app => $isEnabled){11 if($isEnabled)12 $contactApps[] = $app;13 }14 6 15 7 return array( … … 18 10 'contactPhones' => array($GLOBALS['phpgw_info']['user']['telephonenumber']), 19 11 'contactFullName' => $GLOBALS['phpgw_info']['user']['fullname'], 20 'contactApps' => $ contactApps12 'contactApps' => $this->getUserApps() 21 13 ); 14 } 15 16 private function getUserApps(){ 17 // Load Granted Apps for Web Service 18 $config = parse_ini_file( __DIR__ . '/../../config/user.ini',true); 19 $apps = $config['Applications.mapping']; 20 21 // Load Granted Apps for User 22 $contactApps = array(); 23 $acl = CreateObject('phpgwapi.acl'); 24 $user_id = $GLOBALS['phpgw_info']['user']['account_id']['acl']; 25 foreach($acl->get_user_applications($user_id) as $app => $value){ 26 $enabledApp = array_search($app, $apps); 27 if($enabledApp !== FALSE) 28 $contactApps[] = $enabledApp; 29 } 30 31 return $contactApps; 22 32 } 23 33
Note: See TracChangeset
for help on using the changeset viewer.