From 4beb13a83cca02263554ce74a34610dadf7e4174 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 14:56:20 +0600 Subject: [PATCH] Fixed expiration date disappearing --- source/ubl-settings-usergroups.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 9c85d64..8c7c74b 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1559,8 +1559,8 @@ void on_user_save(GtkWidget *self, dictionary *dict){ long password_interval_maximum = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->userPasswordChangeDelayMaximumSpin)); password_expiration_date = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordExpirationEntry)); - if (!yon_char_is_empty(password_expiration_date)){ - password_expiration_date = window->expiration_unix; + if (yon_char_is_empty(password_expiration_date)){ + password_expiration_date=""; } long warning_days_active = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->userWarningSpin)); @@ -1782,10 +1782,10 @@ void on_date_selected(GtkWidget *self, ubl_settings_usergroups_user_window *wind return; } char *dy = yon_char_from_int(day); - char *mn = yon_char_from_int(month); + char *mn = yon_char_from_int(month+1); char *yr = yon_char_from_int(year); - if (tm.tm_mon<10) yon_char_append("0",mn); - if (tm.tm_mday<10) yon_char_append("0",dy); + if (tm.tm_mon+1<10) mn = yon_char_append("0",mn); + if (tm.tm_mday<10) dy = yon_char_append("0",dy); char *date_string = yon_char_unite(yr,"-",mn,"-",dy); gtk_entry_set_text(GTK_ENTRY(window->userPasswordExpirationEntry), date_string); window->expiration_unix=date_string;