Fixed user saving

pull/336/head
parent a45f0a3479
commit 8e0f3d647f

@ -62,6 +62,12 @@ int yon_user_save(yon_user_struct *user){
yon_ubl_status_highlight_incorrect(user->PasswordEntry);
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;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(user->AdminCheck))){
@ -189,6 +195,12 @@ void yon_user_init(main_window *widgets){
if (!users_size){
char *default_user = config(DEFAULTUSER_parameter);
char *default_passwd = config(DEFAULTPASSWD_parameter);
if (yon_char_is_empty(default_user)){
default_user = config(DEFAULTUSER_system_parameter);
}
if (yon_char_is_empty(default_passwd)){
default_passwd = config(DEFAULTPASSWD_system_parameter);
}
yon_user_struct *user = yon_user_struct_new();
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(user->AdminCheck),1);
g_signal_connect(G_OBJECT(user->AdminCheck),"clicked",G_CALLBACK(yon_user_admin_check),widgets);

@ -269,8 +269,12 @@ layout && /description:/ {\
#define admuid_parameter_command "ubconfig --source global get [users] ADMUID"
#define DEFAULTUSER_parameter "AUTOINSTALL[ubconfig set [users] DEFAULTUSER]"
#define DEFAULTUSER_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL['ubconfig set [users] DEFAULTUSER']"
#define DEFAULTUSER_system_parameter "DEFAULTUSER"
#define DEFAULTUSER_system_parameter_command "ubconfig --source global get [users] DEFAULTUSER"
#define DEFAULTPASSWD_parameter "AUTOINSTALL[ubconfig set [users] DEFAULTPASSWD]"
#define DEFAULTPASSWD_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL['ubconfig set [users] DEFAULTPASSWD']"
#define DEFAULTPASSWD_system_parameter "DEFAULTPASSWD"
#define DEFAULTPASSWD_system_parameter_command "ubconfig --source global get [users] DEFAULTPASSWD"
#define SYSTEM_LANG_parameter "AUTOINSTALL['ubconfig set [locale] LANG']"
#define SYSTEM_LANG_parameter_command "ubconfig --source global get autoinstall AUTOINSTALL['ubconfig set [locale] LANG']"
@ -306,7 +310,7 @@ layout && /description:/ {\
#define config_get_command(target) yon_char_unite("ubconfig -ea --conarg --source ", target, " get [autoinstall] AUTOINSTALL[*] -- get [locale] LANG", NULL)
#define config_get_default_command "ubconfig -ea --noconarg --source default get [autoinstall] AUTOINSTALL[*] -- get [locale] LANG -- get [users] ADMUID"
#define config_get_default_command "ubconfig -ea --noconarg --source default get [autoinstall] AUTOINSTALL[*] -- get [locale] LANG -- get [users] ADMUID DEFAULTUSER DEFAULTPASSWD"
#define config_get_global_only_parameters ""
#define config_get_local_only_parameters ""

Loading…
Cancel
Save