|
|
|
@ -549,6 +549,10 @@ void on_password_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strlen(password)<main_config.password_min_length){
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_SHORT_LABEL(yon_char_from_int(main_config.password_min_length)),5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
|
|
|
|
char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
|
|
|
|
if (!strcmp(password,password_check)){
|
|
|
|
if (!strcmp(password,password_check)){
|
|
|
|
char *passwd_hash = g_malloc0(101);
|
|
|
|
char *passwd_hash = g_malloc0(101);
|
|
|
|
@ -1165,24 +1169,28 @@ void on_main_delete(GtkWidget *self, main_window *widgets){
|
|
|
|
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==0){
|
|
|
|
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==0){
|
|
|
|
model = GTK_TREE_MODEL(widgets->UsersList);
|
|
|
|
model = GTK_TREE_MODEL(widgets->UsersList);
|
|
|
|
cur_tree=widgets->UsersTree;
|
|
|
|
cur_tree=widgets->UsersTree;
|
|
|
|
if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){
|
|
|
|
if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){
|
|
|
|
char *name;
|
|
|
|
char *name;
|
|
|
|
gtk_tree_model_get(model,&iter,2,&name,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,2,&name,-1);
|
|
|
|
yon_config_remove_by_key(USERADD(name));
|
|
|
|
yon_config_remove_by_key(USERADD(name));
|
|
|
|
gtk_list_store_remove(GTK_LIST_STORE(model),&iter);
|
|
|
|
gtk_list_store_remove(GTK_LIST_STORE(model),&iter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
model = GTK_TREE_MODEL(widgets->GroupsList);
|
|
|
|
model = GTK_TREE_MODEL(widgets->GroupsList);
|
|
|
|
cur_tree=widgets->GroupsTree;
|
|
|
|
cur_tree=widgets->GroupsTree;
|
|
|
|
if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){
|
|
|
|
if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){
|
|
|
|
char *name;
|
|
|
|
char *name;
|
|
|
|
gtk_tree_model_get(model,&iter,1,&name,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,1,&name,-1);
|
|
|
|
yon_config_remove_by_key(USERADD(name));
|
|
|
|
yon_config_remove_by_key(GROUPADD(name));
|
|
|
|
gtk_list_store_remove(GTK_LIST_STORE(model),&iter);
|
|
|
|
gtk_list_store_remove(GTK_LIST_STORE(model),&iter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_update(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**config_init()
|
|
|
|
/**config_init()
|
|
|
|
* [EN]
|
|
|
|
* [EN]
|
|
|
|
@ -1205,6 +1213,7 @@ void config_init(){
|
|
|
|
main_config.users = yon_file_open(users_path,&main_config.users_size);
|
|
|
|
main_config.users = yon_file_open(users_path,&main_config.users_size);
|
|
|
|
main_config.users_list=NULL;
|
|
|
|
main_config.users_list=NULL;
|
|
|
|
main_config.groups_list=NULL;
|
|
|
|
main_config.groups_list=NULL;
|
|
|
|
|
|
|
|
main_config.password_min_length=6;
|
|
|
|
int login_size;
|
|
|
|
int login_size;
|
|
|
|
config_str login_defs = yon_file_open(uid_path,&login_size);
|
|
|
|
config_str login_defs = yon_file_open(uid_path,&login_size);
|
|
|
|
for (int i=0;i<login_size;i++){
|
|
|
|
for (int i=0;i<login_size;i++){
|
|
|
|
@ -1228,6 +1237,22 @@ void config_init(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_char_parsed_free(login_defs,login_size);
|
|
|
|
yon_char_parsed_free(login_defs,login_size);
|
|
|
|
|
|
|
|
login_defs = yon_file_open(password_limits_path,&login_size);
|
|
|
|
|
|
|
|
for (int i=0;i<login_size;i++){
|
|
|
|
|
|
|
|
if (login_defs[i][0]!='#'){
|
|
|
|
|
|
|
|
char *copy = yon_char_new(login_defs[i]);
|
|
|
|
|
|
|
|
char *divided = yon_char_divide(copy,7);
|
|
|
|
|
|
|
|
if (divided){
|
|
|
|
|
|
|
|
if (!strcmp(divided,"minlen")){
|
|
|
|
|
|
|
|
main_config.password_min_length = atol(strstr(login_defs[i],"\t"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// else if (!strcmp(divided,"UID_MIN")){
|
|
|
|
|
|
|
|
// main_config.MINUID = atol(strstr(login_defs[i],"\t"));
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
yon_char_parsed_free(login_defs,login_size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_main_window_complete(main_window *widgets)
|
|
|
|
/**yon_main_window_complete(main_window *widgets)
|
|
|
|
|