@ -84,12 +84,6 @@ int yon_user_save(yon_user_struct *user){
yon_ubl_status_highlight_incorrect ( user - > PasswordEntry ) ;
yon_ubl_status_highlight_incorrect ( user - > PasswordEntry ) ;
return 0 ;
return 0 ;
}
}
} else {
char * default_passwd = config ( DEFAULTPASSWD_parameter ) ;
if ( yon_char_is_empty ( default_passwd ) ) {
default_passwd = config ( DEFAULTPASSWD_system_parameter ) ;
}
password = default_passwd ;
}
}
char * admin_uid = NULL ;
char * admin_uid = NULL ;
if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( user - > AdminCheck ) ) ) {
if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( user - > AdminCheck ) ) ) {
@ -209,18 +203,18 @@ void yon_user_init(main_window *widgets){
gtk_combo_box_text_remove_all ( GTK_COMBO_BOX_TEXT ( widgets - > UserRootPasswordCombo ) ) ;
gtk_combo_box_text_remove_all ( GTK_COMBO_BOX_TEXT ( widgets - > UserRootPasswordCombo ) ) ;
gtk_combo_box_text_append ( GTK_COMBO_BOX_TEXT ( widgets - > UserRootPasswordCombo ) , NULL , DEFAULT_LABEL ) ;
gtk_combo_box_text_append ( GTK_COMBO_BOX_TEXT ( widgets - > UserRootPasswordCombo ) , NULL , DEFAULT_LABEL ) ;
gtk_combo_box_text_append ( GTK_COMBO_BOX_TEXT ( widgets - > UserRootPasswordCombo ) , NULL , SET_PASSWORD_LABEL ) ;
gtk_combo_box_text_append ( GTK_COMBO_BOX_TEXT ( widgets - > UserRootPasswordCombo ) , NULL , SET_PASSWORD_LABEL ) ;
yon_gtk_entry_set_password_visibility_icon ( GTK_ENTRY ( widgets - > UserRootPasswordEntry ) ) ;
char * root_password = config ( root_password_parameter ) ;
char * root_password = config ( root_password_parameter ) ;
if ( yon_char_is_empty ( root_password ) ) {
// if (yon_char_is_empty(root_password)){
root_password = config ( DEFAULTROOTPASSWD_system_parameter ) ;
// root_password = config(DEFAULTROOTPASSWD_system_parameter);
}
// }
char * autologin = config ( autologin_parameter ) ;
char * autologin = config ( autologin_parameter ) ;
if ( ! yon_char_is_empty ( root_password ) & & strcmp ( root_password , config ( DEFAULTROOTPASSWD_system_parameter ) ) ) {
if ( ! yon_char_is_empty ( root_password ) & & strcmp ( root_password , config ( DEFAULTROOTPASSWD_system_parameter ) ) ) {
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > UserRootPasswordCombo ) , 1 ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > UserRootPasswordCombo ) , 1 ) ;
gtk_entry_set_text ( GTK_ENTRY ( widgets - > UserRootPasswordEntry ) , root_password ) ;
gtk_entry_set_text ( GTK_ENTRY ( widgets - > UserRootPasswordEntry ) , root_password ) ;
} else {
} else {
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > UserRootPasswordCombo ) , 0 ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgets - > UserRootPasswordCombo ) , 0 ) ;
gtk_entry_set_text ( GTK_ENTRY ( widgets - > UserRootPasswordEntry ) , root_password ) ;
gtk_entry_set_placeholder_text ( GTK_ENTRY ( widgets - > UserRootPasswordEntry ) , root_password ) ;
}
}
if ( ! yon_char_is_empty ( autologin ) & & ( ! strcmp ( autologin , " yes " ) | | ! strcmp ( autologin , " enable " ) ) ) {
if ( ! yon_char_is_empty ( autologin ) & & ( ! strcmp ( autologin , " yes " ) | | ! strcmp ( autologin , " enable " ) ) ) {
gtk_switch_set_active ( GTK_SWITCH ( widgets - > UserAutologinSwitch ) , 1 ) ;
gtk_switch_set_active ( GTK_SWITCH ( widgets - > UserAutologinSwitch ) , 1 ) ;
@ -261,13 +255,13 @@ void yon_user_init(main_window *widgets){
gtk_entry_set_text ( GTK_ENTRY ( user - > LoginEntry ) , " superadmin " ) ;
gtk_entry_set_text ( GTK_ENTRY ( user - > LoginEntry ) , " superadmin " ) ;
}
}
user - > changed = 1 ;
user - > changed = 1 ;
if ( ! yon_char_is_empty ( default_passwd ) )
if ( ! yon_char_is_empty ( default_passwd ) & & strcmp ( default_passwd , config ( DEFAULTPASSWD_system_parameter ) ) ) {
gtk_entry_set_text ( GTK_ENTRY ( user - > PasswordEntry ) , default_passwd ) ;
gtk_entry_set_text ( GTK_ENTRY ( user - > PasswordEntry ) , default_passwd ) ;
// if (!yon_char_is_empty(def_usr)&& !strcmp(def_usr,default_user)){
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( user - > AdminCheck ) , 1 ) ;
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( user - > AdminCheck ) , 1 ) ;
// } else {
} else {
// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(user->AdminCheck),strcmp(addadm,"yes"));
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( user - > AdminCheck ) , 0 ) ;
// }
gtk_entry_set_placeholder_text ( GTK_ENTRY ( widgets - > UserRootPasswordEntry ) , default_passwd ) ;
}
}
}
}
}
for ( int i = 0 ; i < users_size ; i + + ) {
for ( int i = 0 ; i < users_size ; i + + ) {
@ -293,9 +287,6 @@ void yon_user_init(main_window *widgets){
if ( strcmp ( parsed [ 5 ] , default_passwd ) ) {
if ( strcmp ( parsed [ 5 ] , default_passwd ) ) {
gtk_entry_set_text ( GTK_ENTRY ( user - > PasswordEntry ) , parsed [ 5 ] ) ;
gtk_entry_set_text ( GTK_ENTRY ( user - > PasswordEntry ) , parsed [ 5 ] ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( user - > PasswordCombo ) , 1 ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( user - > PasswordCombo ) , 1 ) ;
} else {
gtk_entry_set_text ( GTK_ENTRY ( user - > PasswordEntry ) , default_passwd ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( user - > PasswordCombo ) , 0 ) ;
}
}
}
}
if ( parsed_size > 1 ) {
if ( parsed_size > 1 ) {