ILIAS  release_8 Revision v8.24
ilTestPasswordProtectionGUI Class Reference
+ Collaboration diagram for ilTestPasswordProtectionGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilGlobalTemplateInterface $tpl, ilLanguage $lng, ilTestPlayerAbstractGUI $parentGUI, ilTestPasswordChecker $passwordChecker)
 
 executeCommand ()
 

Data Fields

const CMD_SHOW_PASSWORD_FORM = 'showPasswordForm'
 
const CMD_SAVE_ENTERED_PASSWORD = 'saveEnteredPassword'
 
const CMD_BACK_TO_INFO_SCREEN = 'backToInfoScreen'
 

Protected Member Functions

 buildPasswordMsg ()
 
 buildPasswordForm ()
 

Protected Attributes

 $ctrl
 
 $tpl
 
 $lng
 
 $parentGUI
 
 $passwordChecker
 

Private Member Functions

 showPasswordFormCmd ()
 
 saveEnteredPasswordCmd ()
 
 backToInfoScreenCmd ()
 
 setNextCommandClass ($nextCommandClass)
 
 getNextCommandClass ()
 
 setNextCommandCmd ($nextCommandCmd)
 
 getNextCommandCmd ()
 

Private Attributes

ILIAS Test InternalRequestService $testrequest
 
 $nextCommandClass
 
 $nextCommandCmd
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestPasswordProtectionGUI::__construct ( ilCtrl  $ctrl,
ilGlobalTemplateInterface  $tpl,
ilLanguage  $lng,
ilTestPlayerAbstractGUI  $parentGUI,
ilTestPasswordChecker  $passwordChecker 
)

Member Function Documentation

◆ backToInfoScreenCmd()

ilTestPasswordProtectionGUI::backToInfoScreenCmd ( )
private

Definition at line 160 of file class.ilTestPasswordProtectionGUI.php.

161 {
162 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
163 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ buildPasswordForm()

ilTestPasswordProtectionGUI::buildPasswordForm ( )
protected
Returns
ilPropertyFormGUI

Definition at line 112 of file class.ilTestPasswordProtectionGUI.php.

113 {
114 $form = new ilPropertyFormGUI();
115 $form->setTitle($this->lng->txt("tst_password_form"));
116 $form->setDescription($this->lng->txt("tst_password_introduction"));
117
118 $form->setFormAction($this->ctrl->getFormAction($this));
119 $form->addCommandButton(self::CMD_SAVE_ENTERED_PASSWORD, $this->lng->txt("submit"));
120 $form->addCommandButton(self::CMD_BACK_TO_INFO_SCREEN, $this->lng->txt("cancel"));
121
122 $inp = new ilPasswordInputGUI($this->lng->txt("tst_password"), 'password');
123 $inp->setRequired(true);
124 $inp->setRetype(false);
125 $form->addItem($inp);
126 return $form;
127 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by showPasswordFormCmd().

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

◆ buildPasswordMsg()

ilTestPasswordProtectionGUI::buildPasswordMsg ( )
protected

Definition at line 97 of file class.ilTestPasswordProtectionGUI.php.

97 : string
98 {
99 if (!$this->passwordChecker->wrongUserEnteredPasswordExist()) {
100 return '';
101 }
102
104 $this->lng->txt('tst_password_entered_wrong_password'),
105 'failure'
106 );
107 }
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.

References ilUtil\getSystemMessageHTML(), and ILIAS\Repository\lng().

Referenced by showPasswordFormCmd().

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

◆ executeCommand()

ilTestPasswordProtectionGUI::executeCommand ( )

Definition at line 80 of file class.ilTestPasswordProtectionGUI.php.

81 {
82 $this->ctrl->saveParameter($this, 'nextCommand');
83 $nextCommand = explode('::', $this->testrequest->getNextCommand());
84 $this->setNextCommandClass($nextCommand[0]);
85 $this->setNextCommandCmd($nextCommand[1]);
86
87 $this->ctrl->saveParameter($this->parentGUI, 'lock');
88
89 switch ($this->ctrl->getNextClass()) {
90 default:
91
92 $cmd = $this->ctrl->getCmd() . 'Cmd';
93 $this->$cmd();
94 }
95 }

References ILIAS\Repository\ctrl(), setNextCommandClass(), and setNextCommandCmd().

+ Here is the call graph for this function:

◆ getNextCommandClass()

ilTestPasswordProtectionGUI::getNextCommandClass ( )
private

Definition at line 170 of file class.ilTestPasswordProtectionGUI.php.

References $nextCommandClass.

Referenced by saveEnteredPasswordCmd().

+ Here is the caller graph for this function:

◆ getNextCommandCmd()

ilTestPasswordProtectionGUI::getNextCommandCmd ( )
private

Definition at line 180 of file class.ilTestPasswordProtectionGUI.php.

References $nextCommandCmd.

Referenced by saveEnteredPasswordCmd().

+ Here is the caller graph for this function:

◆ saveEnteredPasswordCmd()

ilTestPasswordProtectionGUI::saveEnteredPasswordCmd ( )
private

Definition at line 149 of file class.ilTestPasswordProtectionGUI.php.

150 {
151 $this->passwordChecker->setUserEnteredPassword($_POST["password"]);
152
153 if (!$this->passwordChecker->isUserEnteredPasswordCorrect()) {
154 $this->passwordChecker->logWrongEnteredPassword();
155 }
156
157 $this->ctrl->redirectByClass($this->getNextCommandClass(), $this->getNextCommandCmd());
158 }

References ILIAS\Repository\ctrl(), getNextCommandClass(), and getNextCommandCmd().

+ Here is the call graph for this function:

◆ setNextCommandClass()

ilTestPasswordProtectionGUI::setNextCommandClass (   $nextCommandClass)
private

Definition at line 165 of file class.ilTestPasswordProtectionGUI.php.

166 {
167 $this->nextCommandClass = $nextCommandClass;
168 }

References $nextCommandClass.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ setNextCommandCmd()

ilTestPasswordProtectionGUI::setNextCommandCmd (   $nextCommandCmd)
private

Definition at line 175 of file class.ilTestPasswordProtectionGUI.php.

176 {
177 $this->nextCommandCmd = $nextCommandCmd;
178 }

References $nextCommandCmd.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ showPasswordFormCmd()

ilTestPasswordProtectionGUI::showPasswordFormCmd ( )
private

Definition at line 129 of file class.ilTestPasswordProtectionGUI.php.

130 {
131 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
132 require_once 'Services/Form/classes/class.ilPasswordInputGUI.php';
133
134 global $DIC;
135 $DIC->globalScreen()->tool()->context()->current()->getAdditionalData()->replace(
137 $this->parentGUI->getObject()->getTitle() . ' - ' . $this->lng->txt('tst_password_form')
138 );
139
140 $msg = $this->buildPasswordMsg();
141 $form = $this->buildPasswordForm();
142
143 $this->tpl->setVariable(
144 $this->parentGUI->getContentBlockName(),
145 $msg . $this->ctrl->getHTML($form)
146 );
147 }

References $DIC, buildPasswordForm(), buildPasswordMsg(), and ilTestPlayerLayoutProvider\TEST_PLAYER_TITLE.

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilTestPasswordProtectionGUI::$ctrl
protected

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

Referenced by __construct().

◆ $lng

ilTestPasswordProtectionGUI::$lng
protected

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

Referenced by __construct().

◆ $nextCommandClass

ilTestPasswordProtectionGUI::$nextCommandClass
private

◆ $nextCommandCmd

ilTestPasswordProtectionGUI::$nextCommandCmd
private

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

Referenced by getNextCommandCmd(), and setNextCommandCmd().

◆ $parentGUI

ilTestPasswordProtectionGUI::$parentGUI
protected

Definition at line 52 of file class.ilTestPasswordProtectionGUI.php.

Referenced by __construct().

◆ $passwordChecker

ilTestPasswordProtectionGUI::$passwordChecker
protected

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

Referenced by __construct().

◆ $testrequest

ILIAS Test InternalRequestService ilTestPasswordProtectionGUI::$testrequest
private

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

◆ $tpl

ilTestPasswordProtectionGUI::$tpl
protected

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

Referenced by __construct().

◆ CMD_BACK_TO_INFO_SCREEN

const ilTestPasswordProtectionGUI::CMD_BACK_TO_INFO_SCREEN = 'backToInfoScreen'

Definition at line 31 of file class.ilTestPasswordProtectionGUI.php.

◆ CMD_SAVE_ENTERED_PASSWORD

const ilTestPasswordProtectionGUI::CMD_SAVE_ENTERED_PASSWORD = 'saveEnteredPassword'

Definition at line 30 of file class.ilTestPasswordProtectionGUI.php.

◆ CMD_SHOW_PASSWORD_FORM

const ilTestPasswordProtectionGUI::CMD_SHOW_PASSWORD_FORM = 'showPasswordForm'

Definition at line 29 of file class.ilTestPasswordProtectionGUI.php.


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