19declare(strict_types=1);
45 string $a_postvar =
""
49 $this->
lng = $DIC->language();
58 $this->value = $a_value;
68 $this->retype = $a_val;
78 $this->retypevalue = $a_retypevalue;
83 return $this->retypevalue;
88 $this->maxlength = $a_maxlength;
93 return $this->maxlength;
96 public function setSize(
int $a_size): void
98 $this->size = $a_size;
103 $this->setValue($a_values[$this->getPostVar()] ??
"");
104 $this->setRetypeValue($a_values[$this->getPostVar() .
"_retype"] ??
"");
115 $this->validateauthpost = $a_validateauthpost;
120 return $this->validateauthpost;
126 $this->requiredonauth = $a_requiredonauth;
131 return $this->requiredonauth;
136 $this->skip_syntax_check = $a_val;
141 return $this->skip_syntax_check;
146 $this->autocomplete_disabled = $a_value;
151 return $this->autocomplete_disabled;
161 $this->use_strip_slashes = $a_stat;
166 return $this->use_strip_slashes;
173 $pass_value = $this->getInput();
174 $retype_value = ($this->getUseStripSlashes())
175 ? $this->
str($this->getPostVar() .
"_retype")
176 : $this->
raw($this->getPostVar() .
"_retype");
178 if ($this->getRequired() && trim($pass_value) ==
"") {
179 $this->setAlert(
$lng->txt(
"msg_input_is_required"));
182 if ($this->getValidateAuthPost() !=
"") {
187 && trim($pass_value) ==
"") {
188 $this->setAlert(
$lng->txt(
"form_password_required_for_auth"));
193 if (trim($pass_value) !=
"" &&
195 $this->setAlert(
$lng->txt(
"form_password_not_allowed_for_auth"));
199 if ($this->getRetype() &&
200 ($pass_value != $retype_value)) {
201 $this->setAlert(
$lng->txt(
"passwd_not_match"));
204 if (!$this->getSkipSyntaxCheck() &&
207 if ($custom_error !=
'') {
208 $this->setAlert($custom_error);
210 $this->setAlert(
$lng->txt(
"passwd_invalid"));
215 return $this->checkSubItemsInput();
220 if ($this->getUseStripSlashes()) {
221 return $this->
str($this->getPostVar());
223 return $this->
raw($this->getPostVar());
230 $ptpl =
new ilTemplate(
"tpl.prop_password.html",
true,
true,
"components/ILIAS/Form");
232 if ($this->getRetype()) {
233 $ptpl->setCurrentBlock(
"retype");
234 $ptpl->setVariable(
"RSIZE", $this->getSize());
235 $ptpl->setVariable(
"RID", $this->getFieldId());
236 if ($this->getMaxLength() > 0) {
237 $ptpl->setCurrentBlock(
"rmaxlength");
238 $ptpl->setVariable(
"RMAXLENGTH", $this->getMaxLength());
239 $ptpl->parseCurrentBlock();
241 $ptpl->setVariable(
"RPOST_VAR", $this->getPostVar());
243 if ($this->isHtmlAutoCompleteDisabled()) {
244 $ptpl->setVariable(
"RAUTOCOMPLETE",
"autocomplete=\"off\"");
251 $retype_value = $this->getRetypeValue();
253 if ($this->getDisabled()) {
256 " disabled=\"disabled\""
259 $ptpl->setVariable(
"TXT_RETYPE",
$lng->txt(
"form_retype_password"));
260 $ptpl->parseCurrentBlock();
264 $ptpl->setCurrentBlock(
"prop_password_propval");
266 $ptpl->parseCurrentBlock();
268 $ptpl->setVariable(
"POST_VAR", $this->getPostVar());
269 $ptpl->setVariable(
"ID", $this->getFieldId());
270 $ptpl->setVariable(
"SIZE", $this->getSize());
271 if ($this->getMaxLength() > 0) {
272 $ptpl->setCurrentBlock(
"maxlength");
273 $ptpl->setVariable(
"MAXLENGTH", $this->getMaxLength());
274 $ptpl->parseCurrentBlock();
276 if ($this->getDisabled()) {
279 " disabled=\"disabled\""
282 if ($this->isHtmlAutoCompleteDisabled()) {
283 $ptpl->setVariable(
"AUTOCOMPLETE",
"autocomplete=\"off\"");
285 if ($this->getRequired()) {
286 $ptpl->setVariable(
"REQUIRED",
"required=\"required\"");
293 $html = $this->render();
setVariable($variable, $value='')
Sets a variable value.
static _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
static _getAuthMode(?string $a_auth_mode)
static isPassword(string $a_passwd, ?string &$customError=null)
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc