_setMessage('Your profile has been updated', static::MSG_UPDATED); $this->_setBackUrl($this->_getRedirectUrl()); return $this; } protected function _doGetUserAjax() { $term = \Qs_Request::getGetValue('term'); $data = $this->_getDataObj()->getUsers4Json($term); if (false !== stripos(\App_Admin_Obj::ADMINISTRATOR_TITLE, $term)) { array_unshift($data, array('title' => \App_Admin_Obj::ADMINISTRATOR_TITLE, 'value' => \App_Admin_Obj::ADMINISTRATOR_VALUE)); } $this->_displayJson($data); } public static function getAutocompleteNameEmailUrl() { if (($url = static::getPage('url'))) { $url .= '?action=autocompleteNameEmail'; } return $url; } protected function _doAutocompleteNameEmail() { exit; } /** * get param: string $term */ protected function _doAutocompleteNameEmailAjax() { $term = \Qs_Request::getGetValue('term'); $data = $this->_getDataObj()->getAutocompleteNameEmail($term); $this->_displayJson($data); } protected function _getLog() { if (null === $this->_log) { parent::_getLog(); $this->_log->setAction('edit', 'Headed to Edit Profile'); $this->_log->setAction('update', 'Profile has been updated'); } return $this->_log; } protected function _callAction() { $this->_getDataObj()->setPrimarykey($this->_doc->getAuthData('id')); parent::_callAction(); } protected function _initFromForm(Qs_Form $form) { $this->_newPassword = $form->getElement('password')->getValue(); return parent::_initFromForm($form); } protected function _postUpdate() { $data = $this->_doc->getAuth()->getStorage()->read(); if (!empty($this->_newPassword)) { $data['credential'] = $this->_newPassword; $this->_doc->getAuth()->getStorage()->write($data); } return parent::_postUpdate(); } protected function _getRedirectUrl() { $redirectUrl = ''; $redirectPageId = $this->getConfig('redirectPageId'); if ($redirectPageId) { $redirectUrl = Qs_SiteMap::findFirst(array('id' => $redirectPageId), null, null, 'url'); } if (empty($redirectUrl)) { $redirectUrl = $this->url(); } return $redirectUrl; } public static function getUserAutocompleteUrl() { return static::getPage('url') . '?action=getUser'; } }