getConfig('defaultAction'); if (!in_array($defaultAction, $this->_actions)) { throw new Qs_Exception('Default action is not set properly'); } $this->_defaultAction = $defaultAction; return parent::_initAction(); } protected function _initFromForm(\Qs_Form $form) { $this->_newPassword = $form->getElement('password')->getValue(); return parent::_initFromForm($form); } protected function _postUpdate() { $this->_updateCredential(); return parent::_postUpdate(); } protected function _updateCredential() { if (!empty($this->_newPassword)) { $data = $this->_doc->getAuth()->getStorage()->read(); $data['credential'] = $this->_newPassword; $this->_doc->getAuth()->getStorage()->write($data); } return $this; } protected function _doEdit() { if ($this->_doc->isPagePreviewMode()) { /** * Якщо ми на прев’юві сторінки, то дані про юзера треба брати з конфігу, а не з БД. */ $data = $this->getConfig('previewData')->dbData->toArray(); } else { $data = $this->_getDataObj()->getData(); } if (null === $data) { $this->_setBackError(static::MSG_DATA_UNAVAILABLE); $this->_doBack(); } if (!$this->_lock()) { $this->_setBackAttention($this->_createMessage(static::MSG_LOCKED, $this->_getLocker())); $this->_doBack(); } unset($data['securityAnswer']); $form = $this->_getEditForm(['defaults' => $data]); $form->setDefaults(); $this->_addFormItem($form); $this->_postEdit(); return $this; } protected function _doView() { if ($this->_doc->getAuthData('alias')) { $memberPageUrl = MemberView::getPage('url') . '/' . $this->_doc->getAuthData('alias'); Qs_Http::redirect($memberPageUrl); } return $this; } }