|
|
|
|
@ -1380,28 +1380,30 @@ void on_group_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int config_size=0;
|
|
|
|
|
int final_size=0;
|
|
|
|
|
config_str config_users = yon_config_get_all_by_key(GROUPADD_SEARCH_macro,&config_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;
|
|
|
|
|
char *uid_string = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
|
|
|
|
|
for (int i=0;i<final_size;i++){
|
|
|
|
|
int parsed_size;
|
|
|
|
|
config_str parsed = yon_char_parse(final[i],&parsed_size,":");
|
|
|
|
|
if (parsed_size>2&&!strcmp(parsed[2],uid_string)){
|
|
|
|
|
if (yon_char_is_empty(window->last_gid)||(!yon_char_is_empty(window->last_gid)&&strcmp(parsed[2],window->last_gid))){
|
|
|
|
|
found = yon_char_parsed_check_exist(config_users,config_size,final[i])>-1?1:2;
|
|
|
|
|
break;
|
|
|
|
|
if (strcmp(gid,window->last_gid)){
|
|
|
|
|
int config_size=0;
|
|
|
|
|
int final_size=0;
|
|
|
|
|
config_str config_users = yon_config_get_all_by_key(GROUPADD_SEARCH_macro,&config_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;
|
|
|
|
|
char *uid_string = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
|
|
|
|
|
for (int i=0;i<final_size;i++){
|
|
|
|
|
int parsed_size;
|
|
|
|
|
config_str parsed = yon_char_parse(final[i],&parsed_size,":");
|
|
|
|
|
if (parsed_size>2&&!strcmp(parsed[2],uid_string)){
|
|
|
|
|
if (yon_char_is_empty(window->last_gid)||(!yon_char_is_empty(window->last_gid)&&strcmp(parsed[2],window->last_gid))){
|
|
|
|
|
found = yon_char_parsed_check_exist(config_users,config_size,final[i])>-1?1:2;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (parsed_size) yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
|
}
|
|
|
|
|
if (found){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),found==1?GID_ALREADY_EXIST_CONFIG_LABEL:GID_ALREADY_EXIST_SYSTEM_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (parsed_size) yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
|
}
|
|
|
|
|
if (found){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),found==1?GID_ALREADY_EXIST_CONFIG_LABEL:GID_ALREADY_EXIST_SYSTEM_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -2010,24 +2012,26 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
config_str final = yon_char_parsed_merge(main_config.users,main_config.users_size,config_users,config_size,&final_size);
|
|
|
|
|
|
|
|
|
|
uid_string = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
|
|
|
|
|
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateUnuniqueCheck))){
|
|
|
|
|
int found=0;
|
|
|
|
|
for (int i=0;i<final_size;i++){
|
|
|
|
|
int parsed_size;
|
|
|
|
|
config_str parsed = yon_char_parse(final[i],&parsed_size,":");
|
|
|
|
|
if (parsed_size>2&&!strcmp(parsed[2],uid_string)){
|
|
|
|
|
if (yon_char_is_empty(window->last_uid)||(!yon_char_is_empty(window->last_uid)&&strcmp(parsed[2],window->last_uid))){
|
|
|
|
|
found = yon_char_parsed_check_exist(config_users,config_size,final[i])>-1?1:2;
|
|
|
|
|
break;
|
|
|
|
|
if (strcmp(uid_string,window->last_uid)){
|
|
|
|
|
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateUnuniqueCheck))){
|
|
|
|
|
int found=0;
|
|
|
|
|
for (int i=0;i<final_size;i++){
|
|
|
|
|
int parsed_size;
|
|
|
|
|
config_str parsed = yon_char_parse(final[i],&parsed_size,":");
|
|
|
|
|
if (parsed_size>2&&!strcmp(parsed[2],uid_string)){
|
|
|
|
|
if (yon_char_is_empty(window->last_uid)||(!yon_char_is_empty(window->last_uid)&&strcmp(parsed[2],window->last_uid))){
|
|
|
|
|
found = yon_char_parsed_check_exist(config_users,config_size,final[i])>-1?1:2;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (parsed_size) yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
|
}
|
|
|
|
|
if (found){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),found==1?UID_ALREADY_EXIST_CONFIG_LABEL:UID_ALREADY_EXIST_SYSTEM_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
|
|
|
|
|
return;
|
|
|
|
|
if (parsed_size) yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
|
}
|
|
|
|
|
if (found){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),found==1?UID_ALREADY_EXIST_CONFIG_LABEL:UID_ALREADY_EXIST_SYSTEM_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|