|
|
|
@ -754,6 +754,20 @@ void on_password_open(GtkWidget *, web_publication_add_window *window){
|
|
|
|
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(dialog->PasswordEntry));
|
|
|
|
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(dialog->PasswordEntry));
|
|
|
|
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(dialog->PasswordHashEntry));
|
|
|
|
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(dialog->PasswordHashEntry));
|
|
|
|
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(dialog->RepeatPasswordEntry));
|
|
|
|
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(dialog->RepeatPasswordEntry));
|
|
|
|
|
|
|
|
char *old_password = yon_char_new(gtk_entry_get_text(GTK_ENTRY(window->UserPasswordEntry)));
|
|
|
|
|
|
|
|
char *hash_type = NULL;
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(old_password)&&strstr(old_password,"|")){
|
|
|
|
|
|
|
|
hash_type = yon_char_divide(old_password,6);
|
|
|
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(dialog->EncryptionCombo),hash_type);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(old_password)&&(strlen(old_password)==128||strlen(old_password)==64)){
|
|
|
|
|
|
|
|
dialog->old_password = old_password;
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(dialog->PasswordHashEntry),old_password);
|
|
|
|
|
|
|
|
} else if (!yon_char_is_empty(old_password)){
|
|
|
|
|
|
|
|
dialog->old_password = old_password;
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(dialog->PasswordEntry),old_password);
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(dialog->RepeatPasswordEntry),old_password);
|
|
|
|
|
|
|
|
}
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",dialog);
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",dialog);
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"target",window->UserPasswordEntry);
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"target",window->UserPasswordEntry);
|
|
|
|
@ -1411,7 +1425,7 @@ char *yon_password_hash_get(password_window *window){
|
|
|
|
const char *encription = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->EncryptionCombo));
|
|
|
|
const char *encription = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->EncryptionCombo));
|
|
|
|
const char *hash = gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry));
|
|
|
|
const char *hash = gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry));
|
|
|
|
if (!yon_char_is_empty(hash)){
|
|
|
|
if (!yon_char_is_empty(hash)){
|
|
|
|
if (strlen(hash)!=128&&strlen(hash)!=64){
|
|
|
|
if (strcmp(hash,window->old_password)&&strlen(hash)!=128&&strlen(hash)!=64){
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),INCORRECT_HASH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),INCORRECT_HASH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_ubl_status_highlight_incorrect(window->PasswordHashEntry);
|
|
|
|
yon_ubl_status_highlight_incorrect(window->PasswordHashEntry);
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
@ -1594,6 +1608,8 @@ password_window *yon_password_window_new(){
|
|
|
|
window->PasswordHashEntry = yon_gtk_builder_get_widget(builder,"PasswordHashEntry");
|
|
|
|
window->PasswordHashEntry = yon_gtk_builder_get_widget(builder,"PasswordHashEntry");
|
|
|
|
window->UserCancelButton = yon_gtk_builder_get_widget(builder,"UserCancelButton");
|
|
|
|
window->UserCancelButton = yon_gtk_builder_get_widget(builder,"UserCancelButton");
|
|
|
|
window->AcceptButton = yon_gtk_builder_get_widget(builder,"UserOkButton");
|
|
|
|
window->AcceptButton = yon_gtk_builder_get_widget(builder,"UserOkButton");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window->old_password=NULL;
|
|
|
|
g_signal_connect(G_OBJECT(window->UserCancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->UserCancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->NoEncriptionCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->PasswordHashEntry);
|
|
|
|
g_signal_connect(G_OBJECT(window->NoEncriptionCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->PasswordHashEntry);
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|