4
0

update 2023-07-28 11:15:40

This commit is contained in:
Robot 2023-07-28 11:15:40 +02:00
parent e4c2212070
commit 76808959d3
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
3 changed files with 86 additions and 8 deletions

View File

@ -24,6 +24,7 @@ class Linker << (F,LightGreen) >> #Green {
+ valid(string $linker) : bool + valid(string $linker) : bool
+ trigger(string $linker) : bool + trigger(string $linker) : bool
+ set(string $linker) : bool + set(string $linker) : bool
+ revokeSession(string $linker) : ?array
+ setName(string $name) : ?array + setName(string $name) : ?array
+ access(string $linker, string $pass, ...) : ?array + access(string $linker, string $pass, ...) : ?array
+ revoke(string $linker) : ?array + revoke(string $linker) : ?array
@ -95,14 +96,21 @@ note left of Linker::set
return: bool return: bool
end note end note
note right of Linker::setName note right of Linker::revokeSession
Revoke Linker Session
since: 2.0.1
return: ?array
end note
note left of Linker::setName
Set a linker name Set a linker name
since: 2.0.1 since: 2.0.1
return: ?array return: ?array
end note end note
note left of Linker::access note right of Linker::access
Set Access Set Access
since: 2.0.1 since: 2.0.1
@ -114,42 +122,42 @@ note left of Linker::access
?string $oldPass ?string $oldPass
end note end note
note right of Linker::revoke note left of Linker::revoke
Revoke Access Revoke Access
since: 2.0.1 since: 2.0.1
return: ?array return: ?array
end note end note
note left of Linker::hasAccess note right of Linker::hasAccess
Has Access Has Access
since: 2.0.1 since: 2.0.1
return: bool return: bool
end note end note
note right of Linker::getPassGuid note left of Linker::getPassGuid
Get Password GUID Get Password GUID
since: 2.0.1 since: 2.0.1
return: ?string return: ?string
end note end note
note left of Linker::getPassword note right of Linker::getPassword
Get Password Get Password
since: 2.0.1 since: 2.0.1
return: ?object return: ?object
end note end note
note right of Linker::setLinker note left of Linker::setLinker
Set Linker Set Linker
since: 2.0.1 since: 2.0.1
return: bool return: bool
end note end note
note left of Linker::setPassword note right of Linker::setPassword
Set Password Set Password
since: 2.0.1 since: 2.0.1

View File

@ -238,6 +238,41 @@ final class Linker
return true; return true;
} }
/**
* Revoke Linker Session
*
* @param string $linker The linker GUID value
*
* @return array|null The success or error details
* @since 2.0.1
**/
public function revokeSession(string $linker): ?array
{
// linker not valid GUID
if (!GuidHelper::valid($linker))
{
// hmm we can log this
return [
'error' => Text::_('COM_GETBIBLE_ACCESS_REVOKED')
];
}
if (($access = $this->session->get('getbible_active_linker_guid', null)) !== null
|| $access !== $linker)
{
// hmm we can log this
return [
'success' => Text::_('COM_GETBIBLE_ACCESS_REVOKED')
];
}
$this->session->set('getbible_active_linker_guid', null);
return [
'success' => Text::_('COM_GETBIBLE_ACCESS_REVOKED')
];
}
/** /**
* Set a linker name * Set a linker name
* *

View File

@ -208,6 +208,41 @@
return true; return true;
} }
/**
* Revoke Linker Session
*
* @param string $linker The linker GUID value
*
* @return array|null The success or error details
* @since 2.0.1
**/
public function revokeSession(string $linker): ?array
{
// linker not valid GUID
if (!GuidHelper::valid($linker))
{
// hmm we can log this
return [
'error' => Text::_('Access revoked.')
];
}
if (($access = $this->session->get('getbible_active_linker_guid', null)) !== null
|| $access !== $linker)
{
// hmm we can log this
return [
'success' => Text::_('Access revoked.')
];
}
$this->session->set('getbible_active_linker_guid', null);
return [
'success' => Text::_('Access revoked.')
];
}
/** /**
* Set a linker name * Set a linker name
* *