Static Public Member Functions | Static Protected Member Functions

Session Class Reference

List of all members.

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= '')

Detailed Description

Habari Session class

Manages sessions for the PHP session routines

Definition at line 13 of file session.php.


Member Function Documentation

static Session::add_to_set ( set,
value,
key = null 
) [static]

Adds a value to a session set

Parameters:
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

Parameters:
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

Parameters:
string $session_id The PHP generated session id
Returns:

Definition at line 216 of file session.php.

static Session::error ( error,
key = null 
) [static]
static Session::gc ( max_lifetime  )  [static]

Session garbage collection deletes expired sessions

Parameters:
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.

Parameters:
string $key ID of the error to retrieve
boolean $clear true to clear the error from the session upon receipt
Returns:
string Return the error message

Definition at line 371 of file session.php.

static Session::get_errors ( clear = true  )  [static]

Get all error messsages from the user session

Parameters:
boolean $clear true to clear the messages from the session upon receipt
Returns:
array And array of error messages

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.

Parameters:
string $key ID of the notice to retrieve
boolean $clear true to clear the notice from the session upon receipt
Returns:
string Return the notice message

Definition at line 341 of file session.php.

static Session::get_notices ( clear = true  )  [static]

Get all notice messsages from the user session

Parameters:
boolean $clear true to clear the messages from the session upon receipt
Returns:
array And array of notice messages

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

Parameters:
string $set The name of the message set
boolean $clear true to clear the messages from the session upon receipt
Returns:
array An array of message strings

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

Parameters:
string $key Optional key of the unique error message
Returns:
boolean true if there are errors, false if not

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.

Returns:
boolean true if there are messages to display.

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

Parameters:
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
Returns:
mixed output of 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

Parameters:
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]
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.

Parameters:
string $session_id The id generated by PHP for the session.
Returns:
string The retrieved session.

Definition at line 106 of file session.php.

static Session::remove_error ( key  )  [static]

Removes a specific error from the stored errors.

Parameters:
string $key ID of the error to remove
Returns:
boolean True or false depending if the error was removed successfully.

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.

Parameters:
string $key ID of the notice to remove
Returns:
boolean True or false depending if the notice was removed successfully.

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

Parameters:
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.

Parameters:
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.


The documentation for this class was generated from the following file: