diff --git a/source/ubl-settings-usergroups-settings.c b/source/ubl-settings-usergroups-settings.c index 75aa645..d7992e7 100644 --- a/source/ubl-settings-usergroups-settings.c +++ b/source/ubl-settings-usergroups-settings.c @@ -35,9 +35,9 @@ void on_additional_settings_changed(GtkWidget *self, ubl_settings_usergroups_add } char *default_password = NULL; int user_password_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->DefaultPasswordCombo)); - if (user_password_active==2) + if (user_password_active==1) default_password=(char*)gtk_entry_get_text(GTK_ENTRY(window->DefaultPasswordEntry)); - else if (user_password_active==1) + else if (user_password_active==2) default_password=" "; else if (user_password_active==3){ default_password="!*"; @@ -51,9 +51,9 @@ void on_additional_settings_changed(GtkWidget *self, ubl_settings_usergroups_add } char *root_password = NULL; int root_password_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->RootPasswordCombo)); - if (root_password_active==2) + if (root_password_active==1) root_password=(char*)gtk_entry_get_text(GTK_ENTRY(window->RootPasswordCombo)); - else if (root_password_active==1) + else if (root_password_active==2) root_password=" "; if (!yon_char_is_empty(root_password)){ if (window->default_root_password) @@ -674,21 +674,21 @@ ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_ char *default_password = yon_config_get_by_key(DEFAULTPASSWD_parameter); if (!yon_char_is_empty(default_password)){ if (!strcmp(default_password," ")){ - gtk_combo_box_set_active(GTK_COMBO_BOX(window->DefaultPasswordCombo),1); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->DefaultPasswordCombo),2); } else if (!strcmp(default_password,"!*")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->DefaultPasswordCombo),3); } else { - gtk_combo_box_set_active(GTK_COMBO_BOX(window->DefaultPasswordCombo),2); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->DefaultPasswordCombo),1); gtk_entry_set_text(GTK_ENTRY(window->DefaultPasswordEntry),default_password); } } char *root_password = yon_config_get_by_key(DEFAULTROOTPASSWD_parameter); if (!yon_char_is_empty(root_password)){ if (!strcmp(root_password," ")){ - gtk_combo_box_set_active(GTK_COMBO_BOX(window->RootPasswordCombo),1); - } else { gtk_combo_box_set_active(GTK_COMBO_BOX(window->RootPasswordCombo),2); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(window->RootPasswordCombo),1); gtk_entry_set_text(GTK_ENTRY(window->DefaultPasswordEntry),root_password); } } diff --git a/source/ubl-settings-usergroups-user.c b/source/ubl-settings-usergroups-user.c index f6e63d2..3cd23fd 100644 --- a/source/ubl-settings-usergroups-user.c +++ b/source/ubl-settings-usergroups-user.c @@ -394,9 +394,9 @@ void on_user_save(GtkWidget *self, dictionary *dict){ int password_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userPasswordCombo)); if (password_active == 0){ password = ""; - } else if (password_active ==1){ + } else if (password_active ==5){ password = " "; - } else if (password_active ==2){ + } else if (password_active ==1){ password = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordEntry)); if (yon_char_is_empty(password)){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); @@ -404,15 +404,15 @@ void on_user_save(GtkWidget *self, dictionary *dict){ gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0); return; } - } else if (password_active==3){ + } else if (password_active==2){ password = "!*"; - } else if (password_active ==4){ + } else if (password_active ==3){ password = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordEntry)); if (password[0]!='!') { char *temp = yon_char_append("!",password); password=temp; } - } else if (password_active == 5){ + } else if (password_active == 4){ password = yon_char_new((char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordEntry))); if (yon_char_is_empty(password)){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 2327c2a..3875555 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -841,13 +841,13 @@ void on_password_combo_changed(GtkComboBox *self, GtkWidget *target){ int active = gtk_combo_box_get_active(self); switch(active){ case 0: - case 1: + case 2: case 3: - case 4: + case 5: gtk_widget_set_sensitive(target,0); break; - case 2: - case 5: + case 1: + case 4: gtk_widget_set_sensitive(target,1); break; } @@ -1399,7 +1399,7 @@ void on_toggle_button_set_active_from_combo_box(GtkComboBox *self,ubl_settings_u void on_toggle_button_set_active_from_toggle_button_inversed(GtkToggleButton *, ubl_settings_usergroups_user_window *window){ char *passw = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordEntry)); - if ((passw[0]!='$')&>k_combo_box_get_active(GTK_COMBO_BOX(window->userPasswordCombo))>1){ + if ((passw[0]!='$')&>k_combo_box_get_active(GTK_COMBO_BOX(window->userPasswordCombo))==1){ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck))){ gtk_widget_set_sensitive(GTK_WIDGET(window->userSyncSAMBAPasswordCheck),0); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBAPasswordCheck))){ @@ -1590,18 +1590,18 @@ void on_main_edit(GtkWidget *, main_window *widgets){ g_signal_handlers_block_by_func(G_OBJECT(window->userSyncSAMBACheck),G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userSyncSAMBAPasswordCheck); } if (!strcmp(parameters[5],"!*")){ - gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),3); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),2); } else if (!strcmp(parameters[5]," ")) { - gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),1); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),5); } else if (parameters[5][0]=='!'){ char *password_or = yon_char_new(parameters[5]); free(yon_char_divide(password_or,0)); gtk_entry_set_text(GTK_ENTRY(window->userPasswordEntry),password_or); - gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),4); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),3); free(password_or); } else { gtk_entry_set_text(GTK_ENTRY(window->userPasswordEntry),parameters[5]); - gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),2); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),1); } } } diff --git a/ubl-settings-usergroups-additional-settings.glade b/ubl-settings-usergroups-additional-settings.glade index 8921f94..f475bcc 100644 --- a/ubl-settings-usergroups-additional-settings.glade +++ b/ubl-settings-usergroups-additional-settings.glade @@ -1,5 +1,5 @@ - + @@ -76,8 +76,8 @@ False Group GID range - - + + True True False @@ -90,8 +90,8 @@ False Group GID in system - - + + True True False @@ -176,8 +176,8 @@ False Users UID range - - + + True True False @@ -190,8 +190,8 @@ False User UID in system - - + + True True False @@ -383,8 +383,9 @@ 0 Default - No password required Set a password + No password required + Deny login @@ -459,9 +460,8 @@ 0 Default - No password required Set a password - Deny login + No password required diff --git a/ubl-settings-usergroups-user.glade b/ubl-settings-usergroups-user.glade index 59c758c..a25b015 100644 --- a/ubl-settings-usergroups-user.glade +++ b/ubl-settings-usergroups-user.glade @@ -1,5 +1,5 @@ - + @@ -235,11 +235,11 @@ 0 Default - No password required Set a password Deny login Block login with password Unblock login with password + No password required