mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
rework session deduplication
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
9d4c591f1a
commit
3118ecf385
7 changed files with 40 additions and 29 deletions
|
|
@ -3,6 +3,8 @@
|
|||
namespace AIO\Auth;
|
||||
|
||||
use AIO\Data\ConfigurationManager;
|
||||
use AIO\Data\DataConst;
|
||||
use \DateTime;
|
||||
|
||||
class AuthManager {
|
||||
private const SESSION_KEY = 'aio_authenticated';
|
||||
|
|
@ -21,6 +23,14 @@ class AuthManager {
|
|||
}
|
||||
|
||||
public function SetAuthState(bool $isLoggedIn) : void {
|
||||
|
||||
if (!$this->IsAuthenticated() && $isLoggedIn === true) {
|
||||
$date = new DateTime();
|
||||
$dateTime = $date->getTimestamp();
|
||||
$_SESSION['date_time'] = $dateTime;
|
||||
file_put_contents(DataConst::GetSessionDateFile(), (string)$dateTime);
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_KEY] = $isLoggedIn;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue