|
|
|
|
@ -500,16 +500,16 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
|
gtk_list_store_set(widgets->WebPublicationList,&iter,5,parsed[3],-1);
|
|
|
|
|
}
|
|
|
|
|
if (cur_size>4&&!yon_char_is_empty(parsed[4])){
|
|
|
|
|
if (!strcmp(parsed[5],"sha256")||!strcmp(parsed[5],"sha512")){
|
|
|
|
|
if (!strcmp(parsed[4],"sha256")||!strcmp(parsed[4],"sha512")){
|
|
|
|
|
gtk_list_store_set(widgets->WebPublicationList,&iter,7,"******",-1);
|
|
|
|
|
gtk_list_store_set(widgets->WebPublicationList,&iter,6,parsed[5],-1);
|
|
|
|
|
gtk_list_store_set(widgets->WebPublicationList,&iter,6,parsed[4],-1);
|
|
|
|
|
} else {
|
|
|
|
|
if (strlen(parsed[4])==128||strlen(parsed[4])==64)
|
|
|
|
|
gtk_list_store_set(widgets->WebPublicationList,&iter,7,parsed[4],-1);
|
|
|
|
|
gtk_list_store_set(widgets->WebPublicationList,&iter,7,parsed[5],-1);
|
|
|
|
|
else
|
|
|
|
|
gtk_list_store_set(widgets->WebPublicationList,&iter,7,"******",-1);
|
|
|
|
|
if (cur_size>5&&!yon_char_is_empty(parsed[5])){
|
|
|
|
|
gtk_list_store_set(widgets->WebPublicationList,&iter,6,parsed[5],-1);
|
|
|
|
|
gtk_list_store_set(widgets->WebPublicationList,&iter,6,parsed[4],-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -751,6 +751,8 @@ void yon_hash_entry_sensitiveness_update(GtkWidget *, password_window *dialog){
|
|
|
|
|
|
|
|
|
|
void on_password_open(GtkWidget *, web_publication_add_window *window){
|
|
|
|
|
password_window *dialog = yon_password_window_new();
|
|
|
|
|
g_signal_connect(G_OBJECT(dialog->NoEncriptionCheck),"toggled",G_CALLBACK(yon_hash_entry_sensitiveness_update),dialog);
|
|
|
|
|
g_signal_connect(G_OBJECT(dialog->EncryptionCombo),"changed",G_CALLBACK(yon_hash_entry_sensitiveness_update),dialog);
|
|
|
|
|
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->RepeatPasswordEntry));
|
|
|
|
|
@ -772,8 +774,6 @@ void on_password_open(GtkWidget *, web_publication_add_window *window){
|
|
|
|
|
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);
|
|
|
|
|
g_signal_connect(G_OBJECT(dialog->AcceptButton),"clicked",G_CALLBACK(on_password_accept),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(dialog->NoEncriptionCheck),"toggled",G_CALLBACK(yon_hash_entry_sensitiveness_update),dialog);
|
|
|
|
|
g_signal_connect(G_OBJECT(dialog->EncryptionCombo),"changed",G_CALLBACK(yon_hash_entry_sensitiveness_update),dialog);
|
|
|
|
|
g_signal_connect(G_OBJECT(dialog->EncryptionCombo),"changed",G_CALLBACK(on_password_encryption_changed),dialog);
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(dialog->Window),GTK_WINDOW(window->Window),PASSWORD_INPUT_LABEL,icon_path,"password_window");
|
|
|
|
|
}
|
|
|
|
|
@ -1237,11 +1237,12 @@ void on_web_publish_accept(GtkWidget *, dictionary *dict){
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->UserPasswordEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (username_check&&encryption&&!yon_char_is_empty(encryption)&&(strlen(user_password)!=128&&strlen(user_password)!=64)){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_RESTRICTED_SYMBOL_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->UserPasswordEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if (username_check&&encryption&&!yon_char_is_empty(encryption)&&(strlen(user_password)!=128&&strlen(user_password)!=64)){
|
|
|
|
|
|
|
|
|
|
// yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_RESTRICTED_SYMBOL_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
// yon_ubl_status_highlight_incorrect(window->UserPasswordEntry);
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
char *name = (char*)gtk_entry_get_text(GTK_ENTRY(window->PathEntry));
|
|
|
|
|
char *full_name = "";
|
|
|
|
|
@ -1271,8 +1272,8 @@ void on_web_publish_accept(GtkWidget *, dictionary *dict){
|
|
|
|
|
enable_browser?"listing":"",":",
|
|
|
|
|
port_enabled?port:"",":",
|
|
|
|
|
username_check?username:"",":",
|
|
|
|
|
username_check?!yon_char_is_empty(user_password)?user_password:"":"",":",
|
|
|
|
|
username_check?yon_char_is_empty(encryption)?"":encryption:"",
|
|
|
|
|
username_check?yon_char_is_empty(encryption)?user_password:encryption:"",":",
|
|
|
|
|
username_check?!yon_char_is_empty(user_password)&&!yon_char_is_empty(encryption)?user_password:"":"",
|
|
|
|
|
NULL);
|
|
|
|
|
if (!yon_char_is_empty(window->name)&&strcmp(final_name,window->name)){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_WEB_full(window->name));
|
|
|
|
|
@ -1425,11 +1426,26 @@ char *yon_password_hash_get(password_window *window){
|
|
|
|
|
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));
|
|
|
|
|
if (!yon_char_is_empty(hash)){
|
|
|
|
|
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_highlight_incorrect(window->PasswordHashEntry);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
// if (!yon_char_is_empty(window->old_password)&&strcmp(hash,window->old_password)){
|
|
|
|
|
switch(encription_active){
|
|
|
|
|
case 1:{
|
|
|
|
|
if (strlen(hash)!=128){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),INCORRECT_HASH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->PasswordHashEntry);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 2:{
|
|
|
|
|
if (strlen(hash)!=64){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),INCORRECT_HASH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->PasswordHashEntry);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
char *final = yon_char_unite(encription,"|",hash,NULL);
|
|
|
|
|
return final;
|
|
|
|
|
} else {
|
|
|
|
|
@ -1440,6 +1456,11 @@ char *yon_password_hash_get(password_window *window){
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->PasswordEntry);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
if (yon_char_is_empty(password_repeat)){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->RepeatPasswordEntry);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
if (strcmp(password,password_repeat)){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_MISMATCH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->PasswordEntry);
|
|
|
|
|
@ -1595,6 +1616,29 @@ void on_file_chooser_open(GtkWidget *, GtkEntry *target){
|
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_password_hash_sensitiveness(GtkWidget *,password_window *window){
|
|
|
|
|
const char *password = gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
|
const char *repeat_password = gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
|
|
|
|
|
const char *hash = gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry));
|
|
|
|
|
if (!yon_char_is_empty(password)||!yon_char_is_empty(repeat_password)){
|
|
|
|
|
gtk_widget_set_sensitive(window->HashBox,0);
|
|
|
|
|
gtk_widget_set_sensitive(window->PasswordBox,1);
|
|
|
|
|
} else if (yon_char_is_empty(password)&&yon_char_is_empty(repeat_password)&&
|
|
|
|
|
gtk_combo_box_get_active(GTK_COMBO_BOX(window->EncryptionCombo))>0&&
|
|
|
|
|
yon_char_is_empty(hash)){
|
|
|
|
|
gtk_widget_set_sensitive(window->HashBox,1);
|
|
|
|
|
gtk_widget_set_sensitive(window->PasswordBox,1);
|
|
|
|
|
gtk_widget_set_sensitive(window->NoEncriptionCheck,1);
|
|
|
|
|
} else if (!yon_char_is_empty(hash)) {
|
|
|
|
|
gtk_widget_set_sensitive(window->HashBox,1);
|
|
|
|
|
gtk_widget_set_sensitive(window->PasswordBox,0);
|
|
|
|
|
gtk_widget_set_sensitive(window->NoEncriptionCheck,0);
|
|
|
|
|
} else {
|
|
|
|
|
gtk_widget_set_sensitive(window->HashBox,0);
|
|
|
|
|
gtk_widget_set_sensitive(window->PasswordBox,1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
password_window *yon_password_window_new(){
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_password_path);
|
|
|
|
|
password_window *window = malloc(sizeof(password_window));
|
|
|
|
|
@ -1608,10 +1652,16 @@ password_window *yon_password_window_new(){
|
|
|
|
|
window->PasswordHashEntry = yon_gtk_builder_get_widget(builder,"PasswordHashEntry");
|
|
|
|
|
window->UserCancelButton = yon_gtk_builder_get_widget(builder,"UserCancelButton");
|
|
|
|
|
window->AcceptButton = yon_gtk_builder_get_widget(builder,"UserOkButton");
|
|
|
|
|
window->PasswordBox = yon_gtk_builder_get_widget(builder,"PasswordBox");
|
|
|
|
|
window->HashBox = yon_gtk_builder_get_widget(builder,"HashBox");
|
|
|
|
|
|
|
|
|
|
window->old_password=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->EncryptionCombo),"changed",G_CALLBACK(on_password_hash_sensitiveness),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->NoEncriptionCheck),"toggled",G_CALLBACK(on_password_hash_sensitiveness),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PasswordHashEntry),"changed",G_CALLBACK(on_password_hash_sensitiveness),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PasswordEntry),"changed",G_CALLBACK(on_password_hash_sensitiveness),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RepeatPasswordEntry),"changed",G_CALLBACK(on_password_hash_sensitiveness),window);
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|