diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 0282921..3b20198 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1507,6 +1507,14 @@ void on_user_save(GtkWidget *self, dictionary *dict){ yon_ubl_status_highlight_incorrect(window->userPasswordEntry); return; } + 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,"!!","%%!*"); + } else { + password = yon_char_append("!*",password); + } + } } else { password=""; } @@ -1548,8 +1556,10 @@ void on_user_save(GtkWidget *self, dictionary *dict){ if (!yon_char_is_empty(password_expiration_date)){ password_expiration_date = window->expiration_unix; } - - warning_days = yon_char_from_long(gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->userWarningSpin))); + + long warning_days_active = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->userWarningSpin)); + if (warning_days_active>0) + warning_days = yon_char_from_long(warning_days_active); int no_activity_days_active = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->userActivitySpin)); if (no_activity_days_active>0){