Elgg
Version master
|
Public Member Functions | |
__construct (protected UsersRememberMeCookiesTable $cookie_table, protected\ElggSession $session, protected\Elgg\Security\Crypto $crypto,\Elgg\Config $config,\Elgg\Http\Request $request) | |
Constructor. More... | |
makeLoginPersistent (\ElggUser $user) | |
Make the user's login persistent. More... | |
removePersistentLogin () | |
Remove the persisted login token from client and server. More... | |
handlePasswordChange (\ElggUser $subject,\ElggUser $modifier=null) | |
Handle a password change. More... | |
bootSession () | |
Boot the persistent login session, possibly returning the user who should be silently logged in. More... | |
getUserFromToken (string $token) | |
Get a user from a persistent cookie token. More... | |
updateTokenUsage (\ElggUser $user) | |
Update the timestamp linked to a persistent cookie code, this indicates that the code was used recently. More... | |
removeExpiredTokens ($time) | |
Remove all persistent codes from the database which have expired based on the cookie config. More... | |
Public Attributes | |
$_callable_elgg_set_cookie = 'elgg_set_cookie' | |
Protected Member Functions | |
hashToken (string $token) | |
Create a hash from the token. More... | |
setCookie (string $token) | |
Store the token in the client cookie (or remove the cookie) More... | |
setSessionToken (string $token) | |
Store the token in the session (or remove it from the session) More... | |
generateToken () | |
Generate a random token (base 64 URL) More... | |
Protected Attributes | |
array | $cookie_config |
string | $cookie_token |
If a user selects a persistent login, a long, random token is generated and stored in the cookie called "elggperm", and a hash of the token is stored in the DB. If the user's PHP session expires, the session boot sequence will try to log the user in via the token in the cookie.
Definition at line 17 of file PersistentLoginService.php.
Elgg\PersistentLoginService::__construct | ( | protected UsersRememberMeCookiesTable | $cookie_table, |
protected\ElggSession | $session, | ||
protected\Elgg\Security\Crypto | $crypto, | ||
\Elgg\Config | $config, | ||
\Elgg\Http\Request | $request | ||
) |
Constructor.
UsersRememberMeCookiesTable | $cookie_table | The persistent cookie storage table |
\ElggSession | $session | The Elgg session |
\Elgg\Security\Crypto | $crypto | The cryptography service |
\Elgg\Config | $config | The site configuration |
\Elgg\Http\Request | $request | The request |
Definition at line 40 of file PersistentLoginService.php.
Elgg\PersistentLoginService::bootSession | ( | ) |
Boot the persistent login session, possibly returning the user who should be silently logged in.
Definition at line 107 of file PersistentLoginService.php.
|
protected |
Generate a random token (base 64 URL)
The first char is always "z" to indicate the value has more entropy than the previously generated ones.
Definition at line 250 of file PersistentLoginService.php.
Elgg\PersistentLoginService::getUserFromToken | ( | string | $token | ) |
Get a user from a persistent cookie token.
string | $token | the cookie token |
Definition at line 131 of file PersistentLoginService.php.
Elgg\PersistentLoginService::handlePasswordChange | ( | \ElggUser | $subject, |
\ElggUser | $modifier = null |
||
) |
Handle a password change.
\ElggUser | $subject | The user whose password changed |
\ElggUser | $modifier | The user who changed the password |
Definition at line 92 of file PersistentLoginService.php.
|
protected |
Create a hash from the token.
string | $token | The token to hash |
Definition at line 200 of file PersistentLoginService.php.
Elgg\PersistentLoginService::makeLoginPersistent | ( | \ElggUser | $user | ) |
Make the user's login persistent.
\ElggUser | $user | The user who logged in |
Definition at line 60 of file PersistentLoginService.php.
Elgg\PersistentLoginService::removeExpiredTokens | ( | $time | ) |
Remove all persistent codes from the database which have expired based on the cookie config.
int | \DateTime | string | $time | the base timestamp to use |
Definition at line 179 of file PersistentLoginService.php.
Elgg\PersistentLoginService::removePersistentLogin | ( | ) |
Remove the persisted login token from client and server.
Definition at line 74 of file PersistentLoginService.php.
|
protected |
Store the token in the client cookie (or remove the cookie)
string | $token | Empty string to remove cookie |
Definition at line 213 of file PersistentLoginService.php.
|
protected |
Store the token in the session (or remove it from the session)
string | $token | The token to store in session. Empty string to remove. |
Definition at line 234 of file PersistentLoginService.php.
Elgg\PersistentLoginService::updateTokenUsage | ( | \ElggUser | $user | ) |
Update the timestamp linked to a persistent cookie code, this indicates that the code was used recently.
\ElggUser | $user | the user to update the cookie code for |
Definition at line 157 of file PersistentLoginService.php.
Elgg\PersistentLoginService::$_callable_elgg_set_cookie = 'elgg_set_cookie' |
Definition at line 29 of file PersistentLoginService.php.
|
protected |
Definition at line 21 of file PersistentLoginService.php.
|
protected |
Definition at line 23 of file PersistentLoginService.php.