Свойство | Тип | Описание | |
---|---|---|---|
$_callable_elgg_set_cookie | DO NOT USE. For unit test mocking | ||
$_callable_get_user | DO NOT USE. For unit test mocking | ||
$_callable_sleep | DO NOT USE. For unit test mocking |
Свойство | Тип | Описание | |
---|---|---|---|
$cookie_config | array | ||
$cookie_token | string | ||
$crypto | ElggCrypto | ||
$db | |||
$session | ElggSession | ||
$table | string | ||
$time | integer |
Метод | Описание | |
---|---|---|
__construct ( |
Constructor | |
bootSession ( ) : ElggUser | null | Boot the persistent login session, possibly returning the user who should be silently logged in. | |
getUserFromHash ( string $hash ) : ElggUser | null | Find a user with the given hash | |
handlePasswordChange ( ElggUser $subject, ElggUser $modifier = null ) : void | Handle a password change | |
makeLoginPersistent ( ElggUser $user ) : void | Make the user's login persistent | |
removePersistentLogin ( ) : void | Remove the persisted login token from client and server | |
replaceLegacyToken ( ElggUser $logged_in_user ) : void | Replace the user's token if it's a legacy hexadecimal token |
Метод | Описание | |
---|---|---|
generateToken ( ) : string | Generate a random token (base 64 URL) | |
handleDbException ( DatabaseException $exception, string $default = null ) : mixed | Swallow a schema not upgraded exception, otherwise rethrow it | |
hashToken ( string $token ) : string | Create a hash from the token | |
isLegacyToken ( string $token ) : boolean | Is the given token a legacy MD5 hash? | |
removeAllHashes ( ElggUser $user ) : void | Remove all the hashes associated with a user | |
removeHash ( string $hash ) : void | Remove a hash from the DB | |
setCookie ( string $token ) : void | Store the token in the client cookie (or remove the cookie) | |
setSession ( string $token ) : void | Store the token in the session (or remove it from the session) | |
storeHash ( ElggUser $user, string $hash ) : void | Store a hash in the DB |
public __construct ( |
||
$db | The DB service | |
$session | ElggSession | The Elgg session |
$crypto | ElggCrypto | The cryptography service |
$cookie_config | array | The persistent login cookie settings |
$cookie_token | string | The token from the request cookie |
$time | integer | The current time |
public bootSession ( ) : ElggUser | null | ||
Результат | ElggUser | null |
protected generateToken ( ) : string | ||
Результат | string |
public getUserFromHash ( string $hash ) : ElggUser | null | ||
$hash | string | The hashed token |
Результат | ElggUser | null |
protected handleDbException ( DatabaseException $exception, string $default = null ) : mixed | ||
$exception | DatabaseException | The exception to handle |
$default | string | The value to return if the table doesn't exist yet |
Результат | mixed |
public handlePasswordChange ( ElggUser $subject, ElggUser $modifier = null ) : void | ||
$subject | ElggUser | The user whose password changed |
$modifier | ElggUser | The user who changed the password |
Результат | void |
protected isLegacyToken ( string $token ) : boolean | ||
$token | string | The token to analyze |
Результат | boolean |
public makeLoginPersistent ( ElggUser $user ) : void | ||
$user | ElggUser | The user who logged in |
Результат | void |
protected removeAllHashes ( ElggUser $user ) : void | ||
$user | ElggUser | The user for whom we're removing hashes |
Результат | void |
protected removeHash ( string $hash ) : void | ||
$hash | string | The hashed token to remove (unused before 1.9) |
Результат | void |
public removePersistentLogin ( ) : void | ||
Результат | void |
public replaceLegacyToken ( ElggUser $logged_in_user ) : void | ||
$logged_in_user | ElggUser | The logged in user |
Результат | void |
protected setSession ( string $token ) : void | ||
$token | string | The token to store in session. Empty string to remove. |
Результат | void |
public $_callable_elgg_set_cookie |