ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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

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

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

References $ctrl, $lng, $parentGUI, $passwordChecker, and $tpl.

{
$this->ctrl = $ctrl;
$this->tpl = $tpl;
$this->lng = $lng;
$this->parentGUI = $parentGUI;
$this->passwordChecker = $passwordChecker;
}

Member Function Documentation

ilTestPasswordProtectionGUI::backToInfoScreenCmd ( )
private

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

{
$this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
}
ilTestPasswordProtectionGUI::executeCommand ( )

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

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

{
$this->ctrl->saveParameter($this, 'nextCommand');
$nextCommand = explode('::', $_GET['nextCommand']);
$this->setNextCommandClass($nextCommand[0]);
$this->setNextCommandCmd($nextCommand[1]);
$this->ctrl->saveParameter($this->parentGUI, 'lock');
switch($this->ctrl->getNextClass())
{
default:
$cmd = $this->ctrl->getCmd().'Cmd';
$this->$cmd();
}
}

+ Here is the call graph for this function:

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:

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:

ilTestPasswordProtectionGUI::saveEnteredPasswordCmd ( )
private

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

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

{
$this->passwordChecker->setUserEnteredPassword($_POST["password"]);
if( !$this->passwordChecker->isUserEnteredPasswordCorrect() )
{
ilUtil::sendFailure($this->lng->txt("tst_password_entered_wrong_password"), true);
}
$this->ctrl->redirectByClass($this->getNextCommandClass(), $this->getNextCommandCmd());
}

+ Here is the call graph for this function:

ilTestPasswordProtectionGUI::setNextCommandClass (   $nextCommandClass)
private

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

References $nextCommandClass.

Referenced by executeCommand().

{
$this->nextCommandClass = $nextCommandClass;
}

+ Here is the caller graph for this function:

ilTestPasswordProtectionGUI::setNextCommandCmd (   $nextCommandCmd)
private

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

References $nextCommandCmd.

Referenced by executeCommand().

{
$this->nextCommandCmd = $nextCommandCmd;
}

+ Here is the caller graph for this function:

ilTestPasswordProtectionGUI::showPasswordFormCmd ( )
private

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

References ilFormPropertyGUI\setRequired().

{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
require_once 'Services/Form/classes/class.ilPasswordInputGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt("tst_password_form"));
$form->setDescription($this->lng->txt("tst_password_introduction"));
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton(self::CMD_SAVE_ENTERED_PASSWORD, $this->lng->txt("submit"));
$form->addCommandButton(self::CMD_BACK_TO_INFO_SCREEN, $this->lng->txt("cancel"));
$inp = new ilPasswordInputGUI($this->lng->txt("tst_password"), 'password');
$inp->setRequired(true);
$inp->setRetype(false);
$form->addItem($inp);
$this->tpl->setVariable($this->parentGUI->getContentBlockName(), $this->ctrl->getHTML($form));
}

+ Here is the call graph for this function:

Field Documentation

ilTestPasswordProtectionGUI::$ctrl
protected

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

Referenced by __construct().

ilTestPasswordProtectionGUI::$lng
protected

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

Referenced by __construct().

ilTestPasswordProtectionGUI::$nextCommandClass
private
ilTestPasswordProtectionGUI::$nextCommandCmd
private

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

Referenced by getNextCommandCmd(), and setNextCommandCmd().

ilTestPasswordProtectionGUI::$parentGUI
protected

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

Referenced by __construct().

ilTestPasswordProtectionGUI::$passwordChecker
protected

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

Referenced by __construct().

ilTestPasswordProtectionGUI::$tpl
protected

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

Referenced by __construct().

const ilTestPasswordProtectionGUI::CMD_BACK_TO_INFO_SCREEN = 'backToInfoScreen'

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

const ilTestPasswordProtectionGUI::CMD_SAVE_ENTERED_PASSWORD = 'saveEnteredPassword'

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

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: