ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestPasswordChecker Class Reference
+ Collaboration diagram for ilTestPasswordChecker:

Public Member Functions

 __construct (ilRbacSystem $rbacsystem, ilObjUser $user, ilObjTest $testOBJ)
 isPasswordProtectionPageRedirectRequired ()
 isUserEnteredPasswordCorrect ()
 setUserEnteredPassword ($enteredPassword)

Protected Member Functions

 isTestPasswordEnabled ()
 isPrivilegedParticipant ()
 getUserEnteredPassword ()
 initSession ()
 buildSessionKey ()

Protected Attributes

 $rbacsystem
 $user
 $testOBJ

Detailed Description

Definition at line 11 of file class.ilTestPasswordChecker.php.

Constructor & Destructor Documentation

ilTestPasswordChecker::__construct ( ilRbacSystem  $rbacsystem,
ilObjUser  $user,
ilObjTest  $testOBJ 
)

Definition at line 28 of file class.ilTestPasswordChecker.php.

References $rbacsystem, $testOBJ, $user, and initSession().

{
$this->rbacsystem = $rbacsystem;
$this->user = $user;
$this->testOBJ = $testOBJ;
$this->initSession();
}

+ Here is the call graph for this function:

Member Function Documentation

ilTestPasswordChecker::buildSessionKey ( )
protected

Definition at line 90 of file class.ilTestPasswordChecker.php.

Referenced by getUserEnteredPassword(), initSession(), and setUserEnteredPassword().

{
return 'tst_password_'.$this->testOBJ->getTestId();
}

+ Here is the caller graph for this function:

ilTestPasswordChecker::getUserEnteredPassword ( )
protected

Definition at line 77 of file class.ilTestPasswordChecker.php.

References $_SESSION, and buildSessionKey().

Referenced by isUserEnteredPasswordCorrect().

{
return $_SESSION[$this->buildSessionKey()];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestPasswordChecker::initSession ( )
protected

Definition at line 82 of file class.ilTestPasswordChecker.php.

References $_SESSION, and buildSessionKey().

Referenced by __construct().

{
if( !isset($_SESSION[$this->buildSessionKey()]) )
{
$_SESSION[$this->buildSessionKey()] = null;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestPasswordChecker::isPasswordProtectionPageRedirectRequired ( )

Definition at line 37 of file class.ilTestPasswordChecker.php.

References isPrivilegedParticipant(), isTestPasswordEnabled(), and isUserEnteredPasswordCorrect().

{
if( !$this->isTestPasswordEnabled() )
{
return false;
}
if( $this->isPrivilegedParticipant() )
{
return false;
}
{
return false;
}
return true;
}

+ Here is the call graph for this function:

ilTestPasswordChecker::isPrivilegedParticipant ( )
protected

Definition at line 62 of file class.ilTestPasswordChecker.php.

Referenced by isPasswordProtectionPageRedirectRequired().

{
return $this->rbacsystem->checkAccess('write', $this->testOBJ->getRefId());
}

+ Here is the caller graph for this function:

ilTestPasswordChecker::isTestPasswordEnabled ( )
protected

Definition at line 57 of file class.ilTestPasswordChecker.php.

Referenced by isPasswordProtectionPageRedirectRequired().

{
return strlen($this->testOBJ->getPassword());
}

+ Here is the caller graph for this function:

ilTestPasswordChecker::isUserEnteredPasswordCorrect ( )

Definition at line 67 of file class.ilTestPasswordChecker.php.

References getUserEnteredPassword().

Referenced by isPasswordProtectionPageRedirectRequired().

{
return $this->getUserEnteredPassword() == $this->testOBJ->getPassword();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestPasswordChecker::setUserEnteredPassword (   $enteredPassword)

Definition at line 72 of file class.ilTestPasswordChecker.php.

References $_SESSION, and buildSessionKey().

{
$_SESSION[$this->buildSessionKey()] = $enteredPassword;
}

+ Here is the call graph for this function:

Field Documentation

ilTestPasswordChecker::$rbacsystem
protected

Definition at line 16 of file class.ilTestPasswordChecker.php.

Referenced by __construct().

ilTestPasswordChecker::$testOBJ
protected

Definition at line 26 of file class.ilTestPasswordChecker.php.

Referenced by __construct().

ilTestPasswordChecker::$user
protected

Definition at line 21 of file class.ilTestPasswordChecker.php.

Referenced by __construct().


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