4
0

update 2023-08-01 17:39:32

This commit is contained in:
Robot 2023-08-01 17:39:32 +02:00
parent 7e7466b02e
commit bdd414c22f
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
3 changed files with 74 additions and 12 deletions

View File

@ -22,6 +22,7 @@ class Linker << (F,LightGreen) >> #Green {
+ active(bool $setup = true) : ?string
+ activeDetails(bool $setup = true) : ?array
+ valid(string $linker) : bool
+ authenticated(string $linker) : array
+ trigger(string $linker) : bool
+ set(string $linker) : bool
+ revokeSession(string $linker) : ?array
@ -83,35 +84,42 @@ note left of Linker::valid
return: bool
end note
note right of Linker::trigger
note right of Linker::authenticated
Check if the linker is authenticated
since: 2.0.1
return: array
end note
note left of Linker::trigger
The Share His Word Trigger
since: 2.0.1
return: bool
end note
note left of Linker::set
note right of Linker::set
Set Active Linker
since: 2.0.1
return: bool
end note
note right of Linker::revokeSession
note left of Linker::revokeSession
Revoke Linker Session
since: 2.0.1
return: ?array
end note
note left of Linker::setName
note right of Linker::setName
Set a linker name
since: 2.0.1
return: ?array
end note
note right of Linker::access
note left of Linker::access
Set Access
since: 2.0.1
@ -123,49 +131,49 @@ note right of Linker::access
?string $oldPass
end note
note left of Linker::revoke
note right of Linker::revoke
Revoke Access
since: 2.0.1
return: ?array
end note
note right of Linker::hasAccess
note left of Linker::hasAccess
Has Access
since: 2.0.1
return: bool
end note
note left of Linker::getPassGuid
note right of Linker::getPassGuid
Get Password GUID
since: 2.0.1
return: ?string
end note
note right of Linker::getPassword
note left of Linker::getPassword
Get Password
since: 2.0.1
return: ?object
end note
note left of Linker::setLinker
note right of Linker::setLinker
Set Linker
since: 2.0.1
return: bool
end note
note right of Linker::setPassword
note left of Linker::setPassword
Set Password
since: 2.0.1
return: bool
end note
note left of Linker::getGuid
note right of Linker::getGuid
Get a GUID
since: 2.0.1

View File

@ -199,6 +199,33 @@ final class Linker
return false;
}
/**
* Check if the linker is authenticated
*
* @param string $linker The linker GUID value
*
* @return array Linker authenticated message
* @since 2.0.1
**/
public function authenticated(string $linker): array
{
if (($access = $this->session->get("getbible_active_{$linker}", null)) === null
|| $access !== 'valid_access')
{
return ['error' => Text::_('COM_GETBIBLE_SESSION_NOT_ACTIVE')];
}
// get current session
$current = $this->session->get('getbible_active_linker_guid', null);
if (strcasecmp($linker, $current) == 0)
{
return ['success' => Text::_('COM_GETBIBLE_SESSION_ACTIVE'), 'status' => true];
}
return ['success' => Text::_('COM_GETBIBLE_SESSION_ACTIVE'), 'status' => false];
}
/**
* The Share His Word Trigger
*

View File

@ -169,6 +169,33 @@
return false;
}
/**
* Check if the linker is authenticated
*
* @param string $linker The linker GUID value
*
* @return array Linker authenticated message
* @since 2.0.1
**/
public function authenticated(string $linker): array
{
if (($access = $this->session->get("getbible_active_{$linker}", null)) === null
|| $access !== 'valid_access')
{
return ['error' => Text::_('Session not active.')];
}
// get current session
$current = $this->session->get('getbible_active_linker_guid', null);
if (strcasecmp($linker, $current) == 0)
{
return ['success' => Text::_('Session active.'), 'status' => true];
}
return ['success' => Text::_('Session active.'), 'status' => false];
}
/**
* The Share His Word Trigger
*