3declare(strict_types=1);
44 string $a_postvar =
""
48 $this->
lng = $DIC->language();
57 $this->value = $a_value;
67 $this->retype = $a_val;
77 $this->retypevalue = $a_retypevalue;
82 return $this->retypevalue;
87 $this->maxlength = $a_maxlength;
92 return $this->maxlength;
95 public function setSize(
int $a_size): void
97 $this->size = $a_size;
102 $this->setValue($a_values[$this->getPostVar()] ??
"");
103 $this->setRetypeValue($a_values[$this->getPostVar() .
"_retype"] ??
"");
114 $this->validateauthpost = $a_validateauthpost;
119 return $this->validateauthpost;
125 $this->requiredonauth = $a_requiredonauth;
130 return $this->requiredonauth;
135 $this->skip_syntax_check = $a_val;
140 return $this->skip_syntax_check;
145 $this->autocomplete_disabled = $a_value;
150 return $this->autocomplete_disabled;
160 $this->use_strip_slashes = $a_stat;
165 return $this->use_strip_slashes;
172 $pass_value = $this->getInput();
173 $retype_value = ($this->getUseStripSlashes())
174 ? $this->
str($this->getPostVar() .
"_retype")
175 : $this->
raw($this->getPostVar() .
"_retype");
177 if ($this->getRequired() && trim($pass_value) ==
"") {
178 $this->setAlert(
$lng->txt(
"msg_input_is_required"));
181 if ($this->getValidateAuthPost() !=
"") {
186 && trim($pass_value) ==
"") {
187 $this->setAlert(
$lng->txt(
"form_password_required_for_auth"));
192 if (trim($pass_value) !=
"" &&
194 $this->setAlert(
$lng->txt(
"form_password_not_allowed_for_auth"));
198 if ($this->getRetype() &&
199 ($pass_value != $retype_value)) {
200 $this->setAlert(
$lng->txt(
"passwd_not_match"));
203 if (!$this->getSkipSyntaxCheck() &&
206 if ($custom_error !=
'') {
207 $this->setAlert($custom_error);
209 $this->setAlert(
$lng->txt(
"passwd_invalid"));
214 return $this->checkSubItemsInput();
219 if ($this->getUseStripSlashes()) {
220 return $this->
str($this->getPostVar());
222 return $this->
raw($this->getPostVar());
229 $ptpl =
new ilTemplate(
"tpl.prop_password.html",
true,
true,
"Services/Form");
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();
240 $ptpl->setVariable(
"RPOST_VAR", $this->getPostVar());
242 if ($this->isHtmlAutoCompleteDisabled()) {
243 $ptpl->setVariable(
"RAUTOCOMPLETE",
"autocomplete=\"off\"");
250 $retype_value = $this->getRetypeValue();
252 if ($this->getDisabled()) {
255 " disabled=\"disabled\""
258 $ptpl->setVariable(
"TXT_RETYPE",
$lng->txt(
"form_retype_password"));
259 $ptpl->parseCurrentBlock();
263 $ptpl->setCurrentBlock(
"prop_password_propval");
265 $ptpl->parseCurrentBlock();
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();
275 if ($this->getDisabled()) {
278 " disabled=\"disabled\""
281 if ($this->isHtmlAutoCompleteDisabled()) {
282 $ptpl->setVariable(
"AUTOCOMPLETE",
"autocomplete=\"off\"");
284 if ($this->getRequired()) {
285 $ptpl->setVariable(
"REQUIRED",
"required=\"required\"");
292 $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