ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setRetype ($a_val)
 Set retype on/off. More...
 
 getRetype ()
 Get retype on/off. More...
 
 setRetypeValue ($a_retypevalue)
 Set Retype Value. More...
 
 getRetypeValue ()
 Get Retype Value. More...
 
 setMaxLength ($a_maxlength)
 Set Max Length. More...
 
 getMaxLength ()
 Get Max Length. More...
 
 setSize ($a_size)
 Set Size. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 getSize ()
 Get Size. More...
 
 setValidateAuthPost ($a_validateauthpost)
 Set Validate required status against authentication POST var. More...
 
 getValidateAuthPost ()
 Get Validate required status against authentication POST var. More...
 
 setRequiredOnAuth ($a_requiredonauth)
 Set input required, if authentication mode allows password setting. More...
 
 getRequiredOnAuth ()
 Get input required, if authentication mode allows password setting. More...
 
 setSkipSyntaxCheck ($a_val)
 Set skip syntax check. More...
 
 getSkipSyntaxCheck ()
 Get skip syntax check. More...
 
 setDisableHtmlAutoComplete ($a_value)
 Set autocomplete. More...
 
 isHtmlAutoCompleteDisabled ()
 Get autocomplete. More...
 
 setUseStripSlashes ($a_stat)
 En/disable use of stripslashes. More...
 
 getUseStripSlashes ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 render ()
 Render item. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 

Protected Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

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

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

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

32 {
33 global $DIC;
34
35 $this->lng = $DIC->language();
36 parent::__construct($a_title, $a_postvar);
37 $this->setRetype(true);
38 $this->setSkipSyntaxCheck(false);
39 }
setRetype($a_val)
Set retype on/off.
setSkipSyntaxCheck($a_val)
Set skip syntax check.
global $DIC
Definition: saml.php:7

References $DIC, setRetype(), and setSkipSyntaxCheck().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

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

258 {
260
261 if ($this->getUseStripSlashes()) {
263 $_POST[$this->getPostVar() . "_retype"] = ilUtil::stripSlashes($_POST[$this->getPostVar() . "_retype"]);
264 }
265 if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "") {
266 $this->setAlert($lng->txt("msg_input_is_required"));
267
268 return false;
269 }
270 if ($this->getValidateAuthPost() != "") {
272
273 // check, if password is required dependent on auth mode
275 && trim($_POST[$this->getPostVar()]) == "") {
276 $this->setAlert($lng->txt("form_password_required_for_auth"));
277
278 return false;
279 }
280
281 // check, if password is allowed to be set for given auth mode
282 if (trim($_POST[$this->getPostVar()]) != "" &&
284 $this->setAlert($lng->txt("form_password_not_allowed_for_auth"));
285
286 return false;
287 }
288 }
289 if ($this->getRetype() &&
290 ($_POST[$this->getPostVar()] != $_POST[$this->getPostVar() . "_retype"])) {
291 $this->setAlert($lng->txt("passwd_not_match"));
292
293 return false;
294 }
295 if (!$this->getSkipSyntaxCheck() &&
296 !ilUtil::isPassword($_POST[$this->getPostVar()], $custom_error) &&
297 $_POST[$this->getPostVar()] != "") {
298 if ($custom_error != '') {
299 $this->setAlert($custom_error);
300 } else {
301 $this->setAlert($lng->txt("passwd_invalid"));
302 }
303
304 return false;
305 }
306
307 return $this->checkSubItemsInput();
308 }
$_POST["username"]
static _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
static _getAuthMode($a_auth_mode, $a_db_handler='')
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
getRetype()
Get retype on/off.
getValidateAuthPost()
Get Validate required status against authentication POST var.
getRequiredOnAuth()
Get input required, if authentication mode allows password setting.
getSkipSyntaxCheck()
Get skip syntax check.
static isPassword($a_passwd, &$customError=null)
validates a password @access public
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$auth
Definition: fileserver.php:48

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

+ Here is the call graph for this function:

◆ getMaxLength()

ilPasswordInputGUI::getMaxLength ( )

Get Max Length.

Returns
int Max Length

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

References $maxlength.

Referenced by render().

+ Here is the caller graph for this function:

◆ getRequiredOnAuth()

ilPasswordInputGUI::getRequiredOnAuth ( )

Get input required, if authentication mode allows password setting.

Returns
boolean require input

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

References $requiredonauth.

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ getRetype()

ilPasswordInputGUI::getRetype ( )

Get retype on/off.

Returns
boolean retype

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

77 {
78 return $this->retype;
79 }

Referenced by checkInput(), and render().

+ Here is the caller graph for this function:

◆ getRetypeValue()

ilPasswordInputGUI::getRetypeValue ( )

Get Retype Value.

Returns
string Retype Value

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

97 {
98 return $this->retypevalue;
99 }

Referenced by render().

+ Here is the caller graph for this function:

◆ getSize()

ilPasswordInputGUI::getSize ( )

Get Size.

Returns
int Size

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

148 {
149 return $this->size;
150 }

References $size.

Referenced by render().

+ Here is the caller graph for this function:

◆ getSkipSyntaxCheck()

ilPasswordInputGUI::getSkipSyntaxCheck ( )

Get skip syntax check.

Returns
boolean skip syntax check

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

208 {
209 return $this->skip_syntax_check;
210 }

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ getUseStripSlashes()

ilPasswordInputGUI::getUseStripSlashes ( )
Returns
type

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

References $use_strip_slashes.

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ getValidateAuthPost()

ilPasswordInputGUI::getValidateAuthPost ( )

Get Validate required status against authentication POST var.

Returns
string POST var

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

References $validateauthpost.

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ getValue()

ilPasswordInputGUI::getValue ( )

Get Value.

Returns
string Value

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

References $value.

Referenced by render().

+ Here is the caller graph for this function:

◆ insert()

ilPasswordInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

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

384 {
385 $html = $this->render();
386
387 $a_tpl->setCurrentBlock("prop_generic");
388 $a_tpl->setVariable("PROP_GENERIC", $html);
389 $a_tpl->parseCurrentBlock();
390 }
$html
Definition: example_001.php:87

References $html, and render().

+ Here is the call graph for this function:

◆ isHtmlAutoCompleteDisabled()

ilPasswordInputGUI::isHtmlAutoCompleteDisabled ( )

Get autocomplete.

Returns
bool Value

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

References $autocomplete_disabled.

Referenced by render().

+ Here is the caller graph for this function:

◆ render()

ilPasswordInputGUI::render ( )

Render item.

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

314 {
316
317 $ptpl = new ilTemplate("tpl.prop_password.html", true, true, "Services/Form");
318
319 if ($this->getRetype()) {
320 $ptpl->setCurrentBlock("retype");
321 $ptpl->setVariable("RSIZE", $this->getSize());
322 $ptpl->setVariable("RID", $this->getFieldId());
323 if ($this->getMaxLength() > 0) {
324 $ptpl->setCurrentBlock("rmaxlength");
325 $ptpl->setVariable("RMAXLENGTH", $this->getMaxLength());
326 $ptpl->parseCurrentBlock();
327 }
328 $ptpl->setVariable("RPOST_VAR", $this->getPostVar());
329
330 if ($this->isHtmlAutoCompleteDisabled()) {
331 $ptpl->setVariable("RAUTOCOMPLETE", "autocomplete=\"off\"");
332 }
333
334 // this is creating an "auto entry" in the setup, if the retype is missing
335 /*$retype_value = ($this->getRetypeValue() != "")
336 ? $this->getRetypeValue()
337 : $this->getValue();*/
338 $retype_value = $this->getRetypeValue();
339 $ptpl->setVariable("PROPERTY_RETYPE_VALUE", ilUtil::prepareFormOutput($retype_value));
340 if ($this->getDisabled()) {
341 $ptpl->setVariable(
342 "RDISABLED",
343 " disabled=\"disabled\""
344 );
345 }
346 $ptpl->setVariable("TXT_RETYPE", $lng->txt("form_retype_password"));
347 $ptpl->parseCurrentBlock();
348 }
349
350 if (strlen($this->getValue())) {
351 $ptpl->setCurrentBlock("prop_password_propval");
352 $ptpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
353 $ptpl->parseCurrentBlock();
354 }
355 $ptpl->setVariable("POST_VAR", $this->getPostVar());
356 $ptpl->setVariable("ID", $this->getFieldId());
357 $ptpl->setVariable("SIZE", $this->getSize());
358 if ($this->getMaxLength() > 0) {
359 $ptpl->setCurrentBlock("maxlength");
360 $ptpl->setVariable("MAXLENGTH", $this->getMaxLength());
361 $ptpl->parseCurrentBlock();
362 }
363 if ($this->getDisabled()) {
364 $ptpl->setVariable(
365 "DISABLED",
366 " disabled=\"disabled\""
367 );
368 }
369 if ($this->isHtmlAutoCompleteDisabled()) {
370 $ptpl->setVariable("AUTOCOMPLETE", "autocomplete=\"off\"");
371 }
372 if ($this->getRequired()) {
373 $ptpl->setVariable("REQUIRED", "required=\"required\"");
374 }
375 return $ptpl->get();
376 }
getFieldId()
Get Post Variable.
getRetypeValue()
Get Retype Value.
isHtmlAutoCompleteDisabled()
Get autocomplete.
special template class to simplify handling of ITX/PEAR
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

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

Referenced by insert().

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

◆ setDisableHtmlAutoComplete()

ilPasswordInputGUI::setDisableHtmlAutoComplete (   $a_value)

Set autocomplete.

Parameters
bool$a_valueValue

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

218 {
219 $this->autocomplete_disabled = (bool) $a_value;
220 }

◆ setMaxLength()

ilPasswordInputGUI::setMaxLength (   $a_maxlength)

Set Max Length.

Parameters
int$a_maxlengthMax Length

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

107 {
108 $this->maxlength = $a_maxlength;
109 }

◆ setRequiredOnAuth()

ilPasswordInputGUI::setRequiredOnAuth (   $a_requiredonauth)

Set input required, if authentication mode allows password setting.

Parameters
boolean$a_requiredonauthrequire input

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

178 {
179 $this->requiredonauth = $a_requiredonauth;
180 }

◆ setRetype()

ilPasswordInputGUI::setRetype (   $a_val)

Set retype on/off.

Parameters
booleanretype

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

67 {
68 $this->retype = $a_val;
69 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setRetypeValue()

ilPasswordInputGUI::setRetypeValue (   $a_retypevalue)

Set Retype Value.

Parameters
string$a_retypevalueRetype Value

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

87 {
88 $this->retypevalue = $a_retypevalue;
89 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setSize()

ilPasswordInputGUI::setSize (   $a_size)

Set Size.

Parameters
int$a_sizeSize

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

127 {
128 $this->size = $a_size;
129 }
font size
Definition: langcheck.php:162

References size.

◆ setSkipSyntaxCheck()

ilPasswordInputGUI::setSkipSyntaxCheck (   $a_val)

Set skip syntax check.

Parameters
booleanskip syntax check

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

198 {
199 $this->skip_syntax_check = $a_val;
200 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setUseStripSlashes()

ilPasswordInputGUI::setUseStripSlashes (   $a_stat)

En/disable use of stripslashes.

e.g on login screen. Otherwise passwords containing "<" are stripped and therefor authentication fails against external authentication services.

Parameters
type$a_stat

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

239 {
240 $this->use_strip_slashes = $a_stat;
241 }

◆ setValidateAuthPost()

ilPasswordInputGUI::setValidateAuthPost (   $a_validateauthpost)

Set Validate required status against authentication POST var.

Parameters
string$a_validateauthpostPOST var

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

158 {
159 $this->validateauthpost = $a_validateauthpost;
160 }

◆ setValue()

ilPasswordInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

47 {
48 $this->value = $a_value;
49 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilPasswordInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

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

137 {
138 $this->setValue($a_values[$this->getPostVar()]);
139 $this->setRetypeValue($a_values[$this->getPostVar() . "_retype"]);
140 }
setRetypeValue($a_retypevalue)
Set Retype Value.
setValue($a_value)
Set Value.

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

+ Here is the call graph for this function:

Field Documentation

◆ $autocomplete_disabled

ilPasswordInputGUI::$autocomplete_disabled = true
protected

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

Referenced by isHtmlAutoCompleteDisabled().

◆ $maxlength

ilPasswordInputGUI::$maxlength = false
protected

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

Referenced by getMaxLength().

◆ $requiredonauth

ilPasswordInputGUI::$requiredonauth = false
protected

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

Referenced by getRequiredOnAuth().

◆ $size

ilPasswordInputGUI::$size = 20
protected

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

Referenced by getSize().

◆ $use_strip_slashes

ilPasswordInputGUI::$use_strip_slashes = true
protected

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

Referenced by getUseStripSlashes().

◆ $validateauthpost

ilPasswordInputGUI::$validateauthpost = ""
protected

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

Referenced by getValidateAuthPost().

◆ $value

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: