From d4167897da33b0b248514c391a197fb3e612359b Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 13 Oct 2025 18:02:16 +0600 Subject: [PATCH] Added password language check --- locale/ubl-settings-repomanager.pot | 4 ++++ locale/ubl-settings-repomanager_ru.po | 4 ++++ source/ubl-settings-repomanager-key.c | 8 ++++++++ source/ubl-strings.h | 4 +++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/locale/ubl-settings-repomanager.pot b/locale/ubl-settings-repomanager.pot index b458f12..8fd656b 100644 --- a/locale/ubl-settings-repomanager.pot +++ b/locale/ubl-settings-repomanager.pot @@ -582,3 +582,7 @@ msgstr "" #: source/ubl-strings.h:183 msgid "Repository were not added" msgstr "" + +#: source/ubl-strings.h:183 +msgid "Invalid password" +msgstr "" \ No newline at end of file diff --git a/locale/ubl-settings-repomanager_ru.po b/locale/ubl-settings-repomanager_ru.po index f4d5cb0..79ec573 100644 --- a/locale/ubl-settings-repomanager_ru.po +++ b/locale/ubl-settings-repomanager_ru.po @@ -596,3 +596,7 @@ msgstr "Выбранный каталог хранилища находится #: source/ubl-strings.h:183 msgid "Repository were not added" msgstr "Репозиторий не добавлен" + +#: source/ubl-strings.h:183 +msgid "Invalid password" +msgstr "Неверный пароль" \ No newline at end of file diff --git a/source/ubl-settings-repomanager-key.c b/source/ubl-settings-repomanager-key.c index b9510bb..cb349a9 100644 --- a/source/ubl-settings-repomanager-key.c +++ b/source/ubl-settings-repomanager-key.c @@ -47,9 +47,17 @@ void on_key_generate_accept(GtkWidget *self, key_creation_window* window){ const char *password_confirm = gtk_entry_get_text(GTK_ENTRY(window->PasswordConfirmationEntry)); int ex_status=0; if (yon_char_is_empty(password)&&yon_char_is_empty(password_confirm)){ + yon_debug_output("%s\n",yon_generate_key_no_password_command(type,name,email,strength,comment,expire,password)); ex_status = system(yon_debug_output("%s\n",yon_generate_key_no_password_command(type,name,email,strength,comment,expire,password))); } else if (!strcmp(password,password_confirm)){ + for (int i=0;iStatusBox),PASSWORD_INVALID_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(window->PasswordEntry); + return; + } + } yon_debug_output("%s\n",yon_generate_key_command(type,name,email,strength,comment,expire,password)); ex_status = system(yon_debug_output("%s\n",yon_generate_key_command(type,name,email,strength,comment,expire,password))); } else { diff --git a/source/ubl-strings.h b/source/ubl-strings.h index d4549b8..f107a44 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -182,4 +182,6 @@ #define INSIDE_STORAGE_ERROR_LABEL _("Chosen storage directory is inside of another storage") -#define UNADDED_REPO_LABEL _("Repository were not added") \ No newline at end of file +#define UNADDED_REPO_LABEL _("Repository were not added") + +#define PASSWORD_INVALID_LABEL _("Invalid password") \ No newline at end of file