4
0

update 2023-07-20 19:20:31

This commit is contained in:
Robot 2023-07-20 19:20:31 +02:00
parent f5cb5ef4de
commit 17d09272e1
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
4 changed files with 15 additions and 14 deletions

View File

@ -18,8 +18,8 @@ class Linker << (F,LightGreen) >> #Green {
+ __construct(Load $load, Insert $insert, ...) + __construct(Load $load, Insert $insert, ...)
+ get() : ?string + get() : ?string
+ active(bool $setup = true) : ?string + active(bool $setup = true) : ?string
+ set(string $linker) : ?string + set(string $linker) : bool
+ access(string $linker, string $pass, ...) : bool + access(string $linker, string $pass, ...) : ?array
- hasAccess(string $linker, string $pass) : bool - hasAccess(string $linker, string $pass) : bool
- getPassGuid(string $linker, string $pass) : ?string - getPassGuid(string $linker, string $pass) : ?string
- getPassword(string $linker, string $pass) : ?object - getPassword(string $linker, string $pass) : ?object
@ -57,14 +57,14 @@ note left of Linker::set
Set Active Linker Set Active Linker
since: 2.0.1 since: 2.0.1
return: ?string return: bool
end note end note
note right of Linker::access note right of Linker::access
Set Access Set Access
since: 2.0.1 since: 2.0.1
return: bool return: ?array
arguments: arguments:
string $linker string $linker

View File

@ -13,6 +13,7 @@ namespace VDM\Joomla\GetBible;
use Joomla\CMS\User\UserHelper; use Joomla\CMS\User\UserHelper;
use Joomla\CMS\Language\Text;
use VDM\Joomla\GetBible\Database\Load; use VDM\Joomla\GetBible\Database\Load;
use VDM\Joomla\GetBible\Database\Insert; use VDM\Joomla\GetBible\Database\Insert;
use VDM\Joomla\GetBible\Database\Update; use VDM\Joomla\GetBible\Database\Update;
@ -95,7 +96,7 @@ final class Linker
} }
if (($access = $this->session->get("getbible_active_{$linker}", null)) === null if (($access = $this->session->get("getbible_active_{$linker}", null)) === null
|| $access === 'valid_access') || $access !== 'valid_access')
{ {
return null; return null;
} }
@ -137,7 +138,7 @@ final class Linker
* @return bool True on success * @return bool True on success
* @since 2.0.1 * @since 2.0.1
**/ **/
public function set(string $linker): ?string public function set(string $linker): bool
{ {
if (!GuidHelper::valid($linker)) if (!GuidHelper::valid($linker))
{ {
@ -156,10 +157,10 @@ final class Linker
* @param string $pass The linker pass value * @param string $pass The linker pass value
* @param string|null $oldPass The linker old pass value * @param string|null $oldPass The linker old pass value
* *
* @return bool True on success * @return array|null The success or error details
* @since 2.0.1 * @since 2.0.1
**/ **/
public function access(string $linker, string $pass, ?string $oldPass): bool public function access(string $linker, string $pass, ?string $oldPass): ?array
{ {
// password to short // password to short
if (strlen($pass) <= 3) if (strlen($pass) <= 3)

View File

@ -66,7 +66,7 @@
} }
if (($access = $this->session->get("getbible_active_{$linker}", null)) === null if (($access = $this->session->get("getbible_active_{$linker}", null)) === null
|| $access === 'valid_access') || $access !== 'valid_access')
{ {
return null; return null;
} }
@ -108,7 +108,7 @@
* @return bool True on success * @return bool True on success
* @since 2.0.1 * @since 2.0.1
**/ **/
public function set(string $linker): ?string public function set(string $linker): bool
{ {
if (!GuidHelper::valid($linker)) if (!GuidHelper::valid($linker))
{ {
@ -127,10 +127,10 @@
* @param string $pass The linker pass value * @param string $pass The linker pass value
* @param string|null $oldPass The linker old pass value * @param string|null $oldPass The linker old pass value
* *
* @return bool True on success * @return array|null The success or error details
* @since 2.0.1 * @since 2.0.1
**/ **/
public function access(string $linker, string $pass, ?string $oldPass): bool public function access(string $linker, string $pass, ?string $oldPass): ?array
{ {
// password to short // password to short
if (strlen($pass) <= 3) if (strlen($pass) <= 3)

View File

@ -34,6 +34,6 @@
"namespace": "VDM\\Joomla\\GetBible\\Linker", "namespace": "VDM\\Joomla\\GetBible\\Linker",
"description": "The GetBible Linker\r\n\r\n@since 2.0.1", "description": "The GetBible Linker\r\n\r\n@since 2.0.1",
"licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/getBible>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/getBible>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "use Joomla\\CMS\\User\\UserHelper;", "head": "use Joomla\\CMS\\User\\UserHelper;\r\nuse Joomla\\CMS\\Language\\Text;",
"composer": "" "composer": ""
} }