public function initAction() { $initData = array('session-token' => RemoteSessionManager::getSessionToken()); $securityService = SecurityService::getInstance(); if ($securityService->isAuthorized()) { $initData['isLoggedIn'] = true; $initData['user'] = $securityService->getUser(); unset($initData['user']['password']); } else { $initData['isLoggedIn'] = false; } $this->setData($initData); }
public function getUser($field = null) { $this->requireAuthorization(); $user = SecurityService::getInstance($this->_securityServiceScope)->getUser(); if (is_null($field)) { return $user; } else { return isset($user[$field]) ? $user[$field] : null; } }