get_user_applications($user_id); $contactApps = array(); foreach($apps as $app => $isEnabled){ if($isEnabled) $contactApps[] = $app; } return array( 'contactID' => $GLOBALS['phpgw_info']['user']['account_dn'], 'contactMails' => array($GLOBALS['phpgw_info']['user']['email']), 'contactPhones' => array($GLOBALS['phpgw_info']['user']['telephonenumber']), 'contactFullName' => $GLOBALS['phpgw_info']['user']['fullname'], 'contactApps' => $contactApps ); } public function post($request){ // to Receive POST Params (use $this->params) parent::post($request); if($sessionid = $GLOBALS['phpgw']->session->create($this->getParam('user'), $this->getParam('password'))) { $result = array( 'auth' => $sessionid.":".$GLOBALS['phpgw']->session->kp3, 'profile' => array($this->getUserProfile()) ); $this->setResult($result); } else { throw new ResponseException("",$GLOBALS['phpgw']->session->cd_reason); } return $this->getResponse(); } }