\GB_Session_Tokens
Abstract class for managing user session tokens.
Synopsis
class GB_Session_Tokens
{
- // members
- protected $user_id;
- // methods
- protected void __construct()
- public final static GB_Session_Tokens get_instance()
- private final string hash_token()
- public final array get()
- public final bool verify()
- public final string create()
- public final void update()
- public final void destroy()
- public final void destroy_others()
- protected final bool is_still_valid()
- public final void destroy_all()
- public final static void destroy_all_for_all_users()
- public final array get_all()
- protected abstract array get_sessions()
- protected abstract array|null get_session()
- protected abstract void update_session()
- protected abstract void destroy_other_sessions()
- protected abstract void destroy_all_sessions()
- public static void drop_sessions()
Violations
Checkstyle
Line | Column | Severity | Message |
---|---|---|---|
47 | 25 | error | Method name "GB_Session_Tokens::get_instance" is not in camel caps format |
53 | 11 | error | Whitespace found at end of line |
72 | 19 | error | Method name "GB_Session_Tokens::hash_token" is not in camel caps format |
143 | 11 | error | Whitespace found at end of line |
214 | 18 | error | Method name "GB_Session_Tokens::destroy_others" is not in camel caps format |
236 | 21 | error | Method name "GB_Session_Tokens::is_still_valid" is not in camel caps format |
247 | 18 | error | Method name "GB_Session_Tokens::destroy_all" is not in camel caps format |
260 | 25 | error | Method name "GB_Session_Tokens::destroy_all_for_all_users" is not in camel caps format |
280 | 18 | error | Method name "GB_Session_Tokens::get_all" is not in camel caps format |
293 | 24 | error | Method name "GB_Session_Tokens::get_sessions" is not in camel caps format |
305 | 24 | error | Method name "GB_Session_Tokens::get_session" is not in camel caps format |
318 | 24 | error | Method name "GB_Session_Tokens::update_session" is not in camel caps format |
330 | 24 | error | Method name "GB_Session_Tokens::destroy_other_sessions" is not in camel caps format |
338 | 24 | error | Method name "GB_Session_Tokens::destroy_all_sessions" is not in camel caps format |
348 | 19 | error | Method name "GB_Session_Tokens::drop_sessions" is not in camel caps format |
349 | 6 | error | Closing brace must be on a line by itself |
Members
protected
- $user_id
—
int
User ID.
Methods
private
- hash_token() — Hashes a session token for storage.
protected
- __construct() — Protected constructor.
- destroy_all_sessions() — This method should destroy all sessions for a user.
- destroy_other_sessions() — This method should destroy all session tokens for this user, except a single session passed.
- get_session() — This method should look up a session by its verifier (token hash).
- get_sessions() — This method should retrieve all sessions of a user, keyed by verifier.
- is_still_valid() — Determine whether a session token is still valid, based on expiration.
- update_session() — This method should update a session by its verifier.
public
- create() — Generate a session token and attach session information to it.
- destroy() — Destroy a session token.
- destroy_all() — Destroy all session tokens for a user.
- destroy_all_for_all_users() — Destroy all session tokens for all users.
- destroy_others() — Destroy all session tokens for this user, except a single token, presumably the one in use.
- drop_sessions() — This static method should destroy all session tokens for all users.
- get() — Get a user's session.
- get_all() — Retrieve all sessions of a user.
- get_instance() — Get a session token manager instance for a user.
- update() — Update a session token.
- verify() — Validate a user's session token as authentic.
History
-
2017-05-29T22:42:45+00:00 (commit #ba5872a)
Author: Limych (andrey@khrolenok.ru) / Commiter: Limych (andrey@khrolenok.ru)
Core remastered to Bootstrap CSS framework.