. */ namespace SP\Modules\Web\Controllers\Account; use Exception; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use SP\Core\Events\Event; use SP\Domain\Core\Acl\AclActionsInterface; 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 { $accountEnrichedDto = $this->accountService->getByIdEnriched($id); $accountEnrichedDto = $this->accountService->withUsers($accountEnrichedDto); $accountEnrichedDto = $this->accountService->withUserGroups($accountEnrichedDto); $this->accountHelper->setViewForAccount($accountEnrichedDto, AclActionsInterface::ACCOUNT_EDIT_PASS); $this->view->addTemplate('account-editpass'); $this->view->assign( 'title', [ 'class' => 'titleOrange', 'name' => __('Edit Account Password'), 'icon' => $this->icons->editPass()->getIcon(), ] ); $this->view->assign('formRoute', 'account/saveEditPass'); $this->eventDispatcher->notify('show.account.editpass', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); } $this->view(); } catch (Exception $e) { processException($e); $this->eventDispatcher->notify('exception', new Event($e)); if ($this->isAjax === false && !$this->view->isUpgraded()) { $this->upgradeView(); } ErrorUtil::showExceptionInView($this->view, $e, 'account-editpass'); } } }