|
|
|
@ -1375,20 +1375,21 @@ void on_group_save(GtkWidget *self, dictionary *dict){
|
|
|
|
config_str config_users = yon_config_get_all_by_key(USERADD_SEARCH_macro,&config_size);
|
|
|
|
config_str config_users = yon_config_get_all_by_key(USERADD_SEARCH_macro,&config_size);
|
|
|
|
yon_char_parsed_prepend_strings(config_users,config_size,":");
|
|
|
|
yon_char_parsed_prepend_strings(config_users,config_size,":");
|
|
|
|
config_str final = yon_char_parsed_merge(main_config.groups,main_config.groups_size,config_users,config_size,&final_size);
|
|
|
|
config_str final = yon_char_parsed_merge(main_config.groups,main_config.groups_size,config_users,config_size,&final_size);
|
|
|
|
|
|
|
|
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UnuniqueGIDCheck))){
|
|
|
|
int found=0;
|
|
|
|
int found=0;
|
|
|
|
char *uid_string = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
|
|
|
|
char *uid_string = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
|
|
|
|
for (int i=0;i<final_size;i++){
|
|
|
|
for (int i=0;i<final_size;i++){
|
|
|
|
int parsed_size;
|
|
|
|
int parsed_size;
|
|
|
|
config_str parsed = yon_char_parse(final[i],&parsed_size,":");
|
|
|
|
config_str parsed = yon_char_parse(final[i],&parsed_size,":");
|
|
|
|
printf("%s / %s\n",parsed[2],uid_string);
|
|
|
|
printf("%s / %s\n",parsed[2],uid_string);
|
|
|
|
if (parsed_size>1&&!strcmp(parsed[2],uid_string)&&strcmp(parsed[2],window->last_gid)) found = 1;
|
|
|
|
if (parsed_size>1&&!strcmp(parsed[2],uid_string)&&strcmp(parsed[2],window->last_gid)) found = 1;
|
|
|
|
if (parsed_size) yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
if (parsed_size) yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (found){
|
|
|
|
if (found){
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),GID_ALREADY_EXIST_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),GID_ALREADY_EXIST_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
group_name = (char*)gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry));
|
|
|
|
group_name = (char*)gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry));
|
|
|
|
@ -1989,18 +1990,20 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
yon_char_parsed_prepend_strings(config_users,config_size,":");
|
|
|
|
yon_char_parsed_prepend_strings(config_users,config_size,":");
|
|
|
|
config_str final = yon_char_parsed_merge(main_config.users,main_config.users_size,config_users,config_size,&final_size);
|
|
|
|
config_str final = yon_char_parsed_merge(main_config.users,main_config.users_size,config_users,config_size,&final_size);
|
|
|
|
|
|
|
|
|
|
|
|
int found=0;
|
|
|
|
|
|
|
|
uid_string = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
|
|
|
|
uid_string = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
|
|
|
|
for (int i=0;i<final_size;i++){
|
|
|
|
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateUnuniqueCheck))){
|
|
|
|
int parsed_size;
|
|
|
|
int found=0;
|
|
|
|
config_str parsed = yon_char_parse(final[i],&parsed_size,":");
|
|
|
|
for (int i=0;i<final_size;i++){
|
|
|
|
if (parsed_size>1&&!strcmp(parsed[2],uid_string)&&strcmp(parsed[2],window->last_uid)) found = 1;
|
|
|
|
int parsed_size;
|
|
|
|
if (parsed_size) yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
config_str parsed = yon_char_parse(final[i],&parsed_size,":");
|
|
|
|
}
|
|
|
|
if (parsed_size>1&&!strcmp(parsed[2],uid_string)&&strcmp(parsed[2],window->last_uid)) found = 1;
|
|
|
|
if (found){
|
|
|
|
if (parsed_size) yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),UID_ALREADY_EXIST_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
}
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
|
|
|
|
if (found){
|
|
|
|
return;
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),UID_ALREADY_EXIST_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (yon_char_is_empty(uid_string)){
|
|
|
|
if (yon_char_is_empty(uid_string)){
|
|
|
|
|