diff --git a/app/modules/web/Controllers/Account/CopyController.php b/app/modules/web/Controllers/Account/CopyController.php index 985ad10c..43bb0326 100644 --- a/app/modules/web/Controllers/Account/CopyController.php +++ b/app/modules/web/Controllers/Account/CopyController.php @@ -37,7 +37,7 @@ final class CopyController extends AccountViewBase /** * Copy action * - * @param int $id Account's ID + * @param int $id Account's ID */ public function copyAction(int $id): void { @@ -54,8 +54,8 @@ final class CopyController extends AccountViewBase 'title', [ 'class' => 'titleGreen', - 'name' => __('New Account'), - 'icon' => $this->icons->getIconAdd()->getIcon(), + 'name' => __('New Account'), + 'icon' => $this->icons->add()->getIcon(), ] ); $this->view->assign('formRoute', 'account/saveCopy'); diff --git a/app/modules/web/Controllers/Account/CreateController.php b/app/modules/web/Controllers/Account/CreateController.php index b4b0be03..111dd846 100644 --- a/app/modules/web/Controllers/Account/CreateController.php +++ b/app/modules/web/Controllers/Account/CreateController.php @@ -47,8 +47,8 @@ final class CreateController extends AccountViewBase 'title', [ 'class' => 'titleGreen', - 'name' => __('New Account'), - 'icon' => $this->icons->getIconAdd()->getIcon(), + 'name' => __('New Account'), + 'icon' => $this->icons->add()->getIcon(), ] ); $this->view->assign('formRoute', 'account/saveCreate'); diff --git a/app/modules/web/Controllers/Account/DeleteController.php b/app/modules/web/Controllers/Account/DeleteController.php index 7186452e..55c4e4e1 100644 --- a/app/modules/web/Controllers/Account/DeleteController.php +++ b/app/modules/web/Controllers/Account/DeleteController.php @@ -29,6 +29,7 @@ use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\UI\ThemeIcons; +use SP\Domain\Account\Ports\AccountServiceInterface; use SP\Modules\Web\Controllers\Helpers\Account\AccountHelper; use SP\Mvc\Controller\WebControllerHelper; use SP\Util\ErrorUtil; @@ -40,13 +41,13 @@ final class DeleteController extends AccountControllerBase { private AccountHelper $accountHelper; private ThemeIcons $icons; - private \SP\Domain\Account\Ports\AccountServiceInterface $accountService; + private AccountServiceInterface $accountService; public function __construct( - Application $application, - WebControllerHelper $webControllerHelper, - AccountHelper $accountHelper, - \SP\Domain\Account\Ports\AccountServiceInterface $accountService + Application $application, + WebControllerHelper $webControllerHelper, + AccountHelper $accountHelper, + AccountServiceInterface $accountService ) { parent::__construct( $application, @@ -62,7 +63,7 @@ final class DeleteController extends AccountControllerBase /** * Delete action * - * @param int|null $id Account's ID + * @param int|null $id Account's ID */ public function deleteAction(?int $id = null): void { @@ -79,8 +80,8 @@ final class DeleteController extends AccountControllerBase 'title', [ 'class' => 'titleRed', - 'name' => __('Remove Account'), - 'icon' => $this->icons->getIconDelete()->getIcon(), + 'name' => __('Remove Account'), + 'icon' => $this->icons->delete()->getIcon(), ] ); $this->view->assign('formRoute', 'account/saveDelete'); diff --git a/app/modules/web/Controllers/Account/EditController.php b/app/modules/web/Controllers/Account/EditController.php index 81404317..ee310899 100644 --- a/app/modules/web/Controllers/Account/EditController.php +++ b/app/modules/web/Controllers/Account/EditController.php @@ -38,7 +38,7 @@ final class EditController extends AccountViewBase /** * Edit action * - * @param int $id Account's ID + * @param int $id Account's ID */ public function editAction(int $id): void { @@ -55,8 +55,8 @@ final class EditController extends AccountViewBase 'title', [ 'class' => 'titleOrange', - 'name' => __('Edit Account'), - 'icon' => $this->icons->getIconEdit()->getIcon(), + 'name' => __('Edit Account'), + 'icon' => $this->icons->edit()->getIcon(), ] ); $this->view->assign('formRoute', 'account/saveEdit'); diff --git a/app/modules/web/Controllers/Account/EditPassController.php b/app/modules/web/Controllers/Account/EditPassController.php index 5b740c20..b14b7eab 100644 --- a/app/modules/web/Controllers/Account/EditPassController.php +++ b/app/modules/web/Controllers/Account/EditPassController.php @@ -39,7 +39,7 @@ final class EditPassController extends AccountViewBase /** * Obtener los datos para mostrar el interface para modificar la clave de cuenta * - * @param int $id Account's ID + * @param int $id Account's ID * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface @@ -58,8 +58,8 @@ final class EditPassController extends AccountViewBase 'title', [ 'class' => 'titleOrange', - 'name' => __('Edit Account Password'), - 'icon' => $this->icons->getIconEditPass()->getIcon(), + 'name' => __('Edit Account Password'), + 'icon' => $this->icons->editPass()->getIcon(), ] ); $this->view->assign('formRoute', 'account/saveEditPass'); diff --git a/app/modules/web/Controllers/Account/ViewController.php b/app/modules/web/Controllers/Account/ViewController.php index be8efaf5..82ccbd61 100644 --- a/app/modules/web/Controllers/Account/ViewController.php +++ b/app/modules/web/Controllers/Account/ViewController.php @@ -39,7 +39,7 @@ final class ViewController extends AccountViewBase /** * View action * - * @param int $id Account's ID + * @param int $id Account's ID */ public function viewAction(int $id): void { @@ -59,8 +59,8 @@ final class ViewController extends AccountViewBase 'title', [ 'class' => 'titleNormal', - 'name' => __('Account Details'), - 'icon' => $this->icons->getIconView()->getIcon(), + 'name' => __('Account Details'), + 'icon' => $this->icons->view()->getIcon(), ] ); diff --git a/app/modules/web/Controllers/Account/ViewLinkController.php b/app/modules/web/Controllers/Account/ViewLinkController.php index ebeee051..ec97dc50 100644 --- a/app/modules/web/Controllers/Account/ViewLinkController.php +++ b/app/modules/web/Controllers/Account/ViewLinkController.php @@ -36,6 +36,8 @@ use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\UI\ThemeIcons; use SP\DataModel\AccountExtData; +use SP\Domain\Account\Ports\AccountServiceInterface; +use SP\Domain\Account\Ports\PublicLinkServiceInterface; use SP\Domain\Account\Services\PublicLinkService; use SP\Http\Uri; use SP\Mvc\Controller\WebControllerHelper; @@ -49,17 +51,17 @@ use SP\Util\Util; */ final class ViewLinkController extends AccountControllerBase { - private \SP\Domain\Account\Ports\AccountServiceInterface $accountService; + private AccountServiceInterface $accountService; private ThemeIcons $icons; private PublicLinkService $publicLinkService; private ImageUtil $imageUtil; public function __construct( - Application $application, - WebControllerHelper $webControllerHelper, - \SP\Domain\Account\Ports\AccountServiceInterface $accountService, - \SP\Domain\Account\Ports\PublicLinkServiceInterface $publicLinkService, - ImageUtilInterface $imageUtil + Application $application, + WebControllerHelper $webControllerHelper, + AccountServiceInterface $accountService, + PublicLinkServiceInterface $publicLinkService, + ImageUtilInterface $imageUtil ) { parent::__construct( $application, @@ -76,7 +78,7 @@ final class ViewLinkController extends AccountControllerBase /** * View public link action * - * @param string $hash Link's hash + * @param string $hash Link's hash */ public function viewLinkAction(string $hash): void { @@ -106,8 +108,8 @@ final class ViewLinkController extends AccountControllerBase 'title', [ 'class' => 'titleNormal', - 'name' => __('Account Details'), - 'icon' => $this->icons->getIconView()->getIcon(), + 'name' => __('Account Details'), + 'icon' => $this->icons->view()->getIcon(), ] ); @@ -136,24 +138,30 @@ final class ViewLinkController extends AccountControllerBase ? '***' : $this->request->getClientAddress(true); - $baseUrl = ($this->configData->getApplicationUrl() ?: BootstrapBase::$WEBURI).BootstrapBase::$SUBURI; + $baseUrl = ($this->configData->getApplicationUrl() ?: BootstrapBase::$WEBURI) . BootstrapBase::$SUBURI; $deepLink = new Uri($baseUrl); - $deepLink->addParam('r', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW) . '/' . $accountData->getId()); + $deepLink->addParam( + 'r', + Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW) . '/' . $accountData->getId() + ); $this->eventDispatcher->notify( 'show.account.link', new Event( $this, EventMessage::factory() - ->addDescription(__u('Link viewed')) - ->addDetail(__u('Account'), $accountData->getName()) - ->addDetail(__u('Client'), $accountData->getClientName()) - ->addDetail(__u('Agent'), $this->request->getHeader('User-Agent')) - ->addDetail(__u('HTTPS'), $this->request->isHttps() ? __u('ON') : __u('OFF')) - ->addDetail(__u('IP'), $clientAddress) - ->addDetail(__u('Link'), $deepLink->getUriSigned($this->configData->getPasswordSalt())) - ->addExtra('userId', $publicLinkData->getUserId()) - ->addExtra('notify', $publicLinkData->isNotify()) + ->addDescription(__u('Link viewed')) + ->addDetail(__u('Account'), $accountData->getName()) + ->addDetail(__u('Client'), $accountData->getClientName()) + ->addDetail(__u('Agent'), $this->request->getHeader('User-Agent')) + ->addDetail(__u('HTTPS'), $this->request->isHttps() ? __u('ON') : __u('OFF')) + ->addDetail(__u('IP'), $clientAddress) + ->addDetail( + __u('Link'), + $deepLink->getUriSigned($this->configData->getPasswordSalt()) + ) + ->addExtra('userId', $publicLinkData->getUserId()) + ->addExtra('notify', $publicLinkData->isNotify()) ) ); } else { diff --git a/app/modules/web/Controllers/ConfigManager/IndexController.php b/app/modules/web/Controllers/ConfigManager/IndexController.php index a2a1ffbf..42e4d0e4 100644 --- a/app/modules/web/Controllers/ConfigManager/IndexController.php +++ b/app/modules/web/Controllers/ConfigManager/IndexController.php @@ -41,6 +41,7 @@ use SP\Core\Exceptions\SPException; use SP\Core\Language; use SP\Core\MimeTypesInterface; use SP\Domain\Account\Ports\AccountServiceInterface; +use SP\Domain\Common\Services\ServiceException; use SP\Domain\Config\Ports\ConfigServiceInterface; use SP\Domain\Crypt\Services\TemporaryMasterPassService; use SP\Domain\Export\Services\BackupFiles; @@ -180,10 +181,10 @@ final class IndexController extends ControllerBase } /** - * @return \SP\Mvc\View\Components\DataTab - * @throws \SP\Core\Exceptions\CheckException - * @throws \SP\Core\Exceptions\ConstraintException - * @throws \SP\Core\Exceptions\QueryException + * @return DataTab + * @throws CheckException + * @throws ConstraintException + * @throws QueryException */ protected function getConfigGeneral(): DataTab { @@ -200,7 +201,7 @@ final class IndexController extends ControllerBase $template->assign( 'themes', SelectItemAdapter::factory( - $this->theme->getThemesAvailable() + $this->theme->getAvailable() )->getItemsFromArraySelected([$this->configData->getSiteTheme()]) ); $template->assign( @@ -245,8 +246,8 @@ final class IndexController extends ControllerBase } /** - * @return \SP\Mvc\View\Components\DataTab - * @throws \SP\Core\Exceptions\CheckException + * @return DataTab + * @throws CheckException */ protected function getAccountConfig(): DataTab { @@ -294,10 +295,10 @@ final class IndexController extends ControllerBase } /** - * @return \SP\Mvc\View\Components\DataTab - * @throws \SP\Core\Exceptions\CheckException - * @throws \SP\Core\Exceptions\ConstraintException - * @throws \SP\Core\Exceptions\QueryException + * @return DataTab + * @throws CheckException + * @throws ConstraintException + * @throws QueryException */ protected function getLdapConfig(): DataTab { @@ -357,9 +358,9 @@ final class IndexController extends ControllerBase } /** - * @return \SP\Mvc\View\Components\DataTab - * @throws \SP\Core\Exceptions\ConstraintException - * @throws \SP\Core\Exceptions\QueryException + * @return DataTab + * @throws ConstraintException + * @throws QueryException */ protected function getMailConfig(): DataTab { @@ -401,7 +402,7 @@ final class IndexController extends ControllerBase * @throws ConstraintException * @throws QueryException * @throws NoSuchItemException - * @throws \SP\Domain\Common\Services\ServiceException + * @throws ServiceException */ protected function getEncryptionConfig(): DataTab { @@ -521,9 +522,9 @@ final class IndexController extends ControllerBase } /** - * @return \SP\Mvc\View\Components\DataTab - * @throws \SP\Core\Exceptions\ConstraintException - * @throws \SP\Core\Exceptions\QueryException + * @return DataTab + * @throws ConstraintException + * @throws QueryException */ protected function getImportConfig(): DataTab { @@ -546,9 +547,9 @@ final class IndexController extends ControllerBase } /** - * @return \SP\Mvc\View\Components\DataTab - * @throws \SP\Domain\Common\Services\ServiceException - * @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException + * @return DataTab + * @throws ServiceException + * @throws NoSuchItemException */ protected function getInfo(): DataTab { diff --git a/app/modules/web/Controllers/ControllerBase.php b/app/modules/web/Controllers/ControllerBase.php index 6b1af859..540d67ef 100644 --- a/app/modules/web/Controllers/ControllerBase.php +++ b/app/modules/web/Controllers/ControllerBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -30,7 +30,7 @@ use Exception; use SP\Core\Acl\Acl; use SP\Core\Application; use SP\Core\Bootstrap\BootstrapBase; -use SP\Core\Context\ContextInterface; +use SP\Core\Context\SessionContextInterface; use SP\Core\Crypt\Hash; use SP\Core\Events\EventDispatcher; use SP\Core\Exceptions\FileNotFoundException; @@ -50,6 +50,10 @@ use SP\Mvc\Controller\WebControllerHelper; use SP\Mvc\View\TemplateInterface; use SP\Providers\Auth\Browser\BrowserAuthInterface; +use function SP\__; +use function SP\logger; +use function SP\processException; + /** * Clase base para los controladores */ @@ -59,21 +63,21 @@ abstract class ControllerBase protected const ERR_UNAVAILABLE = 0; - protected EventDispatcher $eventDispatcher; - protected ConfigFileService $config; - protected ContextInterface $session; - protected ThemeInterface $theme; - protected Acl $acl; - protected ConfigDataInterface $configData; - protected RequestInterface $request; - protected PhpExtensionChecker $extensionChecker; - protected TemplateInterface $view; - protected ?UserLoginResponse $userData = null; - protected ?ProfileData $userProfileData = null; - protected bool $isAjax; - protected LayoutHelper $layoutHelper; - private BrowserAuthInterface $browser; - protected string $actionName; + protected EventDispatcher $eventDispatcher; + protected ConfigFileService $config; + protected SessionContextInterface $session; + protected ThemeInterface $theme; + protected Acl $acl; + protected ConfigDataInterface $configData; + protected RequestInterface $request; + protected PhpExtensionChecker $extensionChecker; + protected TemplateInterface $view; + protected ?UserLoginResponse $userData = null; + protected ?ProfileData $userProfileData = null; + protected bool $isAjax; + protected LayoutHelper $layoutHelper; + protected string $actionName; + private BrowserAuthInterface $browser; public function __construct( Application $application, @@ -119,7 +123,7 @@ abstract class ControllerBase $this->view->assign('timeStart', $this->request->getServer('REQUEST_TIME_FLOAT')); $this->view->assign('queryTimeStart', microtime()); $this->view->assign('isDemo', $this->configData->isDemoEnabled()); - $this->view->assign('themeUri', $this->view->getTheme()->getThemeUri()); + $this->view->assign('themeUri', $this->view->getTheme()->getUri()); $this->view->assign('configData', $this->configData); if ($loggedIn) { @@ -183,10 +187,10 @@ abstract class ControllerBase /** * Comprobar si el usuario está logado. * - * @param bool $requireAuthCompleted + * @param bool $requireAuthCompleted * - * @throws \SP\Core\Exceptions\SessionTimeout - * @throws \SP\Domain\Auth\Services\AuthException + * @throws SessionTimeout + * @throws AuthException */ protected function checkLoggedIn(bool $requireAuthCompleted = true): void { @@ -230,7 +234,7 @@ abstract class ControllerBase /** * Comprobar si está permitido el acceso al módulo/página. * - * @param int $action La acción a comprobar + * @param int $action La acción a comprobar */ protected function checkAccess(int $action): bool { diff --git a/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php index c15ef0f3..37c704a5 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php @@ -63,7 +63,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Account Details')); $action->setTitle(__('Account Details')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconView()); + $action->setIcon($this->icons->view()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowView'); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); @@ -75,8 +75,8 @@ final class AccountActionsHelper extends HelperBase /** * Set icons for view * - * @param AccountAcl $accountAcl - * @param AccountActionsDto $accountActionsDto + * @param AccountAcl $accountAcl + * @param AccountActionsDto $accountActionsDto * * @return DataGridAction[] */ @@ -139,7 +139,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Back')); $action->setTitle(__('Back')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconBack()); + $action->setIcon($this->icons->back()); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $action->addAttribute('type', 'button'); @@ -158,7 +158,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Edit Account Password')); $action->setTitle(__('Edit Account Password')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconEditPass()); + $action->setIcon($this->icons->editPass()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowViewPass'); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT_PASS)); $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT_PASS)); @@ -178,7 +178,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Edit Account')); $action->setTitle(__('Edit Account')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconEdit()); + $action->setIcon($this->icons->edit()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowEdit'); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT)); $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT)); @@ -197,7 +197,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Request Modification')); $action->setTitle(__('Request Modification')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconEmail()); + $action->setIcon($this->icons->email()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowRequest'); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_REQUEST)); $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); @@ -217,7 +217,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Restore account from this point')); $action->setTitle(__('Restore account from this point')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconRestore()); + $action->setIcon($this->icons->restore()); $action->addData('action-route', 'account/saveEditRestore'); $action->addData('onclick', 'account/saveEditRestore'); $action->addAttribute('type', 'button'); @@ -236,7 +236,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Save')); $action->setTitle(__('Save')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconSave()); + $action->setIcon($this->icons->save()); $action->addData('action-route', 'account/save'); $action->addData('onclick', 'account/save'); $action->addAttribute('type', 'submit'); @@ -247,8 +247,8 @@ final class AccountActionsHelper extends HelperBase /** * Set icons for view * - * @param AccountAcl $accountAcl - * @param AccountActionsDto $accountActionsDto + * @param AccountAcl $accountAcl + * @param AccountActionsDto $accountActionsDto * * @return DataGridAction[] */ @@ -262,7 +262,7 @@ final class AccountActionsHelper extends HelperBase if ($accountAcl->isShowDelete()) { $actions[] = $this->getDeleteAction() - ->addData('item-id', $accountActionsDto->getAccountId()); + ->addData('item-id', $accountActionsDto->getAccountId()); } if ($accountActionsDto->isHistory() === false @@ -300,14 +300,14 @@ final class AccountActionsHelper extends HelperBase if ($accountAcl->isShowViewPass()) { if ($accountActionsDto->isHistory()) { $actionViewPass = $this->getViewPassHistoryAction() - ->addData('item-id', $accountActionsDto->getAccountHistoryId()); + ->addData('item-id', $accountActionsDto->getAccountHistoryId()); $actionCopy = $this->getCopyPassHistoryAction() - ->addData('item-id', $accountActionsDto->getAccountHistoryId()); + ->addData('item-id', $accountActionsDto->getAccountHistoryId()); } else { $actionViewPass = $this->getViewPassAction() - ->addData('item-id', $accountActionsDto->getAccountId()); + ->addData('item-id', $accountActionsDto->getAccountId()); $actionCopy = $this->getCopyPassAction() - ->addData('item-id', $accountActionsDto->getAccountId()); + ->addData('item-id', $accountActionsDto->getAccountId()); } $actionViewPass->addData('parent-id', $accountActionsDto->getAccountParentId()); @@ -319,7 +319,7 @@ final class AccountActionsHelper extends HelperBase if ($accountAcl->isShowCopy()) { $actions[] = $this->getCopyAction() - ->addData('item-id', $accountActionsDto->getAccountId()); + ->addData('item-id', $accountActionsDto->getAccountId()); } return $actions; @@ -336,7 +336,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Remove Account')); $action->setTitle(__('Remove Account')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconDelete()); + $action->setIcon($this->icons->delete()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowDelete'); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_DELETE)); $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_DELETE)); @@ -355,7 +355,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Update Public Link')); $action->setTitle(__('Update Public Link')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconPublicLink()); + $action->setIcon($this->icons->publicLink()); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::PUBLICLINK_REFRESH)); $action->addData('onclick', 'link/refresh'); $action->addData('action-next', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); @@ -369,7 +369,7 @@ final class AccountActionsHelper extends HelperBase */ public function getPublicLinkDeleteAction(): DataGridAction { - $icon = clone $this->icons->getIconPublicLink(); + $icon = clone $this->icons->publicLink(); $icon->setIcon('link_off'); $action = new DataGridAction(); @@ -396,7 +396,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Create Public Link')); $action->setTitle(__('Create Public Link')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconPublicLink()); + $action->setIcon($this->icons->publicLink()); $action->addData('action-route', 'publicLink/saveCreateFromAccount'); $action->addData('onclick', 'link/save'); $action->addData('action-next', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); @@ -416,7 +416,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('View password')); $action->setTitle(__('View password')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconViewPass()); + $action->setIcon($this->icons->viewPass()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowViewPass'); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_HISTORY_VIEW_PASS)); $action->addData('action-full', 1); @@ -438,7 +438,7 @@ final class AccountActionsHelper extends HelperBase $action->setTitle(__('Copy Password to Clipboard')); $action->addClass('btn-action'); $action->addClass('clip-pass-button'); - $action->setIcon($this->icons->getIconClipboard()); + $action->setIcon($this->icons->clipboard()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowCopyPass'); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_HISTORY_COPY_PASS)); $action->addData('action-full', 0); @@ -459,7 +459,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('View password')); $action->setTitle(__('View password')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconViewPass()); + $action->setIcon($this->icons->viewPass()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowViewPass'); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW_PASS)); $action->addData('action-full', 1); @@ -481,7 +481,7 @@ final class AccountActionsHelper extends HelperBase $action->setTitle(__('Copy Password to Clipboard')); $action->addClass('btn-action'); $action->addClass('clip-pass-button'); - $action->setIcon($this->icons->getIconClipboard()); + $action->setIcon($this->icons->clipboard()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowCopyPass'); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_COPY_PASS)); $action->addData('action-full', 0); @@ -502,7 +502,7 @@ final class AccountActionsHelper extends HelperBase $action->setName(__('Copy Account')); $action->setTitle(__('Copy Account')); $action->addClass('btn-action'); - $action->setIcon($this->icons->getIconCopy()); + $action->setIcon($this->icons->copy()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowCopy'); $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_COPY)); $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_COPY)); diff --git a/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php index 3c4208c5..c98e1807 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php @@ -34,6 +34,7 @@ use SP\Core\Exceptions\QueryException; use SP\Core\Exceptions\SPException; use SP\DataModel\ProfileData; use SP\DataModel\UserPreferencesData; +use SP\Domain\Account\Ports\AccountSearchServiceInterface; use SP\Domain\Account\Search\AccountSearchConstants; use SP\Domain\Account\Search\AccountSearchFilter; use SP\Domain\Account\Services\AccountSearchItem; @@ -68,20 +69,20 @@ final class AccountSearchHelper extends HelperBase private bool $isIndex; private ?AccountSearchFilter $accountSearchFilter = null; private ClientServiceInterface $clientService; - private \SP\Domain\Account\Ports\AccountSearchServiceInterface $accountSearchService; + private AccountSearchServiceInterface $accountSearchService; private AccountActionsHelper $accountActionsHelper; private CategoryServiceInterface $categoryService; private TagServiceInterface $tagService; public function __construct( - Application $application, - TemplateInterface $template, - RequestInterface $request, - ClientServiceInterface $clientService, - CategoryServiceInterface $categoryService, - TagServiceInterface $tagService, - \SP\Domain\Account\Ports\AccountSearchServiceInterface $accountSearchService, - AccountActionsHelper $accountActionsHelper + Application $application, + TemplateInterface $template, + RequestInterface $request, + ClientServiceInterface $clientService, + CategoryServiceInterface $categoryService, + TagServiceInterface $tagService, + AccountSearchServiceInterface $accountSearchService, + AccountActionsHelper $accountActionsHelper ) { parent::__construct($application, $template, $request); @@ -96,11 +97,76 @@ final class AccountSearchHelper extends HelperBase $this->setVars(); } + /** + * Establecer las variables necesarias para las plantillas + */ + private function setVars(): void + { + $userData = $this->context->getUserData(); + + $this->view->assign('isAdmin', $userData->getIsAdminApp() || $userData->getIsAdminAcc()); + + $profileData = $this->context->getUserProfile() ?? new ProfileData(); + + $this->view->assign( + 'showGlobalSearch', + $this->configData->isGlobalSearch() && $profileData->isAccGlobalSearch() + ); + + $this->accountSearchFilter = $this->getFilters(); + + $this->view->assign('searchCustomer', $this->accountSearchFilter->getClientId()); + $this->view->assign('searchCategory', $this->accountSearchFilter->getCategoryId()); + $this->view->assign('searchTags', $this->accountSearchFilter->getTagsId()); + $this->view->assign('searchTxt', $this->accountSearchFilter->getTxtSearch()); + $this->view->assign('searchGlobal', $this->accountSearchFilter->getGlobalSearch()); + $this->view->assign('searchFavorites', $this->accountSearchFilter->isSearchFavorites()); + $this->view->assign('searchRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_SEARCH)); + $this->view->assign('favoriteRouteOn', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FAVORITE_ADD)); + $this->view->assign('favoriteRouteOff', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FAVORITE_DELETE)); + $this->view->assign('viewAccountRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); + } + + /** + * Set search filters + * + * @return AccountSearchFilter + */ + private function getFilters(): AccountSearchFilter + { + $accountSearchFilter = $this->context->getSearchFilters(); + + // Return search filters from session if accessed from menu + if ($accountSearchFilter !== null && $this->isIndex) { + return $accountSearchFilter; + } + + $userPreferences = $this->context->getUserData()->getPreferences() ?? new UserPreferencesData(); + $limitCount = $userPreferences->getResultsPerPage() > 0 + ? $userPreferences->getResultsPerPage() + : $this->configData->getAccountCount(); + + $accountSearchFilter = new AccountSearchFilter(); + $accountSearchFilter->setSortKey($this->request->analyzeInt('skey', 0)); + $accountSearchFilter->setSortOrder($this->request->analyzeInt('sorder', 0)); + $accountSearchFilter->setLimitStart($this->request->analyzeInt('start', 0)); + $accountSearchFilter->setLimitCount($this->request->analyzeInt('rpp', $limitCount)); + $accountSearchFilter->setGlobalSearch($this->request->analyzeBool('gsearch', false)); + $accountSearchFilter->setClientId($this->request->analyzeInt('client')); + $accountSearchFilter->setCategoryId($this->request->analyzeInt('category')); + $accountSearchFilter->setTagsId($this->request->analyzeArray('tags', null, [])); + $accountSearchFilter->setSearchFavorites($this->request->analyzeBool('searchfav', false)); + $accountSearchFilter->setTxtSearch($this->request->analyzeString('search')); + $accountSearchFilter->setSortViews($userPreferences->isSortViews()); + + return $accountSearchFilter; + } + /** * Obtener los datos para la caja de búsqueda * - * @throws \SP\Core\Exceptions\ConstraintException - * @throws \SP\Core\Exceptions\QueryException + * @throws ConstraintException + * @throws QueryException */ public function getSearchBox(): void { @@ -109,19 +175,19 @@ final class AccountSearchHelper extends HelperBase $this->view->assign( 'clients', SelectItemAdapter::factory($this->clientService->getAllForUser()) - ->getItemsFromModelSelected( - [$this->accountSearchFilter->getClientId()] - ) + ->getItemsFromModelSelected( + [$this->accountSearchFilter->getClientId()] + ) ); $this->view->assign( 'categories', SelectItemAdapter::factory($this->categoryService->getAllBasic()) - ->getItemsFromModelSelected([$this->accountSearchFilter->getCategoryId()]) + ->getItemsFromModelSelected([$this->accountSearchFilter->getCategoryId()]) ); $this->view->assign( 'tags', SelectItemAdapter::factory($this->tagService->getAllBasic()) - ->getItemsFromModelSelected($this->accountSearchFilter->getTagsId()) + ->getItemsFromModelSelected($this->accountSearchFilter->getTagsId()) ); } @@ -203,7 +269,7 @@ final class AccountSearchHelper extends HelperBase $gridActionOptional->setId(0); $gridActionOptional->setName(__('More Actions')); $gridActionOptional->setTitle(__('More Actions')); - $gridActionOptional->setIcon($icons->getIconOptional()); + $gridActionOptional->setIcon($icons->optional()); $gridActionOptional->setRuntimeFilter( AccountSearchItem::class, 'isShowOptional' @@ -211,10 +277,10 @@ final class AccountSearchHelper extends HelperBase $gridActionOptional->addData('onclick', 'account/menu'); $gridPager = new DataGridPager(); - $gridPager->setIconPrev($icons->getIconNavPrev()); - $gridPager->setIconNext($icons->getIconNavNext()); - $gridPager->setIconFirst($icons->getIconNavFirst()); - $gridPager->setIconLast($icons->getIconNavLast()); + $gridPager->setIconPrev($icons->navPrev()); + $gridPager->setIconNext($icons->navNext()); + $gridPager->setIconFirst($icons->navFirst()); + $gridPager->setIconLast($icons->navLast()); $gridPager->setSortKey($this->accountSearchFilter->getSortKey()); $gridPager->setSortOrder($this->accountSearchFilter->getSortOrder()); $gridPager->setLimitStart($this->accountSearchFilter->getLimitStart()); @@ -274,111 +340,46 @@ final class AccountSearchHelper extends HelperBase $gridSortCustomer = new DataGridSort(); $gridSortCustomer->setName(__('Client')) - ->setTitle(__('Sort by Client')) - ->setSortKey(AccountSearchConstants::SORT_CLIENT) - ->setIconUp($icons->getIconUp()) - ->setIconDown($icons->getIconDown()); + ->setTitle(__('Sort by Client')) + ->setSortKey(AccountSearchConstants::SORT_CLIENT) + ->setIconUp($icons->up()) + ->setIconDown($icons->down()); $gridSortName = new DataGridSort(); $gridSortName->setName(__('Name')) - ->setTitle(__('Sort by Name')) - ->setSortKey(AccountSearchConstants::SORT_NAME) - ->setIconUp($icons->getIconUp()) - ->setIconDown($icons->getIconDown()); + ->setTitle(__('Sort by Name')) + ->setSortKey(AccountSearchConstants::SORT_NAME) + ->setIconUp($icons->up()) + ->setIconDown($icons->down()); $gridSortCategory = new DataGridSort(); $gridSortCategory->setName(__('Category')) - ->setTitle(__('Sort by Category')) - ->setSortKey(AccountSearchConstants::SORT_CATEGORY) - ->setIconUp($icons->getIconUp()) - ->setIconDown($icons->getIconDown()); + ->setTitle(__('Sort by Category')) + ->setSortKey(AccountSearchConstants::SORT_CATEGORY) + ->setIconUp($icons->up()) + ->setIconDown($icons->down()); $gridSortLogin = new DataGridSort(); $gridSortLogin->setName(__('User')) - ->setTitle(__('Sort by Username')) - ->setSortKey(AccountSearchConstants::SORT_LOGIN) - ->setIconUp($icons->getIconUp()) - ->setIconDown($icons->getIconDown()); + ->setTitle(__('Sort by Username')) + ->setSortKey(AccountSearchConstants::SORT_LOGIN) + ->setIconUp($icons->up()) + ->setIconDown($icons->down()); $gridSortUrl = new DataGridSort(); $gridSortUrl->setName(__('URL / IP')) - ->setTitle(__('Sort by URL / IP')) - ->setSortKey(AccountSearchConstants::SORT_URL) - ->setIconUp($icons->getIconUp()) - ->setIconDown($icons->getIconDown()); + ->setTitle(__('Sort by URL / IP')) + ->setSortKey(AccountSearchConstants::SORT_URL) + ->setIconUp($icons->up()) + ->setIconDown($icons->down()); $gridHeaderSort = new DataGridHeaderSort(); $gridHeaderSort->addSortField($gridSortCustomer) - ->addSortField($gridSortName) - ->addSortField($gridSortCategory) - ->addSortField($gridSortLogin) - ->addSortField($gridSortUrl); + ->addSortField($gridSortName) + ->addSortField($gridSortCategory) + ->addSortField($gridSortLogin) + ->addSortField($gridSortUrl); return $gridHeaderSort; } - - /** - * Establecer las variables necesarias para las plantillas - */ - private function setVars(): void - { - $userData = $this->context->getUserData(); - - $this->view->assign('isAdmin', $userData->getIsAdminApp() || $userData->getIsAdminAcc()); - - $profileData = $this->context->getUserProfile() ?? new ProfileData(); - - $this->view->assign( - 'showGlobalSearch', - $this->configData->isGlobalSearch() && $profileData->isAccGlobalSearch() - ); - - $this->accountSearchFilter = $this->getFilters(); - - $this->view->assign('searchCustomer', $this->accountSearchFilter->getClientId()); - $this->view->assign('searchCategory', $this->accountSearchFilter->getCategoryId()); - $this->view->assign('searchTags', $this->accountSearchFilter->getTagsId()); - $this->view->assign('searchTxt', $this->accountSearchFilter->getTxtSearch()); - $this->view->assign('searchGlobal', $this->accountSearchFilter->getGlobalSearch()); - $this->view->assign('searchFavorites', $this->accountSearchFilter->isSearchFavorites()); - $this->view->assign('searchRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_SEARCH)); - $this->view->assign('favoriteRouteOn', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FAVORITE_ADD)); - $this->view->assign('favoriteRouteOff', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FAVORITE_DELETE)); - $this->view->assign('viewAccountRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); - } - - /** - * Set search filters - * - * @return \SP\Domain\Account\Search\AccountSearchFilter - */ - private function getFilters(): AccountSearchFilter - { - $accountSearchFilter = $this->context->getSearchFilters(); - - // Return search filters from session if accessed from menu - if ($accountSearchFilter !== null && $this->isIndex) { - return $accountSearchFilter; - } - - $userPreferences = $this->context->getUserData()->getPreferences() ?? new UserPreferencesData(); - $limitCount = $userPreferences->getResultsPerPage() > 0 - ? $userPreferences->getResultsPerPage() - : $this->configData->getAccountCount(); - - $accountSearchFilter = new AccountSearchFilter(); - $accountSearchFilter->setSortKey($this->request->analyzeInt('skey', 0)); - $accountSearchFilter->setSortOrder($this->request->analyzeInt('sorder', 0)); - $accountSearchFilter->setLimitStart($this->request->analyzeInt('start', 0)); - $accountSearchFilter->setLimitCount($this->request->analyzeInt('rpp', $limitCount)); - $accountSearchFilter->setGlobalSearch($this->request->analyzeBool('gsearch', false)); - $accountSearchFilter->setClientId($this->request->analyzeInt('client')); - $accountSearchFilter->setCategoryId($this->request->analyzeInt('category')); - $accountSearchFilter->setTagsId($this->request->analyzeArray('tags', null, [])); - $accountSearchFilter->setSearchFavorites($this->request->analyzeBool('searchfav', false)); - $accountSearchFilter->setTxtSearch($this->request->analyzeString('search')); - $accountSearchFilter->setSortViews($userPreferences->isSortViews()); - - return $accountSearchFilter; - } } diff --git a/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php b/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php index 323b96d8..ea132759 100644 --- a/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php @@ -68,15 +68,17 @@ final class AccountGrid extends GridBase $grid->addDataAction( $this->getBulkEditAction() - ->setIsSelection(true), - true); + ->setIsSelection(true), + true + ); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), - true); + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), + true + ); $grid->setTime(round(getElapsedTime($this->queryTimeStart), 5)); @@ -163,7 +165,7 @@ final class AccountGrid extends GridBase $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('Account Details')); $gridAction->setTitle(__('Account Details')); - $gridAction->setIcon($this->icons->getIconView()); + $gridAction->setIcon($this->icons->view()); $gridAction->setOnClickFunction(Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $gridAction->addData( 'action-route', @@ -183,7 +185,7 @@ final class AccountGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Remove Account')); $gridAction->setTitle(__('Remove Account')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', @@ -203,7 +205,7 @@ final class AccountGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Bulk Update')); $gridAction->setTitle(__('Bulk Update')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php b/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php index 6352e519..c2ea22f2 100644 --- a/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php @@ -64,10 +64,11 @@ final class AccountHistoryGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), - true); + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), + true + ); $grid->setTime(round(getElapsedTime($this->queryTimeStart), 5)); @@ -113,8 +114,8 @@ final class AccountHistoryGrid extends GridBase protected function getData(): DataGridData { // Grid Data - $iconEdit = clone $this->icons->getIconEdit(); - $iconDelete = clone $this->icons->getIconDelete(); + $iconEdit = clone $this->icons->edit(); + $iconDelete = clone $this->icons->delete(); // Grid Data $gridData = new DataGridData(); @@ -126,12 +127,12 @@ final class AccountHistoryGrid extends GridBase $gridData->addDataRowSourceWithIcon( 'isModify', $iconEdit->setTitle(__('Modified')) - ->setClass('opacity50') + ->setClass('opacity50') ); $gridData->addDataRowSourceWithIcon( 'isDeleted', $iconDelete->setTitle(__('Removed')) - ->setClass('opacity50') + ->setClass('opacity50') ); $gridData->setData($this->queryResult); @@ -167,7 +168,7 @@ final class AccountHistoryGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Account Restore')); $gridAction->setTitle(__('Account Restore')); - $gridAction->setIcon($this->icons->getIconRestore()); + $gridAction->setIcon($this->icons->restore()); $gridAction->setOnClickFunction('accountManager/restore'); $gridAction->addData( 'action-route', @@ -187,7 +188,7 @@ final class AccountHistoryGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Remove Account')); $gridAction->setTitle(__('Remove Account')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php b/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php index 945281ec..683706ec 100644 --- a/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php @@ -67,10 +67,11 @@ final class AuthTokenGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), - true); + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), + true + ); $grid->setTime(round(getElapsedTime($this->queryTimeStart), 5)); @@ -158,7 +159,7 @@ final class AuthTokenGrid extends GridBase $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Authorization')); $gridAction->setTitle(__('New Authorization')); - $gridAction->setIcon($this->icons->getIconAdd()); + $gridAction->setIcon($this->icons->add()); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( @@ -179,7 +180,7 @@ final class AuthTokenGrid extends GridBase $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Authorization token')); $gridAction->setTitle(__('View Authorization token')); - $gridAction->setIcon($this->icons->getIconView()); + $gridAction->setIcon($this->icons->view()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -199,7 +200,7 @@ final class AuthTokenGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Authorization')); $gridAction->setTitle(__('Edit Authorization')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -219,7 +220,7 @@ final class AuthTokenGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Authorization')); $gridAction->setTitle(__('Delete Authorization')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php b/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php index abcb585f..23ca092e 100644 --- a/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php @@ -66,10 +66,11 @@ final class CategoryGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), - true); + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), + true + ); $grid->setTime(round(getElapsedTime($this->queryTimeStart), 5)); @@ -151,7 +152,7 @@ final class CategoryGrid extends GridBase $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Category')); $gridAction->setTitle(__('New Category')); - $gridAction->setIcon($this->icons->getIconAdd()); + $gridAction->setIcon($this->icons->add()); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( @@ -172,7 +173,7 @@ final class CategoryGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Category')); $gridAction->setTitle(__('Edit Category')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -192,7 +193,7 @@ final class CategoryGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Category')); $gridAction->setTitle(__('Delete Category')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php b/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php index 3b20a70b..e9c0c371 100644 --- a/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php @@ -65,10 +65,11 @@ final class ClientGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), - true); + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), + true + ); $grid->setTime(round(getElapsedTime($this->queryTimeStart), 5)); @@ -158,7 +159,7 @@ final class ClientGrid extends GridBase $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Client')); $gridAction->setTitle(__('New Client')); - $gridAction->setIcon($this->icons->getIconAdd()); + $gridAction->setIcon($this->icons->add()); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( @@ -179,7 +180,7 @@ final class ClientGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Client')); $gridAction->setTitle(__('Edit Client')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -199,7 +200,7 @@ final class ClientGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Client')); $gridAction->setTitle(__('Delete Client')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php b/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php index 18e6613c..eb583841 100644 --- a/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php @@ -66,10 +66,11 @@ final class CustomFieldGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), - true); + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), + true + ); $grid->setTime(round(getElapsedTime($this->queryTimeStart), 5)); @@ -128,7 +129,7 @@ final class CustomFieldGrid extends GridBase $gridData->addDataRowSource('typeName'); $gridData->addDataRowSourceWithIcon( 'isEncrypted', - $this->icons->getIconEditPass()->setTitle(__('Encrypted')) + $this->icons->editPass()->setTitle(__('Encrypted')) ); $gridData->setData($this->queryResult); @@ -165,7 +166,7 @@ final class CustomFieldGrid extends GridBase $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Field')); $gridAction->setTitle(__('New Field')); - $gridAction->setIcon($this->icons->getIconAdd()); + $gridAction->setIcon($this->icons->add()); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( @@ -186,7 +187,7 @@ final class CustomFieldGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Field')); $gridAction->setTitle(__('Edit Field')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -206,7 +207,7 @@ final class CustomFieldGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Field')); $gridAction->setTitle(__('Delete Field')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php b/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php index 7dcfe0ad..d18ec8e1 100644 --- a/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php @@ -119,10 +119,13 @@ final class EventlogGrid extends GridBase $gridData->addDataRowSource('level'); $gridData->addDataRowSource('action', null, null, false); $gridData->addDataRowSource('login'); - $gridData->addDataRowSource('ipAddress', false, + $gridData->addDataRowSource( + 'ipAddress', + false, function ($value) use ($isDemoMode) { return $isDemoMode ? '*.*.*.*' : $value; - }); + } + ); $gridData->addDataRowSource( 'description', false, @@ -137,10 +140,11 @@ final class EventlogGrid extends GridBase if (preg_match('/^SQL.*/m', $value)) { $value = preg_replace([ - '/([a-zA-Z_]+),/m', - '/(UPDATE|DELETE|TRUNCATE|INSERT|SELECT|WHERE|LEFT|ORDER|LIMIT|FROM)/m'], - ['\\1,
', '
\\1'], - $value + '/([a-zA-Z_]+),/m', + '/(UPDATE|DELETE|TRUNCATE|INSERT|SELECT|WHERE|LEFT|ORDER|LIMIT|FROM)/m' + ], + ['\\1,
', '
\\1'], + $value ); } @@ -189,7 +193,7 @@ final class EventlogGrid extends GridBase $gridAction->setSkip(true); $gridAction->setName(__('Refresh')); $gridAction->setTitle(__('Refresh')); - $gridAction->setIcon($this->icons->getIconRefresh()); + $gridAction->setIcon($this->icons->refresh()); $gridAction->setOnClickFunction('eventlog/refresh'); $gridAction->addData('action-form', 'frmSearchEvent'); $gridAction->addData( @@ -211,7 +215,7 @@ final class EventlogGrid extends GridBase $gridAction->setSkip(true); $gridAction->setName(__('Clear the event log out')); $gridAction->setTitle(__('Clear the event log out')); - $gridAction->setIcon($this->icons->getIconClear()); + $gridAction->setIcon($this->icons->clear()); $gridAction->setOnClickFunction('eventlog/clear'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/FileGrid.php b/app/modules/web/Controllers/Helpers/Grid/FileGrid.php index d0b6a116..a73bde4c 100644 --- a/app/modules/web/Controllers/Helpers/Grid/FileGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/FileGrid.php @@ -65,10 +65,11 @@ final class FileGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), - true); + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), + true + ); $grid->setTime(round(getElapsedTime($this->queryTimeStart), 5)); @@ -163,7 +164,7 @@ final class FileGrid extends GridBase $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View File')); $gridAction->setTitle(__('View File')); - $gridAction->setIcon($this->icons->getIconView()); + $gridAction->setIcon($this->icons->view()); $gridAction->setOnClickFunction('file/view'); $gridAction->setFilterRowSource('type', 'application/pdf'); $gridAction->addData( @@ -184,7 +185,7 @@ final class FileGrid extends GridBase $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('Download File')); $gridAction->setTitle(__('Download File')); - $gridAction->setIcon($this->icons->getIconDownload()); + $gridAction->setIcon($this->icons->download()); $gridAction->setOnClickFunction('file/download'); $gridAction->addData( 'action-route', @@ -209,7 +210,7 @@ final class FileGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete File')); $gridAction->setTitle(__('Delete File')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/GridBase.php b/app/modules/web/Controllers/Helpers/Grid/GridBase.php index bba6c7ce..e741a2ff 100644 --- a/app/modules/web/Controllers/Helpers/Grid/GridBase.php +++ b/app/modules/web/Controllers/Helpers/Grid/GridBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -52,7 +52,7 @@ abstract class GridBase extends HelperBase implements GridInterface Application $application, TemplateInterface $template, RequestInterface $request, - Acl $acl + Acl $acl ) { parent::__construct($application, $template, $request); @@ -65,8 +65,8 @@ abstract class GridBase extends HelperBase implements GridInterface /** * Actualizar los datos del paginador * - * @param DataGridInterface $dataGrid - * @param ItemSearchData $itemSearchData + * @param DataGridInterface $dataGrid + * @param ItemSearchData $itemSearchData * * @return DataGridInterface */ @@ -75,9 +75,9 @@ abstract class GridBase extends HelperBase implements GridInterface ItemSearchData $itemSearchData ): DataGridInterface { $dataGrid->getPager() - ->setLimitStart($itemSearchData->getLimitStart()) - ->setLimitCount($itemSearchData->getLimitCount()) - ->setFilterOn(!empty($itemSearchData->getSeachString())); + ->setLimitStart($itemSearchData->getLimitStart()) + ->setLimitCount($itemSearchData->getLimitCount()) + ->setFilterOn(!empty($itemSearchData->getSeachString())); $dataGrid->updatePager(); @@ -87,7 +87,7 @@ abstract class GridBase extends HelperBase implements GridInterface /** * Devolver el paginador por defecto * - * @param DataGridActionSearch $sourceAction + * @param DataGridActionSearch $sourceAction * * @return DataGridPager */ @@ -99,10 +99,10 @@ abstract class GridBase extends HelperBase implements GridInterface $gridPager->setOnClickFunction('appMgmt/nav'); $gridPager->setLimitStart(0); $gridPager->setLimitCount($this->configData->getAccountCount()); - $gridPager->setIconPrev($this->icons->getIconNavPrev()); - $gridPager->setIconNext($this->icons->getIconNavNext()); - $gridPager->setIconFirst($this->icons->getIconNavFirst()); - $gridPager->setIconLast($this->icons->getIconNavLast()); + $gridPager->setIconPrev($this->icons->navPrev()); + $gridPager->setIconNext($this->icons->navNext()); + $gridPager->setIconFirst($this->icons->navFirst()); + $gridPager->setIconLast($this->icons->navLast()); return $gridPager; } @@ -121,4 +121,4 @@ abstract class GridBase extends HelperBase implements GridInterface * @return DataGridData */ abstract protected function getData(): DataGridData; -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php b/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php index 071062a2..a4e38caa 100644 --- a/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php @@ -69,10 +69,11 @@ final class ItemPresetGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setTitle(__('Delete Selected')) - ->setName(__('Delete Selected')) - ->setIsSelection(true), - true); + ->setTitle(__('Delete Selected')) + ->setName(__('Delete Selected')) + ->setIsSelection(true), + true + ); $grid->setTime(round(getElapsedTime($this->queryTimeStart), 5)); @@ -126,7 +127,7 @@ final class ItemPresetGrid extends GridBase $gridData->addDataRowSource('userGroupName'); $gridData->addDataRowSource('userProfileName'); $gridData->addDataRowSource('priority'); - $gridData->addDataRowSourceWithIcon('fixed', $this->icons->getIconEnabled()); + $gridData->addDataRowSourceWithIcon('fixed', $this->icons->enabled()); $gridData->setData($this->queryResult); return $gridData; @@ -163,13 +164,14 @@ final class ItemPresetGrid extends GridBase $gridAction->setName(__('Permission Preset')); $gridAction->setTitle(__('New Permission Preset')); - $icon = clone $this->icons->getIconAdd(); + $icon = clone $this->icons->add(); $gridAction->setIcon($icon->setIcon('add_circle')); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); - $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PERMISSION; + $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . + ItemPresetInterface::ITEM_TYPE_ACCOUNT_PERMISSION; $gridAction->addData('action-route', $route); @@ -187,13 +189,14 @@ final class ItemPresetGrid extends GridBase $gridAction->setName(__('Private Account Preset')); $gridAction->setTitle(__('New Private Account Preset')); - $icon = clone $this->icons->getIconAdd(); + $icon = clone $this->icons->add(); $gridAction->setIcon($icon->setIcon('add_circle')); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); - $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PRIVATE; + $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . + ItemPresetInterface::ITEM_TYPE_ACCOUNT_PRIVATE; $gridAction->addData('action-route', $route); @@ -211,13 +214,14 @@ final class ItemPresetGrid extends GridBase $gridAction->setName(__('Session Timeout Preset')); $gridAction->setTitle(__('New Session Timeout Preset')); - $icon = clone $this->icons->getIconAdd(); + $icon = clone $this->icons->add(); $gridAction->setIcon($icon->setIcon('add_circle')); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); - $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_SESSION_TIMEOUT; + $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . + ItemPresetInterface::ITEM_TYPE_SESSION_TIMEOUT; $gridAction->addData('action-route', $route); @@ -235,13 +239,14 @@ final class ItemPresetGrid extends GridBase $gridAction->setName(__('Account Password Preset')); $gridAction->setTitle(__('New Account Password Preset')); - $icon = clone $this->icons->getIconAdd(); + $icon = clone $this->icons->add(); $gridAction->setIcon($icon->setIcon('add_circle')); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); - $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PASSWORD; + $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . + ItemPresetInterface::ITEM_TYPE_ACCOUNT_PASSWORD; $gridAction->addData('action-route', $route); @@ -258,7 +263,7 @@ final class ItemPresetGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Value')); $gridAction->setTitle(__('Edit Value')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -278,7 +283,7 @@ final class ItemPresetGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Value')); $gridAction->setTitle(__('Delete Value')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php b/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php index 475c07c6..2bd730b5 100644 --- a/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php @@ -82,10 +82,12 @@ final class NotificationGrid extends GridBase $grid->addDataAction( $this->setNonAdminFilter( $this->getDeleteAction() - ->setTitle(__('Delete Selected')) - ->setName(__('Delete Selected')) - ->setIsSelection(true)), - true); + ->setTitle(__('Delete Selected')) + ->setName(__('Delete Selected')) + ->setIsSelection(true) + ), + true + ); $grid->setTime(round(getElapsedTime($this->queryTimeStart), 5)); @@ -153,15 +155,15 @@ final class NotificationGrid extends GridBase ); $gridData->addDataRowSourceWithIcon( 'checked', - $this->icons->getIconEnabled()->setTitle(__('Read')) + $this->icons->enabled()->setTitle(__('Read')) ); $gridData->addDataRowSourceWithIcon( 'onlyAdmin', - $this->icons->getIconAppAdmin()->setTitle(__('Only Admins')) + $this->icons->appAdmin()->setTitle(__('Only Admins')) ); $gridData->addDataRowSourceWithIcon( 'sticky', - $this->icons->getIconGroup()->setTitle(__('Global')) + $this->icons->group()->setTitle(__('Global')) ); $gridData->setData($this->queryResult); @@ -198,7 +200,7 @@ final class NotificationGrid extends GridBase $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Notification')); $gridAction->setTitle(__('New Notification')); - $gridAction->setIcon($this->icons->getIconAdd()); + $gridAction->setIcon($this->icons->add()); $gridAction->setSkip(true); $gridAction->setOnClickFunction('notification/show'); $gridAction->addData( @@ -219,7 +221,7 @@ final class NotificationGrid extends GridBase $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Notification')); $gridAction->setTitle(__('View Notification')); - $gridAction->setIcon($this->icons->getIconView()); + $gridAction->setIcon($this->icons->view()); $gridAction->setOnClickFunction('notification/show'); $gridAction->addData( 'action-route', @@ -236,8 +238,7 @@ final class NotificationGrid extends GridBase */ private function setNonAdminFilter( DataGridActionInterface $gridAction - ): DataGridActionInterface - { + ): DataGridActionInterface { if (!$this->isAdminApp) { $gridAction->setFilterRowSource('sticky'); } @@ -254,7 +255,7 @@ final class NotificationGrid extends GridBase $gridAction->setId(AclActionsInterface::NOTIFICATION_CHECK); $gridAction->setName(__('Checkout Notification')); $gridAction->setTitle(__('Checkout Notification')); - $gridAction->setIcon($this->icons->getIconEnabled()); + $gridAction->setIcon($this->icons->enabled()); $gridAction->setOnClickFunction('notification/check'); $gridAction->setFilterRowSource('checked'); $gridAction->addData( @@ -278,7 +279,7 @@ final class NotificationGrid extends GridBase $gridAction->setId(AclActionsInterface::NOTIFICATION_EDIT); $gridAction->setName(__('Edit Notification')); $gridAction->setTitle(__('Edit Notification')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('notification/show'); $gridAction->addData( 'action-route', @@ -298,7 +299,7 @@ final class NotificationGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Notification')); $gridAction->setTitle(__('Delete Notification')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('notification/delete'); $gridAction->setFilterRowSource('checked', 0); $gridAction->addData( diff --git a/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php b/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php index e510a290..43354eb4 100644 --- a/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php @@ -113,16 +113,16 @@ final class PluginGrid extends GridBase $gridData->addDataRowSource('name'); $gridData->addDataRowSourceWithIcon( 'enabled', - $this->icons->getIconEnabled() + $this->icons->enabled() ); $gridData->addDataRowSourceWithIcon( 'enabled', - $this->icons->getIconDisabled(), + $this->icons->disabled(), 0 ); $gridData->addDataRowSourceWithIcon( 'available', - $this->icons->getIconDelete()->setTitle(__('Unavailable')), + $this->icons->delete()->setTitle(__('Unavailable')), 0 ); $gridData->setData($this->queryResult); @@ -160,7 +160,7 @@ final class PluginGrid extends GridBase $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Plugin')); $gridAction->setTitle(__('View Plugin')); - $gridAction->setIcon($this->icons->getIconView()); + $gridAction->setIcon($this->icons->view()); $gridAction->setOnClickFunction('plugin/show'); $gridAction->setFilterRowSource('available', 0); $gridAction->addData( @@ -180,7 +180,7 @@ final class PluginGrid extends GridBase $gridAction->setId(AclActionsInterface::PLUGIN_ENABLE); $gridAction->setName(__('Enable')); $gridAction->setTitle(__('Enable')); - $gridAction->setIcon($this->icons->getIconEnabled()); + $gridAction->setIcon($this->icons->enabled()); $gridAction->setOnClickFunction('plugin/toggle'); $gridAction->setFilterRowSource('enabled'); $gridAction->setFilterRowSource('available', 0); @@ -202,7 +202,7 @@ final class PluginGrid extends GridBase $gridAction->setId(AclActionsInterface::PLUGIN_DISABLE); $gridAction->setName(__('Disable')); $gridAction->setTitle(__('Disable')); - $gridAction->setIcon($this->icons->getIconDisabled()); + $gridAction->setIcon($this->icons->disabled()); $gridAction->setOnClickFunction('plugin/toggle'); $gridAction->setFilterRowSource('enabled', 0); $gridAction->setFilterRowSource('available', 0); @@ -224,7 +224,7 @@ final class PluginGrid extends GridBase $gridAction->setId(AclActionsInterface::PLUGIN_RESET); $gridAction->setName(__('Reset Data')); $gridAction->setTitle(__('Reset Data')); - $gridAction->setIcon($this->icons->getIconRefresh()); + $gridAction->setIcon($this->icons->refresh()); $gridAction->setOnClickFunction('plugin/reset'); $gridAction->setFilterRowSource('available', 0); $gridAction->addData( @@ -250,7 +250,7 @@ final class PluginGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Plugin')); $gridAction->setTitle(__('Delete Plugin')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setFilterRowSource('available'); $gridAction->setOnClickFunction('plugin/delete'); $gridAction->addData( diff --git a/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php b/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php index 8c47bedb..b5772517 100644 --- a/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php @@ -67,9 +67,9 @@ final class PublicLinkGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), true ); @@ -170,7 +170,7 @@ final class PublicLinkGrid extends GridBase $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Link')); $gridAction->setTitle(__('New Link')); - $gridAction->setIcon($this->icons->getIconAdd()); + $gridAction->setIcon($this->icons->add()); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( @@ -191,7 +191,7 @@ final class PublicLinkGrid extends GridBase $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Link')); $gridAction->setTitle(__('View Link')); - $gridAction->setIcon($this->icons->getIconView()); + $gridAction->setIcon($this->icons->view()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -210,7 +210,7 @@ final class PublicLinkGrid extends GridBase $gridAction->setId(AclActionsInterface::PUBLICLINK_REFRESH); $gridAction->setName(__('Renew Link')); $gridAction->setTitle(__('Renew Link')); - $gridAction->setIcon($this->icons->getIconRefresh()); + $gridAction->setIcon($this->icons->refresh()); $gridAction->setOnClickFunction('link/refresh'); $gridAction->addData( 'action-route', @@ -230,7 +230,7 @@ final class PublicLinkGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Link')); $gridAction->setTitle(__('Delete Link')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/TagGrid.php b/app/modules/web/Controllers/Helpers/Grid/TagGrid.php index 111216fb..7d2ec3a1 100644 --- a/app/modules/web/Controllers/Helpers/Grid/TagGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/TagGrid.php @@ -66,9 +66,9 @@ final class TagGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), true ); @@ -150,7 +150,7 @@ final class TagGrid extends GridBase $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Tag')); $gridAction->setTitle(__('New Tag')); - $gridAction->setIcon($this->icons->getIconAdd()); + $gridAction->setIcon($this->icons->add()); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( @@ -171,7 +171,7 @@ final class TagGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Tag')); $gridAction->setTitle(__('Edit Tag')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -191,7 +191,7 @@ final class TagGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Tag')); $gridAction->setTitle(__('Delete Tag')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php b/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php index 023b5a54..3cd21409 100644 --- a/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php @@ -190,7 +190,7 @@ final class TrackGrid extends GridBase $gridAction->setSkip(true); $gridAction->setName(__('Refresh')); $gridAction->setTitle(__('Refresh')); - $gridAction->setIcon($this->icons->getIconRefresh()); + $gridAction->setIcon($this->icons->refresh()); $gridAction->setOnClickFunction('track/refresh'); $gridAction->addData('action-form', 'frmSearchTrack'); $gridAction->addData( @@ -212,7 +212,7 @@ final class TrackGrid extends GridBase $gridAction->setSkip(true); $gridAction->setName(Acl::getActionInfo(AclActionsInterface::TRACK_CLEAR)); $gridAction->setTitle(Acl::getActionInfo(AclActionsInterface::TRACK_CLEAR)); - $gridAction->setIcon($this->icons->getIconClear()); + $gridAction->setIcon($this->icons->clear()); $gridAction->setOnClickFunction('track/clear'); $gridAction->addData( 'action-route', @@ -232,7 +232,7 @@ final class TrackGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(Acl::getActionInfo(AclActionsInterface::TRACK_UNLOCK)); $gridAction->setTitle(Acl::getActionInfo(AclActionsInterface::TRACK_UNLOCK)); - $gridAction->setIcon($this->icons->getIconCheck()); + $gridAction->setIcon($this->icons->check()); $gridAction->setOnClickFunction('track/unlock'); $gridAction->setFilterRowSource('tracked', 0); $gridAction->addData( diff --git a/app/modules/web/Controllers/Helpers/Grid/UserGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserGrid.php index 0e89e3aa..48fe2bbd 100644 --- a/app/modules/web/Controllers/Helpers/Grid/UserGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/UserGrid.php @@ -68,9 +68,9 @@ final class UserGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), true ); @@ -126,19 +126,19 @@ final class UserGrid extends GridBase $gridData->addDataRowSource('userGroupName'); $gridData->addDataRowSourceWithIcon( 'isAdminApp', - $this->icons->getIconAppAdmin() + $this->icons->appAdmin() ); $gridData->addDataRowSourceWithIcon( 'isAdminAcc', - $this->icons->getIconAccAdmin() + $this->icons->accAdmin() ); $gridData->addDataRowSourceWithIcon( 'isLdap', - $this->icons->getIconLdapUser() + $this->icons->ldapUser() ); $gridData->addDataRowSourceWithIcon( 'isDisabled', - $this->icons->getIconDisabled() + $this->icons->disabled() ); $gridData->setData($this->queryResult); @@ -175,7 +175,7 @@ final class UserGrid extends GridBase $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New User')); $gridAction->setTitle(__('New User')); - $gridAction->setIcon($this->icons->getIconAdd()); + $gridAction->setIcon($this->icons->add()); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( @@ -196,7 +196,7 @@ final class UserGrid extends GridBase $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View User Details')); $gridAction->setTitle(__('View User Details')); - $gridAction->setIcon($this->icons->getIconView()); + $gridAction->setIcon($this->icons->view()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -216,7 +216,7 @@ final class UserGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit User')); $gridAction->setTitle(__('Edit User')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -236,7 +236,7 @@ final class UserGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Change User\'s Password')); $gridAction->setTitle(__('Change User\'s Password')); - $gridAction->setIcon($this->icons->getIconEditPass()); + $gridAction->setIcon($this->icons->editPass()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->setFilterRowSource('isLdap'); $gridAction->addData( @@ -257,7 +257,7 @@ final class UserGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete User')); $gridAction->setTitle(__('Delete User')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php index 8c4da938..a52e7ef4 100644 --- a/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php @@ -67,9 +67,9 @@ final class UserGroupGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), true ); @@ -153,7 +153,7 @@ final class UserGroupGrid extends GridBase $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Group')); $gridAction->setTitle(__('New Group')); - $gridAction->setIcon($this->icons->getIconAdd()); + $gridAction->setIcon($this->icons->add()); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( @@ -174,7 +174,7 @@ final class UserGroupGrid extends GridBase $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Group')); $gridAction->setTitle(__('View Group')); - $gridAction->setIcon($this->icons->getIconView()); + $gridAction->setIcon($this->icons->view()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -194,7 +194,7 @@ final class UserGroupGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Group')); $gridAction->setTitle(__('Edit Group')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -214,7 +214,7 @@ final class UserGroupGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Group')); $gridAction->setTitle(__('Delete Group')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php index ed0baf5e..025b56ed 100644 --- a/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php @@ -67,9 +67,9 @@ final class UserProfileGrid extends GridBase $grid->addDataAction($this->getDeleteAction()); $grid->addDataAction( $this->getDeleteAction() - ->setName(__('Delete Selected')) - ->setTitle(__('Delete Selected')) - ->setIsSelection(true), + ->setName(__('Delete Selected')) + ->setTitle(__('Delete Selected')) + ->setIsSelection(true), true ); @@ -151,7 +151,7 @@ final class UserProfileGrid extends GridBase $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Profile')); $gridAction->setTitle(__('New Profile')); - $gridAction->setIcon($this->icons->getIconAdd()); + $gridAction->setIcon($this->icons->add()); $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( @@ -172,7 +172,7 @@ final class UserProfileGrid extends GridBase $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Profile Details')); $gridAction->setTitle(__('View Profile Details')); - $gridAction->setIcon($this->icons->getIconView()); + $gridAction->setIcon($this->icons->view()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -192,7 +192,7 @@ final class UserProfileGrid extends GridBase $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Profile')); $gridAction->setTitle(__('Edit Profile')); - $gridAction->setIcon($this->icons->getIconEdit()); + $gridAction->setIcon($this->icons->edit()); $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', @@ -212,7 +212,7 @@ final class UserProfileGrid extends GridBase $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Profile')); $gridAction->setTitle(__('Delete Profile')); - $gridAction->setIcon($this->icons->getIconDelete()); + $gridAction->setIcon($this->icons->delete()); $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', diff --git a/app/modules/web/Controllers/Helpers/LayoutHelper.php b/app/modules/web/Controllers/Helpers/LayoutHelper.php index 593f23c1..def3c6c2 100644 --- a/app/modules/web/Controllers/Helpers/LayoutHelper.php +++ b/app/modules/web/Controllers/Helpers/LayoutHelper.php @@ -54,12 +54,12 @@ final class LayoutHelper extends HelperBase private bool $loggedIn; public function __construct( - Application $application, + Application $application, TemplateInterface $template, RequestInterface $request, ThemeInterface $theme, CryptPKIInterface $cryptPKI, - PluginManager $pluginManager + PluginManager $pluginManager ) { parent::__construct($application, $template, $request); @@ -74,8 +74,8 @@ final class LayoutHelper extends HelperBase /** * Sets a full layout page * - * @param string $page Page/view name - * @param Acl|null $acl + * @param string $page Page/view name + * @param Acl|null $acl * * @return LayoutHelper */ @@ -119,9 +119,9 @@ final class LayoutHelper extends HelperBase $this->view->assign('app_website_url', AppInfoInterface::APP_WEBSITE_URL); $this->view->assign('app_blog_url', AppInfoInterface::APP_BLOG_URL); $this->view->assign('app_version', InstallerService::VERSION_TEXT); - $this->view->assign('logo_icon', $baseUrl.'/public/images/logo_icon.png'); - $this->view->assign('logo_no_bg_color', $baseUrl.'/public/images/logo_full_nobg_outline_color.png'); - $this->view->assign('logo_no_bg', $baseUrl.'/public/images/logo_full_nobg_outline.png'); + $this->view->assign('logo_icon', $baseUrl . '/public/images/logo_icon.png'); + $this->view->assign('logo_no_bg_color', $baseUrl . '/public/images/logo_full_nobg_outline_color.png'); + $this->view->assign('logo_no_bg', $baseUrl . '/public/images/logo_full_nobg_outline.png'); $this->view->assign('httpsEnabled', $this->request->isHttps()); $this->view->assign('homeRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT)); @@ -148,7 +148,7 @@ final class LayoutHelper extends HelperBase protected function getResourcesLinks(): void { $version = VersionUtil::getVersionStringNormalized(); - $baseUrl = ($this->configData->getApplicationUrl() ?? BootstrapBase::$WEBURI).BootstrapBase::$SUBURI; + $baseUrl = ($this->configData->getApplicationUrl() ?? BootstrapBase::$WEBURI) . BootstrapBase::$SUBURI; $jsUri = new Uri($baseUrl); $jsUri->addParam('_r', 'resource/js'); @@ -160,12 +160,12 @@ final class LayoutHelper extends HelperBase $this->view->append('jsLinks', $jsUri->getUriSigned($this->configData->getPasswordSalt())); - $themeInfo = $this->theme->getThemeInfo(); + $themeInfo = $this->theme->getInfo(); if (isset($themeInfo['js'])) { $jsUri->resetParams() - ->addParam('b', $this->theme->getThemePath().DIRECTORY_SEPARATOR.'js') - ->addParam('f', implode(',', $themeInfo['js'])); + ->addParam('b', $this->theme->getPath() . DIRECTORY_SEPARATOR . 'js') + ->addParam('f', implode(',', $themeInfo['js'])); $this->view->append('jsLinks', $jsUri->getUriSigned($this->configData->getPasswordSalt())); } @@ -174,7 +174,8 @@ final class LayoutHelper extends HelperBase if ($this->loggedIn && $userPreferences - && $userPreferences->getUserId() > 0) { + && $userPreferences->getUserId() > 0 + ) { $resultsAsCards = $userPreferences->isResultsAsCards(); } else { $resultsAsCards = $this->configData->isResultsAsCards(); @@ -182,7 +183,7 @@ final class LayoutHelper extends HelperBase $cssUri = (new Uri($baseUrl)) ->addParam('_r', 'resource/css') - ->addParam('_v', md5($version.$resultsAsCards)); + ->addParam('_v', md5($version . $resultsAsCards)); $this->view->append('cssLinks', $cssUri->getUriSigned($this->configData->getPasswordSalt())); @@ -196,8 +197,8 @@ final class LayoutHelper extends HelperBase } $cssUri->resetParams() - ->addParam('b', $this->theme->getThemePath().DIRECTORY_SEPARATOR.'css') - ->addParam('f', implode(',', $themeInfo['css'])); + ->addParam('b', $this->theme->getPath() . DIRECTORY_SEPARATOR . 'css') + ->addParam('f', implode(',', $themeInfo['css'])); $this->view->append('cssLinks', $cssUri->getUriSigned($this->configData->getPasswordSalt())); } @@ -207,23 +208,23 @@ final class LayoutHelper extends HelperBase foreach ($loadedPlugins as $plugin) { $base = str_replace(APP_ROOT, '', $plugin->getBase()); - $base .= DIRECTORY_SEPARATOR.'public'; + $base .= DIRECTORY_SEPARATOR . 'public'; $jsResources = $plugin->getJsResources(); $cssResources = $plugin->getCssResources(); if (count($jsResources) > 0) { $jsUri->resetParams() - ->addParam('b', $base.DIRECTORY_SEPARATOR.'js') - ->addParam('f', implode(',', $jsResources)); + ->addParam('b', $base . DIRECTORY_SEPARATOR . 'js') + ->addParam('f', implode(',', $jsResources)); $this->view->append('jsLinks', $jsUri->getUriSigned($this->configData->getPasswordSalt())); } if (count($cssResources) > 0) { $cssUri->resetParams() - ->addParam('b', $base.DIRECTORY_SEPARATOR.'css') - ->addParam('f', implode(',', $cssResources)); + ->addParam('b', $base . DIRECTORY_SEPARATOR . 'css') + ->addParam('f', implode(',', $cssResources)); $this->view->append('cssLinks', $cssUri->getUriSigned($this->configData->getPasswordSalt())); } @@ -254,9 +255,9 @@ final class LayoutHelper extends HelperBase $icons = $this->theme->getIcons(); if ($userData->getIsAdminApp()) { - $userType = $icons->getIconAppAdmin(); + $userType = $icons->appAdmin(); } elseif ($userData->getIsAdminAcc()) { - $userType = $icons->getIconAccAdmin(); + $userType = $icons->accAdmin(); } $this->view->assign('ctx_userType', $userType); @@ -269,7 +270,7 @@ final class LayoutHelper extends HelperBase /** * Obtener los datos para mostrar el menú de acciones * - * @param Acl $acl + * @param Acl $acl */ public function getMenu(Acl $acl): void { @@ -279,12 +280,12 @@ final class LayoutHelper extends HelperBase $actionSearch = new DataGridAction(); $actionSearch->setId(AclActionsInterface::ACCOUNT); $actionSearch->setTitle(__('Search')); - $actionSearch->setIcon($icons->getIconSearch()); + $actionSearch->setIcon($icons->search()); $actionSearch->setData([ - 'historyReset' => 1, - 'view' => 'search', - 'route' => Acl::getActionRoute(AclActionsInterface::ACCOUNT), - ]); + 'historyReset' => 1, + 'view' => 'search', + 'route' => Acl::getActionRoute(AclActionsInterface::ACCOUNT), + ]); $actions[] = $actionSearch; @@ -292,12 +293,12 @@ final class LayoutHelper extends HelperBase $actionNewAccount = new DataGridAction(); $actionNewAccount->setId(AclActionsInterface::ACCOUNT_CREATE); $actionNewAccount->setTitle(__('New Account')); - $actionNewAccount->setIcon($icons->getIconAdd()); + $actionNewAccount->setIcon($icons->add()); $actionNewAccount->setData([ - 'historyReset' => 0, - 'view' => 'account', - 'route' => Acl::getActionRoute(AclActionsInterface::ACCOUNT_CREATE), - ]); + 'historyReset' => 0, + 'view' => 'account', + 'route' => Acl::getActionRoute(AclActionsInterface::ACCOUNT_CREATE), + ]); $actions[] = $actionNewAccount; } @@ -306,12 +307,12 @@ final class LayoutHelper extends HelperBase $actionAccessManager = new DataGridAction(); $actionAccessManager->setId(AclActionsInterface::ACCESS_MANAGE); $actionAccessManager->setTitle(Acl::getActionInfo(AclActionsInterface::ACCESS_MANAGE)); - $actionAccessManager->setIcon($icons->getIconAccount()); + $actionAccessManager->setIcon($icons->account()); $actionAccessManager->setData([ - 'historyReset' => 0, - 'view' => 'datatabs', - 'route' => Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE), - ]); + 'historyReset' => 0, + 'view' => 'datatabs', + 'route' => Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE), + ]); $actions[] = $actionAccessManager; } @@ -320,12 +321,12 @@ final class LayoutHelper extends HelperBase $actionItemManager = new DataGridAction(); $actionItemManager->setId(AclActionsInterface::ITEMS_MANAGE); $actionItemManager->setTitle(Acl::getActionInfo(AclActionsInterface::ITEMS_MANAGE)); - $actionItemManager->setIcon($icons->getIconGroup()); + $actionItemManager->setIcon($icons->group()); $actionItemManager->setData([ - 'historyReset' => 0, - 'view' => 'datatabs', - 'route' => Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE), - ]); + 'historyReset' => 0, + 'view' => 'datatabs', + 'route' => Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE), + ]); $actions[] = $actionItemManager; } @@ -336,10 +337,10 @@ final class LayoutHelper extends HelperBase $actionSecurityManager->setTitle(Acl::getActionInfo(AclActionsInterface::SECURITY_MANAGE)); $actionSecurityManager->setIcon($icons->getIconByName('security')); $actionSecurityManager->setData([ - 'historyReset' => 0, - 'view' => 'datatabs', - 'route' => Acl::getActionRoute(AclActionsInterface::SECURITY_MANAGE), - ]); + 'historyReset' => 0, + 'view' => 'datatabs', + 'route' => Acl::getActionRoute(AclActionsInterface::SECURITY_MANAGE), + ]); $actions[] = $actionSecurityManager; } @@ -350,10 +351,10 @@ final class LayoutHelper extends HelperBase $actionPlugins->setTitle(__('Plugins')); $actionPlugins->setIcon($icons->getIconByName('extension')); $actionPlugins->setData([ - 'historyReset' => 1, - 'view' => 'plugin', - 'route' => Acl::getActionRoute(AclActionsInterface::PLUGIN), - ]); + 'historyReset' => 1, + 'view' => 'plugin', + 'route' => Acl::getActionRoute(AclActionsInterface::PLUGIN), + ]); $actions[] = $actionPlugins; } @@ -362,12 +363,12 @@ final class LayoutHelper extends HelperBase $actionConfigManager = new DataGridAction(); $actionConfigManager->setId('config'); $actionConfigManager->setTitle(__('Configuration')); - $actionConfigManager->setIcon($icons->getIconSettings()); + $actionConfigManager->setIcon($icons->settings()); $actionConfigManager->setData([ - 'historyReset' => 1, - 'view' => 'config', - 'route' => Acl::getActionRoute(AclActionsInterface::CONFIG), - ]); + 'historyReset' => 1, + 'view' => 'config', + 'route' => Acl::getActionRoute(AclActionsInterface::CONFIG), + ]); $actions[] = $actionConfigManager; } @@ -379,8 +380,8 @@ final class LayoutHelper extends HelperBase /** * Sets a full layout page * - * @param string $template - * @param string $page Page/view name + * @param string $template + * @param string $page Page/view name * * @return LayoutHelper */ @@ -399,8 +400,8 @@ final class LayoutHelper extends HelperBase /** * Sets a custom layout page * - * @param string $template - * @param string $page Page/view name + * @param string $template + * @param string $page Page/view name * * @return LayoutHelper */ diff --git a/app/modules/web/Controllers/UserSettingsManager/IndexController.php b/app/modules/web/Controllers/UserSettingsManager/IndexController.php index e1d27c8c..8b055655 100644 --- a/app/modules/web/Controllers/UserSettingsManager/IndexController.php +++ b/app/modules/web/Controllers/UserSettingsManager/IndexController.php @@ -83,7 +83,7 @@ final class IndexController extends ControllerBase implements ExtensibleTabContr } /** - * @param DataTab $tab + * @param DataTab $tab */ public function addTab(DataTab $tab): void { @@ -105,16 +105,16 @@ final class IndexController extends ControllerBase implements ExtensibleTabContr $template->assign( 'langs', SelectItemAdapter::factory(Language::getAvailableLanguages()) - ->getItemsFromArraySelected( - [$userPreferences->getLang() ?: $this->configData->getSiteLang()] - ) + ->getItemsFromArraySelected( + [$userPreferences->getLang() ?: $this->configData->getSiteLang()] + ) ); $template->assign( 'themes', - SelectItemAdapter::factory($this->theme->getThemesAvailable()) - ->getItemsFromArraySelected( - [$userPreferences->getTheme() ?: $this->configData->getSiteTheme()] - ) + SelectItemAdapter::factory($this->theme->getAvailable()) + ->getItemsFromArraySelected( + [$userPreferences->getTheme() ?: $this->configData->getSiteTheme()] + ) ); $template->assign('userPreferences', $userPreferences); $template->assign('route', 'userSettingsGeneral/save'); diff --git a/app/modules/web/Init.php b/app/modules/web/Init.php index d4dd8d24..94cf0ff3 100644 --- a/app/modules/web/Init.php +++ b/app/modules/web/Init.php @@ -25,23 +25,25 @@ namespace SP\Modules\Web; use Defuse\Crypto\Exception\CryptoException; +use Defuse\Crypto\Exception\EnvironmentIsBrokenException; use Exception; +use JsonException; use Klein\Klein; use SP\Core\Application; use SP\Core\Bootstrap\BootstrapBase; -use SP\Core\Bootstrap\BootstrapWeb; +use SP\Core\Bootstrap\UriContextInterface; use SP\Core\Context\ContextBase; use SP\Core\Context\SessionContext; use SP\Core\Crypt\CryptSessionHandler; use SP\Core\Crypt\Csrf; use SP\Core\Crypt\CsrfInterface; use SP\Core\Crypt\Session as CryptSession; -use SP\Core\Crypt\UuidCookie; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\InitializationException; use SP\Core\Exceptions\InvalidArgumentException; use SP\Core\Exceptions\NoSuchPropertyException; use SP\Core\Exceptions\QueryException; +use SP\Core\Exceptions\SPException; use SP\Core\HttpModuleBase; use SP\Core\Language; use SP\Core\LanguageInterface; @@ -60,6 +62,7 @@ use SP\Domain\User\Services\UserProfileService; use SP\Http\Address; use SP\Http\RequestInterface; use SP\Http\Uri; +use SP\Infrastructure\Common\Repositories\NoSuchItemException; use SP\Infrastructure\Database\DatabaseUtil; use SP\Infrastructure\File\FileException; use SP\Modules\Web\Controllers\Bootstrap\GetEnvironmentController; @@ -83,6 +86,9 @@ use SP\Modules\Web\Controllers\Upgrade\UpgradeController; use SP\Plugin\PluginManager; use SP\Util\HttpUtil; +use function SP\logger; +use function SP\processException; + /** * Class Init */ @@ -142,18 +148,19 @@ final class Init extends HttpModuleBase private bool $isIndex = false; public function __construct( - Application $application, - ProvidersHelper $providersHelper, - RequestInterface $request, - Klein $router, - CsrfInterface $csrf, - ThemeInterface $theme, - LanguageInterface $language, - SecureSessionServiceInterface $secureSessionService, - PluginManager $pluginManager, - ItemPresetService $itemPresetService, - DatabaseUtil $databaseUtil, - UserProfileServiceInterface $userProfileService + Application $application, + ProvidersHelper $providersHelper, + RequestInterface $request, + Klein $router, + CsrfInterface $csrf, + ThemeInterface $theme, + LanguageInterface $language, + SecureSessionServiceInterface $secureSessionService, + PluginManager $pluginManager, + ItemPresetService $itemPresetService, + DatabaseUtil $databaseUtil, + UserProfileServiceInterface $userProfileService, + private readonly UriContextInterface $uriContext ) { parent::__construct( $application, @@ -175,17 +182,17 @@ final class Init extends HttpModuleBase /** * Initialize Web App * - * @param string $controller + * @param string $controller * - * @throws \Defuse\Crypto\Exception\EnvironmentIsBrokenException - * @throws \JsonException - * @throws \SP\Core\Exceptions\ConstraintException - * @throws \SP\Core\Exceptions\InitializationException - * @throws \SP\Core\Exceptions\QueryException - * @throws \SP\Core\Exceptions\SPException - * @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException - * @throws \SP\Infrastructure\File\FileException - * @throws \Exception + * @throws EnvironmentIsBrokenException + * @throws JsonException + * @throws ConstraintException + * @throws InitializationException + * @throws QueryException + * @throws SPException + * @throws NoSuchItemException + * @throws FileException + * @throws Exception */ public function initialize(string $controller): void { @@ -211,9 +218,6 @@ final class Init extends HttpModuleBase // Setup language $this->language->setLanguage($isReload); - // Setup theme - $this->theme->initTheme($isReload); - // Comprobar si es necesario cambiar a HTTPS HttpUtil::checkHttps($this->configData, $this->request); @@ -227,7 +231,7 @@ final class Init extends HttpModuleBase if (!$this->checkInstalled()) { logger('Not installed', 'ERROR'); - $this->router->response()->redirect(self::getUriFor(self::ROUTE_INSTALL))->send(); + $this->router->response()->redirect($this->getUriFor(self::ROUTE_INSTALL))->send(); throw new InitializationException('Not installed'); } @@ -236,7 +240,7 @@ final class Init extends HttpModuleBase if (!$this->databaseUtil->checkDatabaseConnection()) { logger('Database connection error', 'ERROR'); - $this->router->response()->redirect(self::getUriFor(self::ROUTE_ERROR_DATABASE_CONNECTION))->send(); + $this->router->response()->redirect($this->getUriFor(self::ROUTE_ERROR_DATABASE_CONNECTION))->send(); throw new InitializationException('Database connection error'); } @@ -245,7 +249,7 @@ final class Init extends HttpModuleBase if ($this->checkMaintenanceMode()) { logger('Maintenance mode', 'INFO'); - $this->router->response()->redirect(self::getUriFor(self::ROUTE_ERROR_MAINTENANCE))->send(); + $this->router->response()->redirect($this->getUriFor(self::ROUTE_ERROR_MAINTENANCE))->send(); throw new InitializationException('Maintenance mode'); } @@ -256,7 +260,7 @@ final class Init extends HttpModuleBase $this->config->generateUpgradeKey(); - $this->router->response()->redirect(self::getUriFor(self::ROUTE_UPGRADE))->send(); + $this->router->response()->redirect($this->getUriFor(self::ROUTE_UPGRADE))->send(); throw new InitializationException('Upgrade needed'); } @@ -265,7 +269,7 @@ final class Init extends HttpModuleBase if (!$this->databaseUtil->checkDatabaseTables($this->configData->getDbName())) { logger('Database checking error', 'ERROR'); - $this->router->response()->redirect(self::getUriFor(self::ROUTE_ERROR_DATABASE))->send(); + $this->router->response()->redirect($this->getUriFor(self::ROUTE_ERROR_DATABASE))->send(); throw new InitializationException('Database checking error'); } @@ -312,7 +316,8 @@ final class Init extends HttpModuleBase { if ($encrypt === true && BootstrapBase::$checkPhpVersion - && ($key = $this->secureSessionService->getKey()) !== false) { + && ($key = $this->secureSessionService->getKey()) !== false + ) { session_set_save_handler(new CryptSessionHandler($key), true); } @@ -336,6 +341,11 @@ final class Init extends HttpModuleBase && $this->router->request()->param('r') !== 'install/index'; } + private function getUriFor(string $route): string + { + return (new Uri($this->uriContext->getWebRoot()))->addParam('r', $route)->getUri(); + } + /** * Comprobar si es necesario actualizar componentes * @@ -408,7 +418,7 @@ final class Init extends HttpModuleBase if ($this->isIndex || $timeout === null) { $userTimeout = $this->getSessionTimeoutForUser($timeout) ?: $this->configData->getSessionTimeout(); - logger('Session timeout: '.$userTimeout); + logger('Session timeout: ' . $userTimeout); return $this->context->setSessionTimeout($userTimeout); } @@ -437,7 +447,8 @@ final class Init extends HttpModuleBase $this->request->getClientAddress(), $sessionTimeout->getAddress(), $sessionTimeout->getMask() - )) { + ) + ) { return $sessionTimeout->getTimeout(); } } @@ -445,9 +456,4 @@ final class Init extends HttpModuleBase return $default; } - - private static function getUriFor(string $route): string - { - return (new Uri(BootstrapWeb::$WEBROOT))->addParam('r', $route)->getUri(); - } } diff --git a/app/modules/web/themes/material-blue/views/account/account-editpass.inc b/app/modules/web/themes/material-blue/views/account/account-editpass.inc index 7725a27c..a1dc19c8 100644 --- a/app/modules/web/themes/material-blue/views/account/account-editpass.inc +++ b/app/modules/web/themes/material-blue/views/account/account-editpass.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,16 +23,17 @@ */ /** - * @var callable $_getvar - * @var ThemeIcons $icons - * @var AccountExtData $accountData - * @var AccountAcl $accountAcl - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var callable $_getvar + * @var ThemeIconsInterface $icons + * @var AccountExtData $accountData + * @var AccountAcl $accountAcl + * @var ConfigDataInterface $configData */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\AccountExtData; use SP\Domain\Account\Services\AccountAcl; +use SP\Domain\Config\Ports\ConfigDataInterface; /** @var AccountExtData $accountData */ $accountData = $_getvar('accountData'); @@ -43,70 +44,87 @@ $accountAcl = $_getvar('accountAcl');
- - + +
- + - + - + - + - + - + - isAccountExpireEnabled()): ?> + isAccountExpireEnabled()): ?> - + - +
+ for="name">
+ for="client">
+ for="url">
+ for="login">
+ for="password">
+ for="password_repeat">
+ for="password_date_expire">
date_range + title="">date_range
@@ -159,17 +186,23 @@ $accountAcl = $_getvar('accountAcl'); diff --git a/app/modules/web/themes/material-blue/views/account/account-history.inc b/app/modules/web/themes/material-blue/views/account/account-history.inc index a8daa4c4..9b14a92a 100644 --- a/app/modules/web/themes/material-blue/views/account/account-history.inc +++ b/app/modules/web/themes/material-blue/views/account/account-history.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,16 +23,17 @@ */ /** - * @var callable $_getvar - * @var ThemeIcons $icons - * @var AccountExtData $accountData - * @var AccountAcl $accountAcl - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var callable $_getvar + * @var ThemeIconsInterface $icons + * @var AccountExtData $accountData + * @var AccountAcl $accountAcl + * @var ConfigDataInterface $configData */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\AccountExtData; use SP\Domain\Account\Services\AccountAcl; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; /** @var AccountExtData $accountData */ @@ -45,130 +46,167 @@ $accountAcl = $_getvar('accountAcl');
- + title=""> +
+ class="mdl-tabs__tab is-active"> - isShowDetails()): ?> + isShowDetails()): ?> - + class="mdl-tabs__tab"> +
- + - + - + - + - + - + - + - isShowHistory() - && count($_getvar('historyData', [])) > 0): ?> + isShowHistory() + && count($_getvar('historyData', [])) > 0 + ): ?> - + - + - +
+ for="name">
-
+
-
+
+ for="name">
+ for="name">
+ for="password_date_expire">
+ for="notes">
-
+
- getDateEdit(), - htmlspecialchars($accountData->getUserEditName(), ENT_QUOTES) - ?: htmlspecialchars($accountData->getUserEditLogin(), ENT_QUOTES)); ?> + getDateEdit(), + htmlspecialchars($accountData->getUserEditName(), ENT_QUOTES) + ?: htmlspecialchars($accountData->getUserEditLogin(), ENT_QUOTES) + ); ?>
@@ -223,10 +277,12 @@ $accountAcl = $_getvar('accountAcl');
- isShowDetails()): include $this->includeTemplate('details'); endif; ?> + isShowDetails()): include $this->includeTemplate('details'); endif; ?>
- includeTemplate('actions'); ?> + includeTemplate('actions'); ?>
diff --git a/app/modules/web/themes/material-blue/views/account/account-link.inc b/app/modules/web/themes/material-blue/views/account/account-link.inc index 7919be82..557e24a3 100644 --- a/app/modules/web/themes/material-blue/views/account/account-link.inc +++ b/app/modules/web/themes/material-blue/views/account/account-link.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,16 +23,17 @@ */ /** - * @var callable $_getvar - * @var ThemeIcons $icons - * @var AccountExtData $accountData - * @var AccountAcl $accountAcl - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var callable $_getvar + * @var ThemeIconsInterface $icons + * @var AccountExtData $accountData + * @var AccountAcl $accountAcl + * @var ConfigDataInterface $configData */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\AccountExtData; use SP\Domain\Account\Services\AccountAcl; +use SP\Domain\Config\Ports\ConfigDataInterface; /** @var AccountExtData $accountData */ $accountData = $_getvar('accountData'); @@ -41,78 +42,96 @@ $accountData = $_getvar('accountData');
- +
- includeTemplate('aux-customfields', 'common'); ?> + includeTemplate('aux-customfields', 'common'); ?>
- +
- includeTemplate('account-permissions'); endif; ?>
- includeTemplate('files'); endif; ?>
- includeTemplate('details'); endif; ?>
- includeTemplate('linkedAccounts'); endif; ?>
- includeTemplate('actions'); ?> - \ No newline at end of file + includeTemplate('actions'); ?> + diff --git a/app/modules/web/themes/material-blue/views/account/actions.inc b/app/modules/web/themes/material-blue/views/account/actions.inc index 033a8dc8..c47400a1 100644 --- a/app/modules/web/themes/material-blue/views/account/actions.inc +++ b/app/modules/web/themes/material-blue/views/account/actions.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,34 +23,45 @@ */ /** - * @var ThemeIcons $icons - * @var callable $_getvar - * @var AccountExtData $accountData - * @var AccountAcl $accountAcl - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var AccountExtData $accountData + * @var AccountAcl $accountAcl + * @var ConfigDataInterface $configData */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\AccountExtData; use SP\Domain\Account\Services\AccountAcl; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Html\DataGrid\Action\DataGridActionInterface; ?>
- + diff --git a/app/modules/web/themes/material-blue/views/account/details.inc b/app/modules/web/themes/material-blue/views/account/details.inc index d19c62a6..1d7c50a5 100644 --- a/app/modules/web/themes/material-blue/views/account/details.inc +++ b/app/modules/web/themes/material-blue/views/account/details.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,110 +23,157 @@ */ /** - * @var ThemeIcons $icons - * @var callable $_getvar - * @var AccountExtData $accountData - * @var AccountAcl $accountAcl - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var AccountExtData $accountData + * @var AccountAcl $accountAcl + * @var ConfigDataInterface $configData */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\AccountExtData; use SP\Domain\Account\Services\AccountAcl; +use SP\Domain\Config\Ports\ConfigDataInterface; ?>
- + - + - getUserEditName()): ?> + getUserEditName()): ?> - + - + - + - + - isModified()): ?> + isModified()): ?> - + - + - + - + - 0): ?> + 0): ?> - + - + - +
-
+
- getCountView() . '(' . $accountData->getCountDecrypt() . ')'; ?> + getCountView() . '(' . $accountData->getCountDecrypt() . ')'; ?>
-
+
- getDateAdd() ?> + getDateAdd() ?>
-
+
- getDateEdit(), htmlspecialchars($accountData->getUserEditName(), ENT_QUOTES)); ?> + getDateEdit(), + htmlspecialchars($accountData->getUserEditName(), ENT_QUOTES) + ); ?>
-
+
- getUserName(), ENT_QUOTES) ?: htmlspecialchars($accountData->getUserLogin(), ENT_QUOTES); ?> + getUserName(), ENT_QUOTES) ?: htmlspecialchars( + $accountData->getUserLogin(), + ENT_QUOTES + ); ?>
-
+
- getUserGroupName(), ENT_QUOTES); ?> + getUserGroupName(), ENT_QUOTES); ?>
-
+
- getDateEdit(); ?> + getDateEdit(); ?>
-
+
- getUserEditName(), ENT_QUOTES) ?: htmlspecialchars($accountData->getUserEditLogin(), ENT_QUOTES); ?> + getUserEditName(), ENT_QUOTES) ?: htmlspecialchars( + $accountData->getUserEditLogin(), + ENT_QUOTES + ); ?>
-
+
- +
-
+
- +
-
+
- getId(); ?> + getId(); ?>
diff --git a/app/modules/web/themes/material-blue/views/account/files-list.inc b/app/modules/web/themes/material-blue/views/account/files-list.inc index 11782776..ca64a2c0 100644 --- a/app/modules/web/themes/material-blue/views/account/files-list.inc +++ b/app/modules/web/themes/material-blue/views/account/files-list.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,69 +23,100 @@ */ /** - * @var ThemeIcons $icons - * @var callable $_getvar - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData - * @var FileData $file + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var ConfigDataInterface $configData + * @var FileData $file */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\FileData; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Html\Html; ?>
diff --git a/app/modules/web/themes/material-blue/views/account/files.inc b/app/modules/web/themes/material-blue/views/account/files.inc index f6b5c644..e8eb6d32 100644 --- a/app/modules/web/themes/material-blue/views/account/files.inc +++ b/app/modules/web/themes/material-blue/views/account/files.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,36 +23,46 @@ */ /** - * @var ThemeIcons $icons - * @var callable $_getvar - * @var AccountExtData $accountData - * @var AccountAcl $accountAcl - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var AccountExtData $accountData + * @var AccountAcl $accountAcl + * @var ConfigDataInterface $configData */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\AccountExtData; use SP\Domain\Account\Services\AccountAcl; +use SP\Domain\Config\Ports\ConfigDataInterface; ?>
+ data-action-route="" + data-item-id="" + data-history="" + data-delete="isShowDelete(); ?>">
- +
+ data-files-ext="" + data-item-id="" + data-action-route="" + data-delete="isShowDelete(); ?>"> cloud_upload
-
' . __('Maximum file size: %d MB'), - $_getvar('maxFileSize')); ?> + $_getvar('maxFileSize') + ); ?>
- +
diff --git a/app/modules/web/themes/material-blue/views/account/linkedAccounts.inc b/app/modules/web/themes/material-blue/views/account/linkedAccounts.inc index 0fe39866..c34c34ed 100644 --- a/app/modules/web/themes/material-blue/views/account/linkedAccounts.inc +++ b/app/modules/web/themes/material-blue/views/account/linkedAccounts.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,41 +23,57 @@ */ /** - * @var ThemeIcons $icons - * @var callable $_getvar - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var ConfigDataInterface $configData */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; ?>
    - +
  • layers - name, ENT_QUOTES), htmlspecialchars($account->clientName, ENT_QUOTES)); ?> + name, ENT_QUOTES), + htmlspecialchars($account->clientName, ENT_QUOTES) + ); ?> - - getIconEdit()->getIcon(); ?> + edit()->getIcon(); ?> - - getIconView()->getIcon(); ?> + view()->getIcon(); ?>
  • - +
diff --git a/app/modules/web/themes/material-blue/views/account/search-header.inc b/app/modules/web/themes/material-blue/views/account/search-header.inc index 58415a77..2094a2fa 100644 --- a/app/modules/web/themes/material-blue/views/account/search-header.inc +++ b/app/modules/web/themes/material-blue/views/account/search-header.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,15 +23,16 @@ */ /** - * @var ThemeIcons $icons - * @var callable $_getvar - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData - * @var AccountSearchItem $account - * @var DataGridTab $data + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var ConfigDataInterface $configData + * @var AccountSearchItem $account + * @var DataGridTab $data */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\Domain\Account\Services\AccountSearchItem; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Html\DataGrid\DataGridTab; if (!isset($data)) { @@ -41,36 +42,53 @@ if (!isset($data)) {
diff --git a/app/modules/web/themes/material-blue/views/account/search-index.inc b/app/modules/web/themes/material-blue/views/account/search-index.inc index b434d306..fbcdd270 100644 --- a/app/modules/web/themes/material-blue/views/account/search-index.inc +++ b/app/modules/web/themes/material-blue/views/account/search-index.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,15 +23,16 @@ */ /** - * @var ThemeIcons $icons - * @var callable $_getvar - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData - * @var AccountSearchItem $account - * @var DataGrid $data + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var ConfigDataInterface $configData + * @var AccountSearchItem $account + * @var DataGrid $data */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\Domain\Account\Services\AccountSearchItem; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Html\DataGrid\DataGrid; if (!isset($data)) { @@ -40,29 +41,39 @@ if (!isset($data)) { ?>
- getData()->getDataCount() === 0): ?> -
- + getData()->getDataCount() === 0): ?> +
+
- getDataHeaderTemplate(); ?> + getDataHeaderTemplate(); ?>
- +
- getDataPagerTemplate(); ?> + getDataPagerTemplate(); ?>
- +
- getDataRowTemplate(); ?> + getDataRowTemplate(); ?>
- getDataPagerTemplate(); ?> + getDataPagerTemplate(); ?>
- +
diff --git a/app/modules/web/themes/material-blue/views/account/search-rows.inc b/app/modules/web/themes/material-blue/views/account/search-rows.inc index f4885983..35d15bea 100644 --- a/app/modules/web/themes/material-blue/views/account/search-rows.inc +++ b/app/modules/web/themes/material-blue/views/account/search-rows.inc @@ -23,19 +23,20 @@ */ /** - * @var ThemeIcons $icons - * @var callable $_getvar - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData - * @var AccountSearchItem $account - * @var DataGridTab $data - * @var DataGridActionBase $actionMenu - * @var DataGridActionBase $action - * @var AccountSearchItem $accountSearchItem + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var ConfigDataInterface $configData + * @var AccountSearchItem $account + * @var DataGridTab $data + * @var DataGridActionBase $actionMenu + * @var DataGridActionBase $action + * @var AccountSearchItem $accountSearchItem */ use SP\Core\Acl\AclActionsInterface; -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\Domain\Account\Services\AccountSearchItem; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Html\DataGrid\Action\DataGridActionBase; use SP\Html\DataGrid\DataGridTab; use SP\Util\DateUtil; @@ -50,7 +51,8 @@ $favoriteRouteOff = $_getvar('favoriteRouteOff'); ?>
- isShow() - || $accountSearchItem->isShowRequest()): ?> + isShow() + || $accountSearchItem->isShowRequest() + ): ?> - +
- + diff --git a/app/modules/web/themes/material-blue/views/account/search-searchbox.inc b/app/modules/web/themes/material-blue/views/account/search-searchbox.inc index fb9bd8c0..eeee716d 100644 --- a/app/modules/web/themes/material-blue/views/account/search-searchbox.inc +++ b/app/modules/web/themes/material-blue/views/account/search-searchbox.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,15 +23,16 @@ */ /** - * @var ThemeIcons $icons - * @var callable $_getvar - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData - * @var AccountSearchItem $account - * @var DataGrid $data + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var ConfigDataInterface $configData + * @var AccountSearchItem $account + * @var DataGrid $data */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\Domain\Account\Services\AccountSearchItem; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Html\DataGrid\DataGrid; use SP\Mvc\View\Components\SelectItem; @@ -45,90 +46,121 @@ $pager = $data->getPager(); diff --git a/app/modules/web/themes/material-blue/views/account/viewpass.inc b/app/modules/web/themes/material-blue/views/account/viewpass.inc index 843d0923..6f1b01fa 100644 --- a/app/modules/web/themes/material-blue/views/account/viewpass.inc +++ b/app/modules/web/themes/material-blue/views/account/viewpass.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,62 +23,84 @@ */ /** - * @var callable $_getvar - * @var ThemeIcons $icons - * @var AccountExtData $accountData - * @var AccountAcl $accountAcl - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var callable $_getvar + * @var ThemeIconsInterface $icons + * @var AccountExtData $accountData + * @var AccountAcl $accountAcl + * @var ConfigDataInterface $configData */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\AccountExtData; use SP\Domain\Account\Services\AccountAcl; +use SP\Domain\Config\Ports\ConfigDataInterface; ?>
-

  - - getIconPublicLink()->getIcon(); ?> - +

  + + publicLink()->getIcon(); ?> +

- - + + - + - + - - + + - + - +
- +  
- +  
diff --git a/app/modules/web/themes/material-blue/views/common/aux-customfields.inc b/app/modules/web/themes/material-blue/views/common/aux-customfields.inc index f5156231..2cfda0c5 100644 --- a/app/modules/web/themes/material-blue/views/common/aux-customfields.inc +++ b/app/modules/web/themes/material-blue/views/common/aux-customfields.inc @@ -1,86 +1,157 @@ . */ -use SP\Core\UI\ThemeIcons; +/** + * @var ThemeIconsInterface $icons + * @var CustomFieldItem[] $customFields + * @var callable $_getvar + * @var TemplateInterface $this + */ + +use SP\Core\UI\ThemeIconsInterface; use SP\Domain\CustomField\Services\CustomFieldItem; +use SP\Mvc\View\TemplateInterface; $customFields = $_getvar('customFields'); foreach ($customFields as $index => $field):?> - definitionName, ENT_QUOTES); ?> - isEncrypted && $field->isValueEncrypted === true): ?> + definitionName, ENT_QUOTES); ?> + isEncrypted && $field->isValueEncrypted === true): ?> + title=""> lock_outline - isEncrypted && $field->isValueEncrypted === false): ?> + isEncrypted && $field->isValueEncrypted === false): ?> + title=""> lock_outline - isEncrypted === 0 && $field->isValueEncrypted === true): ?> + isEncrypted === 0 && $field->isValueEncrypted === true): ?> + title=""> lock_open - + - help): ?> -
- getIconHelp()->getIcon(); ?> + help): ?> +
+ help()->getIcon(); ?>
-

help; ?>

+ for="help-formId; ?>"> +

help; ?>

- + - typeName === 'color' && $_getvar('isView')): ?> + typeName === 'color' && $_getvar('isView')): ?> - typeName === 'password'): ?> + style="background-color: value; ?>;"> + typeName === 'password'): ?>
- required ? 'required' : ''; ?> > + value="value) ? '***' : htmlspecialchars( + $field->value, + ENT_QUOTES + ); ?>" required ? 'required' : ''; ?> > + for="formId; ?>">definitionName, ENT_QUOTES); ?>
- typeName === 'textarea'): ?> + typeName === 'textarea'): ?>
+ name="customfield[definitionId; ?>]" + id="formId; ?>" >value, ENT_QUOTES); ?> + for="formId; ?>">definitionName, ENT_QUOTES); ?>
- +
- required ? 'required' : ''; ?> > + value="value, ENT_QUOTES); ?>" required ? 'required' : ''; ?> > + for="formId; ?>">definitionName, ENT_QUOTES); ?>
- + - \ No newline at end of file + diff --git a/app/modules/web/themes/material-blue/views/common/datatabs.inc b/app/modules/web/themes/material-blue/views/common/datatabs.inc index 4aa91a91..24ec67fc 100644 --- a/app/modules/web/themes/material-blue/views/common/datatabs.inc +++ b/app/modules/web/themes/material-blue/views/common/datatabs.inc @@ -1,14 +1,37 @@ . */ -use SP\Core\UI\ThemeIcons; +/** + * @var DataTab[] $tabs + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var TemplateInterface $this + */ + +use SP\Core\UI\ThemeIconsInterface; use SP\Mvc\View\Components\DataTab; -use SP\Mvc\View\Template; +use SP\Mvc\View\TemplateInterface; $tabs = $_getvar('tabs'); ?> @@ -17,19 +40,26 @@ $tabs = $_getvar('tabs');
- $tab): ?> -
$tab): ?> +
+ data-tab-route="" + data-tab-index="">
- render(); ?> + render(); ?>
- +
- \ No newline at end of file + diff --git a/app/modules/web/themes/material-blue/views/common/debug.inc b/app/modules/web/themes/material-blue/views/common/debug.inc index 4f21fb76..d7190325 100644 --- a/app/modules/web/themes/material-blue/views/common/debug.inc +++ b/app/modules/web/themes/material-blue/views/common/debug.inc @@ -1,23 +1,52 @@ . */ -use SP\Core\UI\ThemeIcons; -use SP\Mvc\View\Template; +/** + * @var ThemeIconsInterface $icons + * @var callable $_getvar + * @var TemplateInterface $this + */ + +use SP\Core\UI\ThemeIconsInterface; +use SP\Mvc\View\TemplateInterface; ?>

DEBUG INFO

    -
  • RENDER -> sec
  • -
  • MEM -> Init: KB - - End: KB - - Total: KB +
  • RENDER -> sec +
  • +
  • MEM -> Init: KB - + End: KB - + Total: KB
  • SESSION: -
    +
diff --git a/app/modules/web/themes/material-blue/views/config/accounts.inc b/app/modules/web/themes/material-blue/views/config/accounts.inc index 34a9b12a..8036d84f 100644 --- a/app/modules/web/themes/material-blue/views/config/accounts.inc +++ b/app/modules/web/themes/material-blue/views/config/accounts.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,29 +23,36 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; ?> - +
- + getIconHelp()->getIcon(); ?> + class="material-icons">help()->getIcon(); ?>

- +

- +
search - +
@@ -77,10 +89,12 @@ use SP\Mvc\View\Components\SelectItem; pattern="[0-9]{1,5}" class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="5" - value="getAccountCount(); ?>" + value="getAccountCount(); ?>" required/> + for="account_count"> @@ -95,13 +109,16 @@ use SP\Mvc\View\Components\SelectItem; isAccountExpireEnabled() ? 'checked' : ''; ?>/> + name="account_expire_enabled" isAccountExpireEnabled() ? 'checked' : ''; ?>/> - - + + @@ -109,13 +126,17 @@ use SP\Mvc\View\Components\SelectItem; @@ -125,9 +146,11 @@ use SP\Mvc\View\Components\SelectItem; type="number" pattern="[0-9]{1,3}" class="mdl-textfield__input mdl-color-text--indigo-400" - value="getAccountExpireTime() / 24 / 3600; ?>"/> + value="getAccountExpireTime() / 24 / 3600; ?>"/> + for="account_expire_time"> @@ -141,13 +164,16 @@ use SP\Mvc\View\Components\SelectItem; for="account_link_enabled"> isAccountLink() ? 'checked' : ''; ?>/> + name="account_link_enabled" isAccountLink() ? 'checked' : ''; ?>/> - - + + @@ -158,13 +184,18 @@ use SP\Mvc\View\Components\SelectItem; isGlobalSearch() ? 'checked' : ''; ?>/> + name="account_globalsearch_enabled" isGlobalSearch() ? 'checked' : ''; ?>/> - - + + @@ -175,16 +206,22 @@ use SP\Mvc\View\Components\SelectItem; isAccountPassToImage() ? 'checked' : ''; ?>/> + name="account_passtoimage_enabled" isAccountPassToImage() ? 'checked' : ''; ?>/> - + - +
- +
@@ -196,14 +233,17 @@ use SP\Mvc\View\Components\SelectItem; isResultsAsCards() ? 'checked' : ''; ?>/> + name="account_resultsascards_enabled" isResultsAsCards() ? 'checked' : ''; ?>/> - + - + @@ -215,16 +255,22 @@ use SP\Mvc\View\Components\SelectItem; isAccountFullGroupAccess() ? 'checked' : ''; ?>/> + name="account_fullgroup_access_enabled" isAccountFullGroupAccess() ? 'checked' : ''; ?>/> - + - +
- +
@@ -235,7 +281,8 @@ use SP\Mvc\View\Components\SelectItem;
link - +
- +
getIconHelp()->getIcon(); ?>
+ class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

- +

- +
getIconHelp()->getIcon(); ?>
+ class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

- +

@@ -249,18 +296,25 @@ use SP\Mvc\View\Components\SelectItem; for="publiclinks_enabled"> isPublinksEnabled() ? 'checked' : ''; ?>/> + name="publiclinks_enabled" isPublinksEnabled() ? 'checked' : ''; ?>/> - + - +
- +
- +
@@ -272,14 +326,17 @@ use SP\Mvc\View\Components\SelectItem; isPublinksImageEnabled() ? 'checked' : ''; ?>/> + name="publiclinks_image_enabled" isPublinksImageEnabled() ? 'checked' : ''; ?>/> - + - + @@ -288,7 +345,8 @@ use SP\Mvc\View\Components\SelectItem; @@ -324,7 +387,8 @@ use SP\Mvc\View\Components\SelectItem;
attachment - +
- +
@@ -297,15 +355,18 @@ use SP\Mvc\View\Components\SelectItem; pattern="[0-9]{1,5}" class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="5" - value="getPublinksMaxTime() / 60; ?>"/> + value="getPublinksMaxTime() / 60; ?>"/> + for="publiclinks_maxtime">
- +
@@ -314,9 +375,11 @@ use SP\Mvc\View\Components\SelectItem; pattern="[0-9]{1,5}" class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="5" - value="getPublinksMaxViews(); ?>"/> + value="getPublinksMaxViews(); ?>"/> + for="publiclinks_maxviews">
@@ -338,13 +402,16 @@ use SP\Mvc\View\Components\SelectItem; for="files_enabled"> isFilesEnabled() ? 'checked' : ''; ?>/> + name="files_enabled" isFilesEnabled() ? 'checked' : ''; ?>/> - - + + @@ -352,48 +419,66 @@ use SP\Mvc\View\Components\SelectItem; @@ -404,9 +489,11 @@ use SP\Mvc\View\Components\SelectItem; pattern="[0-9]{1,5}" class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="5" - value="getFilesAllowedSize(); ?>"/> + value="getFilesAllowedSize(); ?>"/> + for="files_allowed_size"> @@ -417,16 +504,22 @@ use SP\Mvc\View\Components\SelectItem; diff --git a/app/modules/web/themes/material-blue/views/config/backup.inc b/app/modules/web/themes/material-blue/views/config/backup.inc index 187706b8..eab7b7a4 100644 --- a/app/modules/web/themes/material-blue/views/config/backup.inc +++ b/app/modules/web/themes/material-blue/views/config/backup.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,74 +23,96 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar * @var callable $_getRoute - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; ?> - +
- + getIconHelp()->getIcon(); ?> + class="material-icons">help()->getIcon(); ?>

- +

- +
backup - +
- +
getIconHelp()->getIcon(); ?>
+ class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

- +

- +

-
+
- +
getIconHelp()->getIcon(); ?>
+ class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

- +

- +

- + - +
- + -
+
- +
- + -
+
- - + - - - + +
@@ -98,28 +120,40 @@ use SP\Core\UI\ThemeIcons;
  • + title="">
    -

    +

    -

    +

  • @@ -127,7 +161,8 @@ use SP\Core\UI\ThemeIcons;
    import_export - +
    - + -
    +
    - + - + - + -
    +
    - - + - - + + - + - +
    @@ -175,13 +223,15 @@ use SP\Core\UI\ThemeIcons; class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input" maxlength="255"/> + for="exportPwd">
    - +
    @@ -190,7 +240,8 @@ use SP\Core\UI\ThemeIcons; class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="255"/> + for="exportPwdR">
    @@ -201,37 +252,54 @@ use SP\Core\UI\ThemeIcons;
    • + title="">
      -

      +

      -

      +

      -

      +

      -

      +

    diff --git a/app/modules/web/themes/material-blue/views/config/encryption.inc b/app/modules/web/themes/material-blue/views/config/encryption.inc index 1fa1f33b..10aa6b57 100644 --- a/app/modules/web/themes/material-blue/views/config/encryption.inc +++ b/app/modules/web/themes/material-blue/views/config/encryption.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,14 +23,16 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; $disabled = $configData->isMaintenance() ? '' : 'disabled'; ?> @@ -42,91 +44,127 @@ $disabled = $configData->isMaintenance() ? '' : 'disabled';
    enhanced_encryption - +
    - 0): ?> + 0): ?> - + @@ -144,9 +182,11 @@ $disabled = $configData->isMaintenance() ? '' : 'disabled'; - + - + @@ -163,9 +203,13 @@ $disabled = $configData->isMaintenance() ? '' : 'disabled'; - + - + @@ -174,60 +218,87 @@ $disabled = $configData->isMaintenance() ? '' : 'disabled';
    - + -
    +
    - +
    - +
    /> + maxlength="255" required /> + for="current_masterpass">
    - +
    /> + maxlength="255" required /> + for="new_masterpass">
    - +
    /> + maxlength="255" required /> + for="new_masterpass_repeat">
    - isMaintenance()): ?> + isMaintenance()): ?>
    getIconWarning()->getIcon(); ?>
    - . + class="icon material-icons warning()->getClass(); ?>">warning()->getIcon(); ?> + .
    - +
    getIconWarning()->getIcon(); ?>
    - + class="icon material-icons warning()->getClass(); ?>">warning()->getIcon(); ?> +
    getIconWarning()->getIcon(); ?>
    - + class="icon material-icons warning()->getClass(); ?>">warning()->getIcon(); ?> +
    getIconWarning()->getIcon(); ?>
    - + class="icon material-icons warning()->getClass(); ?>">warning()->getIcon(); ?> +
    getIconWarning()->getIcon(); ?>
    - + class="icon material-icons warning()->getClass(); ?>">warning()->getIcon(); ?> +
    - + + value=""> - +
    • + title="">
      -

      +

      -

      +

      -

      https://doc.syspass.org'); ?>

      +

      https://doc.syspass.org' + ); ?>

    • - +
    • - + - isMaintenance() && $_getvar('numAccounts') > 0): ?> + isMaintenance() && $_getvar('numAccounts') > 0): ?>
    • - +
    enhanced_encryption - +
    isMaintenance() ? '' : 'disabled'; @@ -300,14 +387,17 @@ $disabled = $configData->isMaintenance() ? '' : 'disabled'; isMailEnabled() ? 'disabled' : ''; ?>/> + name="temporary_masterpass_email" isMailEnabled() ? 'disabled' : ''; ?>/> - + - + @@ -316,35 +406,48 @@ $disabled = $configData->isMaintenance() ? '' : 'disabled'; - + - +
    - + -
    +
    - 0) ? date('r', $_getvar('tempMasterPassTime')) : __('Not generated'); ?> + 0) ? date('r', $_getvar('tempMasterPassTime')) : __( + 'Not generated' + ); ?>
    - + -
    +
    $tempMasterMaxTime): ?> - - 0): echo date('r', $tempMasterMaxTime); ?> - - + + 0): echo date('r', $tempMasterMaxTime); ?> + +
    - + -
    +
    - +
    - +
    @@ -285,7 +371,8 @@ $disabled = $configData->isMaintenance() ? '' : 'disabled'; value="3600" required/> + for="temporary_masterpass_maxtime">
    - + -
    +
    - + -
    +
    - +
    @@ -352,32 +455,44 @@ $disabled = $configData->isMaintenance() ? '' : 'disabled';
    • + title="">
      -

      +

    diff --git a/app/modules/web/themes/material-blue/views/config/general-auth.inc b/app/modules/web/themes/material-blue/views/config/general-auth.inc index 1590140a..e1edcd93 100644 --- a/app/modules/web/themes/material-blue/views/config/general-auth.inc +++ b/app/modules/web/themes/material-blue/views/config/general-auth.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,20 +23,23 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; ?>
    verified_user - +
    @@ -50,13 +53,16 @@ use SP\Mvc\View\Components\SelectItem; for="authbasic_enabled"> isAuthBasicEnabled() ? 'checked' : ''; ?>/> + name="authbasic_enabled" isAuthBasicEnabled() ? 'checked' : ''; ?>/> - - + + @@ -67,13 +73,16 @@ use SP\Mvc\View\Components\SelectItem; isAuthBasicAutoLoginEnabled() ? 'checked' : ''; ?>/> + name="authbasicautologin_enabled" isAuthBasicAutoLoginEnabled() ? 'checked' : ''; ?>/> - - + + @@ -81,12 +90,18 @@ use SP\Mvc\View\Components\SelectItem; @@ -95,61 +110,85 @@ use SP\Mvc\View\Components\SelectItem; + value="getAuthBasicDomain(), ENT_QUOTES); ?>"> + for="authbasic_domain"> diff --git a/app/modules/web/themes/material-blue/views/config/general-events.inc b/app/modules/web/themes/material-blue/views/config/general-events.inc index 609f1b38..55546c70 100644 --- a/app/modules/web/themes/material-blue/views/config/general-events.inc +++ b/app/modules/web/themes/material-blue/views/config/general-events.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,20 +23,23 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; ?>
    view_headline - +
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    -
    +
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    -
    +
    @@ -50,13 +53,16 @@ use SP\Mvc\View\Components\SelectItem; for="log_enabled"> isLogEnabled() ? 'checked' : ''; ?>/> + name="log_enabled" isLogEnabled() ? 'checked' : ''; ?>/> - - + + @@ -66,12 +72,14 @@ use SP\Mvc\View\Components\SelectItem; for="syslog_enabled"> isSyslogEnabled() ? 'checked' : ''; ?>/> + name="syslog_enabled" isSyslogEnabled() ? 'checked' : ''; ?>/> - + @@ -82,12 +90,14 @@ use SP\Mvc\View\Components\SelectItem; for="remotesyslog_enabled"> isSyslogRemoteEnabled() ? 'checked' : ''; ?>/> + name="remotesyslog_enabled" isSyslogRemoteEnabled() ? 'checked' : ''; ?>/> - + @@ -97,22 +107,26 @@ use SP\Mvc\View\Components\SelectItem; diff --git a/app/modules/web/themes/material-blue/views/config/general-proxy.inc b/app/modules/web/themes/material-blue/views/config/general-proxy.inc index 8822bd9f..a1b200e7 100644 --- a/app/modules/web/themes/material-blue/views/config/general-proxy.inc +++ b/app/modules/web/themes/material-blue/views/config/general-proxy.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,19 +23,22 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; ?>
    device_hub - +
    - +
    + value="getSyslogServer(), ENT_QUOTES); ?>"/> + for="remotesyslog_server">
    - +
    @@ -120,27 +134,36 @@ use SP\Mvc\View\Components\SelectItem; type="number" pattern="[0-9]{1-5}" step="1" max="65535" class="mdl-textfield__input mdl-color-text--indigo-400" - value="getSyslogPort(); ?>"/> + value="getSyslogPort(); ?>"/> + for="remotesyslog_port">
    - + -
    +
    @@ -49,13 +52,16 @@ use SP\Core\UI\ThemeIcons; for="proxy_enabled"> isProxyEnabled() ? 'checked' : ''; ?>/> + name="proxy_enabled" isProxyEnabled() ? 'checked' : ''; ?>/> - - + + @@ -63,22 +69,26 @@ use SP\Core\UI\ThemeIcons; diff --git a/app/modules/web/themes/material-blue/views/config/general-site.inc b/app/modules/web/themes/material-blue/views/config/general-site.inc index 30fe15a3..3a5162a7 100644 --- a/app/modules/web/themes/material-blue/views/config/general-site.inc +++ b/app/modules/web/themes/material-blue/views/config/general-site.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,91 +23,125 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; ?> - +
    - + getIconHelp()->getIcon(); ?> + class="material-icons">help()->getIcon(); ?>

    - +

    - +
    home - +
    - +
    + value="getProxyServer(), ENT_QUOTES); ?>"> + for="proxy_server">
    - +
    @@ -86,39 +96,47 @@ use SP\Core\UI\ThemeIcons; class="mdl-textfield__input mdl-color-text--indigo-400" pattern="[0-9]{1,5}" maxlength="128" - value="getProxyPort(); ?>"> + value="getProxyPort(); ?>"> + for="proxy_port">
    - +
    + value="getProxyUser(), ENT_QUOTES); ?>"> + for="proxy_user">
    - +
    + value="getProxyPass() ? '***' : ''; ?>"> + for="proxy_pass">
    @@ -157,13 +199,16 @@ use SP\Mvc\View\Components\SelectItem; for="https_enabled"> isHttpsEnabled() ? 'checked' : ''; ?>/> + name="https_enabled" isHttpsEnabled() ? 'checked' : ''; ?>/> - - + + @@ -173,13 +218,18 @@ use SP\Mvc\View\Components\SelectItem; for="debug_enabled"> isDebug() ? 'checked' : ''; ?>/> + name="debug_enabled" isDebug() ? 'checked' : ''; ?>/> - - + + @@ -189,13 +239,18 @@ use SP\Mvc\View\Components\SelectItem; for="maintenance_enabled"> isMaintenance() ? 'checked' : ''; ?>/> + name="maintenance_enabled" isMaintenance() ? 'checked' : ''; ?>/> - - + + @@ -205,13 +260,16 @@ use SP\Mvc\View\Components\SelectItem; for="check_updates_enabled"> isCheckUpdates() ? 'checked' : ''; ?>/> + name="check_updates_enabled" isCheckUpdates() ? 'checked' : ''; ?>/> - - + + @@ -221,13 +279,18 @@ use SP\Mvc\View\Components\SelectItem; for="check_notices_enabled"> isCheckNotices() ? 'checked' : ''; ?>/> + name="check_notices_enabled" isCheckNotices() ? 'checked' : ''; ?>/> - - + + @@ -237,15 +300,21 @@ use SP\Mvc\View\Components\SelectItem; for="encrypt_session_enabled"> isEncryptSession() ? 'checked' : ''; ?>/> + name="encrypt_session_enabled" isEncryptSession() ? 'checked' : ''; ?>/> - + - - + + diff --git a/app/modules/web/themes/material-blue/views/config/general.inc b/app/modules/web/themes/material-blue/views/config/general.inc index 58e230e9..effafff5 100644 --- a/app/modules/web/themes/material-blue/views/config/general.inc +++ b/app/modules/web/themes/material-blue/views/config/general.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,13 +23,15 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; ?> - includeTemplate('general-site'); ?> - includeTemplate('general-events'); ?> - includeTemplate('general-proxy'); ?> - includeTemplate('general-auth'); ?> + includeTemplate('general-site'); ?> + includeTemplate('general-events'); ?> + includeTemplate('general-proxy'); ?> + includeTemplate('general-auth'); ?>
    diff --git a/app/modules/web/themes/material-blue/views/config/import.inc b/app/modules/web/themes/material-blue/views/config/import.inc index 5699bdb2..bdb5b371 100644 --- a/app/modules/web/themes/material-blue/views/config/import.inc +++ b/app/modules/web/themes/material-blue/views/config/import.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,85 +23,112 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; ?>
    import_export - +
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    - +

    -
    +
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    -
    +
    - +
    @@ -116,21 +150,27 @@ use SP\Mvc\View\Components\SelectItem; pattern="[0-9]{2,4}" class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="5" - value="getSessionTimeout(); ?>" + value="getSessionTimeout(); ?>" required/> + for="session_timeout">
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    -

    @@ -141,9 +181,11 @@ use SP\Mvc\View\Components\SelectItem; + value="getApplicationUrl(), ENT_QUOTES); ?>"/> + for="app_url">
    - + @@ -211,40 +251,54 @@ use SP\Mvc\View\Components\SelectItem; type="password" class="mdl-textfield__input passwordfield__input mdl-color-text--indigo-400" maxlength="128" - value="getLdapBindPass() ? '***' : ''; ?>"/> + value="getLdapBindPass() ? '***' : ''; ?>"/> + for="ldap_bindpass"> - getLdapBindPass()): ?> + getLdapBindPass()): ?>
    - getIconWarning()->getIcon(); ?> + class="icon material-icons warning()->getClass(); ?>"> + warning()->getIcon(); ?>

    - +

    - + - + @@ -515,26 +640,35 @@ use SP\Mvc\View\Components\SelectItem;
    @@ -542,26 +676,32 @@ use SP\Mvc\View\Components\SelectItem;
    import_export - +
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    -
    +
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    -
    +
    -
    +
    cloud_upload
    @@ -117,35 +144,52 @@ use SP\Mvc\View\Components\SelectItem;
    • + title="">
      -

      +

      -

      +

      -

      +

      -

      +

      -

      +

      -

      +

      -

      +

    • @@ -153,18 +197,23 @@ use SP\Mvc\View\Components\SelectItem;
      - +
      @@ -174,19 +223,26 @@ use SP\Mvc\View\Components\SelectItem; class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input-show" maxlength="255"/> + for="importPwd"> @@ -197,26 +253,32 @@ use SP\Mvc\View\Components\SelectItem; class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input-show" maxlength="255"/> + for="importMasterPwd">
      - +
      getIconHelp()->getIcon(); ?>
      + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

      - +

      - +
      getIconHelp()->getIcon(); ?>
      + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

      - +

      - +
      @@ -226,7 +288,8 @@ use SP\Mvc\View\Components\SelectItem; class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="1" value=";"/> + for="csvDelimiter"> diff --git a/app/modules/web/themes/material-blue/views/config/info.inc b/app/modules/web/themes/material-blue/views/config/info.inc index cde1b28d..3e9faf7a 100644 --- a/app/modules/web/themes/material-blue/views/config/info.inc +++ b/app/modules/web/themes/material-blue/views/config/info.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,18 +23,22 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ ?>
      info -
      - + - +
      - +
      getIconHelp()->getIcon(); ?>
      + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

      - +

      - + -
      +
      - +
      - getConfigVersion()); ?> + getConfigVersion()); ?>
      - getAppVersion()); ?> + getAppVersion()); ?>
      - getDatabaseVersion()); ?> + getDatabaseVersion()); ?>
      - + -
      +
      - $infoval): ?> - + $infoval): ?> +
      - - + +
      - + -
      +
      - +
      - +
      '; } ?> - +
      - +
      - - = 50600): ?> + + = 50600): ?>
      - - $value): ?> -
      - - + + $value): ?> +
      + +
      - + -
      +
      - +
      - + -
      +
      - + - + - +
      - +
      getIconHelp()->getIcon(); ?>
      + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

      - +

      - +

      -
      +
      - +
      - +
      getIconHelp()->getIcon(); ?>
      + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

      - +

      -
      +
      - +
      - + -
      +
        - $plugin): ?>
      • extension - +
        - getVersion())); ?> + getVersion())); ?>
        - getAuthor()); ?> + getAuthor()); ?>
      • - +
      - + -
      +
      -
      diff --git a/app/modules/web/themes/material-blue/views/config/ldap.inc b/app/modules/web/themes/material-blue/views/config/ldap.inc index 43e84d90..26ef920f 100644 --- a/app/modules/web/themes/material-blue/views/config/ldap.inc +++ b/app/modules/web/themes/material-blue/views/config/ldap.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,33 +23,41 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; ?> - +
      - + getIconHelp()->getIcon(); ?> + class="material-icons">help()->getIcon(); ?>

      - +

      - +
      business - +
      isLdapEnabled() ? 'checked' : ''; ?>/> + name="ldap_enabled" isLdapEnabled() ? 'checked' : ''; ?>/>
      - + - +
      - +
      @@ -88,14 +100,16 @@ use SP\Mvc\View\Components\SelectItem; isLdapTlsEnabled() ? 'checked' : ''; ?>/> + name="ldap_tls_enabled" isLdapTlsEnabled() ? 'checked' : ''; ?>/> TLS - + @@ -104,39 +118,52 @@ use SP\Mvc\View\Components\SelectItem;
    -
    +
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    - +

      @@ -151,27 +178,34 @@ use SP\Mvc\View\Components\SelectItem; + value="getLdapServer(), ENT_QUOTES); ?>"/> + for="ldap_server">
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    - +

      @@ -185,23 +219,29 @@ use SP\Mvc\View\Components\SelectItem; + value="getLdapBindUser(), ENT_QUOTES); ?>"/> + for="ldap_binduser">
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    - +

      @@ -258,31 +312,39 @@ use SP\Mvc\View\Components\SelectItem; + value="getLdapBase(), ENT_QUOTES); ?>"/> + for="ldap_base">
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    - +

    - +

      @@ -296,93 +358,123 @@ use SP\Mvc\View\Components\SelectItem; + value="getLdapGroup(), ENT_QUOTES); ?>"/> + for="ldap_group">
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    -
    +
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    -
    +
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    - +

    • @@ -398,27 +490,34 @@ use SP\Mvc\View\Components\SelectItem; name="ldap_filter_user_object" type="text" class="mdl-textfield__input mdl-color-text--indigo-400" - value="getLdapFilterUserObject(); ?>"/> + value="getLdapFilterUserObject(); ?>"/> + for="ldap_filter_user_object">
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    - +

    • @@ -434,77 +533,103 @@ use SP\Mvc\View\Components\SelectItem; name="ldap_filter_group_object" type="text" class="mdl-textfield__input mdl-color-text--indigo-400" - value="getLdapFilterGroupObject(); ?>"/> + value="getLdapFilterGroupObject(); ?>"/> + for="ldap_filter_group_object">
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    -
    +
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    -
    +
    @@ -667,7 +822,8 @@ use SP\Mvc\View\Components\SelectItem; type="text" class="mdl-textfield__input mdl-color-text--indigo-400"/> + for="ldap_import_filter"> @@ -677,19 +833,25 @@ use SP\Mvc\View\Components\SelectItem;
    • @@ -698,7 +860,8 @@ use SP\Mvc\View\Components\SelectItem; data-onclick="ldap/import" data-action-route="configLdap/import" data-src="#frmLdap" - title=""> + title=""> get_app
    • diff --git a/app/modules/web/themes/material-blue/views/config/mail.inc b/app/modules/web/themes/material-blue/views/config/mail.inc index 1320ed51..86025c3e 100644 --- a/app/modules/web/themes/material-blue/views/config/mail.inc +++ b/app/modules/web/themes/material-blue/views/config/mail.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,20 +23,23 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; ?>
      mail - +
      isMailEnabled() ? 'checked' : ''; ?>/> + name="mail_enabled" isMailEnabled() ? 'checked' : ''; ?>/> - - + + @@ -71,14 +77,19 @@ use SP\Mvc\View\Components\SelectItem; isMailRequestsEnabled() ? 'checked' : ''; ?>/> + name="mail_requests_enabled" isMailRequestsEnabled() ? 'checked' : ''; ?>/> - + - + @@ -87,22 +98,26 @@ use SP\Mvc\View\Components\SelectItem;
    @@ -126,12 +143,14 @@ use SP\Mvc\View\Components\SelectItem; for="mail_auth_enabled"> isMailAuthenabled() ? 'checked' : ''; ?>/> + name="mail_auth_enabled" isMailAuthenabled() ? 'checked' : ''; ?>/> - + @@ -140,94 +159,121 @@ use SP\Mvc\View\Components\SelectItem; @@ -238,26 +284,35 @@ use SP\Mvc\View\Components\SelectItem;
    diff --git a/app/modules/web/themes/material-blue/views/config/wiki-dokuwiki.inc b/app/modules/web/themes/material-blue/views/config/wiki-dokuwiki.inc index 4b0fadcc..3c36d35a 100644 --- a/app/modules/web/themes/material-blue/views/config/wiki-dokuwiki.inc +++ b/app/modules/web/themes/material-blue/views/config/wiki-dokuwiki.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,28 +23,35 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; ?> - +
    - + getIconHelp()->getIcon(); ?> + class="material-icons">help()->getIcon(); ?>

    - +

    - +folder - +
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    -
    +
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    -
    +
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    -
    +
    - +
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>

    - +

    - +
    + value="getMailServer(), ENT_QUOTES); ?>"/> + for="mail_server">
    - +
    @@ -110,9 +125,11 @@ use SP\Mvc\View\Components\SelectItem; pattern="[0-9]{1,5}" class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="5" - value="getMailPort(); ?>"/> + value="getMailPort(); ?>"/> + for="mail_port">
    - +
    + value="getMailUser(), ENT_QUOTES); ?>"/> + for="mail_user">
    - +
    + value="getMailPass() ? '***' : ''; ?>"/> + for="mail_pass">
    - + -
    +
    - +
    + value="getMailFrom(), ENT_QUOTES); ?>"/> + for="mail_from">
    - + -
    +
    + value="getMailRecipients()); ?>"/>
    - + -
    +
    @@ -67,16 +75,22 @@ use SP\Core\UI\ThemeIcons; for="dokuwiki_enabled"> isDokuwikiEnabled() ? 'checked' : ''; ?>/> + name="dokuwiki_enabled" isDokuwikiEnabled() ? 'checked' : ''; ?>/> - + - +
    - +
    @@ -86,17 +100,22 @@ use SP\Core\UI\ThemeIcons; @@ -164,15 +194,18 @@ use SP\Core\UI\ThemeIcons; + value="getDokuwikiUser(), ENT_QUOTES); ?>"/> + for="dokuwiki_user"> @@ -204,9 +243,11 @@ use SP\Core\UI\ThemeIcons; type="text" class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="128" - value="getDokuwikiNamespace(), ENT_QUOTES); ?>"/> + value="getDokuwikiNamespace(), ENT_QUOTES); ?>"/> + for="dokuwiki_namespace"> @@ -217,26 +258,35 @@ use SP\Core\UI\ThemeIcons;
    diff --git a/app/modules/web/themes/material-blue/views/config/wiki.inc b/app/modules/web/themes/material-blue/views/config/wiki.inc index 28fd8132..efee11b7 100644 --- a/app/modules/web/themes/material-blue/views/config/wiki.inc +++ b/app/modules/web/themes/material-blue/views/config/wiki.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,13 +23,15 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; ?> @@ -40,7 +42,8 @@ use SP\Core\UI\ThemeIcons;
    folder - +
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    - +

    • http://wiki.syspass.org/lib/exe/xmlrpc.php
    @@ -108,26 +127,32 @@ use SP\Core\UI\ThemeIcons; + value="getDokuwikiUrl(), ENT_QUOTES); ?>"/> + for="dokuwiki_url">
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    - +

    • http://wiki.syspass.org/dokuwiki
    @@ -140,22 +165,27 @@ use SP\Core\UI\ThemeIcons; type="text" class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="255" - value="getDokuwikiUrlBase(), ENT_QUOTES); ?>"/> + value="getDokuwikiUrlBase(), ENT_QUOTES); ?>"/> + for="dokuwiki_urlbase">
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    - +
    @@ -180,21 +213,27 @@ use SP\Core\UI\ThemeIcons; type="password" class="mdl-textfield__input passwordfield__input mdl-color-text--indigo-400" maxlength="128" - value="getDokuwikiPass(); ?>"/> + value="getDokuwikiPass(); ?>"/> + for="dokuwiki_pass">
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    @@ -54,13 +57,18 @@ use SP\Core\UI\ThemeIcons; for="wiki_enabled"> isWikiEnabled() ? 'checked' : ''; ?>/> + name="wiki_enabled" isWikiEnabled() ? 'checked' : ''; ?>/> - - + + @@ -68,21 +76,27 @@ use SP\Core\UI\ThemeIcons;
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    - +

    - +

    @@ -95,30 +109,37 @@ use SP\Core\UI\ThemeIcons; + value="getWikiSearchurl(), ENT_QUOTES); ?>"> + for="wiki_searchurl">

    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    - +

    - +

    @@ -131,34 +152,42 @@ use SP\Core\UI\ThemeIcons; + value="getWikiPageurl(), ENT_QUOTES); ?>"> + for="wiki_pageurl">

    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +

    - +

    -
    +
    + value="getWikiFilter()); ?>"/>
    @@ -168,16 +197,22 @@ use SP\Core\UI\ThemeIcons;
    diff --git a/app/modules/web/themes/material-blue/views/error/error-database.inc b/app/modules/web/themes/material-blue/views/error/error-database.inc index ed9c0298..fee426c1 100644 --- a/app/modules/web/themes/material-blue/views/error/error-database.inc +++ b/app/modules/web/themes/material-blue/views/error/error-database.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,29 +23,36 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Mvc\View\TemplateInterface $this + * @var ThemeIconsInterface $icons + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; -use SP\Mvc\View\Template; +use SP\Core\UI\ThemeIconsInterface; +use SP\Mvc\View\TemplateInterface; ?>
    - includePartial('error-list'); ?> + includePartial('error-list'); ?>
    - + getIconPlay()->getIcon(); ?> + title="">play()->getIcon(); ?>
    -
    \ No newline at end of file +
    diff --git a/app/modules/web/themes/material-blue/views/error/error-maintenance.inc b/app/modules/web/themes/material-blue/views/error/error-maintenance.inc index 9d54bfc6..955185f7 100644 --- a/app/modules/web/themes/material-blue/views/error/error-maintenance.inc +++ b/app/modules/web/themes/material-blue/views/error/error-maintenance.inc @@ -1,22 +1,49 @@ . */ -use SP\Core\UI\ThemeIcons; -use SP\Mvc\View\Template; +/** + * @var ThemeIconsInterface $icons + * @var TemplateInterface $this + */ + +use SP\Core\UI\ThemeIconsInterface; +use SP\Mvc\View\TemplateInterface; ?>
    - includePartial('error-list'); ?> + includePartial('error-list'); ?>
    -
    \ No newline at end of file +
    diff --git a/app/modules/web/themes/material-blue/views/eventlog/datagrid-rows.inc b/app/modules/web/themes/material-blue/views/eventlog/datagrid-rows.inc index f28792dc..fbd834c8 100644 --- a/app/modules/web/themes/material-blue/views/eventlog/datagrid-rows.inc +++ b/app/modules/web/themes/material-blue/views/eventlog/datagrid-rows.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,28 +24,41 @@ /** * @var SP\Html\DataGrid\DataGridTab $data - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $data = $_getvar('data'); ?> - -getData()->getDataCount() > 0): + +getData()->getDataCount() > 0): foreach ($data->getData()->getData() as $dataIndex => $dataItem): if ($dataIndex === 'count'): continue; endif; ?> - - getData()->getDataRowSources() as $rowSrc): ?> - {$rowSrc['name']}() : $dataItem->{$rowSrc['name']}; ?> - - - + + getData()->getDataRowSources() as $rowSrc): ?> + {$rowSrc['name']}( + ) : $dataItem->{$rowSrc['name']}; ?> + + + - - + + diff --git a/app/modules/web/themes/material-blue/views/grid/datagrid-grid.inc b/app/modules/web/themes/material-blue/views/grid/datagrid-grid.inc index 79fa08aa..c316743c 100644 --- a/app/modules/web/themes/material-blue/views/grid/datagrid-grid.inc +++ b/app/modules/web/themes/material-blue/views/grid/datagrid-grid.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,16 +25,18 @@ /** * @var DataGridAction|DataGridActionSearch $action * @var SP\Html\DataGrid\DataGridTab $data - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; +use SP\Mvc\View\TemplateInterface; if (!isset($data)) { $data = $_getvar('data'); @@ -45,116 +47,179 @@ $index = $index ?? 0;
    -
    - getDataTableTemplate()): ?> - getDataTableTemplate(); ?> - - - +
    + getDataTableTemplate()): ?> + getDataTableTemplate(); ?> + + +
    diff --git a/app/modules/web/themes/material-blue/views/grid/datatabs-grid.inc b/app/modules/web/themes/material-blue/views/grid/datatabs-grid.inc index de849fec..69468611 100644 --- a/app/modules/web/themes/material-blue/views/grid/datatabs-grid.inc +++ b/app/modules/web/themes/material-blue/views/grid/datatabs-grid.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,31 +24,40 @@ /** * @var SP\Html\DataGrid\DataGridTab $data - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $tabs = $_getvar('tabs'); ?>
    - $data): ?> -
    $data): ?> +
    + data-tab-route="" + data-tab-index=""> - +
    - +
    diff --git a/app/modules/web/themes/material-blue/views/install/index.inc b/app/modules/web/themes/material-blue/views/install/index.inc index 60bce517..f9bb4f04 100644 --- a/app/modules/web/themes/material-blue/views/install/index.inc +++ b/app/modules/web/themes/material-blue/views/install/index.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,22 +23,26 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; ?>
    -

    +

    - includePartial('error-list'); ?> + includePartial('error-list'); ?>
    @@ -46,7 +50,8 @@ use SP\Mvc\View\Components\SelectItem;
    - +
    + for="adminlogin">
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>
    - +
    @@ -71,19 +80,22 @@ use SP\Mvc\View\Components\SelectItem; class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input" value="" maxlength="255" autocomplete="off"> + for="adminlogin">
    - +
    + for="masterpassword">
    @@ -92,12 +104,14 @@ use SP\Mvc\View\Components\SelectItem; class="mdl-textfield__input mdl-color-text--indigo-400" value="" maxlength="255" autocomplete="off"> + for="masterpasswordR">
    - + @@ -107,15 +121,19 @@ use SP\Mvc\View\Components\SelectItem; class="mdl-textfield__input mdl-color-text--indigo-400" value="root" autocomplete="off" autofocus> + for="dbuser">
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>
    - +
    @@ -123,7 +141,8 @@ use SP\Mvc\View\Components\SelectItem; class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input-show" value="" autocomplete="off" autofocus> + for="dbpass">
    @@ -132,15 +151,19 @@ use SP\Mvc\View\Components\SelectItem; value="syspass" autocomplete="off" autofocus pattern="[0-9a-zA-Z$_-]+"> + for="dbuser">
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>
    - +
    @@ -149,43 +172,59 @@ use SP\Mvc\View\Components\SelectItem; value="localhost" autocomplete="off" autofocus pattern="([0-9a-zA-Z._-]+|([0-9]{1,3}.)+)(:[0-9]{1,5})?|unix:.*"> + for="dbhost">
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>
    - +
    - +
    - +
    @@ -202,9 +241,12 @@ use SP\Mvc\View\Components\SelectItem;
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/account_bulkedit.inc b/app/modules/web/themes/material-blue/views/itemshow/account_bulkedit.inc index 65266457..25facd3f 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/account_bulkedit.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/account_bulkedit.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,10 +23,10 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this * @var SelectItem $client * @var SelectItem $category * @var SelectItem $user @@ -34,107 +34,148 @@ * @var SelectItem $tag */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; ?>
    -

    close

    + class="mdl-tabs__tab is-active"> + class="mdl-tabs__tab"> + class="mdl-tabs__tab">
    - + - + - + - + - + @@ -146,7 +187,8 @@ use SP\Mvc\View\Components\SelectItem; - + - + @@ -281,9 +356,11 @@ use SP\Mvc\View\Components\SelectItem; - + - + @@ -292,7 +369,8 @@ use SP\Mvc\View\Components\SelectItem; - + @@ -315,16 +395,20 @@ use SP\Mvc\View\Components\SelectItem; + value="">
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/auth_token.inc b/app/modules/web/themes/material-blue/views/itemshow/auth_token.inc index 31c3bdc1..8b9de800 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/auth_token.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/auth_token.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,95 +24,132 @@ /** * @var AuthTokenData $authToken - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\AuthTokenData; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; $authToken = $_getvar('authToken'); ?>
    -

    close

    - + - + - + - + - + - + - + - + @@ -120,10 +157,13 @@ $authToken = $_getvar('authToken');
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/category.inc b/app/modules/web/themes/material-blue/views/itemshow/category.inc index a231500f..83fe95c0 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/category.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/category.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,57 +24,70 @@ /** * @var CategoryData $category - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\CategoryData; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $category = $_getvar('category'); ?>
    -

    close

    - + - + - - includeTemplate('aux-customfields', 'common'); ?> - + + includeTemplate('aux-customfields', 'common'); ?> + @@ -82,10 +95,13 @@ $category = $_getvar('category');
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/client.inc b/app/modules/web/themes/material-blue/views/itemshow/client.inc index 818172a4..1078efb7 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/client.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/client.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,52 +24,62 @@ /** * @var ClientData $client - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\ClientData; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $client = $_getvar('client'); ?>
    -

    close

    - + - + @@ -77,14 +87,20 @@ $client = $_getvar('client'); @@ -93,15 +109,20 @@ $client = $_getvar('client'); for="isglobal"> getIsGlobal() ? 'checked' : ' '; ?>/> - + name="isglobal" getIsGlobal() ? 'checked' : ' '; ?>/> + - - includeTemplate('aux-customfields', 'common'); ?> - + + includeTemplate('aux-customfields', 'common'); ?> + @@ -109,10 +130,13 @@ $client = $_getvar('client');
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/custom_field.inc b/app/modules/web/themes/material-blue/views/itemshow/custom_field.inc index 58aa9918..dec7bad9 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/custom_field.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/custom_field.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,82 +24,106 @@ /** * @var CustomFieldDefinitionData $field - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\CustomFieldDefinitionData; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; $field = $_getvar('field'); ?>
    -

    close

    - + - + - + - + @@ -111,8 +135,10 @@ $field = $_getvar('field'); getRequired() ? 'checked' : ''; ?>/> - + getRequired() ? 'checked' : ''; ?>/> + @@ -123,8 +149,10 @@ $field = $_getvar('field'); for="encrypted"> getisEncrypted() ? 'checked' : ''; ?>/> - + name="encrypted" getisEncrypted() ? 'checked' : ''; ?>/> + @@ -135,10 +163,13 @@ $field = $_getvar('field');
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/file.inc b/app/modules/web/themes/material-blue/views/itemshow/file.inc index 737387fd..8966b551 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/file.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/file.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,22 +24,31 @@ /** * @var FileData $fileData - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\FileData; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $fileData = $_getvar('fileData'); ?> - - + -
    getName(), ENT_QUOTES); ?>
    - -
    - +
    getName(), ENT_QUOTES); ?>
    + +
    + diff --git a/app/modules/web/themes/material-blue/views/itemshow/item_preset-password.inc b/app/modules/web/themes/material-blue/views/itemshow/item_preset-password.inc index 4678eada..333eef70 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/item_preset-password.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/item_preset-password.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,14 +24,16 @@ /** * @var Password $password - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\ItemPreset\Password; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $password = $_getvar('password'); ?> @@ -39,57 +41,70 @@ $password = $_getvar('password'); - + - + - + - + @@ -104,12 +119,14 @@ $password = $_getvar('password'); for="use_numbers_enabled"> isUseNumbers() ? 'checked' : ''; ?>/> + name="use_numbers_enabled" isUseNumbers() ? 'checked' : ''; ?>/> - + @@ -119,12 +136,14 @@ $password = $_getvar('password'); for="use_letters_enabled"> isUseLetters() ? 'checked' : ''; ?>/> + name="use_letters_enabled" isUseLetters() ? 'checked' : ''; ?>/> - + @@ -134,12 +153,14 @@ $password = $_getvar('password'); for="use_symbols_enabled"> isUseSymbols() ? 'checked' : ''; ?>/> + name="use_symbols_enabled" isUseSymbols() ? 'checked' : ''; ?>/> - + @@ -149,12 +170,14 @@ $password = $_getvar('password'); for="use_upper_enabled"> isUseUpper() ? 'checked' : ''; ?>/> + name="use_upper_enabled" isUseUpper() ? 'checked' : ''; ?>/> - + @@ -164,12 +187,14 @@ $password = $_getvar('password'); for="use_lower_enabled"> isUseLower() ? 'checked' : ''; ?>/> + name="use_lower_enabled" isUseLower() ? 'checked' : ''; ?>/> - + @@ -179,16 +204,22 @@ $password = $_getvar('password'); for="use_image_enabled"> isUseImage() ? 'checked' : ''; ?>/> + name="use_image_enabled" isUseImage() ? 'checked' : ''; ?>/> - + - +
    - +
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/item_preset-permission.inc b/app/modules/web/themes/material-blue/views/itemshow/item_preset-permission.inc index 4bcac31b..825a67ac 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/item_preset-permission.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/item_preset-permission.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,99 +23,139 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; ?> - + - + diff --git a/app/modules/web/themes/material-blue/views/itemshow/item_preset-private.inc b/app/modules/web/themes/material-blue/views/itemshow/item_preset-private.inc index baa71d88..9704742c 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/item_preset-private.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/item_preset-private.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,14 +24,16 @@ /** * @var AccountPrivate $private - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\ItemPreset\AccountPrivate; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $private = $_getvar('private'); ?> @@ -48,16 +50,20 @@ $private = $_getvar('private'); for="private_user_enabled"> isPrivateUser() ? 'checked' : ''; ?>/> + name="private_user_enabled" isPrivateUser() ? 'checked' : ''; ?>/> - + - +
    - +
    @@ -68,16 +74,22 @@ $private = $_getvar('private'); for="private_group_enabled"> isPrivateGroup() ? 'checked' : ''; ?>/> + name="private_group_enabled" isPrivateGroup() ? 'checked' : ''; ?>/> - + - +
    - +
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/item_preset-session_timeout.inc b/app/modules/web/themes/material-blue/views/itemshow/item_preset-session_timeout.inc index 67a67ce1..0fdeefb8 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/item_preset-session_timeout.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/item_preset-session_timeout.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,14 +24,16 @@ /** * @var SessionTimeout $sessionTimeout - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\ItemPreset\SessionTimeout; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $sessionTimeout = $_getvar('sessionTimeout'); ?> @@ -39,28 +41,34 @@ $sessionTimeout = $_getvar('sessionTimeout'); - + - + diff --git a/app/modules/web/themes/material-blue/views/itemshow/item_preset.inc b/app/modules/web/themes/material-blue/views/itemshow/item_preset.inc index 10d32a37..904e11da 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/item_preset.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/item_preset.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,104 +24,146 @@ /** * @var ItemPreset $preset - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\Domain\Account\Models\ItemPreset; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; $preset = $_getvar('preset'); ?>
    -

    close

    + class="mdl-tabs__tab is-active"> + class="mdl-tabs__tab">
    - + - + - + @@ -132,9 +174,11 @@ $preset = $_getvar('preset'); pattern="[0-9]{1,3}" class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="3" min="0" max="128" - value="getPriority(); ?>"/> + value="getPriority(); ?>"/> + for="priority"> @@ -150,16 +194,20 @@ $preset = $_getvar('preset'); getFixed() ? 'checked' : ''; ?>/> + name="fixed_enabled" getFixed() ? 'checked' : ''; ?>/> - + - +
    - +
    @@ -171,22 +219,30 @@ $preset = $_getvar('preset');
    - includeTemplate($_getvar('typeTemplate'), 'itemshow'); endif; ?> + includeTemplate( + $_getvar('typeTemplate'), + 'itemshow' + ); endif; ?>
    + value="getType(); ?>">
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/public_link.inc b/app/modules/web/themes/material-blue/views/itemshow/public_link.inc index 9b02bcda..f36e4106 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/public_link.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/public_link.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,149 +24,204 @@ /** * @var PublicLinkListData $publicLink - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\PublicLinkListData; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; $publicLink = $_getvar('publicLink'); ?>
    -

    close

    - + - + - + - + - + - + - + - + - + - + - + - - + + - +
    - +
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/results.inc b/app/modules/web/themes/material-blue/views/itemshow/results.inc index 7048d06f..1b00905f 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/results.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/results.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,23 +23,27 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; ?>
    -

    close

    diff --git a/app/modules/web/themes/material-blue/views/itemshow/tag.inc b/app/modules/web/themes/material-blue/views/itemshow/tag.inc index 31dbdcb5..0ae5537d 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/tag.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/tag.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,37 +24,44 @@ /** * @var TagData $tag - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\TagData; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $tag = $_getvar('tag'); ?>
    -

    close

    - + @@ -65,10 +72,13 @@ $tag = $_getvar('tag');
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/user.inc b/app/modules/web/themes/material-blue/views/itemshow/user.inc index 07e17ff2..9726b476 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/user.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/user.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,115 +24,149 @@ /** * @var UserData $user - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\UserData; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; $user = $_getvar('user'); ?>
    -

    close

    + class="mdl-tabs__tab is-active"> + class="mdl-tabs__tab"> - + - + class="mdl-tabs__tab"> +
    - + - + - + - + - + - + - + - + - + - + - + - + - + - - includeTemplate('aux-customfields', 'common'); ?> - + + includeTemplate('aux-customfields', 'common'); ?> + @@ -228,7 +291,8 @@ $user = $_getvar('user');
      - +
    • - + - +
    • @@ -255,20 +323,26 @@ $user = $_getvar('user'); isAdminAcc() ? 'checked' : ' '; ?> /> + name="adminacc_enabled" isAdminAcc() ? 'checked' : ' '; ?> />
    - + - + - + - +
  • - + - +
  • - +
  • @@ -295,12 +374,15 @@ $user = $_getvar('user'); for="disabled"> isDisabled() ? 'checked' : ' '; ?> /> + name="disabled" isDisabled() ? 'checked' : ' '; ?> />
    - +
  • @@ -311,65 +393,85 @@ $user = $_getvar('user');
    - +
    - + - + - + - + - + @@ -378,21 +480,28 @@ $user = $_getvar('user');
    - + + value="isLdap(); ?>"/>
    - +
    - +
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/user_group.inc b/app/modules/web/themes/material-blue/views/itemshow/user_group.inc index 585dcb60..937f0744 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/user_group.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/user_group.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,149 +25,198 @@ /** * @var UserToUserGroupData $groupUsers * @var UserGroupData $group - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\UserGroupData; use SP\DataModel\UserToUserGroupData; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; $group = $_getvar('group'); ?>
    -

    close

    - + - + - + - - includeTemplate('aux-customfields', 'common'); ?> - + + includeTemplate('aux-customfields', 'common'); ?> + - + - + - +
    - +
    - +
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/user_pass.inc b/app/modules/web/themes/material-blue/views/itemshow/user_pass.inc index 99292ed1..53ddf662 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/user_pass.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/user_pass.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,53 +24,62 @@ /** * @var UserData $user - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\UserData; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $user = $_getvar('user'); ?>
    -

    close

    - + - + - + - + @@ -103,9 +115,12 @@ $user = $_getvar('user');
    diff --git a/app/modules/web/themes/material-blue/views/itemshow/user_profile.inc b/app/modules/web/themes/material-blue/views/itemshow/user_profile.inc index 985b1085..711d799d 100644 --- a/app/modules/web/themes/material-blue/views/itemshow/user_profile.inc +++ b/app/modules/web/themes/material-blue/views/itemshow/user_profile.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,39 +25,47 @@ /** * @var ProfileData $profileData * @var UserProfileData $profile - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\ProfileData; use SP\DataModel\UserProfileData; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $profile = $_getvar('profile'); $profileData = $_getvar('profileData'); ?>
    -

    close

    + class="mdl-tabs__tab is-active"> + class="mdl-tabs__tab"> + class="mdl-tabs__tab"> + class="mdl-tabs__tab">
    @@ -65,8 +73,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -74,7 +84,9 @@ $profileData = $_getvar('profileData'); for="profile_accadd"> isAccAdd() ? 'CHECKED' : ''; ?> /> + name="profile_accadd" isAccAdd() ? 'CHECKED' : ''; ?> />
  • @@ -82,8 +94,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -91,7 +105,9 @@ $profileData = $_getvar('profileData'); for="profile_accview"> isAccView() ? 'CHECKED' : ''; ?> /> + name="profile_accview" isAccView() ? 'CHECKED' : ''; ?> />
  • @@ -99,8 +115,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -108,7 +126,9 @@ $profileData = $_getvar('profileData'); for="profile_accviewpass"> isAccViewPass() ? 'CHECKED' : ''; ?> /> + name="profile_accviewpass" isAccViewPass() ? 'CHECKED' : ''; ?> />
  • @@ -116,8 +136,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -126,7 +148,9 @@ $profileData = $_getvar('profileData'); isAccViewHistory() ? 'CHECKED' : ''; ?> /> + name="profile_accviewhistory" isAccViewHistory() ? 'CHECKED' : ''; ?> />
  • @@ -134,8 +158,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -143,7 +169,9 @@ $profileData = $_getvar('profileData'); for="profile_accedit"> isAccEdit() ? 'CHECKED' : ''; ?> /> + name="profile_accedit" isAccEdit() ? 'CHECKED' : ''; ?> />
  • @@ -151,8 +179,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -160,7 +190,9 @@ $profileData = $_getvar('profileData'); for="profile_acceditpass"> isAccEditPass() ? 'CHECKED' : ''; ?> /> + name="profile_acceditpass" isAccEditPass() ? 'CHECKED' : ''; ?> />
  • @@ -168,8 +200,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -177,7 +211,9 @@ $profileData = $_getvar('profileData'); for="profile_accdel"> isAccDelete() ? 'CHECKED' : ''; ?> /> + name="profile_accdel" isAccDelete() ? 'CHECKED' : ''; ?> />
  • @@ -185,8 +221,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -194,7 +232,9 @@ $profileData = $_getvar('profileData'); for="profile_accfiles"> isAccFiles() ? 'CHECKED' : ''; ?> /> + name="profile_accfiles" isAccFiles() ? 'CHECKED' : ''; ?> />
  • @@ -202,8 +242,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -211,7 +253,9 @@ $profileData = $_getvar('profileData'); for="profile_accpublinks"> isAccPublicLinks() ? 'CHECKED' : ''; ?> /> + name="profile_accpublinks" isAccPublicLinks() ? 'CHECKED' : ''; ?> />
  • @@ -219,8 +263,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -228,7 +274,9 @@ $profileData = $_getvar('profileData'); for="profile_accprivate"> isAccPrivate() ? 'CHECKED' : ''; ?> /> + name="profile_accprivate" isAccPrivate() ? 'CHECKED' : ''; ?> />
  • @@ -236,8 +284,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -246,7 +296,9 @@ $profileData = $_getvar('profileData'); isAccPrivateGroup() ? 'CHECKED' : ''; ?> /> + name="profile_accprivategroup" isAccPrivateGroup() ? 'CHECKED' : ''; ?> />
  • @@ -254,8 +306,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -264,7 +318,9 @@ $profileData = $_getvar('profileData'); isAccPermission() ? 'CHECKED' : ''; ?> /> + name="profile_accpermissions" isAccPermission() ? 'CHECKED' : ''; ?> />
  • @@ -272,8 +328,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -282,7 +340,9 @@ $profileData = $_getvar('profileData'); isAccGlobalSearch() ? 'CHECKED' : ''; ?> /> + name="profile_accglobalsearch" isAccGlobalSearch() ? 'CHECKED' : ''; ?> />
  • @@ -294,8 +354,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -303,7 +365,9 @@ $profileData = $_getvar('profileData'); for="profile_users"> isMgmUsers() ? 'CHECKED' : ''; ?> /> + name="profile_users" isMgmUsers() ? 'CHECKED' : ''; ?> />
  • @@ -311,8 +375,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -320,7 +386,9 @@ $profileData = $_getvar('profileData'); for="profile_groups"> isMgmGroups() ? 'CHECKED' : ''; ?> /> + name="profile_groups" isMgmGroups() ? 'CHECKED' : ''; ?> />
  • @@ -328,8 +396,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -337,7 +407,9 @@ $profileData = $_getvar('profileData'); for="profile_profiles"> isMgmProfiles() ? 'CHECKED' : ''; ?> /> + name="profile_profiles" isMgmProfiles() ? 'CHECKED' : ''; ?> />
  • @@ -345,8 +417,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -354,7 +428,9 @@ $profileData = $_getvar('profileData'); for="profile_categories"> isMgmCategories() ? 'CHECKED' : ''; ?> /> + name="profile_categories" isMgmCategories() ? 'CHECKED' : ''; ?> />
  • @@ -362,8 +438,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -371,7 +449,9 @@ $profileData = $_getvar('profileData'); for="profile_tags"> isMgmTags() ? 'CHECKED' : ''; ?> /> + name="profile_tags" isMgmTags() ? 'CHECKED' : ''; ?> />
  • @@ -379,8 +459,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -388,7 +470,9 @@ $profileData = $_getvar('profileData'); for="profile_customers"> isMgmCustomers() ? 'CHECKED' : ''; ?> /> + name="profile_customers" isMgmCustomers() ? 'CHECKED' : ''; ?> />
  • @@ -396,8 +480,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -405,7 +491,9 @@ $profileData = $_getvar('profileData'); for="profile_customfields"> isMgmCustomFields() ? 'CHECKED' : ''; ?> /> + name="profile_customfields" isMgmCustomFields() ? 'CHECKED' : ''; ?> />
  • @@ -413,8 +501,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -422,7 +512,9 @@ $profileData = $_getvar('profileData'); for="profile_apitokens"> isMgmApiTokens() ? 'CHECKED' : ''; ?> /> + name="profile_apitokens" isMgmApiTokens() ? 'CHECKED' : ''; ?> />
  • @@ -430,8 +522,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -439,7 +533,9 @@ $profileData = $_getvar('profileData'); for="profile_publinks"> isMgmPublicLinks() ? 'CHECKED' : ''; ?> /> + name="profile_publinks" isMgmPublicLinks() ? 'CHECKED' : ''; ?> />
  • @@ -447,8 +543,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -456,7 +554,9 @@ $profileData = $_getvar('profileData'); for="profile_accounts"> isMgmAccounts() ? 'CHECKED' : ''; ?> /> + name="profile_accounts" isMgmAccounts() ? 'CHECKED' : ''; ?> />
  • @@ -464,8 +564,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -473,7 +575,9 @@ $profileData = $_getvar('profileData'); for="profile_files"> isMgmFiles() ? 'CHECKED' : ''; ?> /> + name="profile_files" isMgmFiles() ? 'CHECKED' : ''; ?> />
  • @@ -481,8 +585,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -490,7 +596,9 @@ $profileData = $_getvar('profileData'); for="profile_items_preset"> isMgmItemsPreset() ? 'CHECKED' : ''; ?> /> + name="profile_items_preset" isMgmItemsPreset() ? 'CHECKED' : ''; ?> />
  • @@ -502,8 +610,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -511,7 +621,9 @@ $profileData = $_getvar('profileData'); for="profile_config"> isConfigGeneral() ? 'CHECKED' : ''; ?> /> + name="profile_config" isConfigGeneral() ? 'CHECKED' : ''; ?> />
  • @@ -519,8 +631,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -528,7 +642,9 @@ $profileData = $_getvar('profileData'); for="profile_configmpw"> isConfigEncryption() ? 'CHECKED' : ''; ?> /> + name="profile_configmpw" isConfigEncryption() ? 'CHECKED' : ''; ?> />
  • @@ -536,8 +652,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -545,7 +663,9 @@ $profileData = $_getvar('profileData'); for="profile_configback"> isConfigBackup() ? 'CHECKED' : ''; ?> /> + name="profile_configback" isConfigBackup() ? 'CHECKED' : ''; ?> />
  • @@ -553,8 +673,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -562,7 +684,9 @@ $profileData = $_getvar('profileData'); for="profile_configimport"> isConfigImport() ? 'CHECKED' : ''; ?> /> + name="profile_configimport" isConfigImport() ? 'CHECKED' : ''; ?> />
  • @@ -574,8 +698,10 @@ $profileData = $_getvar('profileData');
  • vpn_key - - + + @@ -583,7 +709,9 @@ $profileData = $_getvar('profileData'); for="profile_eventlog"> isEvl() ? 'CHECKED' : ''; ?> /> + name="profile_eventlog" isEvl() ? 'CHECKED' : ''; ?> />
  • @@ -594,41 +722,52 @@ $profileData = $_getvar('profileData');
    - + - + - + - + @@ -636,13 +775,18 @@ $profileData = $_getvar('profileData'); - +
    - +
    diff --git a/app/modules/web/themes/material-blue/views/login/index.inc b/app/modules/web/themes/material-blue/views/login/index.inc index d5b54ebd..49078da5 100644 --- a/app/modules/web/themes/material-blue/views/login/index.inc +++ b/app/modules/web/themes/material-blue/views/login/index.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,13 +23,15 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; ?> @@ -47,7 +49,8 @@ use SP\Core\UI\ThemeIcons; class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="80" autocomplete="off" autofocus> + for="user">
    @@ -58,7 +61,8 @@ use SP\Core\UI\ThemeIcons; class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="255" autocomplete="off"> + for="pass">
    @@ -69,7 +73,8 @@ use SP\Core\UI\ThemeIcons; class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="255" autocomplete="off"> + for="oldpass"> @@ -80,16 +85,21 @@ use SP\Core\UI\ThemeIcons; class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="255" autocomplete="off"> + for="mpass"> - + + value=""/> - + value=""/> + @@ -97,41 +107,53 @@ use SP\Core\UI\ThemeIcons;
    - +
    - +
    - + - +
    - + class="round5"> + - +
      -
    • +
    • perm_identity demo
    • -
    • +
    • vpn_key syspass
    • -
    • +
    • vpn_key 12345678900
    - + diff --git a/app/modules/web/themes/material-blue/views/main/update.inc b/app/modules/web/themes/material-blue/views/main/update.inc index 30610120..16c5a5d1 100644 --- a/app/modules/web/themes/material-blue/views/main/update.inc +++ b/app/modules/web/themes/material-blue/views/main/update.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,30 +23,39 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; ?> - 0): ?> + 0): ?>
    feedback + data-badge="">feedback
    - + class="mdl-tooltip mdl-tooltip--top"> + - - - + + +   
    @@ -54,18 +63,24 @@ use SP\Core\UI\ThemeIcons;
    - + class="mdl-tooltip mdl-tooltip--top"> +
    check_circle
    - + class="mdl-tooltip mdl-tooltip--top"> +
    warning
    - + class="mdl-tooltip mdl-tooltip--top"> + diff --git a/app/modules/web/themes/material-blue/views/main/upgrade.inc b/app/modules/web/themes/material-blue/views/main/upgrade.inc index 93a93a1c..451283ba 100644 --- a/app/modules/web/themes/material-blue/views/main/upgrade.inc +++ b/app/modules/web/themes/material-blue/views/main/upgrade.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,16 +23,20 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ ?>
    -

    @@ -41,46 +45,66 @@
    - - - - - + + + + +
    + for="h">
    - getIconHelp()->getIcon(); ?> + class="icon material-icons help()->getClass(); ?>"> + help()->getIcon(); ?>
    - +
    - 0): + 0 + ): ?>
    • - getIconWarning()->getIcon(); ?> - + warning()->getIcon(); ?> +
      - +
      - -
    • - + +
    • +
    @@ -98,65 +122,97 @@ autocomplete="off" min="0" max="1000" value="0"> + for="userid">
    - + - accounts_category > 0 - || $checkConstraints->accountshistory_category > 0): ?> -
    - - -
    - + accounts_category > 0 + || $checkConstraints->accountshistory_category > 0 + ): ?> +
    + + +
    + - accounts_customer > 0 - || $checkConstraints->accountshistory_customer > 0): ?> -
    - - -
    - + accounts_customer > 0 + || $checkConstraints->accountshistory_customer > 0 + ): ?> +
    + + +
    + - users_group > 0 - || $checkConstraints->accounts_group > 0 - || $checkConstraints->accountshistory_group > 0): ?> -
    - - -
    - + users_group > 0 + || $checkConstraints->accounts_group > 0 + || $checkConstraints->accountshistory_group > 0 + ): ?> +
    + + +
    + - users_profile > 0): ?> -
    - - -
    - - + users_profile > 0): ?> +
    + + +
    + + - +
    • - getIconWarning()->getIcon(); ?> - + warning()->getIcon(); ?> +
      - +
      - https://doc.syspass.org'); ?> + https://doc.syspass.org' + ); ?>
    @@ -166,7 +222,8 @@ class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input-show" maxlength="255" required/> + for="masterkey">
    @@ -175,30 +232,39 @@ class="mdl-textfield__input mdl-color-text--indigo-400" autocomplete="off"> + for="userlogin">
    - = 500): ?> + = 500): ?> + value=""> - - + + + value=""> + value=""> + value=""> @@ -206,8 +272,11 @@
    • - getIconWarning()->getIcon(); ?> - + warning()->getIcon(); ?> +
    @@ -216,9 +285,12 @@
    diff --git a/app/modules/web/themes/material-blue/views/notification/notification.inc b/app/modules/web/themes/material-blue/views/notification/notification.inc index f162c24b..29788de6 100644 --- a/app/modules/web/themes/material-blue/views/notification/notification.inc +++ b/app/modules/web/themes/material-blue/views/notification/notification.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,165 +24,220 @@ /** * @var NotificationData $notification - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\NotificationData; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; use SP\Util\DateUtil; $notification = $_getvar('notification'); ?>
    -

    close

    - + - + - + - + - + - + - + - + - + - +
    - +
    - +
    diff --git a/app/modules/web/themes/material-blue/views/plugin/plugin.inc b/app/modules/web/themes/material-blue/views/plugin/plugin.inc index 67ba9c29..3f13fa11 100644 --- a/app/modules/web/themes/material-blue/views/plugin/plugin.inc +++ b/app/modules/web/themes/material-blue/views/plugin/plugin.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,14 +25,16 @@ /** * @var PluginModel $plugin * @var PluginInterface $pluginInfo - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Infrastructure\Plugin\Repositories\PluginModel; +use SP\Mvc\View\TemplateInterface; use SP\Plugin\PluginInterface; $plugin = $_getvar('plugin'); @@ -40,76 +42,98 @@ $pluginInfo = $_getvar('pluginInfo'); ?>
    -

    close

    - + - + - + - + - + diff --git a/app/modules/web/themes/material-blue/views/upgrade/index.inc b/app/modules/web/themes/material-blue/views/upgrade/index.inc index 33d03f8f..06e20c79 100644 --- a/app/modules/web/themes/material-blue/views/upgrade/index.inc +++ b/app/modules/web/themes/material-blue/views/upgrade/index.inc @@ -1,23 +1,51 @@ . */ -use SP\Core\UI\ThemeIcons; -use SP\Mvc\View\Template; +/** + * @var TemplateInterface $this + * @var ThemeIconsInterface $icons + */ + +use SP\Core\UI\ThemeIconsInterface; +use SP\Mvc\View\TemplateInterface; ?>
    • - getIconWarning()->getIcon(); ?> - + warning()->getIcon(); ?> +

      - +

      - +

    @@ -31,22 +59,27 @@ use SP\Mvc\View\Template; class="mdl-textfield__input mdl-color-text--indigo-400" autocomplete="off" autofocus> + for="key">
    • - getIconWarning()->getIcon(); ?> - + warning()->getIcon(); ?> +
    @@ -55,10 +88,13 @@ use SP\Mvc\View\Template; - \ No newline at end of file + diff --git a/app/modules/web/themes/material-blue/views/userpassreset/request.inc b/app/modules/web/themes/material-blue/views/userpassreset/request.inc index b6d8f2db..7f7133f4 100644 --- a/app/modules/web/themes/material-blue/views/userpassreset/request.inc +++ b/app/modules/web/themes/material-blue/views/userpassreset/request.inc @@ -1,11 +1,38 @@ -. + */ -use SP\Core\UI\ThemeIcons; ?> +/** @var $icons ThemeIconsInterface */ + +use SP\Core\UI\ThemeIconsInterface; + +?>
    - +
    class="mdl-textfield__input mdl-color-text--indigo-400" autocomplete="off" autofocus> + for="login">
    @@ -29,7 +57,8 @@ use SP\Core\UI\ThemeIcons; ?> class="mdl-textfield__input mdl-color-text--indigo-400" autocomplete="off"> + for="email">
    @@ -39,15 +68,21 @@ use SP\Core\UI\ThemeIcons; ?> diff --git a/app/modules/web/themes/material-blue/views/userpassreset/reset.inc b/app/modules/web/themes/material-blue/views/userpassreset/reset.inc index 5c97ae6e..d0fa05a6 100644 --- a/app/modules/web/themes/material-blue/views/userpassreset/reset.inc +++ b/app/modules/web/themes/material-blue/views/userpassreset/reset.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,20 +23,23 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; ?>
    - +
    + for="password">
    @@ -64,11 +68,13 @@ use SP\Core\UI\ThemeIcons; value="" maxlength="255" autocomplete="off"> + for="password_repeat">
    + value=""> @@ -76,15 +82,21 @@ use SP\Core\UI\ThemeIcons; diff --git a/app/modules/web/themes/material-blue/views/usersettings/general.inc b/app/modules/web/themes/material-blue/views/usersettings/general.inc index 503995bf..19e68ae9 100644 --- a/app/modules/web/themes/material-blue/views/usersettings/general.inc +++ b/app/modules/web/themes/material-blue/views/usersettings/general.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,71 +24,93 @@ /** * @var UserPreferencesData $userPreferences - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\DataModel\UserPreferencesData; +use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Mvc\View\Components\SelectItem; +use SP\Mvc\View\TemplateInterface; $userPreferences = $_getvar('userPreferences'); ?>
    home - +
    - + - + @@ -99,10 +121,12 @@ $userPreferences = $_getvar('userPreferences'); pattern="[0-9]{1,5}" class="mdl-textfield__input mdl-color-text--indigo-400" maxlength="5" - value="getResultsPerPage(); ?>" + value="getResultsPerPage(); ?>" required/> + for="resultsperpage"> @@ -116,14 +140,17 @@ $userPreferences = $_getvar('userPreferences'); for="account_link"> isAccountLink() ? 'checked' : ''; ?>/> + name="account_link" isAccountLink() ? 'checked' : ''; ?>/> - + - + @@ -134,14 +161,17 @@ $userPreferences = $_getvar('userPreferences'); for="sort_views"> isSortViews() ? 'checked' : ''; ?>/> + name="sort_views" isSortViews() ? 'checked' : ''; ?>/> - + - + @@ -152,14 +182,17 @@ $userPreferences = $_getvar('userPreferences'); for="top_navbar"> isTopNavbar() ? 'checked' : ''; ?>/> + name="top_navbar" isTopNavbar() ? 'checked' : ''; ?>/> - + - + @@ -170,14 +203,17 @@ $userPreferences = $_getvar('userPreferences'); for="optional_actions"> isOptionalActions() ? 'checked' : ''; ?>/> + name="optional_actions" isOptionalActions() ? 'checked' : ''; ?>/> - + - + @@ -188,14 +224,17 @@ $userPreferences = $_getvar('userPreferences'); for="resultsascards"> isResultsAsCards() ? 'checked' : ''; ?>/> + name="resultsascards" isResultsAsCards() ? 'checked' : ''; ?>/> - + - + @@ -206,14 +245,17 @@ $userPreferences = $_getvar('userPreferences'); for="check_notifications"> isCheckNotifications() ? 'checked' : ''; ?>/> + name="check_notifications" isCheckNotifications() ? 'checked' : ''; ?>/> - + - + @@ -225,14 +267,17 @@ $userPreferences = $_getvar('userPreferences'); isShowAccountSearchFilters() ? 'checked' : ''; ?>/> + name="show_account_search_filters" isShowAccountSearchFilters() ? 'checked' : ''; ?>/> - + - + @@ -247,16 +292,22 @@ $userPreferences = $_getvar('userPreferences');
    diff --git a/app/modules/web/themes/material-blue/views/wiki/wikipage.inc b/app/modules/web/themes/material-blue/views/wiki/wikipage.inc index d39909c5..80417d93 100644 --- a/app/modules/web/themes/material-blue/views/wiki/wikipage.inc +++ b/app/modules/web/themes/material-blue/views/wiki/wikipage.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -23,13 +23,15 @@ */ /** - * @var ThemeIcons $icons - * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData + * @var ThemeIconsInterface $icons + * @var ConfigDataInterface $configData * @var callable $_getvar - * @var \SP\Mvc\View\TemplateInterface $this + * @var TemplateInterface $this */ -use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\Config\Ports\ConfigDataInterface; +use SP\Mvc\View\TemplateInterface; $header = $_getvar('header'); $pageData = $_getvar('pageData'); @@ -38,31 +40,58 @@ $pageInfo = $_getvar('pageInfo'); ?>
    -

    +

    - - - 0): ?> -

    + + + 0): ?> +


    - +
      - -
    • %s', __('Page'), $_getvar('wikiUrlBase') . '/' . $result['id'], $result['id']); ?>
    • - + +
    • %s', + __('Page'), + $_getvar('wikiUrlBase') . '/' . $result['id'], + $result['id'] + ); ?>
    • +
    - -

    - + +

    +
    - +
      -
    • %s', __('Page'), $_getvar('wikiUrlBase') . $pageInfo['name'], $pageInfo['name']); ?>
    • -
    • -
    • +
    • %s', + __('Page'), + $_getvar('wikiUrlBase') . $pageInfo['name'], + $pageInfo['name'] + ); ?>
    • +
    • +
    - +
    diff --git a/lib/SP/Core/Application.php b/lib/SP/Core/Application.php index dfe1d805..662ad539 100644 --- a/lib/SP/Core/Application.php +++ b/lib/SP/Core/Application.php @@ -25,6 +25,7 @@ namespace SP\Core; use SP\Core\Context\ContextInterface; +use SP\Core\Context\SessionContextInterface; use SP\Core\Events\EventDispatcherInterface; use SP\Domain\Config\Ports\ConfigInterface; @@ -38,12 +39,12 @@ final class Application * * @param ConfigInterface $config * @param EventDispatcherInterface $eventDispatcher - * @param ContextInterface $context + * @param SessionContextInterface|ContextInterface $context */ public function __construct( - private readonly ConfigInterface $config, - private readonly EventDispatcherInterface $eventDispatcher, - private readonly ContextInterface $context + private readonly ConfigInterface $config, + private readonly EventDispatcherInterface $eventDispatcher, + private readonly SessionContextInterface|ContextInterface $context ) { } @@ -57,7 +58,7 @@ final class Application return $this->eventDispatcher; } - public function getContext(): ContextInterface + public function getContext(): ContextInterface|SessionContextInterface { return $this->context; } diff --git a/lib/SP/Core/Bootstrap/BootstrapApi.php b/lib/SP/Core/Bootstrap/BootstrapApi.php index ccf39492..24ab5eed 100644 --- a/lib/SP/Core/Bootstrap/BootstrapApi.php +++ b/lib/SP/Core/Bootstrap/BootstrapApi.php @@ -26,6 +26,7 @@ namespace SP\Core\Bootstrap; use Closure; use Exception; +use Klein\Request; use Klein\Response; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; @@ -34,6 +35,7 @@ use SP\Core\HttpModuleBase; use SP\Domain\Api\Ports\ApiRequestInterface; use SP\Domain\Api\Services\JsonRpcResponse; use SP\Modules\Api\Init as InitApi; + use function SP\logger; use function SP\processException; @@ -71,10 +73,7 @@ final class BootstrapApi extends BootstrapBase private function manageApiRequest(): Closure { - return function ($request, $response, $service) { - /** @var \Klein\Request $request */ - /** @var \Klein\Response $response */ - + return function (Request $request, Response $response) { try { logger('API route'); @@ -84,10 +83,10 @@ final class BootstrapApi extends BootstrapBase $controllerClass = self::getClassFor($controllerName, $actionName); - $method = $actionName.'Action'; + $method = $actionName . 'Action'; if (!method_exists($controllerClass, $method)) { - logger($controllerClass.'::'.$method); + logger($controllerClass . '::' . $method); /** @var Response $response */ $response->headers()->set('Content-type', 'application/json; charset=utf-8'); @@ -107,7 +106,7 @@ final class BootstrapApi extends BootstrapBase $this->module->initialize($controllerName); - logger('Routing call: '.$controllerClass.'::'.$method); + logger('Routing call: ' . $controllerClass . '::' . $method); return call_user_func([$this->createObjectFor($controllerClass), $method]); } catch (Exception $e) { diff --git a/lib/SP/Core/Bootstrap/BootstrapBase.php b/lib/SP/Core/Bootstrap/BootstrapBase.php index 059a43a1..adf09b38 100644 --- a/lib/SP/Core/Bootstrap/BootstrapBase.php +++ b/lib/SP/Core/Bootstrap/BootstrapBase.php @@ -26,6 +26,7 @@ namespace SP\Core\Bootstrap; use Closure; use Klein\Klein; +use Klein\Request; use Klein\Response; use PHPMailer\PHPMailer\Exception; use Psr\Container\ContainerExceptionInterface; @@ -33,17 +34,22 @@ use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; use RuntimeException; use SP\Core\Context\ContextInterface; +use SP\Core\Exceptions\CheckException; +use SP\Core\Exceptions\ConfigException; use SP\Core\Exceptions\InitializationException; use SP\Core\Exceptions\SPException; use SP\Core\Language; use SP\Core\PhpExtensionChecker; use SP\Domain\Config\Ports\ConfigDataInterface; use SP\Domain\Config\Services\ConfigUtil; +use SP\Domain\Upgrade\Services\UpgradeException; use SP\Http\RequestInterface; use SP\Plugin\PluginManager; use SP\Util\Checks; use Symfony\Component\Debug\Debug; use Throwable; + +use function SP\__; use function SP\__u; use function SP\logger; use function SP\processException; @@ -59,50 +65,41 @@ abstract class BootstrapBase protected const OOPS_MESSAGE = "Oops, it looks like this content does not exist..."; /** + * @deprecated Use {@see UriContextInterface::getWebRoot()} instead * @var string The current request path relative to the sysPass root (e.g. files/index.php) */ public static string $WEBROOT = ''; /** + * @deprecated Use {@see UriContextInterface::getWebUri()} instead * @var string The full URL to reach sysPass (e.g. https://sub.example.com/syspass/) */ public static string $WEBURI = ''; + /** + * @deprecated Use {@see UriContextInterface::getSubUri()} instead + */ public static string $SUBURI = ''; /** * @var mixed */ - public static $LOCK; - public static bool $checkPhpVersion = false; - protected Klein $router; - protected RequestInterface $request; - protected ConfigDataInterface $configData; - protected ContextInterface $context; - private ContainerInterface $container; - private UpgradeConfigChecker $upgradeConfigChecker; - private PhpExtensionChecker $phpExtensionChecker; + public static $LOCK; + public static bool $checkPhpVersion = false; /** * Bootstrap constructor. */ final public function __construct( - ConfigDataInterface $configData, - Klein $router, - RequestInterface $request, - UpgradeConfigChecker $upgradeConfigChecker, - PhpExtensionChecker $extensionChecker, - ContextInterface $context, - ContainerInterface $container + protected readonly ConfigDataInterface $configData, + protected readonly Klein $router, + protected readonly RequestInterface $request, + private readonly UpgradeConfigChecker $upgradeConfigChecker, + protected readonly PhpExtensionChecker $extensionChecker, + protected readonly ContextInterface $context, + private readonly ContainerInterface $container, + protected readonly UriContextInterface $uriContext ) { // Set the default language Language::setLocales('en_US'); - $this->configData = $configData; - $this->router = $router; - $this->request = $request; - $this->upgradeConfigChecker = $upgradeConfigChecker; - $this->phpExtensionChecker = $extensionChecker; - $this->context = $context; - $this->container = $container; - $this->initRouter(); $this->configureRouter(); } @@ -110,10 +107,10 @@ abstract class BootstrapBase private function initRouter(): void { $this->router->onError(function ($router, $err_msg, $type, $err) { - logger('Routing error: '.$err_msg); + logger('Routing error: ' . $err_msg); /** @var Exception|Throwable $err */ - logger('Routing error: '.$err->getTraceAsString()); + logger('Routing error: ' . $err->getTraceAsString()); /** @var Klein $router */ $router->response()->body(__($err_msg)); @@ -126,8 +123,8 @@ abstract class BootstrapBase private function manageCorsRequest(): Closure { return function ($request, $response) { - /** @var \Klein\Request $request */ - /** @var \Klein\Response $response */ + /** @var Request $request */ + /** @var Response $response */ $this->setCors($response); }; @@ -180,10 +177,10 @@ abstract class BootstrapBase } /** - * @throws \SP\Core\Exceptions\CheckException - * @throws \SP\Core\Exceptions\ConfigException - * @throws \SP\Core\Exceptions\InitializationException - * @throws \SP\Domain\Upgrade\Services\UpgradeException + * @throws CheckException + * @throws ConfigException + * @throws InitializationException + * @throws UpgradeException */ final protected function initializeCommon(): void { @@ -197,10 +194,7 @@ abstract class BootstrapBase // Initialize logging $this->initPHPVars(); - // Set application paths - $this->initPaths(); - - $this->phpExtensionChecker->checkMandatory(); + $this->extensionChecker->checkMandatory(); if (!self::$checkPhpVersion) { throw new InitializationException( @@ -223,7 +217,8 @@ abstract class BootstrapBase // Copiar la cabecera http de autentificación para apache+php-fcgid if ($server->get('HTTP_XAUTHORIZATION') !== null - && $server->get('HTTP_AUTHORIZATION') === null) { + && $server->get('HTTP_AUTHORIZATION') === null + ) { $server->set('HTTP_AUTHORIZATION', $server->get('HTTP_XAUTHORIZATION')); } @@ -273,7 +268,7 @@ abstract class BootstrapBase && touch(LOG_FILE) && chmod(LOG_FILE, 0600) ) { - logger('Setup log file: '.LOG_FILE); + logger('Setup log file: ' . LOG_FILE); } if (date_default_timezone_get() === 'UTC') { @@ -287,31 +282,11 @@ abstract class BootstrapBase } } - /** - * Establecer las rutas de la aplicación. - * Esta función establece las rutas del sistema de archivos y web de la aplicación. - * Las variables de clase definidas son $SERVERROOT, $WEBROOT y $SUBURI - */ - private function initPaths(): void - { - self::$SUBURI = '/'.basename($this->request->getServer('SCRIPT_FILENAME')); - - $uri = $this->request->getServer('REQUEST_URI'); - - $pos = strpos($uri, self::$SUBURI); - - if ($pos > 0) { - self::$WEBROOT = substr($uri, 0, $pos); - } - - self::$WEBURI = $this->request->getHttpHost().self::$WEBROOT; - } - /** * Cargar la configuración * - * @throws \SP\Core\Exceptions\ConfigException - * @throws \SP\Domain\Upgrade\Services\UpgradeException + * @throws ConfigException + * @throws UpgradeException */ private function initConfig(): void { @@ -326,7 +301,7 @@ abstract class BootstrapBase } /** - * @param string $class + * @param string $class * * @return object */ diff --git a/lib/SP/Core/Bootstrap/BootstrapWeb.php b/lib/SP/Core/Bootstrap/BootstrapWeb.php index bc53dc71..d60d9821 100644 --- a/lib/SP/Core/Bootstrap/BootstrapWeb.php +++ b/lib/SP/Core/Bootstrap/BootstrapWeb.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,6 +26,8 @@ namespace SP\Core\Bootstrap; use Closure; use Exception; +use Klein\Request; +use Klein\Response; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; @@ -35,6 +37,10 @@ use SP\Core\HttpModuleBase; use SP\Modules\Web\Init as InitWeb; use SP\Util\Filter; +use function SP\__; +use function SP\logger; +use function SP\processException; + /** * Bootstrap web interface */ @@ -73,14 +79,10 @@ final class BootstrapWeb extends BootstrapBase /** @noinspection PhpInconsistentReturnPointsInspection */ private function manageWebRequest(): Closure { - return function ($request, $response, $service) { - /** @var \Klein\Request $request */ - /** @var \Klein\Response $response */ - + return function (Request $request, Response $response) { try { logger('WEB route'); - /** @var \Klein\Request $request */ $route = Filter::getString($request->param('r', 'index/index')); if (!preg_match_all(self::ROUTE_REGEX, $route, $matches)) { @@ -99,7 +101,7 @@ final class BootstrapWeb extends BootstrapBase $this->initializePluginClasses(); if (!method_exists($controllerClass, $methodName)) { - logger($controllerClass.'::'.$methodName); + logger($controllerClass . '::' . $methodName); $response->code(404); @@ -139,4 +141,4 @@ final class BootstrapWeb extends BootstrapBase } }; } -} \ No newline at end of file +} diff --git a/lib/SP/Core/Bootstrap/UriContext.php b/lib/SP/Core/Bootstrap/UriContext.php new file mode 100644 index 00000000..8dbeb3c2 --- /dev/null +++ b/lib/SP/Core/Bootstrap/UriContext.php @@ -0,0 +1,79 @@ +. + */ + +namespace SP\Core\Bootstrap; + +use SP\Http\RequestInterface; + +/** + * Class UriContext + */ +final class UriContext implements UriContextInterface +{ + + private readonly string $subUri; + private readonly string $webRoot; + private readonly string $webUri; + + public function __construct(RequestInterface $request) + { + $this->subUri = $this->buildSubUri($request); + $this->webRoot = $this->buildWebRoot($request); + $this->webUri = $request->getHttpHost() . $this->webRoot; + } + + private function buildSubUri(RequestInterface $request): string + { + return '/' . basename($request->getServer('SCRIPT_FILENAME')); + } + + private function buildWebRoot(RequestInterface $request): string + { + $uri = $request->getServer('REQUEST_URI'); + + $pos = strpos($uri, $this->subUri); + + if ($pos > 0) { + return substr($uri, 0, $pos); + } + + return ''; + } + + public function getWebUri(): string + { + return $this->webUri; + } + + public function getWebRoot(): string + { + return $this->webRoot; + } + + public function getSubUri(): string + { + return $this->subUri; + } + +} diff --git a/lib/SP/Core/Bootstrap/UriContextInterface.php b/lib/SP/Core/Bootstrap/UriContextInterface.php new file mode 100644 index 00000000..91a4d97a --- /dev/null +++ b/lib/SP/Core/Bootstrap/UriContextInterface.php @@ -0,0 +1,47 @@ +. + */ + +namespace SP\Core\Bootstrap; + +/** + * Class UriContext + */ +interface UriContextInterface +{ + /** + * The full URL to reach the application (e.g. https://sub.example.com/syspass/) + * + * @return string + */ + public function getWebUri(): string; + + /** + * The current request path relative to the application root (e.g. files/index.php) + * + * @return string + */ + public function getWebRoot(): string; + + public function getSubUri(): string; +} diff --git a/lib/SP/Core/Definitions/CoreDefinitions.php b/lib/SP/Core/Definitions/CoreDefinitions.php index baba1d01..009f1230 100644 --- a/lib/SP/Core/Definitions/CoreDefinitions.php +++ b/lib/SP/Core/Definitions/CoreDefinitions.php @@ -32,6 +32,8 @@ use SP\Core\Acl\Acl; use SP\Core\Acl\Actions; use SP\Core\Acl\ActionsInterface; use SP\Core\Application; +use SP\Core\Bootstrap\UriContext; +use SP\Core\Bootstrap\UriContextInterface; use SP\Core\Context\ContextFactory; use SP\Core\Context\ContextInterface; use SP\Core\Crypt\Crypt; @@ -49,6 +51,10 @@ use SP\Core\MimeTypes; use SP\Core\MimeTypesInterface; use SP\Core\ProvidersHelper; use SP\Core\UI\Theme; +use SP\Core\UI\ThemeContext; +use SP\Core\UI\ThemeContextInterface; +use SP\Core\UI\ThemeIcons; +use SP\Core\UI\ThemeIconsInterface; use SP\Core\UI\ThemeInterface; use SP\Domain\Auth\Ports\LdapActionsInterface; use SP\Domain\Auth\Ports\LdapAuthInterface; @@ -114,6 +120,7 @@ final class CoreDefinitions return [ RequestInterface::class => create(Request::class) ->constructor(\Klein\Request::createFromGlobals(), autowire(CryptPKI::class)), + UriContextInterface::class => autowire(UriContext::class), ContextInterface::class => static fn() => ContextFactory::getForModule(APP_MODULE), ConfigInterface::class => create(ConfigFileService::class) @@ -128,8 +135,8 @@ final class CoreDefinitions static fn(ConfigInterface $config) => $config->getConfigData(), DatabaseConnectionData::class => factory([DatabaseConnectionData::class, 'getFromConfig']), DbStorageInterface::class => autowire(MysqlHandler::class), - Actions::class => - static fn() => new ActionsInterface( + ActionsInterface::class => + static fn() => new Actions( new FileCache(Actions::ACTIONS_CACHE_FILE), new XmlHandler(new FileHandler(ACTIONS_FILE)) ), @@ -140,12 +147,17 @@ final class CoreDefinitions ), Acl::class => autowire(Acl::class) ->constructorParameter('actions', get(Actions::class)), - ThemeInterface::class => autowire(Theme::class) + ThemeContextInterface::class => autowire(ThemeContext::class) + ->constructorParameter('basePath', VIEW_PATH) + ->constructorParameter('baseUri', factory([UriContextInterface::class, 'getWebRoot'])) ->constructorParameter('module', APP_MODULE) - ->constructorParameter( - 'fileCache', - create(FileCache::class)->constructor(Theme::ICONS_CACHE_FILE) + ->constructorParameter('name', factory([Theme::class, 'getThemeName'])), + ThemeIconsInterface::class => factory([ThemeIcons::class, 'loadIcons']) + ->parameter( + 'iconsCache', + create(FileCache::class)->constructor(ThemeIcons::ICONS_CACHE_FILE) ), + ThemeInterface::class => autowire(Theme::class), TemplateInterface::class => autowire(Template::class), DatabaseAuthInterface::class => autowire(DatabaseAuth::class), BrowserAuthInterface::class => autowire(BrowserAuth::class), diff --git a/lib/SP/Core/UI/Theme.php b/lib/SP/Core/UI/Theme.php index 273828d4..80351858 100644 --- a/lib/SP/Core/UI/Theme.php +++ b/lib/SP/Core/UI/Theme.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,16 +24,13 @@ namespace SP\Core\UI; -use SP\Core\Bootstrap\BootstrapBase; -use SP\Core\Context\ContextBase; use SP\Core\Context\ContextInterface; use SP\Core\Exceptions\InvalidClassException; use SP\Domain\Config\Ports\ConfigDataInterface; -use SP\Domain\Config\Ports\ConfigInterface; -use SP\Infrastructure\File\FileCacheInterface; use SP\Infrastructure\File\FileException; +use SP\Util\FileUtil; -defined('APP_ROOT') || die(); +use function SP\processException; /** * Class Theme @@ -42,154 +39,57 @@ defined('APP_ROOT') || die(); */ final class Theme implements ThemeInterface { - public const ICONS_CACHE_FILE = CACHE_PATH.DIRECTORY_SEPARATOR.'icons.cache'; - /** - * Cache expire time - */ - public const CACHE_EXPIRE = 86400; - private string $themeUri = ''; - private string $themePath = ''; - private string $themePathFull = ''; - private string $themeName = ''; - private string $viewsPath = ''; - private ?ThemeIcons $icons = null; - private ConfigDataInterface $configData; - private ContextInterface $context; - private string $module; - private FileCacheInterface $fileCache; - - /** - * Theme constructor. - * - * @param string $module - * @param \SP\Domain\Config\Ports\ConfigInterface $config - * @param ContextInterface $context - * @param FileCacheInterface $fileCache - */ public function __construct( - string $module, - ConfigInterface $config, - ContextInterface $context, - FileCacheInterface $fileCache + private readonly ThemeContextInterface $themeContext, + private readonly ThemeIconsInterface $icons ) { - $this->configData = $config->getConfigData(); - $this->context = $context; - $this->fileCache = $fileCache; - $this->module = $module; } - /** - * Inicializar el tema visual a utilizar - * - * @param bool $force Forzar la detección del tema para los inicios de sesión - * - * @throws InvalidClassException - */ - public function initTheme(bool $force): void + public static function getThemeName(ConfigDataInterface $configData, ContextInterface $context): ?string { - if (is_dir(VIEW_PATH)) { - if (empty($this->themeName) || $force === true) { - $this->themeName = $this->getUserTheme() ?: $this->getGlobalTheme(); - } + $name = $configData->getSiteTheme(); - $this->themeUri = BootstrapBase::$WEBURI.'/app/modules/'.$this->module.'themes'.$this->themeName; - $this->themePath = str_replace(APP_ROOT, '', VIEW_PATH).DIRECTORY_SEPARATOR.$this->themeName; - $this->themePathFull = VIEW_PATH.DIRECTORY_SEPARATOR.$this->themeName; - $this->viewsPath = $this->themePathFull.DIRECTORY_SEPARATOR.'views'; - - $this->initIcons(); - } - } - - /** - * Obtener el tema visual del usuario - */ - protected function getUserTheme(): ?string - { - return $this->context->isLoggedIn() ? $this->context->getUserData()->getPreferences()->getTheme() : null; - } - - /** - * Devolver el tema visual de sysPass desde la configuración - */ - protected function getGlobalTheme(): string - { - return $this->configData->getSiteTheme(); - } - - /** - * Inicializar los iconos del tema actual - * - * @throws InvalidClassException - */ - private function initIcons(): void - { - try { - if ($this->context->getAppStatus() !== ContextBase::APP_STATUS_RELOADED - && !$this->fileCache->isExpired(self::CACHE_EXPIRE) - ) { - $this->icons = $this->fileCache->load(); - - logger('Loaded icons cache', 'INFO'); - - return; - } - } catch (FileException $e) { - processException($e); + if ($context->isLoggedIn()) { + return $context->getUserData()->getPreferences()->getTheme() ?? $name; } - $this->saveIcons(); - - } - - /** - * @throws InvalidClassException - */ - private function saveIcons(): void - { - $iconsClass = $this->themePathFull.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'Icons.php'; - - if (file_exists($iconsClass)) { - if (!($this->icons = require $iconsClass) instanceof ThemeIcons) { - throw new InvalidClassException(__u('Invalid icons class')); - } - - try { - $this->fileCache->save($this->icons); - - logger('Saved icons cache', 'INFO'); - } catch (FileException $e) { - processException($e); - } - } + return $name; } /** * Obtener los temas disponibles desde el directorio de temas */ - public function getThemesAvailable(): array + public function getAvailable(): array { + $directory = $this->themeContext->getViewsDirectory(); $themesAvailable = []; - $themesDirs = dir(VIEW_PATH); + while (false !== ($themeDir = $directory->read())) { + if (is_dir($themeDir) && $themeDir !== '.' && $themeDir !== '..') { + try { + $themeInfo = FileUtil::require( + FileUtil::buildPath($this->themeContext->getViewsPath(), $themeDir, 'index.php') + ); - while (false !== ($themeDir = $themesDirs->read())) { - if ($themeDir !== '.' && $themeDir !== '..') { - $themeFile = VIEW_PATH.DIRECTORY_SEPARATOR.$themeDir.DIRECTORY_SEPARATOR.'index.php'; - - if (file_exists($themeFile)) { - $themeInfo = require $themeFile; - - $themesAvailable[$themeDir] = $themeInfo['name']; + if (is_array($themeInfo) && isset($themeInfo['name'])) { + $themesAvailable[$themeDir] = $themeInfo['name']; + } + } catch (InvalidClassException|FileException $e) { + processException($e); } } } - $themesDirs->close(); + $directory->close(); return $themesAvailable; } + public function getViewsPath(): string + { + return $this->themeContext->getViewsPath(); + } + /** * Obtener la información del tema desde el archivo de información * @@ -201,43 +101,33 @@ final class Theme implements ThemeInterface * 'css' => array * ) */ - public function getThemeInfo(): array + public function getInfo(): array { - $themeFile = $this->themePathFull.DIRECTORY_SEPARATOR.'index.php'; - - if (file_exists($themeFile)) { - $themeInfo = include $themeFile; + try { + $themeInfo = FileUtil::require(FileUtil::buildPath($this->themeContext->getFullPath(), 'index.php')); if (is_array($themeInfo)) { return $themeInfo; } + } catch (InvalidClassException|FileException $e) { + processException($e); } return []; } - public function getThemeUri(): string + public function getUri(): string { - return $this->themeUri; + return $this->themeContext->getUri(); } - public function getThemePath(): string + public function getPath(): string { - return $this->themePath; + return $this->themeContext->getPath(); } - public function getThemeName(): string - { - return $this->themeName; - } - - public function getIcons(): ThemeIcons + public function getIcons(): ThemeIconsInterface { return clone $this->icons; } - - public function getViewsPath(): string - { - return $this->viewsPath; - } } diff --git a/lib/SP/Core/UI/ThemeContext.php b/lib/SP/Core/UI/ThemeContext.php new file mode 100644 index 00000000..7630079c --- /dev/null +++ b/lib/SP/Core/UI/ThemeContext.php @@ -0,0 +1,92 @@ +. + */ + +namespace SP\Core\UI; + +use Directory; +use SP\Util\FileUtil; + +/** + * Class ThemeContext + */ +final class ThemeContext implements ThemeContextInterface +{ + + private string $fullPath; + private string $path; + private string $viewsPath; + private string $uri; + + public function __construct( + string $basePath, + string $baseUri, + private readonly string $module, + private readonly string $name + ) { + $this->fullPath = FileUtil::buildPath($basePath, $name); + $this->path = FileUtil::buildPath(str_replace(APP_ROOT, '', $basePath), $name); + $this->viewsPath = FileUtil::buildPath($this->fullPath, 'views'); + $this->uri = sprintf( + '%s/app/modules/%sthemes%s', + $baseUri, + $module, + $name + ); + } + + public function getModule(): string + { + return $this->module; + } + + public function getName(): string + { + return $this->name; + } + + public function getFullPath(): string + { + return $this->fullPath; + } + + public function getPath(): string + { + return $this->path; + } + + public function getViewsPath(): string + { + return $this->viewsPath; + } + + public function getViewsDirectory(): Directory + { + return dir($this->viewsPath); + } + + public function getUri(): string + { + return $this->uri; + } +} diff --git a/lib/SP/Core/UI/ThemeContextInterface.php b/lib/SP/Core/UI/ThemeContextInterface.php new file mode 100644 index 00000000..26d6ef70 --- /dev/null +++ b/lib/SP/Core/UI/ThemeContextInterface.php @@ -0,0 +1,47 @@ +. + */ + +namespace SP\Core\UI; + +use Directory; + +/** + * Class ThemeContext + */ +interface ThemeContextInterface +{ + public function getModule(): string; + + public function getName(): string; + + public function getFullPath(): string; + + public function getPath(): string; + + public function getViewsPath(); + + public function getUri(): string; + + public function getViewsDirectory(): Directory; +} diff --git a/lib/SP/Core/UI/ThemeIcons.php b/lib/SP/Core/UI/ThemeIcons.php index d449608b..3542f5db 100644 --- a/lib/SP/Core/UI/ThemeIcons.php +++ b/lib/SP/Core/UI/ThemeIcons.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,29 +24,73 @@ namespace SP\Core\UI; +use SP\Core\Context\ContextBase; +use SP\Core\Context\ContextInterface; +use SP\Core\Exceptions\InvalidClassException; use SP\Html\Assets\FontIcon; use SP\Html\Assets\IconInterface; +use SP\Infrastructure\File\FileCache; +use SP\Infrastructure\File\FileException; +use SP\Util\FileUtil; -defined('APP_ROOT') || die(); +use function SP\logger; +use function SP\processException; /** - * Class ThemeIconsBase para la implementación de los iconos del tema visual + * Class ThemeIcons * - * @package SP\Core */ -final class ThemeIcons +final class ThemeIcons implements ThemeIconsInterface { + public const CACHE_EXPIRE = 86400; + public const ICONS_CACHE_FILE = CACHE_PATH . DIRECTORY_SEPARATOR . 'icons.cache'; + /** * @var IconInterface[] */ private array $icons = []; /** - * @return IconInterface + * @param ContextInterface $context + * @param FileCache $cache + * @param ThemeContextInterface $themeContext + * @return ThemeIconsInterface + * @throws InvalidClassException + * @throws FileException */ - public function getIconWarning() + public static function loadIcons( + ContextInterface $context, + FileCache $cache, + ThemeContextInterface $themeContext + ): ThemeIconsInterface { + try { + if ($context->getAppStatus() !== ContextBase::APP_STATUS_RELOADED + && !$cache->isExpired(self::CACHE_EXPIRE) + ) { + return $cache->load(); + // logger('Loaded icons cache', 'INFO'); + } + + $icons = FileUtil::require( + FileUtil::buildPath($themeContext->getFullPath(), 'inc', 'Icons.php'), + ThemeIconsInterface::class + ); + + $cache->save($icons); + + logger('Saved icons cache', 'INFO'); + + return $icons; + } catch (FileException $e) { + processException($e); + + throw $e; + } + } + + public function __call(string $name, ?array $arguments = null): IconInterface { - return $this->getIconByName('warning'); + return $this->getIconByName($name); } /** @@ -54,338 +98,17 @@ final class ThemeIcons * * @return IconInterface */ - public function getIconByName(string $name) + public function getIconByName(string $name): IconInterface { - return $this->icons[$name] - ?? new FontIcon($name, 'mdl-color-text--indigo-A200'); + return $this->icons[$name] ?? new FontIcon($name, 'mdl-color-text--indigo-A200'); } /** - * @return IconInterface - */ - public function getIconDownload() - { - return $this->getIconByName('download'); - } - - /** - * @return IconInterface - */ - public function getIconClear() - { - return $this->getIconByName('clear'); - } - - /** - * @return IconInterface - */ - public function getIconPlay() - { - return $this->getIconByName('play'); - } - - /** - * @return IconInterface - */ - public function getIconHelp() - { - return $this->getIconByName('help'); - } - - /** - * @return IconInterface - */ - public function getIconPublicLink() - { - return $this->getIconByName('publicLink'); - } - - /** - * @return IconInterface - */ - public function getIconBack() - { - return $this->getIconByName('back'); - } - - /** - * @return IconInterface - */ - public function getIconRestore() - { - return $this->getIconByName('restore'); - } - - /** - * @return IconInterface - */ - public function getIconSave() - { - return $this->getIconByName('save'); - } - - /** - * @return IconInterface - */ - public function getIconUp() - { - return $this->getIconByName('up'); - } - - /** - * @return IconInterface - */ - public function getIconDown() - { - return $this->getIconByName('down'); - } - - /** - * @return IconInterface - */ - public function getIconViewPass() - { - return $this->getIconByName('viewPass'); - } - - /** - * @return IconInterface - */ - public function getIconCopy() - { - return $this->getIconByName('copy'); - } - - /** - * @return IconInterface - */ - public function getIconClipboard() - { - return $this->getIconByName('clipboard'); - } - - /** - * @return IconInterface - */ - public function getIconEmail() - { - return $this->getIconByName('email'); - } - - /** - * @return IconInterface - */ - public function getIconRefresh() - { - return $this->getIconByName('refresh'); - } - - /** - * @return IconInterface - */ - public function getIconEditPass() - { - return $this->getIconByName('editPass'); - } - - /** - * @return IconInterface - */ - public function getIconAppAdmin() - { - return $this->getIconByName('appAdmin'); - } - - /** - * @return IconInterface - */ - public function getIconAccAdmin() - { - return $this->getIconByName('accAdmin'); - } - - /** - * @return IconInterface - */ - public function getIconLdapUser() - { - return $this->getIconByName('ldapUser'); - } - - /** - * @return IconInterface - */ - public function getIconDisabled() - { - return $this->getIconByName('disabled'); - } - - /** - * @return IconInterface - */ - public function getIconNavPrev() - { - return $this->getIconByName('previous'); - } - - /** - * @return IconInterface - */ - public function getIconNavNext() - { - return $this->getIconByName('next'); - } - - /** - * @return IconInterface - */ - public function getIconNavFirst() - { - return $this->getIconByName('first'); - } - - /** - * @return IconInterface - */ - public function getIconNavLast() - { - return $this->getIconByName('last'); - } - - /** - * @return IconInterface - */ - public function getIconAdd() - { - return $this->getIconByName('add'); - } - - /** - * @return IconInterface - */ - public function getIconView() - { - return $this->getIconByName('view'); - } - - /** - * @return IconInterface - */ - public function getIconEdit() - { - return $this->getIconByName('edit'); - } - - /** - * @return IconInterface - */ - public function getIconDelete() - { - return $this->getIconByName('delete'); - } - - /** - * @return IconInterface - */ - public function getIconOptional() - { - return $this->getIconByName('optional'); - } - - /** - * @return IconInterface - */ - public function getIconCheck() - { - return $this->getIconByName('check'); - } - - /** - * @return IconInterface - */ - public function getIconSearch() - { - return $this->getIconByName('search'); - } - - /** - * @return IconInterface - */ - public function getIconAccount() - { - return $this->getIconByName('account'); - } - - /** - * @return IconInterface - */ - public function getIconGroup() - { - return $this->getIconByName('group'); - } - - /** - * @return IconInterface - */ - public function getIconSettings() - { - return $this->getIconByName('settings'); - } - - /** - * @return IconInterface - */ - public function getIconHeadline() - { - return $this->getIconByName('headline'); - } - - /** - * @return IconInterface - */ - public function getIconInfo() - { - return $this->getIconByName('info'); - } - - /** - * @return IconInterface - */ - public function getIconCritical() - { - return $this->getIconByName('critical'); - } - - /** - * @return IconInterface - */ - public function getIconEnabled() - { - return $this->getIconByName('enabled'); - } - - /** - * @return IconInterface - */ - public function getIconNotices() - { - return $this->getIconByName('notices'); - } - - /** - * @return IconInterface - */ - public function getIconRemove() - { - return $this->getIconByName('remove'); - } - - /** - * @param string $alias + * @param string $alias * @param IconInterface $icon */ public function addIcon(string $alias, IconInterface $icon): void { $this->icons[$alias] = $icon; } -} \ No newline at end of file +} diff --git a/lib/SP/Core/UI/ThemeIconsInterface.php b/lib/SP/Core/UI/ThemeIconsInterface.php index 146c3afe..92ccfb1a 100644 --- a/lib/SP/Core/UI/ThemeIconsInterface.php +++ b/lib/SP/Core/UI/ThemeIconsInterface.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,17 +24,71 @@ namespace SP\Core\UI; -defined('APP_ROOT') || die(); +use SP\Core\Context\ContextInterface; +use SP\Html\Assets\IconInterface; +use SP\Infrastructure\File\FileCache; /** - * Interface ThemeIconsInterface + * Class ThemeIcons + * + * @method IconInterface warning + * @method IconInterface download + * @method IconInterface clear + * @method IconInterface play + * @method IconInterface help + * @method IconInterface publicLink + * @method IconInterface back + * @method IconInterface restore + * @method IconInterface save + * @method IconInterface up + * @method IconInterface down + * @method IconInterface viewPass + * @method IconInterface copy + * @method IconInterface clipboard + * @method IconInterface email + * @method IconInterface refresh + * @method IconInterface editPass + * @method IconInterface appAdmin + * @method IconInterface accAdmin + * @method IconInterface ldapUser + * @method IconInterface disabled + * @method IconInterface navPrev + * @method IconInterface navNext + * @method IconInterface navFirst + * @method IconInterface navLast + * @method IconInterface add + * @method IconInterface view + * @method IconInterface edit + * @method IconInterface delete + * @method IconInterface optional + * @method IconInterface check + * @method IconInterface search + * @method IconInterface account + * @method IconInterface group + * @method IconInterface settings + * @method IconInterface info + * @method IconInterface enabled + * @method IconInterface remove * - * @package SP\Core */ interface ThemeIconsInterface { + public static function loadIcons( + ContextInterface $context, + FileCache $cache, + ThemeContextInterface $themeContext + ): ThemeIconsInterface; + /** - * @return mixed + * @param string $name + * + * @return IconInterface */ - public function setIcons(); -} \ No newline at end of file + public function getIconByName(string $name): IconInterface; + + /** + * @param string $alias + * @param IconInterface $icon + */ + public function addIcon(string $alias, IconInterface $icon): void; +} diff --git a/lib/SP/Core/UI/ThemeInterface.php b/lib/SP/Core/UI/ThemeInterface.php index 58408d9b..bbff8ca5 100644 --- a/lib/SP/Core/UI/ThemeInterface.php +++ b/lib/SP/Core/UI/ThemeInterface.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -31,19 +31,12 @@ namespace SP\Core\UI; */ interface ThemeInterface { - /** - * @param bool $force Forzar la detección del tema para los inicios de sesión - * - * @return mixed - */ - public function initTheme(bool $force): void; - /** * Obtener los temas disponibles desde el directorio de temas * * @return array Con la información del tema */ - public function getThemesAvailable(): array; + public function getAvailable(): array; /** * Obtener la información del tema desde el archivo de información @@ -56,30 +49,25 @@ interface ThemeInterface * 'css' => array * ) */ - public function getThemeInfo(): array; + public function getInfo(): array; /** * @return string */ - public function getThemeUri(): string; + public function getUri(): string; /** * @return string */ - public function getThemePath(): string; + public function getPath(): string; /** - * @return string + * @return ThemeIconsInterface */ - public function getThemeName(): string; - - /** - * @return ThemeIcons - */ - public function getIcons(): ThemeIcons; + public function getIcons(): ThemeIconsInterface; /** * @return string */ public function getViewsPath(): string; -} \ No newline at end of file +} diff --git a/lib/SP/Domain/Auth/Services/LoginService.php b/lib/SP/Domain/Auth/Services/LoginService.php index 9b90f47b..a0e30174 100644 --- a/lib/SP/Domain/Auth/Services/LoginService.php +++ b/lib/SP/Domain/Auth/Services/LoginService.php @@ -33,6 +33,7 @@ use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ConstraintException; +use SP\Core\Exceptions\InvalidArgumentException; use SP\Core\Exceptions\QueryException; use SP\Core\Exceptions\SPException; use SP\Core\LanguageInterface; @@ -96,8 +97,8 @@ final class LoginService extends Service implements LoginServiceInterface private UserProfileServiceInterface $userProfileService; /** - * @throws \SP\Core\Exceptions\InvalidArgumentException - * @throws \SP\Domain\Auth\Services\AuthException + * @throws InvalidArgumentException + * @throws AuthException */ public function __construct( Application $application, @@ -442,11 +443,7 @@ final class LoginService extends Service implements LoginServiceInterface private function loadUserPreferences(): void { $this->language->setLanguage(true); - - $this->theme->initTheme(true); - $this->context->setAuthCompleted(true); - $this->eventDispatcher->notify('login.preferences.load', new Event($this)); } diff --git a/lib/SP/Util/FileUtil.php b/lib/SP/Util/FileUtil.php index a5a89b20..7ad0fe8d 100644 --- a/lib/SP/Util/FileUtil.php +++ b/lib/SP/Util/FileUtil.php @@ -28,7 +28,12 @@ use FilesystemIterator; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; use SP\Core\Exceptions\FileNotFoundException; +use SP\Core\Exceptions\InvalidClassException; use SP\DataModel\FileData; +use SP\Infrastructure\File\FileException; + +use function SP\__; +use function SP\__u; /** * Class FileUtil @@ -79,4 +84,39 @@ class FileUtil { return in_array(strtolower($fileData->getType()), self::IMAGE_MIME, true); } + + /** + * Return a well-formed path + * + * @param string ...$parts + * @return string + */ + public static function buildPath(string ...$parts): string + { + return implode(DIRECTORY_SEPARATOR, $parts); + } + + /** + * @template T + * @param string $file + * @param class-string|null $class + * + * @return null|T + * @throws FileException + * @throws InvalidClassException + */ + public static function require(string $file, ?string $class = null): mixed + { + if (file_exists($file)) { + $out = require $file; + + if ($class !== null && class_exists($class) && !$out instanceof $class) { + throw new InvalidClassException(__u('Invalid class for loaded file data')); + } + + return $out; + } else { + throw new FileException(sprintf(__('File not found: %s'), $file)); + } + } } diff --git a/tests/SP/Core/UI/ThemeTest.php b/tests/SP/Core/UI/ThemeTest.php new file mode 100644 index 00000000..c1de92a7 --- /dev/null +++ b/tests/SP/Core/UI/ThemeTest.php @@ -0,0 +1,188 @@ +. + */ + +namespace SP\Tests\Core\UI; + +use Directory; +use PHPUnit\Framework\MockObject\Exception; +use PHPUnit\Framework\MockObject\MockObject; +use SP\Core\Context\ContextException; +use SP\Core\Context\SessionContextInterface; +use SP\Core\UI\Theme; +use SP\Core\UI\ThemeContextInterface; +use SP\Core\UI\ThemeIconsInterface; +use SP\Domain\User\Services\UserLoginResponse; +use SP\Tests\Generators\UserDataGenerator; +use SP\Tests\UnitaryTestCase; + +/** + * Class ThemeTest + * + * @group unitary + */ +class ThemeTest extends UnitaryTestCase +{ + + private ThemeContextInterface|MockObject $themeContext; + private ThemeIconsInterface|MockObject $themeIcons; + private Theme $theme; + + public function testGetIcons() + { + $expected = spl_object_id($this->themeIcons); + $current = spl_object_id($this->theme->getIcons()); + + $this->assertNotEquals($expected, $current); + } + + /** + * @throws Exception + */ + public function testGetThemeNameUnathenticated() + { + $context = $this->createMock(SessionContextInterface::class); + $context->expects(self::once()) + ->method('isLoggedIn') + ->willReturn(false); + + $context->expects(self::never()) + ->method('getUserData'); + + $configData = $this->config->getConfigData(); + $configData->setSiteTheme(self::$faker->colorName); + + $current = Theme::getThemeName($this->config->getConfigData(), $context); + + $this->assertEquals($configData->getSiteTheme(), $current); + } + + /** + * @throws Exception + */ + public function testGetThemeNameAuthenticated() + { + $context = $this->createMock(SessionContextInterface::class); + $context->expects(self::once()) + ->method('isLoggedIn') + ->willReturn(true); + + $userLoginResponse = new UserLoginResponse(); + $userPreferencesData = UserDataGenerator::factory()->buildUserPreferencesData(); + + $userLoginResponse->setPreferences($userPreferencesData); + + $context->expects(self::once()) + ->method('getUserData') + ->willReturn($userLoginResponse); + + $configData = $this->config->getConfigData(); + $configData->setSiteTheme(self::$faker->colorName); + + $current = Theme::getThemeName($this->config->getConfigData(), $context); + + $this->assertEquals($userPreferencesData->getTheme(), $current); + } + + public function testGetViewsPath() + { + $path = self::$faker->filePath(); + $this->themeContext + ->expects(self::once()) + ->method('getViewsPath') + ->willReturn($path); + + $this->assertEquals($path, $this->theme->getViewsPath()); + } + + public function testGetInfo() + { + $this->themeContext + ->expects(self::once()) + ->method('getFullPath') + ->willReturn(self::$faker->filePath()); + + $this->assertEquals([], $this->theme->getInfo()); + } + + public function testGetUri() + { + $url = self::$faker->url(); + $this->themeContext + ->expects(self::once()) + ->method('getUri') + ->willReturn($url); + + $this->assertEquals($url, $this->theme->getUri()); + } + + /** + * @throws Exception + */ + public function testGetAvailable() + { + $dirname = self::$faker->filePath(); + + $dir = $this->createMock(Directory::class); + $dir->expects(self::exactly(2)) + ->method('read') + ->willReturn('/tmp', false); + + $this->themeContext + ->expects(self::once()) + ->method('getViewsDirectory') + ->willReturn($dir); + + $this->themeContext + ->expects(self::once()) + ->method('getViewsPath') + ->willReturn('/tmp/themes'); + + $this->theme->getAvailable(); + } + + public function testGetPath() + { + $path = self::$faker->filePath(); + $this->themeContext + ->expects(self::once()) + ->method('getPath') + ->willReturn($path); + + $this->assertEquals($path, $this->theme->getPath()); + } + + /** + * @throws ContextException + * @throws Exception + */ + protected function setUp(): void + { + parent::setUp(); + + $this->themeContext = $this->createMock(ThemeContextInterface::class); + $this->themeIcons = $this->createMock(ThemeIconsInterface::class); + + $this->theme = new Theme($this->themeContext, $this->themeIcons); + } +}
    -
    +
    -
    +
    - +
    getIconHelp()->getIcon(); ?>
    + class="icon material-icons help()->getClass(); ?>">help()->getIcon(); ?>

    - +