ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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

◆ __construct()

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ buildSessionKey()

ilTestPasswordChecker::buildSessionKey ( )
protected

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

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

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

+ Here is the caller graph for this function:

◆ getUserEnteredPassword()

ilTestPasswordChecker::getUserEnteredPassword ( )
protected

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

78 {
79 return $_SESSION[$this->buildSessionKey()];
80 }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

References $_SESSION, and buildSessionKey().

Referenced by isUserEnteredPasswordCorrect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSession()

ilTestPasswordChecker::initSession ( )
protected

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

83 {
84 if( !isset($_SESSION[$this->buildSessionKey()]) )
85 {
86 $_SESSION[$this->buildSessionKey()] = null;
87 }
88 }

References $_SESSION, and buildSessionKey().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPasswordProtectionPageRedirectRequired()

ilTestPasswordChecker::isPasswordProtectionPageRedirectRequired ( )

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

38 {
39 if( !$this->isTestPasswordEnabled() )
40 {
41 return false;
42 }
43
44 if( $this->isPrivilegedParticipant() )
45 {
46 return false;
47 }
48
49 if( $this->isUserEnteredPasswordCorrect() )
50 {
51 return false;
52 }
53
54 return true;
55 }

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

+ Here is the call graph for this function:

◆ isPrivilegedParticipant()

ilTestPasswordChecker::isPrivilegedParticipant ( )
protected

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

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

Referenced by isPasswordProtectionPageRedirectRequired().

+ Here is the caller graph for this function:

◆ isTestPasswordEnabled()

ilTestPasswordChecker::isTestPasswordEnabled ( )
protected

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

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

Referenced by isPasswordProtectionPageRedirectRequired().

+ Here is the caller graph for this function:

◆ isUserEnteredPasswordCorrect()

ilTestPasswordChecker::isUserEnteredPasswordCorrect ( )

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

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

References getUserEnteredPassword().

Referenced by isPasswordProtectionPageRedirectRequired().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUserEnteredPassword()

ilTestPasswordChecker::setUserEnteredPassword (   $enteredPassword)

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

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

References $_SESSION, and buildSessionKey().

+ Here is the call graph for this function:

Field Documentation

◆ $rbacsystem

ilTestPasswordChecker::$rbacsystem
protected

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

Referenced by __construct().

◆ $testOBJ

ilTestPasswordChecker::$testOBJ
protected

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

Referenced by __construct().

◆ $user

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: