Static Public Member Functions | |
| static | init () |
| static | open ($save_path, $session_name) |
| static | close () |
| static | read ($session_id) |
| static | write ($session_id, $data) |
| static | destroy ($session_id) |
| static | gc ($max_lifetime) |
| static | set_userid ($user_id) |
| static | clear_userid ($user_id) |
| static | add_to_set ($set, $value, $key=null) |
| static | notice ($notice, $key=null) |
| static | error ($error, $key=null) |
| static | get_set ($set, $clear=true) |
| static | get_notices ($clear=true) |
| static | get_notice ($key, $clear=true) |
| static | get_errors ($clear=true) |
| static | get_error ($key, $clear=true) |
| static | remove_notice ($key) |
| static | remove_error ($key) |
| static | messages_get ($clear=true, $callback=null) |
| static | messages_out ($clear=true, $callback=null) |
| static | has_messages () |
| static | has_errors ($key=null) |
Static Protected Member Functions | |
| static | get_subnet ($remote_address= '') |
Manages sessions for the PHP session routines
Definition at line 13 of file session.php.
| static Session::add_to_set | ( | $ | set, | |
| $ | value, | |||
| $ | key = null | |||
| ) | [static] |
Adds a value to a session set
| string | $set Name of the set | |
| mixed | $value value to store | |
| string | $key Optional unique key for the set under which to store the value |
Definition at line 267 of file session.php.
Referenced by AdminHandler::__construct(), UserHandler::act_login(), FeedbackHandler::add_comment(), error(), notice(), and FormControl::save().
| static Session::clear_userid | ( | $ | user_id | ) | [static] |
Clear the user_id attached to sessions, delete other sessions that are associated to the user_id
| integer | $user_id The user_id to clear. |
Definition at line 254 of file session.php.
Referenced by User::forget().
| static Session::close | ( | ) | [static] |
Executed when closing a session. Not useful for Habari
Definition at line 93 of file session.php.
| static Session::destroy | ( | $ | session_id | ) | [static] |
Destroy stored session data by session id
| string | $session_id The PHP generated session id |
Definition at line 216 of file session.php.
| static Session::error | ( | $ | error, | |
| $ | key = null | |||
| ) | [static] |
Store an error message in the user's session
| string | $error The error message | |
| string | $key An optional id that would guarantee a single unique message for this key |
Definition at line 297 of file session.php.
Referenced by AdminHandler::__construct(), FileCache::__construct(), APCCache::__construct(), UserThemeHandler::act(), FeedbackHandler::act_add_comment(), AdminHandler::act_admin(), FeedbackHandler::add_comment(), AdminLogsHandler::ajax_delete_logs(), AdminTagsHandler::ajax_tags(), AdminCommentsHandler::ajax_update_comment(), User::authenticate(), Plugins::check_every_plugin_syntax(), AdminPostsHandler::get_publish(), AdminUsersHandler::get_user(), AdminGroupsHandler::post_group(), AdminUsersHandler::post_users(), read(), AdminGroupsHandler::update_groups(), and AdminUsersHandler::update_users().
| static Session::gc | ( | $ | max_lifetime | ) | [static] |
Session garbage collection deletes expired sessions
| mixed | $max_lifetime Unused - The session expiration time, in seconds. |
Definition at line 230 of file session.php.
Referenced by read().
| static Session::get_error | ( | $ | key, | |
| $ | clear = true | |||
| ) | [static] |
Retrieve a specific error from stored errors.
| string | $key ID of the error to retrieve | |
| boolean | $clear true to clear the error from the session upon receipt |
Definition at line 371 of file session.php.
| static Session::get_errors | ( | $ | clear = true |
) | [static] |
Get all error messsages from the user session
| boolean | $clear true to clear the messages from the session upon receipt |
Definition at line 359 of file session.php.
Referenced by get_error(), and messages_get().
| static Session::get_notice | ( | $ | key, | |
| $ | clear = true | |||
| ) | [static] |
Retrieve a specific notice from stored errors.
| string | $key ID of the notice to retrieve | |
| boolean | $clear true to clear the notice from the session upon receipt |
Definition at line 341 of file session.php.
| static Session::get_notices | ( | $ | clear = true |
) | [static] |
Get all notice messsages from the user session
| boolean | $clear true to clear the messages from the session upon receipt |
Definition at line 329 of file session.php.
Referenced by get_notice(), and messages_get().
| static Session::get_set | ( | $ | set, | |
| $ | clear = true | |||
| ) | [static] |
Return a set of messages
| string | $set The name of the message set | |
| boolean | $clear true to clear the messages from the session upon receipt |
Definition at line 309 of file session.php.
Referenced by AdminHandler::__construct(), UserHandler::act_login(), Post::comment_form(), FormControl::get_default(), get_errors(), and get_notices().
| static Session::has_errors | ( | $ | key = null |
) | [static] |
Determine if there are error messages to display
| string | $key Optional key of the unique error message |
Definition at line 463 of file session.php.
Referenced by UserHandler::act_login(), FeedbackHandler::add_comment(), HiEngineParser::hi_command(), and AdminUsersHandler::post_users().
| static Session::has_messages | ( | ) | [static] |
Determine if there are messages that should be displayed Messages are not cleared when calling this function.
Definition at line 452 of file session.php.
Referenced by HiEngineParser::hi_command().
| static Session::init | ( | ) | [static] |
Initialize the session handlers
Definition at line 25 of file session.php.
| static Session::messages_get | ( | $ | clear = true, |
|
| $ | callback = null | |||
| ) | [static] |
Return output of notice and error messages
| boolean | $clear true to clear the messages from the session upon receipt | |
| array | $callback a reference to a callback function for formatting the the messages |
Definition at line 414 of file session.php.
Referenced by AdminLogsHandler::ajax_delete_logs(), AdminTagsHandler::ajax_tags(), AdminCommentsHandler::ajax_update_comment(), messages_out(), AdminGroupsHandler::update_groups(), and AdminUsersHandler::update_users().
| static Session::messages_out | ( | $ | clear = true, |
|
| $ | callback = null | |||
| ) | [static] |
Output notice and error messages
| boolean | $clear true to clear the messages from the session upon receipt | |
| array | $callback a reference to a callback function for formatting the the messages |
Definition at line 441 of file session.php.
Referenced by HiEngineParser::hi_command().
| static Session::notice | ( | $ | notice, | |
| $ | key = null | |||
| ) | [static] |
Store a notice message in the user's session
| string | $notice The notice message | |
| string | $key An optional id that would guarantee a single unique message for this key |
Definition at line 286 of file session.php.
Referenced by UserHandler::act_login(), UserHandler::act_password_reset(), K2::action_theme_activated(), Charcoal::action_theme_activated(), FeedbackHandler::add_comment(), AdminLogsHandler::ajax_delete_logs(), AdminTagsHandler::ajax_tags(), AdminCommentsHandler::ajax_update_comment(), AdminOptionsHandler::form_options_success(), AdminUsersHandler::form_user_success(), AdminThemesHandler::get_activate_theme(), AdminPluginsHandler::get_plugin_toggle(), AdminThemesHandler::get_preview_theme(), AdminPostsHandler::post_delete_post(), AdminGroupsHandler::post_group(), AdminUsersHandler::post_users(), AdminGroupsHandler::update_groups(), and AdminUsersHandler::update_users().
| static Session::open | ( | $ | save_path, | |
| $ | session_name | |||
| ) | [static] |
Executed when opening a session. Not useful for Habari
Definition at line 83 of file session.php.
| static Session::read | ( | $ | session_id | ) | [static] |
Read session data from the database to return into the $_SESSION global. Verifies against a number of parameters for security purposes.
| string | $session_id The id generated by PHP for the session. |
Definition at line 106 of file session.php.
| static Session::remove_error | ( | $ | key | ) | [static] |
Removes a specific error from the stored errors.
| string | $key ID of the error to remove |
Definition at line 401 of file session.php.
Referenced by AdminHandler::__construct(), UserHandler::act_login(), and get_error().
| static Session::remove_notice | ( | $ | key | ) | [static] |
Removes a specific notice from the stored notices.
| string | $key ID of the notice to remove |
Definition at line 389 of file session.php.
Referenced by get_notice().
| static Session::set_userid | ( | $ | user_id | ) | [static] |
Sets the user_id attached to the current session
| integer | $user_id The user id of the current user |
Definition at line 244 of file session.php.
Referenced by User::remember().
| static Session::write | ( | $ | session_id, | |
| $ | data | |||
| ) | [static] |
Commit $_SESSION data to the database for this user.
| string | $session_id The PHP-generated session id | |
| string | $data Data from session stored as a string |
Definition at line 176 of file session.php.
1.7.1