Skip to content
Snippets Groups Projects
Commit 04fd70fb authored by Robert Lange's avatar Robert Lange
Browse files

refs #19441 [finc, BARF] add template for change user password

* copied from /themes/bootstrap3/templates/Auth/AbstractBase/newpassword.phtml
* add autocomplete for change user password inputs
parent ca9dfa9d
Branches
Tags
No related merge requests found
<!-- finc-accessibility: Auth - AbstractBase - newpassword -->
<?php /* copied /themes/bootstrap3/templates/Auth/AbstractBase/newpassword.phtml to add autocomplete */ ?>
<?php if (isset($this->username)): ?>
<div class="form-group">
<label class="control-label"><?=$this->transEsc('Username') ?>:</label>
<p class="form-control-static"><?=$this->username ?></p>
</div>
<?php endif; ?>
<?php if (isset($this->verifyold) && $this->verifyold || isset($this->oldpwd)): ?>
<div class="form-group">
<label class="control-label"><?=$this->transEsc('old_password') ?>:</label>
<input id="current-password" type="password" name="oldpwd" class="form-control" autocomplete="current-password"/>
<div class="help-block with-errors"></div>
</div>
<?php endif; ?>
<?php
$pattern = '';
if (isset($this->passwordPolicy['pattern'])) {
if ($this->passwordPolicy['pattern'] == 'numeric') {
$pattern = '\d+';
} elseif ($this->passwordPolicy['pattern'] == 'alphanumeric') {
$pattern = '[\da-zA-Z]+';
} else {
$pattern = $this->passwordPolicy['pattern'];
}
}
?>
<div class="form-group">
<label class="control-label"><?=$this->transEsc('new_password') ?>:</label>
<input type="password" id="password" name="password" class="form-control" required aria-required="true"
<?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']])) . '"' : '' ?>
<?=isset($this->passwordPolicy['maxLength']) ? ' maxlength="' . $this->passwordPolicy['maxLength'] . '"' : '' ?>
<?=$pattern ? ' pattern="' . $pattern . '"' : '' ?>
autocomplete="new-password"
/>
<?php if ($this->passwordPolicy['hint']): ?>
<div class="help-block"><?=$this->transEsc($this->passwordPolicy['hint']) ?></div>
<?php endif; ?>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label class="control-label"><?=$this->transEsc('confirm_new_password') ?>:</label>
<input type="password" name="password2" class="form-control" required aria-required="true" data-match="#password" data-match-error="<?=$this->escapeHtmlAttr($this->translate('Passwords do not match'))?>" autocomplete="new-password"/>
<div class="help-block with-errors"></div>
</div>
<!-- finc-accessibility: Auth - AbstractBase - newpassword - END -->
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment