Changed key creation restricted symbols

pull/143/head
parent bb070f3de8
commit d1ee45c84d
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -16,8 +16,8 @@ void on_key_generate_accept(GtkWidget *self, key_creation_window* window){
yon_ubl_status_highlight_incorrect(window->NameEntry); yon_ubl_status_highlight_incorrect(window->NameEntry);
return; return;
} }
if (!yon_char_is_empty(email)&&strlen(email)<5){ if (!yon_char_is_empty(email)&&!g_regex_match_simple("^(?!\\.)\\S+@\\S+.[^.]\\S+",email,0,0)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NAME_SHORT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMAIL_INVALID_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->EmailEntry); yon_ubl_status_highlight_incorrect(window->EmailEntry);
return; return;
} }
@ -36,6 +36,11 @@ void on_key_generate_accept(GtkWidget *self, key_creation_window* window){
yon_ubl_status_highlight_incorrect(highlight_target); yon_ubl_status_highlight_incorrect(highlight_target);
return; return;
} }
if (highlight_target){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(highlight_target);
return;
}
char *expire = NULL; char *expire = NULL;
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->ExpireCombo))==1){ if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->ExpireCombo))==1){
GDateTime *datetime = g_date_time_new_from_unix_local(yon_calendar_get_last_date()); GDateTime *datetime = g_date_time_new_from_unix_local(yon_calendar_get_last_date());
@ -91,6 +96,9 @@ key_creation_window *yon_key_creation_window_new(){
window->PasswordEntry = yon_gtk_builder_get_widget(builder,"PasswordEntry"); window->PasswordEntry = yon_gtk_builder_get_widget(builder,"PasswordEntry");
window->PasswordConfirmationEntry = yon_gtk_builder_get_widget(builder,"PasswordConfirmationEntry"); window->PasswordConfirmationEntry = yon_gtk_builder_get_widget(builder,"PasswordConfirmationEntry");
yon_gtk_entry_block_symbols(GTK_ENTRY(window->EmailEntry),"()\'\"&^%$#!*=\\|?><~`:;,[]{}");
yon_gtk_entry_block_symbols(GTK_ENTRY(window->NameEntry),"()\'\"&^%$#@!+*=\\|?><~`:;,[]{}");
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->PasswordConfirmationEntry)); yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->PasswordConfirmationEntry));
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->PasswordEntry)); yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->PasswordEntry));

Loading…
Cancel
Save