ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilTestPasswordProtectionGUI Class Reference
+ Collaboration diagram for ilTestPasswordProtectionGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilTemplate $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 Attributes

 $ctrl
 
 $tpl
 
 $lng
 
 $parentGUI
 
 $passwordChecker
 

Private Member Functions

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

Private Attributes

 $nextCommandClass
 
 $nextCommandCmd
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ backToInfoScreenCmd()

ilTestPasswordProtectionGUI::backToInfoScreenCmd ( )
private

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

115 {
116 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
117 }

◆ executeCommand()

ilTestPasswordProtectionGUI::executeCommand ( )

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

64 {
65 $this->ctrl->saveParameter($this, 'nextCommand');
66 $nextCommand = explode('::', $_GET['nextCommand']);
67 $this->setNextCommandClass($nextCommand[0]);
68 $this->setNextCommandCmd($nextCommand[1]);
69
70 $this->ctrl->saveParameter($this->parentGUI, 'lock');
71
72 switch($this->ctrl->getNextClass())
73 {
74 default:
75
76 $cmd = $this->ctrl->getCmd().'Cmd';
77 $this->$cmd();
78 }
79 }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, setNextCommandClass(), and setNextCommandCmd().

+ Here is the call graph for this function:

◆ getNextCommandClass()

ilTestPasswordProtectionGUI::getNextCommandClass ( )
private

Definition at line 124 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 134 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 102 of file class.ilTestPasswordProtectionGUI.php.

103 {
104 $this->passwordChecker->setUserEnteredPassword($_POST["password"]);
105
106 if( !$this->passwordChecker->isUserEnteredPasswordCorrect() )
107 {
108 ilUtil::sendFailure($this->lng->txt("tst_password_entered_wrong_password"), true);
109 }
110
111 $this->ctrl->redirectByClass($this->getNextCommandClass(), $this->getNextCommandCmd());
112 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST['username']
Definition: cron.php:12

References $_POST, getNextCommandClass(), getNextCommandCmd(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ setNextCommandClass()

ilTestPasswordProtectionGUI::setNextCommandClass (   $nextCommandClass)
private

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

120 {
121 $this->nextCommandClass = $nextCommandClass;
122 }

References $nextCommandClass.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ setNextCommandCmd()

ilTestPasswordProtectionGUI::setNextCommandCmd (   $nextCommandCmd)
private

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

130 {
131 $this->nextCommandCmd = $nextCommandCmd;
132 }

References $nextCommandCmd.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ showPasswordFormCmd()

ilTestPasswordProtectionGUI::showPasswordFormCmd ( )
private

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

82 {
83 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
84 require_once 'Services/Form/classes/class.ilPasswordInputGUI.php';
85
86 $form = new ilPropertyFormGUI();
87 $form->setTitle($this->lng->txt("tst_password_form"));
88 $form->setDescription($this->lng->txt("tst_password_introduction"));
89
90 $form->setFormAction($this->ctrl->getFormAction($this));
91 $form->addCommandButton(self::CMD_SAVE_ENTERED_PASSWORD, $this->lng->txt("submit"));
92 $form->addCommandButton(self::CMD_BACK_TO_INFO_SCREEN, $this->lng->txt("cancel"));
93
94 $inp = new ilPasswordInputGUI($this->lng->txt("tst_password"), 'password');
95 $inp->setRequired(true);
96 $inp->setRetype(false);
97 $form->addItem($inp);
98
99 $this->tpl->setVariable($this->parentGUI->getContentBlockName(), $this->ctrl->getHTML($form));
100 }
This class represents a password property in a property form.
This class represents a property form user interface.

Field Documentation

◆ $ctrl

ilTestPasswordProtectionGUI::$ctrl
protected

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

Referenced by __construct().

◆ $lng

ilTestPasswordProtectionGUI::$lng
protected

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

Referenced by __construct().

◆ $nextCommandClass

ilTestPasswordProtectionGUI::$nextCommandClass
private

◆ $nextCommandCmd

ilTestPasswordProtectionGUI::$nextCommandCmd
private

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

Referenced by getNextCommandCmd(), and setNextCommandCmd().

◆ $parentGUI

ilTestPasswordProtectionGUI::$parentGUI
protected

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

Referenced by __construct().

◆ $passwordChecker

ilTestPasswordProtectionGUI::$passwordChecker
protected

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

Referenced by __construct().

◆ $tpl

ilTestPasswordProtectionGUI::$tpl
protected

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

Referenced by __construct().

◆ CMD_BACK_TO_INFO_SCREEN

const ilTestPasswordProtectionGUI::CMD_BACK_TO_INFO_SCREEN = 'backToInfoScreen'

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

◆ CMD_SAVE_ENTERED_PASSWORD

const ilTestPasswordProtectionGUI::CMD_SAVE_ENTERED_PASSWORD = 'saveEnteredPassword'

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

◆ CMD_SHOW_PASSWORD_FORM

const ilTestPasswordProtectionGUI::CMD_SHOW_PASSWORD_FORM = 'showPasswordForm'

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


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