From deddfd706d62c8379845cee2523f753a8fa7c594 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 24 Dec 2024 17:16:04 +0600 Subject: [PATCH] Added ' symbol at restricted to use in passwords --- source/ubl-settings-update.c | 5 +++++ source/ubl-strings.h | 1 + ubl-settings-update.pot | 4 ++++ ubl-settings-update_ru.po | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index e55114c..c0ca695 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -1323,6 +1323,11 @@ void on_password_accept(GtkWidget *,dictionary *dict){ } else { char *password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry)); + if (strstr(password,"'")){ + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_RESTRICTED_SYMBOL_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(window->PasswordEntry); + return; + } if (strcmp(password,password_check)){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_MISMATCH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_highlight_incorrect(window->PasswordEntry); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 0e94d38..2387dc9 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -14,6 +14,7 @@ #define EDIT_WEB_LABEL _("Edit repository for publication") #define PASSWORD_MISMATCH_LABEL _("Passwords do not match") + #define PASSWORD_RESTRICTED_SYMBOL_LABEL _("Password contains restricted symbols") #define REPO_TOOLTIP_LABEL _("file://\t\t- Directory URL prefix for repository\n\ ftp://\t\t- FTP URL prefix for repository\n\ diff --git a/ubl-settings-update.pot b/ubl-settings-update.pot index 685e6a5..7076f69 100644 --- a/ubl-settings-update.pot +++ b/ubl-settings-update.pot @@ -61,6 +61,10 @@ msgstr "" msgid "Passwords do not match" msgstr "" +#: source/ubl-strings.h:17 +msgid "Password contains restricted symbols" +msgstr "" + #: source/ubl-strings.h:18 msgid "" "file://\t\t- Directory URL prefix for repository\n" diff --git a/ubl-settings-update_ru.po b/ubl-settings-update_ru.po index 8a654f5..6aefa16 100644 --- a/ubl-settings-update_ru.po +++ b/ubl-settings-update_ru.po @@ -61,6 +61,10 @@ msgstr "Редактирование репозитория для публик msgid "Passwords do not match" msgstr "Пароли не совпадают" +#: source/ubl-strings.h:17 +msgid "Password contains restricted symbols" +msgstr "Пароль содержит запрещённые символы" + #: source/ubl-strings.h:18 msgid "" "file://\t\t- Directory URL prefix for repository\n"