class vB_Session_Cli extends vB_Session

Traits

Properties

protected vB_dB_Assertor $dBAssertor from vB_Session
protected vB_Datastore $datastore from vB_Session
protected array $config from vB_Session
protected array $vars The individual session variables. Equivalent to $session from the past. from vB_Session
protected $data from vB_Session
protected $cookietimeout from vB_Session
protected $rememberMeToken from vB_Session
protected array $db_fields A list of variables in the $vars member that are in the database. Includes their types. from vB_Session
protected array $changes An array of changes. Used to prevent superfluous updates from being made. from vB_Session
$created from vB_Session
protected array $userinfo Information about the user that this session belongs to. from vB_Session
protected $sessionIdHash from vB_Session
protected string $cpsessionHash cpsessionhash is a special session hash for admins and moderators from vB_Session

Methods

__sleep()

No description

__wakeup()

No description

createSessionIdHash()

Sets the attribute sessionIdHash

loadExistingSession($sessionhash, $restoreSessionInfo)

No description

fetchStoredSession($sessionhash, $restoreSessionInfo = array())

No description

rememberSession($restoreSessionInfo, $useroptions)

Attempt to create a new session for the user without asking for a new login

rememberFacebook($restoreSessionInfo, $useroptions)

Attempt to create a new session for the user from facebook

array
fetchUserForRemember($userid, $useroptions)

Get the user info based on the useroptions

__construct(vB_DB_Assertor $dBAssertor, vB_Datastore $datastore, array $config, $userid)

Constructor. Attempts to grab a session that matches parameters, but will create one if it can't.

static 
getNewSession($dBAssertor, $datastore, $config, $sessionhash = '', $userid = 0, $password = '', $styleid = 0, $languageid = 0)

No description

string
getSessionIdHash()

Returns the sessionIdHash

save()

Saves the session into the database by inserting it or updating an existing one.

delete()

Deletes the session from the session store.

set(string $key, mixed $value)

Sets a session variable and updates the change list.

setChannelPerms($key, $perms)

No description

getChannelPerms($key)

No description

clearChannelPerms()

No description

getRememberMeToken()

No description

mixed
get(string $key)

Gets a session variable.

bool
isCreated()

Returns whether the session was created

array
getAllVars()

Returns an array with all session vars

setSessionVars($userId)

No description

string
fetch_sessionhash()

Fetches a valid sessionhash value, not necessarily the one tied to this session.

string
fetch_substr_ip($ip, $length = null)

Returns the IP address with the specified number of octets removed

array
fetch_session(integer $userid = 0)

Fetches a default session. Used when creating a new session.

loadPhraseGroups()

Called after setting phrasegroups, adds new phrases to userinfo

loadLanguage()

Loads basic language information

array
fetch_userinfo()

Returns appropriate user info for the owner of this session.

mix
fetch_userinfo_value($value)

Returns appropriate value from the user info array for the owner of this session.

array
doLastVisitUpdate(integer $lastvisit = 0, integer $lastactivity = 0)

Updates the last visit and last activity times for guests and registered users (differently).

string
fetchCpsessionHash(bool $renew = false)

Create new cpsession for the user and insert it into database or fetch current existing one

setCpsessionHash($cpsessionhash)

No description

bool
validateCpsession(bool $updatetimeout = true)

Validate cpsession

clearUserInfo()

Clear user cached info. Primarily needed for cleaning cache in memory.

loadUserInfo(Array $nocache = false)

Loads user info and stores it in session object property ($this->userinfo) for a given user regarding options being passed.

static 
getSession($userId, $sessionHash = '', $dBAssertor = null, $datastore = null, $config = null)

No description

saveForTesting()

No description

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 55
protected createSessionIdHash()

Sets the attribute sessionIdHash

at line 46
protected loadExistingSession($sessionhash, $restoreSessionInfo)

Parameters

$sessionhash
$restoreSessionInfo

in vB_Session at line 274
protected fetchStoredSession($sessionhash, $restoreSessionInfo = array())

Parameters

$sessionhash
$restoreSessionInfo

in vB_Session at line 364
protected rememberSession($restoreSessionInfo, $useroptions)

Attempt to create a new session for the user without asking for a new login

This uses various cookie information to revalidate a user without asking for a new login. This is triggered wh

Parameters

$restoreSessionInfo
$useroptions

in vB_Session at line 398
protected rememberFacebook($restoreSessionInfo, $useroptions)

Attempt to create a new session for the user from facebook

This uses various cookie information to revalidate a user without asking for a new login. This is triggered wh

Parameters

$restoreSessionInfo
$useroptions

in vB_Session at line 449
protected array fetchUserForRemember($userid, $useroptions)

Get the user info based on the useroptions

Parameters

$userid
$useroptions

Return Value

array user info array

at line 26
__construct(vB_DB_Assertor $dBAssertor, vB_Datastore $datastore, array $config, $userid)

Constructor. Attempts to grab a session that matches parameters, but will create one if it can't.

Parameters

vB_DB_Assertor $dBAssertor
vB_Datastore $datastore
array $config -- vBulletin config array
$userid

in vB_Session at line 538
static getNewSession($dBAssertor, $datastore, $config, $sessionhash = '', $userid = 0, $password = '', $styleid = 0, $languageid = 0)

Parameters

$dBAssertor
$datastore
$config
$sessionhash
$userid
$password
$styleid
$languageid

in vB_Session at line 562
string getSessionIdHash()

Returns the sessionIdHash

Return Value

string

at line 61
save()

Saves the session into the database by inserting it or updating an existing one.

in vB_Session at line 629
delete()

Deletes the session from the session store.

Deletes records matching the session's sessionhash. If there is an apiaccesstoken then sessions matching that are also deleted.

Will have no effect and no error if the session doesn't exist.

Sets the session to "not created", but does not otherwise affect the session object.

in vB_Session at line 650
set(string $key, mixed $value)

Sets a session variable and updates the change list.

Parameters

string $key Name of session variable to update
mixed $value Value to update it with

in vB_Session at line 660
setChannelPerms($key, $perms)

Parameters

$key
$perms

in vB_Session at line 675
getChannelPerms($key)

Parameters

$key

in vB_Session at line 684
clearChannelPerms()

in vB_Session at line 690
getRememberMeToken()

in vB_Session at line 701
mixed get(string $key)

Gets a session variable.

Parameters

string $key
  • Name of session variable

Return Value

mixed
  • Value of the key, NULL if not found

in vB_Session at line 714
bool isCreated()

Returns whether the session was created

Return Value

bool

in vB_Session at line 724
array getAllVars()

Returns an array with all session vars

Return Value

array

in vB_Session at line 729
setSessionVars($userId)

Parameters

$userId

in vB_Session at line 738
string fetch_sessionhash()

Fetches a valid sessionhash value, not necessarily the one tied to this session.

Return Value

string 32-character sessionhash

in vB_Session at line 748
protected string fetch_substr_ip($ip, $length = null)

Returns the IP address with the specified number of octets removed

Parameters

$ip
$length

Return Value

string truncated IP address

in vB_Session at line 765
protected array fetch_session(integer $userid = 0)

Fetches a default session. Used when creating a new session.

Parameters

integer $userid User ID the session should be for

Return Value

array Array of session variables

in vB_Session at line 796
loadPhraseGroups()

Called after setting phrasegroups, adds new phrases to userinfo

in vB_Session at line 819
loadLanguage()

Loads basic language information

in vB_Session at line 886
array fetch_userinfo()

Returns appropriate user info for the owner of this session.

Return Value

array Array of user information.

in vB_Session at line 983
mix fetch_userinfo_value($value)

Returns appropriate value from the user info array for the owner of this session.

Parameters

$value

Return Value

mix value of user information.

in vB_Session at line 1006
array doLastVisitUpdate(integer $lastvisit = 0, integer $lastactivity = 0)

Updates the last visit and last activity times for guests and registered users (differently).

Last visit is set to the last activity time (before it's updated) only when a certain time has lapsed. Last activity is always set to the specified time.

Parameters

integer $lastvisit Time stamp for last visit time (guest only)
integer $lastactivity Time stamp for last activity time (guest only)

Return Value

array Updated values for setting cookies (guest only)

in vB_Session at line 1089
string fetchCpsessionHash(bool $renew = false)

Create new cpsession for the user and insert it into database or fetch current existing one

Parameters

bool $renew Whether to renew cpsession hash (Create a new one and drop the old one)

Return Value

string The new cpsession hash

Exceptions

vB_Exception

in vB_Session at line 1119
setCpsessionHash($cpsessionhash)

Parameters

$cpsessionhash

in vB_Session at line 1131
bool validateCpsession(bool $updatetimeout = true)

Validate cpsession

Parameters

bool $updatetimeout Whether to update the table to reset the timeout

Return Value

bool

in vB_Session at line 1176
clearUserInfo()

Clear user cached info. Primarily needed for cleaning cache in memory.

in vB_Session at line 1199
protected loadUserInfo(Array $nocache = false)

Loads user info and stores it in session object property ($this->userinfo) for a given user regarding options being passed.

@param Int Userid to load info

Parameters

Array $nocache Extra data passed to consider while loading user information. 'Options' => list of userinfo options (check vB_Api_User USERINFO_XXXX constants) 'Languageid' => id from the language to load info from. @param Bool Determines whether or not fetch cached information.

at line 16
static getSession($userId, $sessionHash = '', $dBAssertor = null, $datastore = null, $config = null)

Parameters

$userId
$sessionHash
$dBAssertor
$datastore
$config

at line 67
saveForTesting()