Move "submanage" Session value into own methods

This commit is contained in:
Philipp 2022-10-21 19:33:28 +02:00
parent cafb23f8f0
commit 44a9683008
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
8 changed files with 37 additions and 11 deletions

View file

@ -72,6 +72,20 @@ interface IHandleUserSessions
*/
public function isAuthenticated(): bool;
/**
* Returns User ID of the managed user in case it's a different identity
*
* @return int|bool uid of the manager or false
*/
public function getSubManagedUserId();
/**
* Sets the User ID of the managed user in case it's a different identity
*
* @param int $managed_uid The user id of the managing user
*/
public function setSubManagedUserId(int $managed_uid): void;
/**
* Set the session variable that contains the contact IDs for the visitor's contact URL
*

View file

@ -118,4 +118,16 @@ class UserSession implements IHandleUserSessions
{
$this->session->set('remote', Contact::getVisitorByUrl($this->session->get('my_url')));
}
/** {@inheritDoc} */
public function getSubManagedUserId()
{
return $this->session->get('submanage') ?? false;
}
/** {@inheritDoc} */
public function setSubManagedUserId(int $managed_uid): void
{
$this->session->set('submanage', $managed_uid);
}
}