diff --git a/app.py b/app.py index 97e852f..5e020f3 100644 --- a/app.py +++ b/app.py @@ -113,9 +113,9 @@ def post_user(): return index_tpl(alerts=[('error', msg, 'fadeOut')], str=i18n.str) if len(form('username')) < 3: - return error(i18n.msg[1]) + return error(i18n.msg[2]) elif not tools.input_validation(form('username')): - return error(i18n.msg[6]) + return error(i18n.msg[3]) if not tools.pwd_validation(form('password')): return error(i18n.msg[21]) @@ -126,7 +126,7 @@ def post_user(): LOG.warning("Unsuccessful attempt to login %s: %s" % (form('username'), e)) return error(str(e)) - return user_tpl(alerts=[('success', '%s %s' % (i18n.msg[3], form('username').capitalize()), 'fadeOut' )], data=newSession().get(), str=i18n.str) + return user_tpl(alerts=[('success', '%s %s' % (i18n.msg[1], form('username').capitalize()), 'fadeOut' )], data=newSession().get(), str=i18n.str) @post('/signup') def post_signup(): @@ -152,14 +152,14 @@ def post_signup(): return signup_tpl(alerts=[('error', msg, 'fadeOut')], str=i18n.str) if not tools.code_is_valid(form('invite_code'), db): - return(error(i18n.msg[4])) + return(error(i18n.msg[6])) if len(form('username')) < 3: - return error(i18n.msg[5]) + return error(i18n.msg[2]) username = form('username').lower() if not tools.input_validation(username): - return error(i18n.msg[6]) + return error(i18n.msg[3]) if len(form('firstname')) == 0: firstname = auto_complete('firstname') @@ -175,7 +175,7 @@ def post_signup(): email = form('email').lower() if not tools.email_validation(email): - return error(i18n.msg[14]) + return error(i18n.msg[15]) if not tools.pwd_validation(form('password')): return error(i18n.msg[8]) #mezua ALDATU egin behar da @@ -216,12 +216,12 @@ def post_edit_fullname(): if len(form('firstname')) < 3: return error(i18n.msg[11]) elif not tools.input_validation(form('firstname')): - return error(i18n.msg[6]) #Not allowed characters for the firstname field. ALDATU + return error(i18n.msg[4]) if len(form('surname')) < 3: return error(i18n.msg[12]) elif not tools.input_validation(form('surname')): - return error(i18n.msg[6]) #Not allowed characters for the surname field. ALDATU + return error(i18n.msg[5]) try: edit_fullname(username, old_firstname, old_surname, form('firstname').lower(), form('surname').lower()) @@ -269,7 +269,9 @@ def post_change_pwd(): def error(msg): return change_pwd_tpl(username=username, alerts=[('error', msg, 'fadeOut')], str=i18n.str) - if (not tools.pwd_validation(form('new-password')) or not tools.pwd_validation(form('confirm-password'))): + if not tools.pwd_validation(form('old-password')): + return error(i18n.msg[26]) + elif (not tools.pwd_validation(form('new-password')) or not tools.pwd_validation(form('confirm-password'))): return error(i18n.msg[8]) #mezua aldatu egin behar da elif form('new-password') != form('confirm-password'): return error(i18n.msg[7]) @@ -369,7 +371,7 @@ def login_user(conf, *args): except LDAPSocketOpenError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) - raise Error(i18n.msg[22]) + raise Error(i18n.msg[23]) except LDAPExceptionError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) @@ -417,7 +419,7 @@ def logout_user(conf, *args): except LDAPSocketOpenError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) - raise Error(i18n.msg[22]) + raise Error(i18n.msg[23]) except LDAPExceptionError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) @@ -543,7 +545,7 @@ def new_fullname(conf, *args): except LDAPSocketOpenError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) - raise Error(i18n.msg[22]) + raise Error(i18n.msg[23]) except LDAPExceptionError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) @@ -606,7 +608,7 @@ def new_email_address(conf, *args): except LDAPSocketOpenError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) - raise Error(i18n.msg[22]) + raise Error(i18n.msg[23]) except LDAPExceptionError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) @@ -664,7 +666,7 @@ def change_password(conf, *args): except LDAPSocketOpenError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) - raise Error(i18n.msg[22]) + raise Error(i18n.msg[23]) except LDAPExceptionError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) @@ -714,7 +716,7 @@ def del_account(conf, *args): except LDAPSocketOpenError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) - raise Error(i18n.msg[22]) + raise Error(i18n.msg[23]) except LDAPExceptionError as e: LOG.error('{}: {!s}'.format(e.__class__.__name__, e)) diff --git a/data/invite-codes.db b/data/invite-codes.db index b718294..a3c0af1 100644 Binary files a/data/invite-codes.db and b/data/invite-codes.db differ diff --git a/edit_email.tpl b/edit_email.tpl index 458a604..84ec1f6 100644 --- a/edit_email.tpl +++ b/edit_email.tpl @@ -18,7 +18,7 @@
- +
diff --git a/edit_fullname.tpl b/edit_fullname.tpl index c544666..760c37f 100644 --- a/edit_fullname.tpl +++ b/edit_fullname.tpl @@ -18,10 +18,10 @@ - + - +
diff --git a/libs/__pycache__/flist.cpython-39.pyc b/libs/__pycache__/flist.cpython-39.pyc index d1a1008..fd0bc85 100644 Binary files a/libs/__pycache__/flist.cpython-39.pyc and b/libs/__pycache__/flist.cpython-39.pyc differ diff --git a/libs/__pycache__/helper.cpython-39.pyc b/libs/__pycache__/helper.cpython-39.pyc index f46e5c6..56f48f6 100644 Binary files a/libs/__pycache__/helper.cpython-39.pyc and b/libs/__pycache__/helper.cpython-39.pyc differ diff --git a/libs/__pycache__/localization.cpython-39.pyc b/libs/__pycache__/localization.cpython-39.pyc index 40109f8..5846bf6 100644 Binary files a/libs/__pycache__/localization.cpython-39.pyc and b/libs/__pycache__/localization.cpython-39.pyc differ diff --git a/libs/__pycache__/slist.cpython-39.pyc b/libs/__pycache__/slist.cpython-39.pyc index 4d2b8a4..0b0bb15 100644 Binary files a/libs/__pycache__/slist.cpython-39.pyc and b/libs/__pycache__/slist.cpython-39.pyc differ diff --git a/libs/localization.py b/libs/localization.py index 8468404..077403d 100644 --- a/libs/localization.py +++ b/libs/localization.py @@ -36,14 +36,14 @@ class LocalizeTo(object): #messages msg_00 = _("The session was closed.") - msg_01 = _("Username must be at least 3 characters long!") - msg_02 = _("Please enter your password!") - msg_03 = _("Welcome") - msg_04 = _("The code is invalid or has expired.") - msg_05 = _("A bit short, don't you think?!") - msg_06 = _("Not allowed characters for the username field.") + msg_01 = _("Welcome") + msg_02 = _("Username must be at least 3 characters long!") + msg_03 = _("Not allowed characters for the username field.") + msg_04 = _("Not allowed characters for the firstname field.") + msg_05 = _("Not allowed characters for the surname field.") + msg_06 = _("The code is invalid or has expired.") msg_07 = _("Passwords do not match!") - msg_08 = _("Password must be at least 8 characters long!") + msg_08 = _("The password must contain at least 8 characters, at least one number, uppercase and lowercase letters and special characters.") msg_09 = _("Congratulations, your account has been created!") msg_10 = _("Your first and last name have not been changed.") msg_11 = _("Your firstname is a bit short, don't you think?") diff --git a/locales/base.pot b/locales/base.pot index 634d4af..0ed2b78 100644 --- a/locales/base.pot +++ b/locales/base.pot @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , 2022. +# FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 0.0.1\n" +"Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-07 17:23+0200\n" +"POT-Creation-Date: 2022-04-25 16:52+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Aitzol Berasategi \n" -"Language-Team: LANGUAGE \n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" +"Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: libs/localization.py:12 @@ -109,7 +109,7 @@ msgstr "" msgid "Delete your account" msgstr "" -#: libs/localization.py:35 libs/localization.py:41 +#: libs/localization.py:35 libs/localization.py:39 msgid "Welcome" msgstr "" @@ -117,24 +117,24 @@ msgstr "" msgid "The session was closed." msgstr "" -#: libs/localization.py:39 +#: libs/localization.py:40 msgid "Username must be at least 3 characters long!" msgstr "" -#: libs/localization.py:40 -msgid "Please enter your password!" +#: libs/localization.py:41 +msgid "Not allowed characters for the username field." msgstr "" #: libs/localization.py:42 -msgid "The code is invalid or has expired." +msgid "Not allowed characters for the firstname field." msgstr "" #: libs/localization.py:43 -msgid "A bit short, don't you think?!" +msgid "Not allowed characters for the surname field." msgstr "" #: libs/localization.py:44 -msgid "Not allowed characters for the username field." +msgid "The code is invalid or has expired." msgstr "" #: libs/localization.py:45 @@ -142,7 +142,9 @@ msgid "Passwords do not match!" msgstr "" #: libs/localization.py:46 -msgid "Password must be at least 8 characters long!" +msgid "" +"The password must contain at least 8 characters, at least one number, " +"uppercase and lowercase letters and special characters." msgstr "" #: libs/localization.py:47 @@ -220,4 +222,4 @@ msgstr "" #: libs/localization.py:65 msgid "The session has expired." -msgstr "" \ No newline at end of file +msgstr "" diff --git a/locales/en/LC_MESSAGES/base.mo b/locales/en/LC_MESSAGES/base.mo index c6e35c1..346e9a4 100644 Binary files a/locales/en/LC_MESSAGES/base.mo and b/locales/en/LC_MESSAGES/base.mo differ diff --git a/locales/en/LC_MESSAGES/base.po b/locales/en/LC_MESSAGES/base.po index a7831ec..53b0d7c 100644 --- a/locales/en/LC_MESSAGES/base.po +++ b/locales/en/LC_MESSAGES/base.po @@ -7,11 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-07 17:23+0200\n" -"PO-Revision-Date: 2022-04-16 17:11+0200\n" +"POT-Creation-Date: 2022-04-07 17:20+0200\n" +"PO-Revision-Date: 2022-04-25 17:15+0200\n" "Last-Translator: Aitzol Berasategi \n" -"Language-Team: LANGUAGE \n" -"Language: en\n" +"Language-Team: LANGUAGE \n" +"Language: eu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -109,7 +109,7 @@ msgstr "Change your password" msgid "Delete your account" msgstr "Delete your account" -#: libs/localization.py:35 libs/localization.py:41 +#: libs/localization.py:35 libs/localization.py:39 msgid "Welcome" msgstr "Welcome" @@ -117,33 +117,37 @@ msgstr "Welcome" msgid "The session was closed." msgstr "The session was closed." -#: libs/localization.py:39 +#: libs/localization.py:40 msgid "Username must be at least 3 characters long!" msgstr "Username must be at least 3 characters long!" -#: libs/localization.py:40 -msgid "Please enter your password!" -msgstr "Please enter your password!" - -#: libs/localization.py:42 -msgid "The code is invalid or has expired." -msgstr "The code is invalid or has expired." - -#: libs/localization.py:43 -msgid "A bit short, don't you think?!" -msgstr "A bit short, don't you think?!" - -#: libs/localization.py:44 +#: libs/localization.py:41 msgid "Not allowed characters for the username field." msgstr "Not allowed characters for the username field." +#: libs/localization.py:42 +msgid "Not allowed characters for the firstname field." +msgstr "Not allowed characters for the firstname field." + +#: libs/localization.py:43 +msgid "Not allowed characters for the surname field." +msgstr "Not allowed characters for the surname field." + +#: libs/localization.py:44 +msgid "The code is invalid or has expired." +msgstr "The code is invalid or has expired." + #: libs/localization.py:45 msgid "Passwords do not match!" msgstr "Passwords do not match!" #: libs/localization.py:46 -msgid "Password must be at least 8 characters long!" -msgstr "Password must be at least 8 characters long!" +msgid "" +"The password must contain at least 8 characters, at least one number, " +"uppercase and lowercase letters and special characters." +msgstr "" +"The password must contain at least 8 characters, at least one number, " +"uppercase and lowercase letters and special characters." #: libs/localization.py:47 msgid "Congratulations, your account has been created!" @@ -202,8 +206,10 @@ msgid "Unable to connect to the remote server." msgstr "Unable to connect to the remote server." #: libs/localization.py:61 -msgid "Encountered an unexpected error while communicating with the remote server." -msgstr "Encountered an unexpected error while communicating with the remote server." +msgid "" +"Encountered an unexpected error while communicating with the remote server." +msgstr "" +"Encountered an unexpected error while communicating with the remote server." #: libs/localization.py:62 msgid "User already exists." @@ -219,4 +225,4 @@ msgstr "Forgot your password? Please try again." #: libs/localization.py:65 msgid "The session has expired." -msgstr "The session has expired." \ No newline at end of file +msgstr "The session has expired." diff --git a/locales/eu/LC_MESSAGES/base.mo b/locales/eu/LC_MESSAGES/base.mo index ac5e52f..9c58475 100644 Binary files a/locales/eu/LC_MESSAGES/base.mo and b/locales/eu/LC_MESSAGES/base.mo differ diff --git a/locales/eu/LC_MESSAGES/base.po b/locales/eu/LC_MESSAGES/base.po index 7087c40..52019fd 100644 --- a/locales/eu/LC_MESSAGES/base.po +++ b/locales/eu/LC_MESSAGES/base.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-04-07 17:23+0200\n" -"PO-Revision-Date: 2022-04-16 17:13+0200\n" +"PO-Revision-Date: 2022-04-25 17:10+0200\n" "Last-Translator: Aitzol Berasategi \n" "Language-Team: LANGUAGE \n" "Language: eu\n" @@ -117,33 +117,37 @@ msgstr "Ongi etorri" msgid "The session was closed." msgstr "Saioa itxi da." -#: libs/localization.py:39 +#: libs/localization.py:40 msgid "Username must be at least 3 characters long!" msgstr "Erabiltzaile izenak gutxienez 3 karaktere izan behar ditu!" -#: libs/localization.py:40 -msgid "Please enter your password!" -msgstr "Sartu zure pasahitza, mesedez!" +#: libs/localization.py:41 +msgid "Not allowed characters for the username field." +msgstr "Erabiltzaile-izen eremurako onartzen ez diren karaktereak." #: libs/localization.py:42 -msgid "The code is invalid or has expired." -msgstr "Kodea baliogabea da edo iraungi egin da." +msgid "Not allowed characters for the firstname field." +msgstr "Izen eremurako onartzen ez diren karaktereak." #: libs/localization.py:43 -msgid "A bit short, don't you think?!" -msgstr "Labur-xamarra, ez duzu uste?!" +msgid "Not allowed characters for the surname field." +msgstr "Abizen eremurako onartzen ez diren karaktereak." #: libs/localization.py:44 -msgid "Not allowed characters for the username field." -msgstr "Erabiltzaile izenerako onartzen ez diren karaktereak." +msgid "The code is invalid or has expired." +msgstr "Kodea baliogabea da edo iraungi egin da." #: libs/localization.py:45 msgid "Passwords do not match!" msgstr "Pasahitzak ez datoz bat!" #: libs/localization.py:46 -msgid "Password must be at least 8 characters long!" -msgstr "Pasahitzak gutxienez 8 karaktereko luzera izan behar du!" +msgid "" +"The password must contain at least 8 characters, at least one number, " +"uppercase and lowercase letters and special characters." +msgstr "" +"Pasahitzak gutxienez 8 karaktere izan behar ditu, zenbakiren bat gutxienez, " +"hizki txiki zein larriak eta baita karaktere bereziak ere." #: libs/localization.py:47 msgid "Congratulations, your account has been created!" @@ -202,7 +206,8 @@ msgid "Unable to connect to the remote server." msgstr "Ezinezkoa urruneko zerbitzara konektatzea." #: libs/localization.py:61 -msgid "Encountered an unexpected error while communicating with the remote server." +msgid "" +"Encountered an unexpected error while communicating with the remote server." msgstr "Ezusteko errore bat gertatu da urruneko zerbitzariarekin komunikatzean." #: libs/localization.py:62 @@ -219,4 +224,4 @@ msgstr "Zure pasahitza ahaztu duzu? Saia zeitez berriz, mesedez." #: libs/localization.py:65 msgid "The session has expired." -msgstr "Saioa iraungi egin da." \ No newline at end of file +msgstr "Saioa iraungi egin da."