mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Warn that password must be at leeast 4 characters long.
This commit is contained in:
parent
db9e70d34f
commit
0dbe01e399
2 changed files with 11 additions and 4 deletions
14
js/app.js
14
js/app.js
|
@ -393,10 +393,16 @@ app = Sammy('#main', function (sam) {
|
||||||
|
|
||||||
sam.post('#/users', function (c) {
|
sam.post('#/users', function (c) {
|
||||||
if (c.params['password'] == c.params['confirmation']) {
|
if (c.params['password'] == c.params['confirmation']) {
|
||||||
c.params['mail'] = c.params['email'] + c.params['domain'];
|
if (c.params['password'].length < 4) {
|
||||||
c.api('/users', function(data) { // http://api.yunohost.org/#!/user/user_create_post_2
|
c.flash('fail', "Passwords is too short");
|
||||||
c.redirect('#/users');
|
store.clear('slide');
|
||||||
}, 'POST', c.params.toHash());
|
}
|
||||||
|
else {
|
||||||
|
c.params['mail'] = c.params['email'] + c.params['domain'];
|
||||||
|
c.api('/users', function(data) { // http://api.yunohost.org/#!/user/user_create_post_2
|
||||||
|
c.redirect('#/users');
|
||||||
|
}, 'POST', c.params.toHash());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
c.flash('fail', "Passwords don't match");
|
c.flash('fail', "Passwords don't match");
|
||||||
store.clear('slide');
|
store.clear('slide');
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
<label for="confirmation" class="col-sm-3 control-label">Confirmation</label>
|
<label for="confirmation" class="col-sm-3 control-label">Confirmation</label>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<input type="password" name="confirmation" class="form-control" placeholder="•••••" required>
|
<input type="password" name="confirmation" class="form-control" placeholder="•••••" required>
|
||||||
|
<div class="help-block">Password must be at least 4 characters long.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue