_setMessage('Your profile has been updated', static::MSG_UPDATED); $lockMessage = 'Your profile is currently being edited by "%firstName% %lastName%" %userRoleTitle%. ' . 'Please try again later.'; $this->_setMessage($lockMessage, static::MSG_LOCKED); $this->_setBackUrl($this->_getRedirectUrl()); return $this; } 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; } }