ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules 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 (string $a_title="", string $a_postvar="")
 
 setValue (string $a_value)
 
 getValue ()
 
 setRetype (bool $a_val)
 
 getRetype ()
 
 setRetypeValue (string $a_retypevalue)
 
 getRetypeValue ()
 
 setMaxLength (int $a_maxlength)
 
 getMaxLength ()
 
 setSize (int $a_size)
 
 setValueByArray (array $a_values)
 
 getSize ()
 
 setValidateAuthPost (string $a_validateauthpost)
 
 getValidateAuthPost ()
 
 setRequiredOnAuth (bool $a_requiredonauth)
 
 getRequiredOnAuth ()
 
 setSkipSyntaxCheck (bool $a_val)
 
 getSkipSyntaxCheck ()
 
 setDisableHtmlAutoComplete (bool $a_value)
 
 isHtmlAutoCompleteDisabled ()
 
 setUseStripSlashes (bool $a_stat)
 En/disable use of stripslashes. More...
 
 getUseStripSlashes ()
 
 checkInput ()
 
 getInput ()
 
 render ()
 
 insert (ilTemplate $a_tpl)
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem (ilFormPropertyGUI $a_item)
 
 getSubItems ()
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 
 getItemByPostVar (string $a_post_var)
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $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...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 

Protected Attributes

bool $skip_syntax_check = false
 
string $value = ""
 
int $size = 20
 
string $validateauthpost = ""
 
bool $requiredonauth = false
 
int $maxlength = 0
 
bool $use_strip_slashes = true
 
bool $autocomplete_disabled = true
 
string $retypevalue = ""
 
bool $retype = false
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 symbol ()
 
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Detailed Description

This class represents a password property in a property form.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), setRetype(), and setSkipSyntaxCheck().

45  {
46  global $DIC;
47 
48  $this->lng = $DIC->language();
49  parent::__construct($a_title, $a_postvar);
50  $this->setRetype(true);
51  $this->setSkipSyntaxCheck(false);
52  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilPasswordInputGUI::checkInput ( )

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

References ilFormPropertyGUI\$lng, ilAuthUtils\_allowPasswordModificationByAuthMode(), ilAuthUtils\_getAuthMode(), ilSubEnabledFormPropertyGUI\checkSubItemsInput(), getInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getRequiredOnAuth(), getRetype(), getSkipSyntaxCheck(), getUseStripSlashes(), getValidateAuthPost(), ilSecuritySettingsChecker\isPassword(), ilFormPropertyGUI\raw(), ilFormPropertyGUI\setAlert(), ilFormPropertyGUI\str(), and ilLanguage\txt().

168  : bool
169  {
170  $lng = $this->lng;
171 
172  $pass_value = $this->getInput();
173  $retype_value = ($this->getUseStripSlashes())
174  ? $this->str($this->getPostVar() . "_retype")
175  : $this->raw($this->getPostVar() . "_retype");
176 
177  if ($this->getRequired() && trim($pass_value) == "") {
178  $this->setAlert($lng->txt("msg_input_is_required"));
179  return false;
180  }
181  if ($this->getValidateAuthPost() != "") {
182  $auth = ilAuthUtils::_getAuthMode($this->str($this->getValidateAuthPost()));
183 
184  // check, if password is required dependent on auth mode
186  && trim($pass_value) == "") {
187  $this->setAlert($lng->txt("form_password_required_for_auth"));
188  return false;
189  }
190 
191  // check, if password is allowed to be set for given auth mode
192  if (trim($pass_value) != "" &&
194  $this->setAlert($lng->txt("form_password_not_allowed_for_auth"));
195  return false;
196  }
197  }
198  if ($this->getRetype() &&
199  ($pass_value != $retype_value)) {
200  $this->setAlert($lng->txt("passwd_not_match"));
201  return false;
202  }
203  if (!$this->getSkipSyntaxCheck() &&
204  !ilSecuritySettingsChecker::isPassword($pass_value, $custom_error) &&
205  $pass_value != "") {
206  if ($custom_error != '') {
207  $this->setAlert($custom_error);
208  } else {
209  $this->setAlert($lng->txt("passwd_invalid"));
210  }
211  return false;
212  }
213 
214  return $this->checkSubItemsInput();
215  }
static _getAuthMode(?string $a_auth_mode)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static isPassword(string $a_passwd, ?string &$customError=null)
static _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
+ Here is the call graph for this function:

◆ getInput()

ilPasswordInputGUI::getInput ( )

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

References ilFormPropertyGUI\getPostVar(), getUseStripSlashes(), ilFormPropertyGUI\raw(), and ilFormPropertyGUI\str().

Referenced by checkInput().

217  : string
218  {
219  if ($this->getUseStripSlashes()) {
220  return $this->str($this->getPostVar());
221  }
222  return $this->raw($this->getPostVar());
223  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMaxLength()

ilPasswordInputGUI::getMaxLength ( )

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

References $maxlength.

Referenced by render().

90  : int
91  {
92  return $this->maxlength;
93  }
+ Here is the caller graph for this function:

◆ getRequiredOnAuth()

ilPasswordInputGUI::getRequiredOnAuth ( )

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

References $requiredonauth.

Referenced by checkInput().

128  : bool
129  {
130  return $this->requiredonauth;
131  }
+ Here is the caller graph for this function:

◆ getRetype()

ilPasswordInputGUI::getRetype ( )

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

References $retype.

Referenced by checkInput(), and render().

70  : bool
71  {
72  return $this->retype;
73  }
+ Here is the caller graph for this function:

◆ getRetypeValue()

ilPasswordInputGUI::getRetypeValue ( )

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

References $retypevalue.

Referenced by render().

80  : string
81  {
82  return $this->retypevalue;
83  }
+ Here is the caller graph for this function:

◆ getSize()

ilPasswordInputGUI::getSize ( )

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

References $size.

Referenced by render().

106  : int
107  {
108  return $this->size;
109  }
+ Here is the caller graph for this function:

◆ getSkipSyntaxCheck()

ilPasswordInputGUI::getSkipSyntaxCheck ( )

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

References $skip_syntax_check.

Referenced by checkInput().

138  : bool
139  {
141  }
+ Here is the caller graph for this function:

◆ getUseStripSlashes()

ilPasswordInputGUI::getUseStripSlashes ( )

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

References $use_strip_slashes.

Referenced by checkInput(), and getInput().

163  : bool
164  {
166  }
+ Here is the caller graph for this function:

◆ getValidateAuthPost()

ilPasswordInputGUI::getValidateAuthPost ( )

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

References $validateauthpost.

Referenced by checkInput().

117  : string
118  {
120  }
+ Here is the caller graph for this function:

◆ getValue()

ilPasswordInputGUI::getValue ( )

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

References $value.

Referenced by render().

60  : string
61  {
62  return $this->value;
63  }
+ Here is the caller graph for this function:

◆ insert()

ilPasswordInputGUI::insert ( ilTemplate  $a_tpl)

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

References ilTemplate\parseCurrentBlock(), render(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

290  : void
291  {
292  $html = $this->render();
293 
294  $a_tpl->setCurrentBlock("prop_generic");
295  $a_tpl->setVariable("PROP_GENERIC", $html);
296  $a_tpl->parseCurrentBlock();
297  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ isHtmlAutoCompleteDisabled()

ilPasswordInputGUI::isHtmlAutoCompleteDisabled ( )

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

References $autocomplete_disabled.

Referenced by render().

148  : bool
149  {
151  }
+ Here is the caller graph for this function:

◆ render()

ilPasswordInputGUI::render ( )

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

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

Referenced by insert().

225  : string
226  {
227  $lng = $this->lng;
228 
229  $ptpl = new ilTemplate("tpl.prop_password.html", true, true, "components/ILIAS/Form");
230 
231  if ($this->getRetype()) {
232  $ptpl->setCurrentBlock("retype");
233  $ptpl->setVariable("RSIZE", $this->getSize());
234  $ptpl->setVariable("RID", $this->getFieldId());
235  if ($this->getMaxLength() > 0) {
236  $ptpl->setCurrentBlock("rmaxlength");
237  $ptpl->setVariable("RMAXLENGTH", $this->getMaxLength());
238  $ptpl->parseCurrentBlock();
239  }
240  $ptpl->setVariable("RPOST_VAR", $this->getPostVar());
241 
242  if ($this->isHtmlAutoCompleteDisabled()) {
243  $ptpl->setVariable("RAUTOCOMPLETE", "autocomplete=\"off\"");
244  }
245 
246  // this is creating an "auto entry" in the setup, if the retype is missing
247  /*$retype_value = ($this->getRetypeValue() != "")
248  ? $this->getRetypeValue()
249  : $this->getValue();*/
250  $retype_value = $this->getRetypeValue();
251  $ptpl->setVariable("PROPERTY_RETYPE_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($retype_value));
252  if ($this->getDisabled()) {
253  $ptpl->setVariable(
254  "RDISABLED",
255  " disabled=\"disabled\""
256  );
257  }
258  $ptpl->setVariable("TXT_RETYPE", $lng->txt("form_retype_password"));
259  $ptpl->parseCurrentBlock();
260  }
261 
262  if (strlen($this->getValue())) {
263  $ptpl->setCurrentBlock("prop_password_propval");
264  $ptpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($this->getValue()));
265  $ptpl->parseCurrentBlock();
266  }
267  $ptpl->setVariable("POST_VAR", $this->getPostVar());
268  $ptpl->setVariable("ID", $this->getFieldId());
269  $ptpl->setVariable("SIZE", $this->getSize());
270  if ($this->getMaxLength() > 0) {
271  $ptpl->setCurrentBlock("maxlength");
272  $ptpl->setVariable("MAXLENGTH", $this->getMaxLength());
273  $ptpl->parseCurrentBlock();
274  }
275  if ($this->getDisabled()) {
276  $ptpl->setVariable(
277  "DISABLED",
278  " disabled=\"disabled\""
279  );
280  }
281  if ($this->isHtmlAutoCompleteDisabled()) {
282  $ptpl->setVariable("AUTOCOMPLETE", "autocomplete=\"off\"");
283  }
284  if ($this->getRequired()) {
285  $ptpl->setVariable("REQUIRED", "required=\"required\"");
286  }
287  return $ptpl->get();
288  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static prepareFormOutput($a_str, bool $a_strip=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDisableHtmlAutoComplete()

ilPasswordInputGUI::setDisableHtmlAutoComplete ( bool  $a_value)

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

143  : void
144  {
145  $this->autocomplete_disabled = $a_value;
146  }

◆ setMaxLength()

ilPasswordInputGUI::setMaxLength ( int  $a_maxlength)

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

85  : void
86  {
87  $this->maxlength = $a_maxlength;
88  }

◆ setRequiredOnAuth()

ilPasswordInputGUI::setRequiredOnAuth ( bool  $a_requiredonauth)

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

123  : void
124  {
125  $this->requiredonauth = $a_requiredonauth;
126  }

◆ setRetype()

ilPasswordInputGUI::setRetype ( bool  $a_val)

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

Referenced by __construct(), ilObjMailGUI\getExternalSettingsForm(), ilSharedResourceGUI\initPasswordForm(), ilObjWorkspaceFolderGUI\initPasswordForm(), and ilECSSettingsGUI\initSettingsForm().

65  : void
66  {
67  $this->retype = $a_val;
68  }
+ Here is the caller graph for this function:

◆ setRetypeValue()

ilPasswordInputGUI::setRetypeValue ( string  $a_retypevalue)

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

Referenced by setValueByArray().

75  : void
76  {
77  $this->retypevalue = $a_retypevalue;
78  }
+ Here is the caller graph for this function:

◆ setSize()

ilPasswordInputGUI::setSize ( int  $a_size)

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

95  : void
96  {
97  $this->size = $a_size;
98  }

◆ setSkipSyntaxCheck()

ilPasswordInputGUI::setSkipSyntaxCheck ( bool  $a_val)

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

Referenced by __construct(), ilLDAPSettingsGUI\initForm(), and ilOpenIdConnectSettingsGUI\initSettingsForm().

133  : void
134  {
135  $this->skip_syntax_check = $a_val;
136  }
+ Here is the caller graph for this function:

◆ setUseStripSlashes()

ilPasswordInputGUI::setUseStripSlashes ( bool  $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.

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

Referenced by ilUserProfile\getPasswordInput(), and ilObjUserGUI\initForm().

158  : void
159  {
160  $this->use_strip_slashes = $a_stat;
161  }
+ Here is the caller graph for this function:

◆ setValidateAuthPost()

ilPasswordInputGUI::setValidateAuthPost ( string  $a_validateauthpost)

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

112  : void
113  {
114  $this->validateauthpost = $a_validateauthpost;
115  }

◆ setValue()

ilPasswordInputGUI::setValue ( string  $a_value)

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

Referenced by setValueByArray().

56  : void {
57  $this->value = $a_value;
58  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilPasswordInputGUI::setValueByArray ( array  $a_values)

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

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

100  : void
101  {
102  $this->setValue($a_values[$this->getPostVar()] ?? "");
103  $this->setRetypeValue($a_values[$this->getPostVar() . "_retype"] ?? "");
104  }
setRetypeValue(string $a_retypevalue)
+ Here is the call graph for this function:

Field Documentation

◆ $autocomplete_disabled

bool ilPasswordInputGUI::$autocomplete_disabled = true
protected

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

Referenced by isHtmlAutoCompleteDisabled().

◆ $maxlength

int ilPasswordInputGUI::$maxlength = 0
protected

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

Referenced by getMaxLength().

◆ $requiredonauth

bool ilPasswordInputGUI::$requiredonauth = false
protected

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

Referenced by getRequiredOnAuth().

◆ $retype

bool ilPasswordInputGUI::$retype = false
protected

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

Referenced by getRetype().

◆ $retypevalue

string ilPasswordInputGUI::$retypevalue = ""
protected

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

Referenced by getRetypeValue().

◆ $size

int ilPasswordInputGUI::$size = 20
protected

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

Referenced by getSize().

◆ $skip_syntax_check

bool ilPasswordInputGUI::$skip_syntax_check = false
protected

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

Referenced by getSkipSyntaxCheck().

◆ $use_strip_slashes

bool ilPasswordInputGUI::$use_strip_slashes = true
protected

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

Referenced by getUseStripSlashes().

◆ $validateauthpost

string ilPasswordInputGUI::$validateauthpost = ""
protected

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

Referenced by getValidateAuthPost().

◆ $value

string ilPasswordInputGUI::$value = ""
protected

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

Referenced by getValue().


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