|
|
|
|
@ -76,6 +76,7 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
|
if (parameters_size>2&&!strcmp(parameters[2],"x")) parameters[2]=login;
|
|
|
|
|
char *pars = "";
|
|
|
|
|
if (parameters_size>5&&strcmp(parameters[5],"x")&&strcmp(parameters[5],"")){
|
|
|
|
|
|
|
|
|
|
if (!check_is_password_hash(parameters[5])){
|
|
|
|
|
pars = ENCRYPTED_LABEL;
|
|
|
|
|
} else {
|
|
|
|
|
@ -128,6 +129,14 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (main_config.groups_size>0){
|
|
|
|
|
yon_char_parsed_free(main_config.groups,main_config.groups_size);
|
|
|
|
|
main_config.groups = yon_file_open(groups_path,&main_config.groups_size);
|
|
|
|
|
}
|
|
|
|
|
if (main_config.users_size>0){
|
|
|
|
|
yon_char_parsed_free(main_config.users,main_config.users_size);
|
|
|
|
|
main_config.users = yon_file_open(users_path,&main_config.users_size);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_local_load(GtkWidget *self, main_window *widgets){
|
|
|
|
|
@ -291,7 +300,7 @@ void on_config_global_save(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_local_save(){
|
|
|
|
|
void on_config_local_save(GtkWidget *self, main_window *widgets){
|
|
|
|
|
int size;
|
|
|
|
|
config_str keys = yon_config_get_all_by_key("USERADD[",&size);
|
|
|
|
|
int passw_size;
|
|
|
|
|
@ -304,7 +313,11 @@ void on_config_local_save(){
|
|
|
|
|
if (parsed_size>5&&!yon_char_is_empty(parsed[5])){
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(passwords,&passw_size,yon_char_new(parsed[5]));
|
|
|
|
|
parsed = yon_char_parsed_rip(parsed,&parsed_size,5);
|
|
|
|
|
yon_config_set(key,yon_char_parsed_to_string(parsed,parsed_size,":"));
|
|
|
|
|
char *final_string = yon_char_parsed_to_string(parsed,parsed_size,":");
|
|
|
|
|
char *temp = yon_char_append(final_string,":");
|
|
|
|
|
free(final_string);
|
|
|
|
|
final_string=temp;
|
|
|
|
|
yon_config_set(key,final_string);
|
|
|
|
|
}
|
|
|
|
|
free(key);
|
|
|
|
|
free(value);
|
|
|
|
|
@ -318,6 +331,7 @@ void on_config_local_save(){
|
|
|
|
|
yon_config_parse_parameter(keys[i],&key,&value);
|
|
|
|
|
yon_config_set(key,value);
|
|
|
|
|
}
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_saving_settings_save(GtkWidget *self, yon_savasettings_window *window){
|
|
|
|
|
@ -643,8 +657,8 @@ void on_password_change(GtkWidget *self, dictionary *entry_dict){//
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
char *password = (char*)gtk_entry_get_text(output_target);
|
|
|
|
|
if (!yon_char_is_empty(password)){
|
|
|
|
|
password = yon_char_new(password);
|
|
|
|
|
if (main_config.load_mode==0){
|
|
|
|
|
password = yon_char_new(password);
|
|
|
|
|
if (!check_is_password_hash(password)){
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->PasswordHashEntry),password);
|
|
|
|
|
} else {
|
|
|
|
|
@ -819,8 +833,11 @@ ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(root_dict,"entry",window->RootPasswordEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->DefaultPasswordButton),"clicked",G_CALLBACK(on_password_change),default_dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RootPasswordButton),"clicked",G_CALLBACK(on_password_change),root_dict);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->EncryptAllPasswordsButton),"clicked",G_CALLBACK(on_passwords_encrypt),NULL);
|
|
|
|
|
dialog_confirmation_data *data=malloc(sizeof(dialog_confirmation_data));
|
|
|
|
|
data->function=on_passwords_encrypt;
|
|
|
|
|
data->action_text = ENCRYPT_SURE_LABEL;
|
|
|
|
|
data->data=NULL;
|
|
|
|
|
g_signal_connect(G_OBJECT(window->EncryptAllPasswordsButton),"clicked",G_CALLBACK(yon_confirmation_dialog_call),data);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PasswordHashCombo),"changed",G_CALLBACK(on_hash_changed),window);
|
|
|
|
|
|
|
|
|
|
@ -980,6 +997,30 @@ void on_group_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
on_subwindow_close(self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_system_parameter_changed(GtkWidget *self, ubl_settings_usergroups_group_creation_window *window){
|
|
|
|
|
|
|
|
|
|
char *non_unique = NULL;
|
|
|
|
|
char *gsystem = NULL;
|
|
|
|
|
|
|
|
|
|
int non_unique_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UnuniqueGIDCheck));
|
|
|
|
|
if(non_unique_active){
|
|
|
|
|
non_unique="--non-unique";
|
|
|
|
|
} else non_unique="";
|
|
|
|
|
|
|
|
|
|
int gsystem_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->SystemGroupCheck));
|
|
|
|
|
if(gsystem_active){
|
|
|
|
|
gsystem="--system";
|
|
|
|
|
} else gsystem="";
|
|
|
|
|
|
|
|
|
|
char *final_str = yon_char_unite(
|
|
|
|
|
yon_char_return_if_exist(non_unique,""),
|
|
|
|
|
!yon_char_is_empty(non_unique)?" ":"",
|
|
|
|
|
yon_char_return_if_exist(gsystem,"")
|
|
|
|
|
);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->groupExtraOptionsEntry),final_str);
|
|
|
|
|
free(final_str);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ubl_settings_usergroups_group_creation_window *yon_ubl_settings_usergroups_group_creation_new(){
|
|
|
|
|
ubl_settings_usergroups_group_creation_window *window = malloc(sizeof(ubl_settings_usergroups_group_creation_window));
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_ubl_settings_usergroups_group_creation);
|
|
|
|
|
@ -1002,6 +1043,7 @@ ubl_settings_usergroups_group_creation_window *yon_ubl_settings_usergroups_group
|
|
|
|
|
window->AdminGroupsEntry=yon_gtk_builder_get_widget(builder,"AdminGroupsEntry");
|
|
|
|
|
window->AdminGroupsButton=yon_gtk_builder_get_widget(builder,"AdminGroupsButton");
|
|
|
|
|
window->GroupaddShutdownCheck=yon_gtk_builder_get_widget(builder,"GroupaddShutdownCheck");
|
|
|
|
|
window->groupExtraOptionsEntry=yon_gtk_builder_get_widget(builder,"groupExtraOptionsEntry");
|
|
|
|
|
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),GROUPS_TITLE_LABEL);
|
|
|
|
|
|
|
|
|
|
@ -1022,6 +1064,8 @@ ubl_settings_usergroups_group_creation_window *yon_ubl_settings_usergroups_group
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->SystemGroupCheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_toggle_button_set_inactive_from_toggle_button_inversed),window->UnuniqueGIDCheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UnuniqueGIDCheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UnuniqueGIDCheck),"toggled",G_CALLBACK(on_system_parameter_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->SystemGroupCheck),"toggled",G_CALLBACK(on_system_parameter_changed),window);
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1382,7 +1426,12 @@ void on_user_login_update(GtkWidget *self, ubl_settings_usergroups_user_window *
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry)));
|
|
|
|
|
} 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){
|
|
|
|
|
@ -1394,6 +1443,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
char *login = NULL;
|
|
|
|
|
char *username = NULL;
|
|
|
|
|
char *main_group = NULL;
|
|
|
|
|
char *no_user_group=NULL;
|
|
|
|
|
char *additional_groups = NULL;
|
|
|
|
|
char *password_changed_date = NULL;
|
|
|
|
|
char *password_expiration_date = NULL;
|
|
|
|
|
@ -1468,9 +1518,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
if (!main_group_active){
|
|
|
|
|
main_group = (char*)gtk_entry_get_text(GTK_ENTRY(window->userGroupsEntry));
|
|
|
|
|
if (yon_char_is_empty(main_group)){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userGroupsEntry);
|
|
|
|
|
return;
|
|
|
|
|
no_user_group="--no-user-group";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
main_group = "";
|
|
|
|
|
@ -1521,7 +1569,11 @@ 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);
|
|
|
|
|
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 = "";
|
|
|
|
|
|
|
|
|
|
int system_user_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateSystemCheck));
|
|
|
|
|
@ -1595,12 +1647,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
":",yon_char_return_if_exist(uid_string,"x"),
|
|
|
|
|
":",yon_char_return_if_exist(main_group,"x"),
|
|
|
|
|
":",yon_char_return_if_exist(additional_groups,"x"),
|
|
|
|
|
":",yon_char_return_if_exist(user_home,""),
|
|
|
|
|
yon_char_return_if_exist(user_shell,""),
|
|
|
|
|
yon_char_return_if_exist(create_system_user,""),
|
|
|
|
|
yon_char_return_if_exist(create_ununique,""),
|
|
|
|
|
yon_char_return_if_exist(do_not_check,""),
|
|
|
|
|
!yon_char_is_empty(extra_options)?extra_options:"",
|
|
|
|
|
!yon_char_is_empty(extra_options)?" ":"",
|
|
|
|
|
yon_char_return_if_exist(extra_options,""),
|
|
|
|
|
":",yon_char_return_if_exist(password,""),
|
|
|
|
|
NULL);
|
|
|
|
|
@ -1711,6 +1758,80 @@ void on_date_selected(GtkWidget *self, ubl_settings_usergroups_user_window *wind
|
|
|
|
|
window->expiration_unix=date_string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *window){
|
|
|
|
|
char *user_shell=NULL;
|
|
|
|
|
char *user_home=NULL;
|
|
|
|
|
char *login=NULL;
|
|
|
|
|
char *create_system_user=NULL;
|
|
|
|
|
char *create_ununique=NULL;
|
|
|
|
|
char *do_not_check=NULL;
|
|
|
|
|
char *main_group=NULL;
|
|
|
|
|
char *no_user_group=NULL;
|
|
|
|
|
|
|
|
|
|
int do_not_check_actve = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userDontCheckCheck));
|
|
|
|
|
if (do_not_check_actve)
|
|
|
|
|
do_not_check = " --badnames";
|
|
|
|
|
|
|
|
|
|
login = (char*)gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry));
|
|
|
|
|
if (login[0]>'0'&&login[0]<'9'&&!do_not_check_actve){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),USER_BEGINS_WITH_DIGIT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userLoginEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (yon_char_is_empty(login)){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userLoginEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int user_shell_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userShellCombo));
|
|
|
|
|
if (user_shell_active>0){
|
|
|
|
|
user_shell = yon_char_unite(" --shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL);
|
|
|
|
|
if (!strcmp(user_shell,SET_LABEL)){
|
|
|
|
|
user_shell = yon_char_unite(" --shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL);
|
|
|
|
|
}
|
|
|
|
|
} else user_shell="";
|
|
|
|
|
|
|
|
|
|
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 = "";
|
|
|
|
|
|
|
|
|
|
int system_user_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateSystemCheck));
|
|
|
|
|
if (system_user_active)
|
|
|
|
|
create_system_user = " --system";
|
|
|
|
|
|
|
|
|
|
int create_ununique_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateUnuniqueCheck));
|
|
|
|
|
if (create_ununique_active)
|
|
|
|
|
create_ununique = " --non-unique";
|
|
|
|
|
int main_group_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userGroupsCheck));
|
|
|
|
|
if (!main_group_active){
|
|
|
|
|
main_group = (char*)gtk_entry_get_text(GTK_ENTRY(window->userGroupsEntry));
|
|
|
|
|
if (yon_char_is_empty(main_group)){
|
|
|
|
|
no_user_group="--no-user-group";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
main_group = "";
|
|
|
|
|
}
|
|
|
|
|
char *final_string = yon_char_unite(yon_char_return_if_exist(user_home,""),
|
|
|
|
|
yon_char_return_if_exist(user_shell,""),
|
|
|
|
|
!yon_char_is_empty(user_shell)?" ":"",
|
|
|
|
|
yon_char_return_if_exist(create_system_user,""),
|
|
|
|
|
!yon_char_is_empty(create_system_user)?" ":"",
|
|
|
|
|
yon_char_return_if_exist(create_ununique,""),
|
|
|
|
|
!yon_char_is_empty(create_ununique)?" ":"",
|
|
|
|
|
yon_char_return_if_exist(do_not_check,""),
|
|
|
|
|
!yon_char_is_empty(do_not_check)?" ":"",
|
|
|
|
|
yon_char_return_if_exist(no_user_group,""),
|
|
|
|
|
NULL);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userExtraOptionsEntry),final_string);
|
|
|
|
|
free(final_string);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
|
|
|
|
|
ubl_settings_usergroups_user_window *window = malloc(sizeof(ubl_settings_usergroups_user_window));
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_ubl_settings_usergroups_user);
|
|
|
|
|
@ -1811,6 +1932,15 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordCombo),"changed",G_CALLBACK(on_toggle_button_set_active_from_combo_box),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordCombo),"changed",G_CALLBACK(on_toggle_button_set_active_from_combo_box),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordEntry),"changed",G_CALLBACK(on_password_user_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userHomeEntry),"changed",G_CALLBACK(on_parameter_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userHomeCombo),"changed",G_CALLBACK(on_parameter_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userShellCombo),"changed",G_CALLBACK(on_parameter_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userShellEntry),"changed",G_CALLBACK(on_parameter_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userCreateSystemCheck),"toggled",G_CALLBACK(on_parameter_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userCreateUnuniqueCheck),"toggled",G_CALLBACK(on_parameter_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userDontCheckCheck),"toggled",G_CALLBACK(on_parameter_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userGroupsCheck),"toggled",G_CALLBACK(on_parameter_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userGroupsEntry),"changed",G_CALLBACK(on_parameter_changed),window);
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1930,13 +2060,11 @@ void on_main_edit(GtkWidget *self, main_window *widgets){
|
|
|
|
|
// gtk_entry_set_text(GTK_ENTRY(window->), parsed_size>4?parameters[4]:"");
|
|
|
|
|
}
|
|
|
|
|
window->old_password=parameters[5];
|
|
|
|
|
if(parsed_size>5){
|
|
|
|
|
if (strcmp(parameters[5],"x")){
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userPasswordEntry), parsed_size>5?parameters[5]:"");
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userPasswordEntry),parameters[5]);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
int samba_sync = yon_samba_sync_get(name);
|
|
|
|
|
if (samba_sync==1){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck),1);
|
|
|
|
|
@ -2049,6 +2177,10 @@ void on_main_edit(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_main_edit_activate(GtkWidget *self, GtkTreePath *path, GtkTreeViewColumn *column, main_window *widgets){
|
|
|
|
|
on_main_edit(self,widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_main_delete(GtkWidget *self, main_window *widgets){
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
GtkWidget *cur_tree;
|
|
|
|
|
@ -2080,7 +2212,6 @@ void on_config_update(GtkWidget *self, main_window *widgets){
|
|
|
|
|
} else {
|
|
|
|
|
on_config_local_load(NULL,widgets);
|
|
|
|
|
}
|
|
|
|
|
// yon_interface_update(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2100,6 +2231,7 @@ void config_init(){
|
|
|
|
|
main_config.lock_save_global=0;
|
|
|
|
|
main_config.lock_save_local=0;
|
|
|
|
|
main_config.groups_size=0;
|
|
|
|
|
main_config.users_size=0;
|
|
|
|
|
main_config.load_mode=1;
|
|
|
|
|
main_config.hash_default_id=-1;
|
|
|
|
|
main_config.groups = yon_file_open(groups_path,&main_config.groups_size);
|
|
|
|
|
@ -2150,6 +2282,18 @@ void config_init(){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(login_defs,login_size);
|
|
|
|
|
int size=0;
|
|
|
|
|
main_config.default_home = NULL;
|
|
|
|
|
config_str file_output = yon_file_open(default_home_initiator_path,&size);
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
char *parameter = yon_char_divide_search(file_output[i],"=",-1);
|
|
|
|
|
if (!strcmp(parameter,"HOME")){
|
|
|
|
|
if (file_output[i][strlen(file_output[i])-1]=='\n') file_output[i][strlen(file_output[i])-1]='\0';
|
|
|
|
|
main_config.default_home=yon_char_new(file_output[i]);
|
|
|
|
|
}
|
|
|
|
|
free(parameter);
|
|
|
|
|
}
|
|
|
|
|
// yon_char_parsed_free(file_output,size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_selection_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
|
@ -2233,7 +2377,9 @@ main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SavingSettingsButton),"clicked",G_CALLBACK(on_saving_settings_open),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SaveMenuItem),"activate",G_CALLBACK(on_config_save),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UsersTree),"cursor-changed",G_CALLBACK(on_selection_changed),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UsersTree),"row-activated",G_CALLBACK(on_main_edit_activate),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->GroupsTree),"cursor-changed",G_CALLBACK(on_selection_changed),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->GroupsTree),"row-activated",G_CALLBACK(on_main_edit_activate),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainNotebook),"switch-page",G_CALLBACK(on_notebook_page_changed),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SaveGlobalMenuItem),"activate",G_CALLBACK(on_config_global_save),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SaveLocalMenuItem),"activate",G_CALLBACK(on_config_local_save),widgets);
|
|
|
|
|
|