ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
inc.pwassist_session_handler.php File Reference

Go to the source code of this file.

Functions

 db_pwassist_session_open ($save_path, $name)
 Database Session Handling for the password assistance use case.
 db_pwassist_session_close ()
 close session
 db_pwassist_create_id ()
 db_pwassist_session_read ($pwassist_id)
 db_pwassist_session_find ($user_id)
 db_pwassist_session_write ($pwassist_id, $maxlifetime, $user_id)
 Writes serialized session data to the database.
 db_pwassist_session_destroy ($pwassist_id)
 destroy session
 db_pwassist_session_gc ()
 removes all expired sessions

Function Documentation

db_pwassist_create_id ( )

Definition at line 67 of file inc.pwassist_session_handler.php.

Referenced by ilPasswordAssistanceGUI\sendPasswordAssistanceMail().

{
// Implementation note: we use the PHP Session id
// generation mechanism to create the session id.
$old_session_id = session_id();
session_regenerate_id();
$pwassist_id = session_id();
session_id($old_session_id);
return $pwassist_id;
}

+ Here is the caller graph for this function:

db_pwassist_session_close ( )

close session

for a db nothing has to be done here

Definition at line 53 of file inc.pwassist_session_handler.php.

{
return true;
}
db_pwassist_session_destroy (   $pwassist_id)

destroy session

Parameters
integer$pwassist_idsecure id

Definition at line 150 of file inc.pwassist_session_handler.php.

Referenced by ilPasswordAssistanceGUI\submitAssignPasswordForm(), and ilSessionTest\testPasswordAssisstanceSession().

{
global $ilDB;
$q = "DELETE FROM usr_pwassist ".
"WHERE pwassist_id = ".$ilDB->quote($pwassist_id, "text");
$ilDB->manipulate($q);
return true;
}

+ Here is the caller graph for this function:

db_pwassist_session_find (   $user_id)

Definition at line 106 of file inc.pwassist_session_handler.php.

References $data.

Referenced by ilPasswordAssistanceGUI\sendPasswordAssistanceMail(), and ilSessionTest\testPasswordAssisstanceSession().

{
global $ilDB;
$q = "SELECT * FROM usr_pwassist ".
"WHERE user_id = ".$ilDB->quote($user_id, "integer");
$r = $ilDB->query($q);
$data = $ilDB->fetchAssoc($r);
return $data;
}

+ Here is the caller graph for this function:

db_pwassist_session_gc ( )

removes all expired sessions

Definition at line 165 of file inc.pwassist_session_handler.php.

Referenced by ilSessionTest\testPasswordAssisstanceSession().

{
global $pear_session_db,$ilDB;
$q = "DELETE FROM usr_pwassist ".
"WHERE expires < ".$ilDB->quote(time(), "integer");
$ilDB->manipulate($q);
return true;
}

+ Here is the caller graph for this function:

db_pwassist_session_open (   $save_path,
  $name 
)

Database Session Handling for the password assistance use case.

inc.db_pwassist_session_handler.php iliascore

Version
$Id$

Definition at line 43 of file inc.pwassist_session_handler.php.

{
return true;
}
db_pwassist_session_read (   $pwassist_id)

Definition at line 86 of file inc.pwassist_session_handler.php.

References $data.

Referenced by ilPasswordAssistanceGUI\showAssignPasswordForm(), ilPasswordAssistanceGUI\submitAssignPasswordForm(), and ilSessionTest\testPasswordAssisstanceSession().

{
global $ilDB;
$q = "SELECT * FROM usr_pwassist ".
"WHERE pwassist_id = ".$ilDB->quote($pwassist_id, "text");
$r = $ilDB->query($q);
$data = $ilDB->fetchAssoc($r);
return $data;
}

+ Here is the caller graph for this function:

db_pwassist_session_write (   $pwassist_id,
  $maxlifetime,
  $user_id 
)

Writes serialized session data to the database.

Parameters
integer$pwassist_idsecure id
integer$maxlifetimesession max lifetime in seconds
integer$user_iduser id

Definition at line 125 of file inc.pwassist_session_handler.php.

Referenced by ilPasswordAssistanceGUI\sendPasswordAssistanceMail(), and ilSessionTest\testPasswordAssisstanceSession().

{
global $ilDB;
$q = "DELETE FROM usr_pwassist ".
"WHERE pwassist_id = ".$ilDB->quote($pwassist_id, "text")." ".
"OR user_id = ".$ilDB->quote($user_id,'integer');
$ilDB->manipulate($q);
$ctime = time();
$expires = $ctime + $maxlifetime;
$ilDB->manipulateF("INSERT INTO usr_pwassist ".
"(pwassist_id, expires, user_id, ctime) ".
"VALUES (%s,%s,%s,%s)",
array("text", "integer", "integer", "integer"),
array($pwassist_id, $expires, $user_id, $ctime));
return true;
}

+ Here is the caller graph for this function: