forked from nette/security
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIUserStorage.php
More file actions
58 lines (46 loc) · 1.13 KB
/
Copy pathIUserStorage.php
File metadata and controls
58 lines (46 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* This file is part of the Nette Framework (https://nette.org)
* Copyright (c) 2004 David Grudl (https://davidgrudl.com)
*/
declare(strict_types=1);
namespace Nette\Security;
/**
* Interface for persistent storage for user object data.
*/
interface IUserStorage
{
/** Log-out reason {@link IUserStorage::getLogoutReason()} */
public const
MANUAL = 0b0001,
INACTIVITY = 0b0010;
/** Log-out behavior */
public const CLEAR_IDENTITY = 0b1000;
/**
* Sets the authenticated status of this user.
* @return static
*/
function setAuthenticated(bool $state);
/**
* Is this user authenticated?
*/
function isAuthenticated(): bool;
/**
* Sets the user identity.
* @return static
*/
function setIdentity(?IIdentity $identity);
/**
* Returns current user identity, if any.
*/
function getIdentity(): ?IIdentity;
/**
* Enables log out from the persistent storage after inactivity (like '20 minutes'). Accepts flag IUserStorage::CLEAR_IDENTITY.
* @return static
*/
function setExpiration(?string $expire, int $flags = 0);
/**
* Why was user logged out?
*/
function getLogoutReason(): ?int;
}