forked from nette/security
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIUserStorage.php
More file actions
63 lines (51 loc) · 1.25 KB
/
Copy pathIUserStorage.php
File metadata and controls
63 lines (51 loc) · 1.25 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
59
60
61
62
63
<?php
/**
* This file is part of the Nette Framework (https://nette.org)
* Copyright (c) 2004 David Grudl (https://davidgrudl.com)
*/
namespace Nette\Security;
/**
* Interface for persistent storage for user object data.
*/
interface IUserStorage
{
/** Log-out reason {@link IUserStorage::getLogoutReason()} */
const MANUAL = 0b0001,
INACTIVITY = 0b0010,
BROWSER_CLOSED = 0b0100;
/** Log-out behavior */
const CLEAR_IDENTITY = 0b1000;
/**
* Sets the authenticated status of this user.
* @param bool
* @return void
*/
function setAuthenticated($state);
/**
* Is this user authenticated?
* @return bool
*/
function isAuthenticated();
/**
* Sets the user identity.
* @return void
*/
function setIdentity(IIdentity $identity = NULL);
/**
* Returns current user identity, if any.
* @return IIdentity|NULL
*/
function getIdentity();
/**
* Enables log out from the persistent storage after inactivity.
* @param string|int|\DateTimeInterface number of seconds or timestamp
* @param int Log out when the browser is closed | Clear the identity from persistent storage?
* @return void
*/
function setExpiration($time, $flags = 0);
/**
* Why was user logged out?
* @return int
*/
function getLogoutReason();
}