add password repeat for user editing (issue #85)
This commit is contained in:
parent
847b8821d6
commit
8154dbd9be
2 changed files with 11 additions and 3 deletions
|
|
@ -493,7 +493,8 @@
|
||||||
$validation = $this->Validation->addValidationResult($validation, 'username', 'exist', true);
|
$validation = $this->Validation->addValidationResult($validation, 'username', 'exist', true);
|
||||||
}
|
}
|
||||||
$password = $this->request->getPostParam('password');
|
$password = $this->request->getPostParam('password');
|
||||||
if(!empty($password)) {
|
if(!empty($password))
|
||||||
|
{
|
||||||
$validation = $this->Validation->addValidationResults($validation,
|
$validation = $this->Validation->addValidationResults($validation,
|
||||||
'password',
|
'password',
|
||||||
$this->Validation->validateParam(
|
$this->Validation->validateParam(
|
||||||
|
|
@ -501,6 +502,9 @@
|
||||||
'password'
|
'password'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
if($password != $this->request->getPostParam('passwordrepeat')) {
|
||||||
|
$validation = $this->Validation->addValidationResult($validation, 'password', 'repeat', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$prename = $this->request->getPostParam('prename');
|
$prename = $this->request->getPostParam('prename');
|
||||||
$surname = $this->request->getPostParam('surname');
|
$surname = $this->request->getPostParam('surname');
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h1><?=_('Edit user')?></h1>
|
<h1><?=_('Edit user')?></h1>
|
||||||
<?php if($validation !== true) : ?>
|
<?php if($validation !== true && !empty($validation)) : ?>
|
||||||
<ul>
|
<ul class="validation">
|
||||||
<?php foreach($validation as $field => &$settings) : ?>
|
<?php foreach($validation as $field => &$settings) : ?>
|
||||||
<li>
|
<li>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -67,6 +67,8 @@
|
||||||
case 'minlength': printf(_('Password is too short (min. %d chars)'), $value);
|
case 'minlength': printf(_('Password is too short (min. %d chars)'), $value);
|
||||||
break;
|
break;
|
||||||
case 'maxlength': printf(_('Password is too long (max. %d chars)'), $value);
|
case 'maxlength': printf(_('Password is too long (max. %d chars)'), $value);
|
||||||
|
break;
|
||||||
|
case 'repeat': printf(_('Passwords does not match'));
|
||||||
break;
|
break;
|
||||||
default: echo _('Password invalid');
|
default: echo _('Password invalid');
|
||||||
}
|
}
|
||||||
|
|
@ -99,6 +101,8 @@
|
||||||
<input name="email" type="email" placeholder="<?=_('E‑mail address')?>" title="<?=_('E‑mail address')?>" required="required" value="<?=$email?>" <?=(array_key_exists('email', $validation)) ? 'class="invalid"' : null?> /><br />
|
<input name="email" type="email" placeholder="<?=_('E‑mail address')?>" title="<?=_('E‑mail address')?>" required="required" value="<?=$email?>" <?=(array_key_exists('email', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||||
<label for="password"><?=_('Password')?>:</label>
|
<label for="password"><?=_('Password')?>:</label>
|
||||||
<input name="password" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" maxlength="<?=$validationSettings['password']['maxlength']?>" <?=(array_key_exists('password', $validation)) ? 'class="invalid"' : null?> /><br />
|
<input name="password" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" maxlength="<?=$validationSettings['password']['maxlength']?>" <?=(array_key_exists('password', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||||
|
<label for="passwordrepeat"><?=_('Repeat password')?>:</label>
|
||||||
|
<input name="passwordrepeat" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" maxlength="<?=$validationSettings['password']['maxlength']?>" <?=(array_key_exists('password', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||||
<input id="mailing" type="checkbox" name="mailing" <?php if($mailing) : ?>checked="checked"<?php endif ?> />
|
<input id="mailing" type="checkbox" name="mailing" <?php if($mailing) : ?>checked="checked"<?php endif ?> />
|
||||||
<label for="mailing"><?=_('Mail notifications')?></label>
|
<label for="mailing"><?=_('Mail notifications')?></label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue