ILIAS  Release_4_4_x_branch Revision 61816
 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.
 setRetype ($a_val)
 Set retype on/off.
 getRetype ()
 Get retype on/off.
 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.
 setPreSelection ($a_val)
 Set preselection.
 getPreSelection ()
 Get preselection.
 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.
 setSkipSyntaxCheck ($a_val)
 Set skip syntax check.
 getSkipSyntaxCheck ()
 Get skip syntax check.
 setDisableHtmlAutoComplete ($a_value)
 Set autocomplete.
 isHtmlAutoCompleteDisabled ()
 Get autocomplete.
 checkInput ()
 Check input, strip slashes etc.
 render ()
 Render item.
 insert (&$a_tpl)
 Insert property html.
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively
 checkSubItemsInput ()
 Check SubItems.
 getSubForm ()
 Get sub form html.
 getItemByPostVar ($a_post_var)
 Get item by post var.
- Public Member Functions inherited from ilFormPropertyGUI
executeCommand ()
 Execute command.
 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.
 setParentForm ($a_parentform)
 Set Parent Form.
 getParentForm ()
 Get Parent Form.
 setParent ($a_val)
 Set Parent GUI object.
 getParent ()
 Get Parent GUI object.
 hideSubForm ()
 Sub form hidden on init?
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders)
 getHiddenTitle ()
 Get hidden title.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 writeToSession ()
 Write to session.
 clearFromSession ()
 Clear session value.
 readFromSession ()
 Read from session.
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties)
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi.
 getMulti ()
 Get Multi.
 setMultiValues (array $a_values)
 Set multi values.
 getMultiValues ()
 Get multi values.
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g.

Protected Attributes

 $value
 $size = 20
 $max_length = 40
 $validateauthpost = ""
 $requiredonauth = false
 $preselection = false
 $maxlength = false
 $autocomplete_disabled = true
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""
 $multi = false
 $multi_sortable = false
 $multi_addremove = true
 $multi_values

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.
 getMultiIconsHTML ()
 Get HTML for multiple value icons.

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 11 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 32 of file class.ilPasswordInputGUI.php.

References setRetype(), and setSkipSyntaxCheck().

{
parent::__construct($a_title, $a_postvar);
$this->setRetype(true);
$this->setSkipSyntaxCheck(false);
}

+ Here is the call graph for this function:

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 255 of file class.ilPasswordInputGUI.php.

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

{
global $lng;
$_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 ($this->getRetype() && !$this->getPreSelection() &&
($_POST[$this->getPostVar()] != $_POST[$this->getPostVar()."_retype"]))
{
$this->setAlert($lng->txt("passwd_not_match"));
return false;
}
if (!$this->getSkipSyntaxCheck() &&
!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 114 of file class.ilPasswordInputGUI.php.

References $maxlength.

Referenced by render().

{
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::getPreSelection ( )

Get preselection.

Returns
boolean preselection of five passwords true/false

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

References $preselection.

Referenced by checkInput(), and render().

{
}

+ 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 205 of file class.ilPasswordInputGUI.php.

References $requiredonauth.

Referenced by checkInput().

{
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::getRetype ( )

Get retype on/off.

Returns
boolean retype

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

Referenced by checkInput(), and render().

{
return $this->retype;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::getRetypeValue ( )

Get Retype Value.

Returns
string Retype Value

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

Referenced by render().

{
return $this->retypevalue;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::getSize ( )

Get Size.

Returns
int Size

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

References $size.

Referenced by render().

{
return $this->size;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::getSkipSyntaxCheck ( )

Get skip syntax check.

Returns
boolean skip syntax check

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

Referenced by checkInput().

{
return $this->skip_syntax_check;
}

+ 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 185 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 54 of file class.ilPasswordInputGUI.php.

References $value.

Referenced by render().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

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

References render().

{
$html = $this->render();
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $html);
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilPasswordInputGUI::isHtmlAutoCompleteDisabled ( )

Get autocomplete.

Returns
bool Value

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

References $autocomplete_disabled.

Referenced by render().

+ Here is the caller graph for this function:

ilPasswordInputGUI::render ( )

Render item.

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

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

Referenced by insert().

{
global $lng;
$ptpl = new ilTemplate("tpl.prop_password.html", true, true, "Services/Form");
if (!$this->getPreSelection())
{
if ($this->getRetype())
{
$ptpl->setCurrentBlock("retype");
$ptpl->setVariable("RSIZE", $this->getSize());
$ptpl->setVariable("RID", $this->getFieldId());
$ptpl->setVariable("RMAXLENGTH", $this->getMaxLength());
$ptpl->setVariable("RPOST_VAR", $this->getPostVar());
{
$ptpl->setVariable("RAUTOCOMPLETE", "autocomplete=\"off\"");
}
// this is creating an "auto entry" in the setup, if the retype is missing
/*$retype_value = ($this->getRetypeValue() != "")
? $this->getRetypeValue()
: $this->getValue();*/
$retype_value = $this->getRetypeValue();
$ptpl->setVariable("PROPERTY_RETYPE_VALUE", ilUtil::prepareFormOutput($retype_value));
if ($this->getDisabled())
{
$ptpl->setVariable("RDISABLED",
" disabled=\"disabled\"");
}
$ptpl->setVariable("TXT_RETYPE", $lng->txt("form_retype_password"));
$ptpl->parseCurrentBlock();
}
if (strlen($this->getValue()))
{
$ptpl->setCurrentBlock("prop_password_propval");
$ptpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
$ptpl->parseCurrentBlock();
}
$ptpl->setVariable("POST_VAR", $this->getPostVar());
$ptpl->setVariable("ID", $this->getFieldId());
$ptpl->setVariable("SIZE", $this->getSize());
$ptpl->setVariable("MAXLENGTH", $this->getMaxLength());
if ($this->getDisabled())
{
$ptpl->setVariable("DISABLED",
" disabled=\"disabled\"");
}
{
$ptpl->setVariable("AUTOCOMPLETE", "autocomplete=\"off\"");
}
}
else
{
// preselection
$passwd_list = ilUtil::generatePasswords(5);
foreach ($passwd_list as $passwd)
{
$i++;
$ptpl->setCurrentBlock("select_input");
$ptpl->setVariable("POST_VAR", $this->getPostVar());
$ptpl->setVariable("OP_ID", $this->getPostVar()."_".$i);
$ptpl->setVariable("VAL_RADIO_OPTION", $passwd);
$ptpl->setVariable("TXT_RADIO_OPTION", $passwd);
$ptpl->parseCurrentBlock();
}
}
return $ptpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPasswordInputGUI::setDisableHtmlAutoComplete (   $a_value)

Set autocomplete.

Parameters
bool$a_valueValue

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

{
$this->autocomplete_disabled = (bool)$a_value;
}
ilPasswordInputGUI::setMaxLength (   $a_maxlength)

Set Max Length.

Parameters
int$a_maxlengthMax Length

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

{
$this->maxlength = $a_maxlength;
}
ilPasswordInputGUI::setPreSelection (   $a_val)

Set preselection.

Parameters
booleanpreselection of five passwords true/false

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

{
$this->preselection = $a_val;
}
ilPasswordInputGUI::setRequiredOnAuth (   $a_requiredonauth)

Set input required, if authentication mode allows password setting.

Parameters
boolean$a_requiredonauthrequire input

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

{
$this->requiredonauth = $a_requiredonauth;
}
ilPasswordInputGUI::setRetype (   $a_val)

Set retype on/off.

Parameters
booleanretype

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

Referenced by __construct(), ilSharedResourceGUI\initPasswordForm(), ilPersonalSettingsGUI\initPasswordForm(), ilObjWorkspaceFolderGUI\initPasswordForm(), and ilStartUpGUI\showLoginForm().

{
$this->retype = $a_val;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::setRetypeValue (   $a_retypevalue)

Set Retype Value.

Parameters
string$a_retypevalueRetype Value

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

Referenced by setValueByArray().

{
$this->retypevalue = $a_retypevalue;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::setSize (   $a_size)

Set Size.

Parameters
int$a_sizeSize

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

Referenced by ilSetupGUI\initClientLoginForm(), ilObjUserGUI\initForm(), and ilSetupGUI\initMasterLoginForm().

{
$this->size = $a_size;
}

+ Here is the caller graph for this function:

ilPasswordInputGUI::setSkipSyntaxCheck (   $a_val)

Set skip syntax check.

Parameters
booleanskip syntax check

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

Referenced by __construct().

{
$this->skip_syntax_check = $a_val;
}

+ 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 175 of file class.ilPasswordInputGUI.php.

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

Set Value.

Parameters
string$a_valueValue

Definition at line 44 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 154 of file class.ilPasswordInputGUI.php.

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

{
$this->setValue($a_values[$this->getPostVar()]);
$this->setRetypeValue($a_values[$this->getPostVar()."_retype"]);
}

+ Here is the call graph for this function:

Field Documentation

ilPasswordInputGUI::$autocomplete_disabled = true
protected

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

Referenced by isHtmlAutoCompleteDisabled().

ilPasswordInputGUI::$max_length = 40
protected

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

ilPasswordInputGUI::$maxlength = false
protected

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

Referenced by getMaxLength().

ilPasswordInputGUI::$preselection = false
protected

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

Referenced by getPreSelection().

ilPasswordInputGUI::$requiredonauth = false
protected

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

Referenced by getRequiredOnAuth().

ilPasswordInputGUI::$size = 20
protected

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

Referenced by getSize().

ilPasswordInputGUI::$validateauthpost = ""
protected

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

Referenced by getValidateAuthPost().

ilPasswordInputGUI::$value
protected

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

Referenced by getValue().


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