|
|
|
|
@ -493,17 +493,15 @@ void yon_delete_confirmation_open(main_window *widgets){
|
|
|
|
|
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->UsersList),&iter)){
|
|
|
|
|
char *name,*username,*parameters,*homedir=NULL;
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->UsersList),&iter,2,&name,3,&username,6,¶meters,-1);
|
|
|
|
|
int found = yon_char_parsed_check_exist(main_config.users,main_config.users_size,yon_char_append(name,":"));
|
|
|
|
|
|
|
|
|
|
if (found>-1){
|
|
|
|
|
int parsed_size;
|
|
|
|
|
config_str parsed = yon_char_parse(main_config.users[found],&parsed_size,":");
|
|
|
|
|
if (parsed_size>5&&!yon_char_is_empty(parsed[5])&&strcmp(parsed[5],"x")){
|
|
|
|
|
|
|
|
|
|
homedir = yon_char_new(parsed[5]);
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
|
int size;
|
|
|
|
|
config_str home = yon_config_load(get_home_command(name),&size);
|
|
|
|
|
if (size>0&&!yon_char_is_empty(home[0])){
|
|
|
|
|
if (home[0][strlen(home[0])-1]=='\n') home[0][strlen(home[0])-1]='\0';
|
|
|
|
|
homedir=home[0];
|
|
|
|
|
} else {
|
|
|
|
|
homedir = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int status=0;
|
|
|
|
|
if (homedir) status=1;
|
|
|
|
|
gtk_list_store_append(window->list,&itar);
|
|
|
|
|
@ -1438,11 +1436,6 @@ void on_user_login_update(GtkWidget *self, ubl_settings_usergroups_user_window *
|
|
|
|
|
} else {
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),"");
|
|
|
|
|
}
|
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->userHomeCombo))==0){
|
|
|
|
|
char *homepath = yon_char_append("/home/",(char*)gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry)));
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userHomeEntry),homepath);
|
|
|
|
|
free(homepath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
@ -1579,8 +1572,6 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
int user_home_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userHomeCombo));
|
|
|
|
|
if (user_home_active==2){
|
|
|
|
|
user_home=yon_char_unite("--home-dir ",(char*)gtk_entry_get_text(GTK_ENTRY(window->userHomeEntry)),NULL);
|
|
|
|
|
} else if (user_home_active==0){
|
|
|
|
|
user_home=yon_char_unite("--home-dir ",main_config.default_home,"/",login,NULL);
|
|
|
|
|
} else if (user_home_active==1){
|
|
|
|
|
user_home="--no-create-home";
|
|
|
|
|
} else user_home = "";
|
|
|
|
|
@ -1803,8 +1794,6 @@ void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *w
|
|
|
|
|
int user_home_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userHomeCombo));
|
|
|
|
|
if (user_home_active==2){
|
|
|
|
|
user_home=yon_char_unite("--home-dir ",(char*)gtk_entry_get_text(GTK_ENTRY(window->userHomeEntry)),NULL);
|
|
|
|
|
} else if (user_home_active==0){
|
|
|
|
|
user_home=yon_char_unite("--home-dir ",main_config.default_home,"/",login,NULL);
|
|
|
|
|
} else if (user_home_active==1){
|
|
|
|
|
user_home="--no-create-home";
|
|
|
|
|
} else user_home = "";
|
|
|
|
|
|