add password repeat for user creation (issue #85)
This commit is contained in:
parent
2fd822f6b3
commit
847b8821d6
2 changed files with 10 additions and 2 deletions
|
|
@ -414,6 +414,10 @@
|
||||||
if($this->Users->emailExists($email)) {
|
if($this->Users->emailExists($email)) {
|
||||||
$validation = $this->Validation->addValidationResult($validation, 'email', 'exist', true);
|
$validation = $this->Validation->addValidationResult($validation, 'email', 'exist', true);
|
||||||
}
|
}
|
||||||
|
$password = $this->request->getPostParam('password');
|
||||||
|
if($password != $this->request->getPostParam('passwordrepeat')) {
|
||||||
|
$validation = $this->Validation->addValidationResult($validation, 'password', 'repeat', false);
|
||||||
|
}
|
||||||
|
|
||||||
// Create
|
// Create
|
||||||
if($validation === true)
|
if($validation === true)
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h1><?=_('New user')?></h1>
|
<h1><?=_('New 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>
|
||||||
|
|
@ -64,6 +64,8 @@
|
||||||
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;
|
break;
|
||||||
|
case 'repeat': printf(_('Passwords does not match'));
|
||||||
|
break;
|
||||||
default: echo _('Password invalid');
|
default: echo _('Password invalid');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -91,6 +93,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')?>" required="required" maxlength="<?=$validationSettings['password']['maxlength']?>" <?=(array_key_exists('password', $validation)) ? 'class="invalid"' : null?> /><br />
|
<input name="password" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" 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 />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue