Web publication password logic changes

pull/99/head
parent ca48a1982f
commit 94891dda35

@ -1391,13 +1391,16 @@ void on_password_accept(GtkWidget *,dictionary *dict){
GtkWidget *target = yon_dictionary_get_data(dict->first->next,GtkWidget*);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->NoEncriptionCheck))){
char *encryption = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->EncryptionCombo));
char *hash = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry));
if (yon_char_is_empty(hash)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->PasswordHashEntry);
return;
}
gtk_entry_set_text(GTK_ENTRY(target),hash);
char *temp = yon_char_unite(encryption,"|",hash,NULL);
gtk_entry_set_text(GTK_ENTRY(target),temp);
free(temp);
} else {
char *password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
@ -1416,6 +1419,11 @@ void on_password_accept(GtkWidget *,dictionary *dict){
if (yon_char_is_empty(encryption)){
gtk_entry_set_text(GTK_ENTRY(target),password);
} else {
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->NoEncriptionCheck))){
char *temp = yon_char_unite(encryption,"|",password,NULL);
gtk_entry_set_text(GTK_ENTRY(target),temp);
free(temp);
} else {
int size;
config_str hash = yon_config_load(yon_debug_output("%s\n",!strcmp(encryption,"sha512")?sha512_encrypt_command(password):sha256_encrypt_command(password)),&size);
@ -1423,6 +1431,8 @@ void on_password_accept(GtkWidget *,dictionary *dict){
char *temp = yon_char_unite(encryption,"|",hash[0],NULL);
gtk_entry_set_text(GTK_ENTRY(target),temp);
yon_char_parsed_free(hash,size);
free(temp);
}
}
}

@ -361,11 +361,10 @@
</child>
<child>
<object class="GtkComboBoxText" id="UserPasswordCombo">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">User password</property>
<property name="active">0</property>
<property name="active">1</property>
<items>
<item translatable="yes">Not encrypted</item>
<item translatable="yes">Set</item>
@ -380,7 +379,6 @@
<child>
<object class="GtkEntry" id="UserPasswordEntry">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">User password</property>
<property name="visibility">False</property>
@ -398,7 +396,6 @@
<property name="width-request">28</property>
<property name="height-request">28</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Edit</property>

Loading…
Cancel
Save