ILIAS  trunk Revision v11.0_alpha-1861-g09f3d197f78
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestPasswordChecker Class Reference
+ Collaboration diagram for ilTestPasswordChecker:

Public Member Functions

 __construct (ilRbacSystem $rbacsystem, ilObjUser $user, ilObjTest $testOBJ, ilLanguage $lng)
 
 isPasswordProtectionPageRedirectRequired ()
 
 wrongUserEnteredPasswordExist ()
 
 isUserEnteredPasswordCorrect ()
 
 setUserEnteredPassword ($enteredPassword)
 
 logWrongEnteredPassword ()
 

Protected Member Functions

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

Protected Attributes

 $rbacsystem
 
 $user
 
 $testOBJ
 
 $lng
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ buildSessionKey()

ilTestPasswordChecker::buildSessionKey ( )
protected

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

Referenced by getUserEnteredPassword(), and setUserEnteredPassword().

100  : string
101  {
102  return 'tst_password_' . $this->testOBJ->getTestId();
103  }
+ Here is the caller graph for this function:

◆ getUserEnteredPassword()

ilTestPasswordChecker::getUserEnteredPassword ( )
protected

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

References buildSessionKey(), and ilSession\get().

Referenced by isUserEnteredPasswordCorrect(), and wrongUserEnteredPasswordExist().

96  {
97  return ilSession::get($this->buildSessionKey());
98  }
static get(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPasswordProtectionPageRedirectRequired()

ilTestPasswordChecker::isPasswordProtectionPageRedirectRequired ( )

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

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

57  : bool
58  {
59  return (
60  $this->isTestPasswordEnabled()
61  && !$this->isPrivilegedParticipant()
62  && !$this->isUserEnteredPasswordCorrect()
63  );
64  }
+ Here is the call graph for this function:

◆ isPrivilegedParticipant()

ilTestPasswordChecker::isPrivilegedParticipant ( )
protected

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

Referenced by isPasswordProtectionPageRedirectRequired().

71  : bool
72  {
73  return $this->rbacsystem->checkAccess('write', $this->testOBJ->getRefId());
74  }
+ Here is the caller graph for this function:

◆ isTestPasswordEnabled()

ilTestPasswordChecker::isTestPasswordEnabled ( )
protected

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

References null.

Referenced by isPasswordProtectionPageRedirectRequired().

66  : bool
67  {
68  return $this->testOBJ->getPassword() !== null;
69  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ isUserEnteredPasswordCorrect()

ilTestPasswordChecker::isUserEnteredPasswordCorrect ( )

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

References getUserEnteredPassword().

Referenced by isPasswordProtectionPageRedirectRequired(), and wrongUserEnteredPasswordExist().

85  : bool
86  {
87  return $this->getUserEnteredPassword() == $this->testOBJ->getPassword();
88  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logWrongEnteredPassword()

ilTestPasswordChecker::logWrongEnteredPassword ( )

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

106  {
107  }

◆ setUserEnteredPassword()

ilTestPasswordChecker::setUserEnteredPassword (   $enteredPassword)

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

References buildSessionKey(), and ilSession\set().

91  {
92  ilSession::set($this->buildSessionKey(), $enteredPassword);
93  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ wrongUserEnteredPasswordExist()

ilTestPasswordChecker::wrongUserEnteredPasswordExist ( )

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

References getUserEnteredPassword(), and isUserEnteredPasswordCorrect().

76  : bool
77  {
78  if ($this->getUserEnteredPassword() && $this->getUserEnteredPassword() === '') {
79  return false;
80  }
81 
82  return !$this->isUserEnteredPasswordCorrect();
83  }
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilTestPasswordChecker::$lng
protected

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

Referenced by __construct().

◆ $rbacsystem

ilTestPasswordChecker::$rbacsystem
protected

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

Referenced by __construct().

◆ $testOBJ

ilTestPasswordChecker::$testOBJ
protected

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

Referenced by __construct().

◆ $user

ilTestPasswordChecker::$user
protected

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

Referenced by __construct().


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