|
|
|
|
@ -5,23 +5,87 @@ config main_config;
|
|
|
|
|
//functions
|
|
|
|
|
|
|
|
|
|
int yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
|
if (yon_config_load_register(type,"logging","",NULL)){
|
|
|
|
|
return 1;
|
|
|
|
|
if (yon_config_load_register(type,"users","DEFAULTPASSWD DEFAULTROOTPASSWD DEFAULTUSER HASHPASSWD USERGROUPS ADDADM USERADD[*] USERSHADOW[*] GROUPADD[*]",NULL)){
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_interface_update(main_window *widgets){
|
|
|
|
|
gtk_list_store_clear(widgets->UsersList);
|
|
|
|
|
gtk_list_store_clear(widgets->GroupsList);
|
|
|
|
|
int size;
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
config_str users = yon_config_get_all_by_key("USERADD",&size);
|
|
|
|
|
if (users){
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
gtk_list_store_append(widgets->UsersList,&iter);
|
|
|
|
|
int parameters_size;
|
|
|
|
|
config_str parameters = yon_char_parse(users[i],¶meters_size,":");
|
|
|
|
|
free(yon_char_divide(parameters[0],7));
|
|
|
|
|
char *login = yon_char_divide_search(parameters[i],"\"",-1);
|
|
|
|
|
login[strlen(login)-2]='\0';
|
|
|
|
|
gtk_list_store_set(widgets->UsersList,&iter,
|
|
|
|
|
2,login,
|
|
|
|
|
3,parameters_size>0?parameters[0]:"",
|
|
|
|
|
1,parameters_size>1?parameters[1]:"",
|
|
|
|
|
4,parameters_size>2?parameters[2]:"",
|
|
|
|
|
5,parameters_size>3?parameters[3]:"",
|
|
|
|
|
6,parameters_size>4?parameters[4]:"",
|
|
|
|
|
7,parameters_size>5?ENDRYPTED_LABEL:DEFAULT_USER_LABEL,
|
|
|
|
|
-1);
|
|
|
|
|
if(parameters)
|
|
|
|
|
free(parameters);
|
|
|
|
|
}
|
|
|
|
|
free(users);
|
|
|
|
|
}
|
|
|
|
|
config_str groups = yon_config_get_all_by_key("GROUPADD",&size);
|
|
|
|
|
if (groups){
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
gtk_list_store_append(widgets->GroupsList,&iter);
|
|
|
|
|
int parameters_size;
|
|
|
|
|
config_str parameters = yon_char_parse(groups[i],¶meters_size,":");
|
|
|
|
|
free(yon_char_divide(parameters[0],8));
|
|
|
|
|
char *login = yon_char_divide_search(parameters[i],"\"",-1);
|
|
|
|
|
login[strlen(login)-2]='\0';
|
|
|
|
|
gtk_list_store_set(widgets->GroupsList,&iter,
|
|
|
|
|
1,login,
|
|
|
|
|
0,parameters_size>1?parameters[1]:"",
|
|
|
|
|
2,parameters_size>0?parameters[0]:"",
|
|
|
|
|
3,parameters_size>2?parameters[2]:"",
|
|
|
|
|
4,parameters_size>3?ENDRYPTED_LABEL:DEFAULT_USER_LABEL,
|
|
|
|
|
-1);
|
|
|
|
|
if(parameters)
|
|
|
|
|
free(parameters);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_local_load(GtkWidget *self, main_window *widgets){
|
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
|
main_config.load_mode=1;
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_global_load(GtkWidget *self, main_window *widgets){
|
|
|
|
|
yon_load_proceed(YON_CONFIG_GLOBAL);
|
|
|
|
|
main_config.load_mode=0;
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_save(){
|
|
|
|
|
yon_save_proceed(NULL,YON_CONFIG_BOTH,"logging", "",NULL);
|
|
|
|
|
yon_save_proceed(NULL,YON_CONFIG_BOTH,"users", "DEFAULTPASSWD DEFAULTROOTPASSWD DEFAULTUSER HASHPASSWD USERGROUPS ADDADM USERADD[*] USERSHADOW[*] GROUPADD[*]",NULL);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_global_save(){
|
|
|
|
|
yon_save_proceed("global",YON_CONFIG_GLOBAL,"logging", "",NULL);
|
|
|
|
|
yon_save_proceed("global",YON_CONFIG_GLOBAL,"users", "DEFAULTPASSWD DEFAULTROOTPASSWD DEFAULTUSER HASHPASSWD USERGROUPS ADDADM USERADD[*] USERSHADOW[*] GROUPADD[*]",NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_local_save(){
|
|
|
|
|
yon_save_proceed("system",YON_CONFIG_LOCAL,"logging", "",NULL);
|
|
|
|
|
yon_save_proceed("system",YON_CONFIG_LOCAL,"users", "DEFAULTPASSWD DEFAULTROOTPASSWD DEFAULTUSER HASHPASSWD USERGROUPS ADDADM USERADD[*] USERSHADOW[*] GROUPADD[*]",NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_password_combo_changed(GtkComboBox *self, GtkWidget *target){
|
|
|
|
|
@ -102,8 +166,15 @@ void on_groups_multiple_clicked(GtkWidget *self, GtkEntry *output_target){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_password_change(GtkWidget *self, GtkEntry *output_target){
|
|
|
|
|
void on_password_change(GtkWidget *self, dictionary *entry_dict){
|
|
|
|
|
GtkComboBox *combo = yon_dictionary_get_data(entry_dict->first,GtkComboBox*);
|
|
|
|
|
GtkEntry *output_target = yon_dictionary_get_data(entry_dict->first->next,GtkEntry*);
|
|
|
|
|
ubl_settings_usergroups_password_window *window = yon_ubl_settings_usergroups_password_new();
|
|
|
|
|
int active = gtk_combo_box_get_active(combo);
|
|
|
|
|
if (active == 2)
|
|
|
|
|
gtk_widget_hide(window->HashBox);
|
|
|
|
|
else if (active==3)
|
|
|
|
|
gtk_widget_hide(window->PasswordBox);
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"target",output_target);
|
|
|
|
|
@ -122,7 +193,7 @@ void on_additional_settings_clicked(GtkWidget *self, GtkEntry *output_target){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_expiration_clicked(GtkWidget *self, GtkEntry *output_target){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// standard functions
|
|
|
|
|
@ -196,8 +267,15 @@ ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_additional_settings_save),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->DefaultPasswordButton),"clicked",G_CALLBACK(on_password_change),window->DefaultPasswordEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RootPasswordButton),"clicked",G_CALLBACK(on_password_change),window->RootPasswordEntry);
|
|
|
|
|
dictionary *default_dict=NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(default_dict,"combo",window->DefaultPasswordCombo);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(default_dict,"entry",window->DefaultPasswordEntry);
|
|
|
|
|
|
|
|
|
|
dictionary *root_dict=NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(root_dict,"combo",window->RootPasswordCombo);
|
|
|
|
|
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->RootPasswordCombo),"changed",G_CALLBACK(on_password_combo_changed),window->RootPasswordButton);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->DefaultPasswordCombo),"changed",G_CALLBACK(on_password_combo_changed),window->DefaultPasswordButton);
|
|
|
|
|
@ -305,12 +383,15 @@ ubl_settings_usergroups_group_creation_window *yon_ubl_settings_usergroups_group
|
|
|
|
|
window->PasswordEntry=yon_gtk_builder_get_widget(builder,"PasswordEntry");
|
|
|
|
|
window->ChangePasswordButton=yon_gtk_builder_get_widget(builder,"ChangePasswordButton");
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UnuniqueGIDCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userLoginEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->ChangePasswordButton),"clicked",G_CALLBACK(on_password_change),window->PasswordEntry);
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),TITLE_LABEL);
|
|
|
|
|
dictionary *entry_dict=NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"combo",window->PasswordCombo);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"entry",window->PasswordEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->ChangePasswordButton),"clicked",G_CALLBACK(on_password_change),entry_dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PasswordCombo),"changed",G_CALLBACK(on_password_combo_changed),window->ChangePasswordButton);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserCancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserAdditionalGroupsButton),"clicked",G_CALLBACK(on_user_choose),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserAdditionalGroupsButton),"clicked",G_CALLBACK(on_user_choose),window->userGroupsEntry);
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -418,16 +499,30 @@ void on_password_changed(GtkEntry *self, ubl_settings_usergroups_password_window
|
|
|
|
|
void on_password_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
ubl_settings_usergroups_password_window *window = yon_dictionary_get_data(dict->first,ubl_settings_usergroups_password_window*);
|
|
|
|
|
GtkEntry *entry = yon_dictionary_get_data(dict->first->next,GtkEntry*);
|
|
|
|
|
char *pasted_hash = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry));
|
|
|
|
|
if (yon_char_is_empty(pasted_hash)){
|
|
|
|
|
if (gtk_widget_get_visible(window->HashBox)){
|
|
|
|
|
char *pasted_hash = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry));
|
|
|
|
|
if (yon_char_is_empty(pasted_hash)){
|
|
|
|
|
yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
gtk_entry_set_text(entry,pasted_hash);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
char *password = yon_char_new((char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)));
|
|
|
|
|
char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
|
if (yon_char_is_empty(password)){
|
|
|
|
|
yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
|
|
|
|
|
if (!strcmp(password,password_check)){
|
|
|
|
|
char *passwd_hash = g_malloc0(101);
|
|
|
|
|
FILE *fl = popen(password_hash_get_command(password),"r");
|
|
|
|
|
fgets(passwd_hash,100,fl);
|
|
|
|
|
if (passwd_hash[strlen(passwd_hash)-1]=='\n') passwd_hash[strlen(passwd_hash)-1]='\0';
|
|
|
|
|
gtk_entry_set_text(entry,passwd_hash);
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),PASSWORD_MISMATCH_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
on_subwindow_close(self);
|
|
|
|
|
@ -441,6 +536,8 @@ ubl_settings_usergroups_password_window *yon_ubl_settings_usergroups_password_ne
|
|
|
|
|
window->PasswordEntry=yon_gtk_builder_get_widget(builder,"PasswordEntry");
|
|
|
|
|
window->RepeatPasswordEntry=yon_gtk_builder_get_widget(builder,"RepeatPasswordEntry");
|
|
|
|
|
window->PasswordHashEntry=yon_gtk_builder_get_widget(builder,"PasswordHashEntry");
|
|
|
|
|
window->HashBox=yon_gtk_builder_get_widget(builder,"HashBox");
|
|
|
|
|
window->PasswordBox=yon_gtk_builder_get_widget(builder,"PasswordBox");
|
|
|
|
|
|
|
|
|
|
window->UserCancelButton=yon_gtk_builder_get_widget(builder,"UserCancelButton");
|
|
|
|
|
window->UserOkButton=yon_gtk_builder_get_widget(builder,"UserOkButton");
|
|
|
|
|
@ -633,9 +730,11 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
|
|
|
|
|
extra_options=(char*)gtk_entry_get_text(GTK_ENTRY(window->userExtraOptionsEntry));
|
|
|
|
|
|
|
|
|
|
time_t t = time(NULL);
|
|
|
|
|
struct tm tm = *localtime(&t);
|
|
|
|
|
password_changed_date = yon_char_unite(yon_char_from_int(tm.tm_mday),".",yon_char_from_int(tm.tm_mon+1),".",yon_char_from_int(1900+tm.tm_year),NULL);
|
|
|
|
|
if (window->old_password&&strcmp(window->old_password,password)){
|
|
|
|
|
time_t t = time(NULL);
|
|
|
|
|
struct tm tm = *localtime(&t);
|
|
|
|
|
password_changed_date = yon_char_unite(yon_char_from_int(tm.tm_mday),".",yon_char_from_int(tm.tm_mon+1),".",yon_char_from_int(1900+tm.tm_year),NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *shadow_string = NULL;
|
|
|
|
|
shadow_string = yon_char_unite(yon_char_return_if_exist(password_changed_date,""),
|
|
|
|
|
@ -705,11 +804,15 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
|
|
|
|
|
window->UserCancelButton=yon_gtk_builder_get_widget(builder,"UserCancelButton");
|
|
|
|
|
window->UserOkButton=yon_gtk_builder_get_widget(builder,"UserOkButton");
|
|
|
|
|
|
|
|
|
|
window->old_password=NULL;
|
|
|
|
|
dictionary *entry_dict = NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"combo",window->userPasswordCombo);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"entry",window->userPasswordEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserCancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userHomeButton),"clicked",G_CALLBACK(on_filechooser_open),window->userHomeEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserGroupsButton),"clicked",G_CALLBACK(on_groups_clicked),window->userGroupsEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordButton),"clicked",G_CALLBACK(on_password_change),window->userPasswordEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordButton),"clicked",G_CALLBACK(on_password_change),entry_dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userAdditionalGroupsButton),"clicked",G_CALLBACK(on_groups_multiple_clicked),window->userAdditionalGroupsEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordExpirationButton),"clicked",G_CALLBACK(on_expiration_clicked),window->userPasswordExpirationEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry);
|
|
|
|
|
@ -764,7 +867,9 @@ void on_main_edit(GtkWidget *self, main_window *widgets){
|
|
|
|
|
char *name;
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->UsersList),&iter,2,&name,-1);
|
|
|
|
|
char *parameter_string = yon_config_get_by_key(USERADD(name));
|
|
|
|
|
int parsed_size;
|
|
|
|
|
int parsed_size=0;
|
|
|
|
|
if (parameter_string[0]=='\"') yon_char_divide(parameter_string,0);
|
|
|
|
|
if (parameter_string[strlen(parameter_string)-1]=='\"') parameter_string[strlen(parameter_string)-1]='\0';
|
|
|
|
|
config_str parameters = yon_char_parse(parameter_string,&parsed_size,":");
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userLoginEntry), name);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userUserNameEntry), parsed_size>0?parameters[0]:"");
|
|
|
|
|
@ -809,6 +914,7 @@ 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];
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userPasswordEntry), parsed_size>5?parameters[5]:"");
|
|
|
|
|
free(parameters);
|
|
|
|
|
parameters=yon_char_parse(yon_config_get_by_key(USERSHADOW(name)),&parsed_size,":");
|
|
|
|
|
@ -829,6 +935,47 @@ void on_main_edit(GtkWidget *self, main_window *widgets){
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserOkButton),"clicked",G_CALLBACK(on_group_save),dict);
|
|
|
|
|
char *name;
|
|
|
|
|
gtk_tree_model_get(model,&iter,1,&name,-1);
|
|
|
|
|
char *config_string = yon_config_get_by_key(GROUPADD(name));
|
|
|
|
|
if (!yon_char_is_empty(config_string)){
|
|
|
|
|
if (config_string[0]=='\"') yon_char_divide(config_string,0);
|
|
|
|
|
if (config_string[strlen(config_string)-1]=='\"') config_string[strlen(config_string)-1]='\0';
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(config_string,&size,":");
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userLoginEntry),name);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),size>1?parsed[0]:"");
|
|
|
|
|
if (size>1){
|
|
|
|
|
if (!strcmp(parsed[1],"")||!strcmp(parsed[1],"x"))
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck),1);
|
|
|
|
|
else
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry),parsed[1]);
|
|
|
|
|
}
|
|
|
|
|
if (size>2&&!yon_char_is_empty(parsed[2])){
|
|
|
|
|
int parsed_size=0;
|
|
|
|
|
config_str substring = yon_char_parse(parsed[2],&parsed_size," ");
|
|
|
|
|
for (int i=0;i<parsed_size;i++){
|
|
|
|
|
if (!yon_char_is_empty(substring[i])){
|
|
|
|
|
if (!strcmp(substring[i],"--non-unique")||!strcmp(substring[i],"-o")){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->UnuniqueGIDCheck),1);
|
|
|
|
|
} else if (!strcmp(substring[i],"--system")||!strcmp(substring[i],"-r")){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->SystemGroupCheck),1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free(substring);
|
|
|
|
|
}
|
|
|
|
|
if (size>3){
|
|
|
|
|
if (strcmp(parsed[3],"")&&strcmp(parsed[3],"x")){
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->PasswordEntry),parsed[3]);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PasswordCombo),3);
|
|
|
|
|
} else {
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PasswordCombo),1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_render(LOADING_FAILED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_window_set_transient_for(GTK_WINDOW(window->CreateGroupWindow),GTK_WINDOW(widgets->Window));
|
|
|
|
|
gtk_widget_show(window->CreateGroupWindow);
|
|
|
|
|
@ -866,11 +1013,11 @@ void config_init(){
|
|
|
|
|
main_config.save_socket_id=-1;
|
|
|
|
|
main_config.load_socket_id=-1;
|
|
|
|
|
main_config.lock_help=0;
|
|
|
|
|
main_config.lock_help=0;
|
|
|
|
|
main_config.lock_load_global=0;
|
|
|
|
|
main_config.lock_save_global=0;
|
|
|
|
|
main_config.lock_save_local=0;
|
|
|
|
|
main_config.groups_size=0;
|
|
|
|
|
main_config.load_mode=1;
|
|
|
|
|
main_config.groups = yon_file_open(groups_path,&main_config.groups_size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -924,9 +1071,12 @@ void yon_main_window_complete(main_window *widgets){
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SaveMenuItem),"activate",G_CALLBACK(on_config_save),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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(widgets->Window);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->LoadGlobalMenuItem),"activate",G_CALLBACK(on_config_global_load),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->LoadLocalMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets);
|
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
|
yon_interface_update((main_window*)widgets);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]){
|
|
|
|
|
@ -1010,6 +1160,5 @@ int main(int argc, char *argv[]){
|
|
|
|
|
yon_ubl_window_init(TITLE_LABEL,TITLE_INFO_LABEL,LocaleName,CssPath,LocaleName,version_application,WIKI_LINK);
|
|
|
|
|
template_main_window *widgets = yon_ubl_window_setup();
|
|
|
|
|
yon_main_window_complete((main_window*)widgets);
|
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
|
gtk_main();
|
|
|
|
|
gtk_main();
|
|
|
|
|
}
|