Fixed USERSHADOW always saving

pull/235/head
parent ed5bc3a74f
commit 8b3fd02f48

@ -498,10 +498,10 @@ void on_user_save(GtkWidget *self, dictionary *dict){
":",yon_char_return_if_exist(password_expiration_date,""),
NULL);
final_user = yon_char_unite(yon_char_return_if_exist(username,"x"),
":",yon_char_return_if_exist(uid_string,"x"),
":",yon_char_return_if_exist(main_group,"x"),
":",yon_char_return_if_exist(additional_groups,"x"),
final_user = yon_char_unite(yon_char_return_if_exist(username,""),
":",yon_char_return_if_exist(uid_string,""),
":",yon_char_return_if_exist(main_group,""),
":",yon_char_return_if_exist(additional_groups,""),
":",yon_char_return_if_exist(extra_options,""),
":",yon_char_return_if_exist(password,""),
NULL);
@ -511,11 +511,13 @@ void on_user_save(GtkWidget *self, dictionary *dict){
if (!yon_char_is_empty(window->old_username)&&strcmp(window->old_username,login)){
yon_config_remove_by_key(USERADD(window->old_username));
}
if (strcmp(window->old_password,password)){
final_command = yon_config_parameter_prepare_command(dull_parameter_get_command,NULL,"users",USERSHADOW(login));
yon_config_register(USERSHADOW(login),final_command,shadow_string);
if (!yon_char_is_empty(window->old_username)&&strcmp(window->old_username,login)){
yon_config_remove_by_key(USERSHADOW(window->old_username));
}
}
int home_delete = yon_char_parsed_check_exist(main_config.remove_homes,main_config.homes_size,login);
if (home_delete>-1){
main_config.remove_homes = yon_char_parsed_rip(main_config.remove_homes,&main_config.homes_size,home_delete);

Loading…
Cancel
Save