/** * Default user profile page * */ public function indexAction() { $this->view->acl = array('edit' => $this->_helper->hasAccess('edit'), 'delete' => $this->_helper->hasAccess('delete') && $this->_userData['accountId'] != Zend_Auth::getInstance()->getIdentity()->accountId, 'changePassword' => $this->_authAdapter->manageLocally() && $this->_userData['accountId'] == Zend_Auth::getInstance()->getIdentity()->accountId && $this->_helper->hasAccess('change-password'), 'apiAppAdd' => $this->_helper->hasAccess('add', 'ot_apiapp'), 'apiAppDelete' => $this->_helper->hasAccess('delete', 'ot_apiapp'), 'apiAppEdit' => $this->_helper->hasAccess('edit', 'ot_apiapp'), 'apiDocs' => $this->_helper->hasAccess('api-docs', 'ot_apiapp'), 'guestApiAccess' => $this->_helper->hasAccess('index', 'ot_api', $this->_helper->configVar('defaultRole'))); $apiApp = new Ot_Model_DbTable_ApiApp(); $apiApps = $apiApp->getAppsForAccount($this->_userData['accountId'], 'access')->toArray(); $pageRegister = new Ot_Account_Profile_Register(); $pages = $pageRegister->getPages(); $this->view->assign(array('userData' => $this->_userData, 'apiApps' => $apiApps, 'tab' => $this->_getParam('tab', 'account'), 'pages' => $pages)); $this->_helper->pageTitle('ot-account-index:title', array($this->_userData['firstName'], $this->_userData['lastName'], $this->_userData['username'])); }
/** * logs you out */ public function logout() { if (!$this->loggedIn) { return; } //$config = Zend_Registry::get('config'); $userId = Zend_Auth::getInstance()->getIdentity(); // Set up the auth adapter $authAdapter = new Ot_Auth_Adapter(); $adapter = $authAdapter->find('local'); $className = (string) $adapter->class; $auth = new $className(); $auth->autoLogout(); Zend_Auth::getInstance()->clearIdentity(); $this->loggedIn = false; }