From 39a878f2c880b35aaa21520806055bf29900ff09 Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Sun, 3 Mar 2024 01:41:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D0=B0=20=D1=81=20oauth=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../administrator/forms/client.xml | 46 ++++++-- .../language/ru-RU/ru-RU.com_oauthserver.ini | 4 + .../administrator/src/Model/ClientsModel.php | 2 +- .../src/View/Clients/HtmlView.php | 3 +- .../administrator/tmpl/clients/default.php | 105 ++++++++++++++++++ 5 files changed, 149 insertions(+), 11 deletions(-) diff --git a/com_oauthserver/administrator/forms/client.xml b/com_oauthserver/administrator/forms/client.xml index f904869..f8688c6 100644 --- a/com_oauthserver/administrator/forms/client.xml +++ b/com_oauthserver/administrator/forms/client.xml @@ -4,20 +4,48 @@
- - + + + + + + + + + + - + + label="COM_OAUTHSERVER_CLIENT_SECRET_LABEL" + description="COM_OAUTHSERVER_CLIENT_SECRET_DESCRIPTION"/>
\ No newline at end of file diff --git a/com_oauthserver/administrator/language/ru-RU/ru-RU.com_oauthserver.ini b/com_oauthserver/administrator/language/ru-RU/ru-RU.com_oauthserver.ini index e69de29..c541565 100644 --- a/com_oauthserver/administrator/language/ru-RU/ru-RU.com_oauthserver.ini +++ b/com_oauthserver/administrator/language/ru-RU/ru-RU.com_oauthserver.ini @@ -0,0 +1,4 @@ +COM_OAUTHSERVER_CLIENTS_HEADING_NAME = "Клиент" +COM_OAUTHSERVER_CLIENTS_HEADING_IDENTIFIER = "ID клиента" +COM_OAUTHSERVER_CLIENTS_HEADING_SECRET = "Ключ" +COM_OAUTHSERVER_CLIENTS_HEADING_PUBLIC = "Публичный" \ No newline at end of file diff --git a/com_oauthserver/administrator/src/Model/ClientsModel.php b/com_oauthserver/administrator/src/Model/ClientsModel.php index b857a80..d78cfa3 100644 --- a/com_oauthserver/administrator/src/Model/ClientsModel.php +++ b/com_oauthserver/administrator/src/Model/ClientsModel.php @@ -96,7 +96,7 @@ class ClientsModel extends ListModel $query = $db->getQuery(true); - $query->select(['client.id', 'client.client_name', 'client.client_token', 'client.client_id',]) + $query->select(['client.id', 'client.name', 'client.secret', 'client.identifier', 'client.public', 'client.redirect_uri', 'client.allow_plain_text_pkce']) ->from($db->qn('#__webmasterskaya_oauthserver_clients', 'client')); // Filter by search state diff --git a/com_oauthserver/administrator/src/View/Clients/HtmlView.php b/com_oauthserver/administrator/src/View/Clients/HtmlView.php index 6bd8052..0914812 100644 --- a/com_oauthserver/administrator/src/View/Clients/HtmlView.php +++ b/com_oauthserver/administrator/src/View/Clients/HtmlView.php @@ -9,6 +9,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Pagination\Pagination; +use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Toolbar\ToolbarFactoryInterface; use Joomla\CMS\Toolbar\ToolbarHelper; @@ -117,7 +118,7 @@ class HtmlView extends \Joomla\CMS\MVC\View\HtmlView $canDo = ContentHelper::getActions('com_oauthserver', 'clients'); $user = $this->getCurrentUser(); - $toolbar = Factory::getContainer()->get(ToolbarFactoryInterface::class)->createToolbar('toolbar'); + $toolbar = Toolbar::getInstance('toolbar'); // Set page title ToolbarHelper::title(Text::_('COM_OAUTHSERVER') . ': ' . Text::_('COM_OAUTHSERVER_CLIENTS')); diff --git a/com_oauthserver/administrator/tmpl/clients/default.php b/com_oauthserver/administrator/tmpl/clients/default.php index a4abe2d..19cc05d 100644 --- a/com_oauthserver/administrator/tmpl/clients/default.php +++ b/com_oauthserver/administrator/tmpl/clients/default.php @@ -1,2 +1,107 @@ document->getWebAssetManager(); +$wa->useScript('table.columns') + ->useScript('multiselect'); +$user = Factory::getApplication()->getIdentity(); +$userId = $user->get('id'); +$listOrder = $this->escape($this->state->get('list.ordering')); +$listDirn = $this->escape($this->state->get('list.direction')); +?> + +
+ +
+
+
+ $this]); + ?> + items)) : ?> +
+ + +
+ + + + + + + + + + + + + + + items as $i => $item) : ?> + + authorise('core.create', 'com_oauthserver.clients'); + $canEdit = $user->authorise('core.edit', 'com_oauthserver.clients'); + $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || is_null($item->checked_out); + $canChange = $user->authorise('core.edit.state', 'com_oauthserver.clients') && $canCheckin; ?> + + + + + + + + + + +
+ , + , + +
+ + + + + + + + + + + +
+ id, false, 'cid', 'cb', $item->name); ?> + + name; ?> + + identifier; ?> + + secret; ?> + + public ? 'JYES' : 'JNO'); ?> + + id; ?> +
+ +
+
+
+ + + + +
\ No newline at end of file