XOOPS  2.6.0
Xoops\Core\Session\RememberMe Class Reference

Public Member Functions

 __construct ()
 
 createUserCookie ($userId)
 
 forget ()
 
 invalidateAllForUser ($userId)
 
 recall ()
 

Protected Member Functions

 clearUserCookie ()
 
 clearUserTokens ()
 
 getNewSeries ()
 
 getNewToken ()
 
 getSeriesToken ($series, $token)
 
 hasSeries ($series)
 
 hasSeriesToken ($series, $token)
 
 readUserCookie ()
 
 readUserTokens ($userId)
 
 removeExpiredTokens ()
 
 setSeriesToken ($series, $token, $values)
 
 unsetSeries ($series)
 
 unsetSeriesToken ($series, $token)
 
 writeUserCookie ($cookieData, $expire=2592000)
 
 writeUserTokens ($userId)
 

Protected Attributes

 $now = 0
 
 $userId = 0
 
 $userTokens = array()
 
 $xoops = null
 

Detailed Description

Definition at line 56 of file RememberMe.php.

Constructor & Destructor Documentation

Xoops\Core\Session\RememberMe::__construct ( )

constructor

Definition at line 82 of file RememberMe.php.

References Xoops\getInstance().

Here is the call graph for this function:

Member Function Documentation

Xoops\Core\Session\RememberMe::clearUserCookie ( )
protected

Update cookie status for current session

Returns
void

Definition at line 359 of file RememberMe.php.

References Xoops\Core\Session\RememberMe\writeUserCookie().

Referenced by Xoops\Core\Session\RememberMe\forget(), Xoops\Core\Session\RememberMe\readUserCookie(), and Xoops\Core\Session\RememberMe\recall().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::clearUserTokens ( )
protected

Clear all tokens for this user

Returns
void

Definition at line 310 of file RememberMe.php.

Referenced by Xoops\Core\Session\RememberMe\invalidateAllForUser(), Xoops\Core\Session\RememberMe\readUserTokens(), and Xoops\Core\Session\RememberMe\recall().

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::createUserCookie (   $userId)

Create a new user cookie, usually in response to login with "remember me" selected

Parameters
integer$userIdid of user to be remembered
Returns
void

Definition at line 342 of file RememberMe.php.

References Xoops\Core\Session\RememberMe\$userId, Xoops\Core\Session\RememberMe\getNewSeries(), Xoops\Core\Session\RememberMe\getNewToken(), Xoops\Core\Session\RememberMe\readUserTokens(), Xoops\Core\Session\RememberMe\setSeriesToken(), Xoops\Core\Session\RememberMe\writeUserCookie(), and Xoops\Core\Session\RememberMe\writeUserTokens().

Here is the call graph for this function:

Xoops\Core\Session\RememberMe::forget ( )

Forget a "remember me" cookie. This should be invoked if a user explicitly logs out of a session. If a cookie is set for this session, this will clear it and remove the associated series tokens.

Returns
void

Definition at line 143 of file RememberMe.php.

References Xoops\Core\Session\RememberMe\$userId, Xoops\Core\Session\RememberMe\clearUserCookie(), Xoops\Core\Session\RememberMe\readUserCookie(), Xoops\Core\Session\RememberMe\readUserTokens(), Xoops\Core\Session\RememberMe\unsetSeries(), and Xoops\Core\Session\RememberMe\writeUserTokens().

Here is the call graph for this function:

Xoops\Core\Session\RememberMe::getNewSeries ( )
protected

Generate a new series

Returns
string a new series key

Definition at line 320 of file RememberMe.php.

References Xoops\Core\Random\generateKey().

Referenced by Xoops\Core\Session\RememberMe\createUserCookie().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::getNewToken ( )
protected

Generate a new token

Returns
string a new token

Definition at line 330 of file RememberMe.php.

References Xoops\Core\Random\generateOneTimeToken().

Referenced by Xoops\Core\Session\RememberMe\createUserCookie(), and Xoops\Core\Session\RememberMe\recall().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::getSeriesToken (   $series,
  $token 
)
protected

Get the values associated with a given series and token

Parameters
string$seriesseries identifier
string$tokentoken to check
Returns
array|false

Definition at line 217 of file RememberMe.php.

Referenced by Xoops\Core\Session\RememberMe\recall().

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::hasSeries (   $series)
protected

Check if the given series exists

Parameters
string$seriesseries identifier
Returns
boolean true if series exists, otherwise false

Definition at line 179 of file RememberMe.php.

Referenced by Xoops\Core\Session\RememberMe\recall().

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::hasSeriesToken (   $series,
  $token 
)
protected

Get the values associated with a given series and token

Parameters
string$seriesseries identifier
string$tokentoken to check
Returns
boolean true if series and token combination exists, otherwise false

Definition at line 204 of file RememberMe.php.

Referenced by Xoops\Core\Session\RememberMe\recall().

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::invalidateAllForUser (   $userId)

Invalidate all existing "remember me" cookie by deleting all the series/tokens

This should be called during a password change.

Parameters
integer$userIdid of user associated with the sessions/tokens to be invalidated
Returns
void

Definition at line 165 of file RememberMe.php.

References Xoops\Core\Session\RememberMe\$userId, Xoops\Core\Session\RememberMe\clearUserTokens(), Xoops\Core\Session\RememberMe\readUserTokens(), and Xoops\Core\Session\RememberMe\writeUserTokens().

Here is the call graph for this function:

Xoops\Core\Session\RememberMe::readUserCookie ( )
protected

Read the user cookie

Returns
array|false the cookie data as array(userid, series, token), or false if cookie does not exist (or not configured)

Definition at line 370 of file RememberMe.php.

References $temp, Xoops\Core\Session\RememberMe\clearUserCookie(), and Xoops\Core\Request\getString().

Referenced by Xoops\Core\Session\RememberMe\forget(), and Xoops\Core\Session\RememberMe\recall().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::readUserTokens (   $userId)
protected

read existing user tokens from persistent storage

Parameters
integer$userIdid of user to read tokens for
Returns
void

Definition at line 259 of file RememberMe.php.

References Xoops\Core\Session\RememberMe\clearUserTokens(), and Xoops\Core\Session\RememberMe\removeExpiredTokens().

Referenced by Xoops\Core\Session\RememberMe\createUserCookie(), Xoops\Core\Session\RememberMe\forget(), Xoops\Core\Session\RememberMe\invalidateAllForUser(), and Xoops\Core\Session\RememberMe\recall().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::removeExpiredTokens ( )
protected

Remove any expired tokens

Returns
void

Definition at line 287 of file RememberMe.php.

References Xoops\Core\Session\RememberMe\$now, Xoops\Core\Session\RememberMe\$userTokens, Xoops\Core\Session\RememberMe\unsetSeries(), and Xoops\Core\Session\RememberMe\unsetSeriesToken().

Referenced by Xoops\Core\Session\RememberMe\readUserTokens().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::setSeriesToken (   $series,
  $token,
  $values 
)
protected

Get the values associated with a given series and token

Parameters
string$seriesseries identifier
string$tokentoken to check
array$valuesvaluestoken to check
Returns
void

Definition at line 234 of file RememberMe.php.

Referenced by Xoops\Core\Session\RememberMe\createUserCookie(), and Xoops\Core\Session\RememberMe\recall().

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::unsetSeries (   $series)
protected

Unset an entire series

Parameters
string$seriesseries identifier
Returns
void

Definition at line 191 of file RememberMe.php.

Referenced by Xoops\Core\Session\RememberMe\forget(), and Xoops\Core\Session\RememberMe\removeExpiredTokens().

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::unsetSeriesToken (   $series,
  $token 
)
protected

Get the values associated with a given series and token

Parameters
string$seriesseries identifier
string$tokentoken to check
Returns
void

Definition at line 247 of file RememberMe.php.

Referenced by Xoops\Core\Session\RememberMe\removeExpiredTokens().

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::writeUserCookie (   $cookieData,
  $expire = 2592000 
)
protected

Update cookie status for current session

Parameters
array | string$cookieDatausercookie value
integer$expireseconds until usercookie expires
Returns
void

Definition at line 399 of file RememberMe.php.

References $path, XoopsBaseConfig\get(), and Xoops\Core\HttpRequest\getInstance().

Referenced by Xoops\Core\Session\RememberMe\clearUserCookie(), Xoops\Core\Session\RememberMe\createUserCookie(), and Xoops\Core\Session\RememberMe\recall().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Session\RememberMe::writeUserTokens (   $userId)
protected

write the existing user tokens to persistent storage

Parameters
integer$userIdid of user to write tokens for
Returns
void

Definition at line 276 of file RememberMe.php.

Referenced by Xoops\Core\Session\RememberMe\createUserCookie(), Xoops\Core\Session\RememberMe\forget(), Xoops\Core\Session\RememberMe\invalidateAllForUser(), and Xoops\Core\Session\RememberMe\recall().

Here is the caller graph for this function:

Member Data Documentation

Xoops\Core\Session\RememberMe::$now = 0
protected

Definition at line 77 of file RememberMe.php.

Referenced by Xoops\Core\Session\RememberMe\removeExpiredTokens().

Xoops\Core\Session\RememberMe::$userTokens = array()
protected

Definition at line 62 of file RememberMe.php.

Referenced by Xoops\Core\Session\RememberMe\removeExpiredTokens().

Xoops\Core\Session\RememberMe::$xoops = null
protected

Definition at line 72 of file RememberMe.php.


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