[fix] Avoid empty fields at postinstall #30.

This commit is contained in:
opi 2014-05-16 12:46:46 +02:00
parent 296d0937ff
commit 8cabcc543f
3 changed files with 7 additions and 2 deletions

View file

@ -354,7 +354,10 @@ app = Sammy('#main', function (sam) {
}); });
sam.post('#/postinstall', function (c) { sam.post('#/postinstall', function (c) {
if (c.params['password'] == c.params['confirmation']) { if (c.params['password'] == '' || c.params['confirmation'] == '') {
c.flash('fail', y18n.t('password_empty'))
}
else if (c.params['password'] == c.params['confirmation']) {
if (c.params['domain'] == '') { if (c.params['domain'] == '') {
if (c.params['ddomain'] == '') { if (c.params['ddomain'] == '') {
c.flash('fail', y18n.t('error_select_domain')); c.flash('fail', y18n.t('error_select_domain'));

View file

@ -42,6 +42,7 @@
"wrong_password" : "Wrong password", "wrong_password" : "Wrong password",
"passwords_dont_match" : "Passwords don't match", "passwords_dont_match" : "Passwords don't match",
"passwords_too_short" : "Password is too short", "passwords_too_short" : "Password is too short",
"password_empty" : "Password field is empty",
"logged_in" : "Logged in", "logged_in" : "Logged in",
"logged_out" : "Logged out", "logged_out" : "Logged out",
"error_occured" : "An error occured, try again", "error_occured" : "An error occured, try again",

View file

@ -42,11 +42,12 @@
"wrong_password" : "Mot de passe incorrect", "wrong_password" : "Mot de passe incorrect",
"passwords_dont_match" : "Les mots de passe ne correspondent pas", "passwords_dont_match" : "Les mots de passe ne correspondent pas",
"passwords_too_short" : "Mot de passe trop court", "passwords_too_short" : "Mot de passe trop court",
"password_empty" : "Le champ mot de passe est vide",
"logged_in" : "Connecté", "logged_in" : "Connecté",
"logged_out" : "Déconnecté", "logged_out" : "Déconnecté",
"error_occured" : "Une erreur est survenue, veuillez réessayer.", "error_occured" : "Une erreur est survenue, veuillez réessayer.",
"error_server" : "Erreur serveur", "error_server" : "Erreur serveur",
"error_select_domain" : "Vous devez indiquer une domaine.", "error_select_domain" : "Vous devez indiquer un domaine.",
"error_modify_something" : "Vous devez modifier quelque chose.", "error_modify_something" : "Vous devez modifier quelque chose.",
"non_compatible_api" : "API Non compatible", "non_compatible_api" : "API Non compatible",
"warning_first_user" : "Vous devez probablement d'abord <a href='#/users/create' class='alert-link'>créer un utilisateur</a>.", "warning_first_user" : "Vous devez probablement d'abord <a href='#/users/create' class='alert-link'>créer un utilisateur</a>.",