Removed standard homedir rendering; Homedir place searching changes

pull/129/head
parent fe75a6af38
commit aea1a70161

@ -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)){ for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->UsersList),&iter)){
char *name,*username,*parameters,*homedir=NULL; char *name,*username,*parameters,*homedir=NULL;
gtk_tree_model_get(GTK_TREE_MODEL(widgets->UsersList),&iter,2,&name,3,&username,6,&parameters,-1); gtk_tree_model_get(GTK_TREE_MODEL(widgets->UsersList),&iter,2,&name,3,&username,6,&parameters,-1);
int found = yon_char_parsed_check_exist(main_config.users,main_config.users_size,yon_char_append(name,":")); int size;
config_str home = yon_config_load(get_home_command(name),&size);
if (found>-1){ if (size>0&&!yon_char_is_empty(home[0])){
int parsed_size; if (home[0][strlen(home[0])-1]=='\n') home[0][strlen(home[0])-1]='\0';
config_str parsed = yon_char_parse(main_config.users[found],&parsed_size,":"); homedir=home[0];
if (parsed_size>5&&!yon_char_is_empty(parsed[5])&&strcmp(parsed[5],"x")){ } else {
homedir = NULL;
homedir = yon_char_new(parsed[5]);
}
yon_char_parsed_free(parsed,parsed_size);
} }
int status=0; int status=0;
if (homedir) status=1; if (homedir) status=1;
gtk_list_store_append(window->list,&itar); gtk_list_store_append(window->list,&itar);
@ -1438,11 +1436,6 @@ void on_user_login_update(GtkWidget *self, ubl_settings_usergroups_user_window *
} else { } else {
gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),""); 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){ 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)); int user_home_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userHomeCombo));
if (user_home_active==2){ if (user_home_active==2){
user_home=yon_char_unite("--home-dir ",(char*)gtk_entry_get_text(GTK_ENTRY(window->userHomeEntry)),NULL); 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){ } else if (user_home_active==1){
user_home="--no-create-home"; user_home="--no-create-home";
} else user_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)); int user_home_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userHomeCombo));
if (user_home_active==2){ if (user_home_active==2){
user_home=yon_char_unite("--home-dir ",(char*)gtk_entry_get_text(GTK_ENTRY(window->userHomeEntry)),NULL); 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){ } else if (user_home_active==1){
user_home="--no-create-home"; user_home="--no-create-home";
} else user_home = ""; } else user_home = "";

@ -51,7 +51,7 @@
#define shadow_path "/etc/shadow" #define shadow_path "/etc/shadow"
#define uid_path "/etc/login.defs" #define uid_path "/etc/login.defs"
#define password_limits_path "/etc/security/pwquiality.conf" #define password_limits_path "/etc/security/pwquiality.conf"
#define get_home_command "getent passwd "$USER" | cut -d: -f6" #define get_home_command(target) yon_char_unite("getent passwd \"",target,"\" | cut -d: -f6",NULL)
#define remove_home_dirs_command(users_string) yon_char_append("/usr/lib/ublinux/functions remove_userhome ", users_string) #define remove_home_dirs_command(users_string) yon_char_append("/usr/lib/ublinux/functions remove_userhome ", users_string)
#define default_home_initiator_path "/etc/default/useradd" #define default_home_initiator_path "/etc/default/useradd"

Loading…
Cancel
Save