From f3ca29df665df21f6ea950d12cc1d8662fa31869 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 22 Feb 2024 15:24:24 +0600 Subject: [PATCH] Added functionality for temporary blocking user button --- source/ubl-settings-usergroups.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 3b20198..ca9fed3 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1510,7 +1510,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userDeactivatedCheck))){ if (password[0]=='%'&&password[1]=='%'){ char *temp = yon_char_replace(password,"%%","!!"); - password = yon_char_replace(password,"!!","%%!*"); + password = yon_char_replace(temp,"!!","%%!*"); } else { password = yon_char_append("!*",password); } @@ -2072,6 +2072,10 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ if (parsed_size>5){ window->old_password=parameters[5]; if (strcmp(parameters[5],"x")&&strcmp(parameters[5],"")){ + if (strstr(parameters[5],"!*")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userDeactivatedCheck),1); + } + yon_char_divide(strstr(parameters[5],"!*"),1); gtk_entry_set_text(GTK_ENTRY(window->userPasswordEntry),parameters[5]); gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),2); }