. */ namespace SP\Modules\Web\Controllers\Account; use Exception; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use SP\Core\Acl\ActionsInterface; use SP\Core\Events\Event; use SP\Util\ErrorUtil; /** * Class EditPassController */ final class EditPassController extends AccountViewBase { /** * Obtener los datos para mostrar el interface para modificar la clave de cuenta * * @param int $id Account's ID * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function editPassAction(int $id): void { try { $accountDetailsResponse = $this->accountService->getById($id); $this->accountService ->withUsersById($accountDetailsResponse) ->withUserGroupsById($accountDetailsResponse); $this->accountHelper->setViewForAccount($accountDetailsResponse, ActionsInterface::ACCOUNT_EDIT_PASS); $this->view->addTemplate('account-editpass'); $this->view->assign( 'title', [ 'class' => 'titleOrange', 'name' => __('Edit Account Password'), 'icon' => $this->icons->getIconEditPass()->getIcon(), ] ); $this->view->assign('formRoute', 'account/saveEditPass'); $this->eventDispatcher->notifyEvent('show.account.editpass', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); } $this->view(); } catch (Exception $e) { processException($e); $this->eventDispatcher->notifyEvent('exception', new Event($e)); if ($this->isAjax === false && !$this->view->isUpgraded()) { $this->upgradeView(); } ErrorUtil::showExceptionInView($this->view, $e, 'account-editpass'); } } }