ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPasswordInputGUI Class Reference

This class represents a password property in a property form. More...

+ Inheritance diagram for ilPasswordInputGUI:
+ Collaboration diagram for ilPasswordInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setValue ($a_value)
 Set Value.
 getValue ()
 Get Value.
 setRetypeValue ($a_retypevalue)
 Set Retype Value.
 getRetypeValue ()
 Get Retype Value.
 setMaxLength ($a_maxlength)
 Set Max Length.
 getMaxLength ()
 Get Max Length.
 setSize ($a_size)
 Set Size.
 setValueByArray ($a_values)
 Set value by array.
 getSize ()
 Get Size.
 setValidateAuthPost ($a_validateauthpost)
 Set Validate required status against authentication POST var.
 getValidateAuthPost ()
 Get Validate required status against authentication POST var.
 setRequiredOnAuth ($a_requiredonauth)
 Set input required, if authentication mode allows password setting.
 getRequiredOnAuth ()
 Get input required, if authentication mode allows password setting.
 checkInput ()
 Check input, strip slashes etc.
 insert (&$a_tpl)
 Insert property html.
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 setSubformMode ($a_subformmode)
 Set Subform Mode.
 getSubformMode ()
 Get Subform Mode.
 checkSubItemsInput ()
 Check SubItems.
 getSubForm ()
 Get sub form html.
- Public Member Functions inherited from ilFormPropertyGUI
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setPostVar ($a_postvar)
 Set Post Variable.
 getPostVar ()
 Get Post Variable.
 getFieldId ()
 Get Post Variable.
 setInfo ($a_info)
 Set Information Text.
 getInfo ()
 Get Information Text.
 setAlert ($a_alert)
 Set Alert Text.
 getAlert ()
 Get Alert Text.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required.
 setDisabled ($a_disabled)
 Set Disabled.
 getDisabled ()
 Get Disabled.

Protected Attributes

 $value
 $size = 20
 $max_length = 40
 $validateauthpost = ""
 $requiredonauth = false
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 $subformmode = "bottom"
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.

Detailed Description

This class represents a password property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

ilPasswordInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

Definition at line 45 of file class.ilPasswordInputGUI.php.

{
parent::__construct($a_title, $a_postvar);
}

Member Function Documentation

ilPasswordInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 185 of file class.ilPasswordInputGUI.php.

References $auth, $lng, ilAuthUtils\_allowPasswordModificationByAuthMode(), ilAuthUtils\_getAuthMode(), ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getRequiredOnAuth(), getValidateAuthPost(), ilUtil\isPassword(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

{
global $lng;
$_POST[$this->getPostVar()] = ilUtil::stripSlashes($_POST[$this->getPostVar()]);
$_POST[$this->getPostVar()."_retype"] = ilUtil::stripSlashes($_POST[$this->getPostVar()."_retype"]);
if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "")
{
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
if ($this->getValidateAuthPost() != "")
{
// check, if password is required dependent on auth mode
&& trim($_POST[$this->getPostVar()]) == "")
{
$this->setAlert($lng->txt("form_password_required_for_auth"));
return false;
}
// check, if password is allowed to be set for given auth mode
if (trim($_POST[$this->getPostVar()]) != "" &&
{
$this->setAlert($lng->txt("form_password_not_allowed_for_auth"));
return false;
}
}
if ($_POST[$this->getPostVar()] != $_POST[$this->getPostVar()."_retype"])
{
$this->setAlert($lng->txt("passwd_not_match"));
return false;
}
if (!ilUtil::isPassword($_POST[$this->getPostVar()],$custom_error) && $_POST[$this->getPostVar()] != "")
{
if($custom_error != '') $this->setAlert($custom_error);
else $this->setAlert($lng->txt("passwd_invalid"));
return false;
}
return $this->checkSubItemsInput();
}

+ Here is the call graph for this function:

ilPasswordInputGUI::getMaxLength ( )

Get Max Length.

Returns
int Max Length

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

Referenced by insert().

{
return $this->maxlength;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::getRequiredOnAuth ( )

Get input required, if authentication mode allows password setting.

Returns
boolean require input

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

References $requiredonauth.

Referenced by checkInput().

{
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::getRetypeValue ( )

Get Retype Value.

Returns
string Retype Value

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

Referenced by insert().

{
return $this->retypevalue;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::getSize ( )

Get Size.

Returns
int Size

Definition at line 135 of file class.ilPasswordInputGUI.php.

References $size.

Referenced by insert().

{
return $this->size;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::getValidateAuthPost ( )

Get Validate required status against authentication POST var.

Returns
string POST var

Definition at line 155 of file class.ilPasswordInputGUI.php.

References $validateauthpost.

Referenced by checkInput().

+ Here is the caller graph for this function:

ilPasswordInputGUI::getValue ( )

Get Value.

Returns
string Value

Definition at line 65 of file class.ilPasswordInputGUI.php.

References $value.

Referenced by insert().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::insert ( $a_tpl)

Insert property html.

Definition at line 239 of file class.ilPasswordInputGUI.php.

References $lng, ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), getMaxLength(), ilFormPropertyGUI\getPostVar(), getRetypeValue(), getSize(), getValue(), and ilUtil\prepareFormOutput().

{
global $lng;
if (strlen($this->getValue()))
{
$a_tpl->setCurrentBlock("prop_password_propval");
$a_tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
$a_tpl->parseCurrentBlock();
}
$a_tpl->setCurrentBlock("prop_password");
$a_tpl->setVariable("TXT_RETYPE", $lng->txt("form_retype_password"));
$a_tpl->setVariable("POST_VAR", $this->getPostVar());
$a_tpl->setVariable("ID", $this->getFieldId());
$retype_value = ($this->getRetypeValue() != "")
? $this->getRetypeValue()
: $this->getValue();
$a_tpl->setVariable("PROPERTY_RETYPE_VALUE", ilUtil::prepareFormOutput($retype_value));
$a_tpl->setVariable("SIZE", $this->getSize());
$a_tpl->setVariable("MAXLENGTH", $this->getMaxLength());
if ($this->getDisabled())
{
$a_tpl->setVariable("DISABLED",
" disabled=\"disabled\"");
}
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilPasswordInputGUI::setMaxLength (   $a_maxlength)

Set Max Length.

Parameters
int$a_maxlengthMax Length

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

{
$this->maxlength = $a_maxlength;
}
ilPasswordInputGUI::setRequiredOnAuth (   $a_requiredonauth)

Set input required, if authentication mode allows password setting.

Parameters
boolean$a_requiredonauthrequire input

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

{
$this->requiredonauth = $a_requiredonauth;
}
ilPasswordInputGUI::setRetypeValue (   $a_retypevalue)

Set Retype Value.

Parameters
string$a_retypevalueRetype Value

Definition at line 75 of file class.ilPasswordInputGUI.php.

{
$this->retypevalue = $a_retypevalue;
}
ilPasswordInputGUI::setSize (   $a_size)

Set Size.

Parameters
int$a_sizeSize

Definition at line 115 of file class.ilPasswordInputGUI.php.

Referenced by ilObjUserGUI\initForm().

{
$this->size = $a_size;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::setValidateAuthPost (   $a_validateauthpost)

Set Validate required status against authentication POST var.

Parameters
string$a_validateauthpostPOST var

Definition at line 145 of file class.ilPasswordInputGUI.php.

{
$this->validateauthpost = $a_validateauthpost;
}
ilPasswordInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Definition at line 55 of file class.ilPasswordInputGUI.php.

Referenced by setValueByArray().

{
$this->value = $a_value;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 125 of file class.ilPasswordInputGUI.php.

References ilFormPropertyGUI\getPostVar(), and setValue().

{
$this->setValue($a_values[$this->getPostVar()]);
}

+ Here is the call graph for this function:

Field Documentation

ilPasswordInputGUI::$max_length = 40
protected

Definition at line 35 of file class.ilPasswordInputGUI.php.

ilPasswordInputGUI::$requiredonauth = false
protected

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

Referenced by getRequiredOnAuth().

ilPasswordInputGUI::$size = 20
protected

Definition at line 34 of file class.ilPasswordInputGUI.php.

Referenced by getSize().

ilPasswordInputGUI::$validateauthpost = ""
protected

Definition at line 36 of file class.ilPasswordInputGUI.php.

Referenced by getValidateAuthPost().

ilPasswordInputGUI::$value
protected

Definition at line 33 of file class.ilPasswordInputGUI.php.

Referenced by getValue().


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