ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules 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

◆ __construct()

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

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

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

29  {
30  $this->rbacsystem = $rbacsystem;
31  $this->user = $user;
32  $this->testOBJ = $testOBJ;
33 
34  $this->initSession();
35  }
+ Here is the call graph for this function:

Member Function Documentation

◆ buildSessionKey()

ilTestPasswordChecker::buildSessionKey ( )
protected

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

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

91  {
92  return 'tst_password_'.$this->testOBJ->getTestId();
93  }
+ Here is the caller graph for this function:

◆ getUserEnteredPassword()

ilTestPasswordChecker::getUserEnteredPassword ( )
protected

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

References $_SESSION, and buildSessionKey().

Referenced by isUserEnteredPasswordCorrect().

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']
+ 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.

References $_SESSION, and buildSessionKey().

Referenced by __construct().

83  {
84  if( !isset($_SESSION[$this->buildSessionKey()]) )
85  {
86  $_SESSION[$this->buildSessionKey()] = null;
87  }
88  }
< 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']
+ 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.

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

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  }
+ Here is the call graph for this function:

◆ isPrivilegedParticipant()

ilTestPasswordChecker::isPrivilegedParticipant ( )
protected

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

Referenced by isPasswordProtectionPageRedirectRequired().

63  {
64  return $this->rbacsystem->checkAccess('write', $this->testOBJ->getRefId());
65  }
+ Here is the caller graph for this function:

◆ isTestPasswordEnabled()

ilTestPasswordChecker::isTestPasswordEnabled ( )
protected

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

Referenced by isPasswordProtectionPageRedirectRequired().

58  {
59  return strlen($this->testOBJ->getPassword());
60  }
+ Here is the caller graph for this function:

◆ isUserEnteredPasswordCorrect()

ilTestPasswordChecker::isUserEnteredPasswordCorrect ( )

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

References getUserEnteredPassword().

Referenced by isPasswordProtectionPageRedirectRequired().

68  {
69  return $this->getUserEnteredPassword() == $this->testOBJ->getPassword();
70  }
+ 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.

References $_SESSION, and buildSessionKey().

73  {
74  $_SESSION[$this->buildSessionKey()] = $enteredPassword;
75  }
< 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']
+ 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: