diff --git a/Makefile b/Makefile index 82e76b9..ca6fee4 100644 --- a/Makefile +++ b/Makefile @@ -140,6 +140,7 @@ install: check uninstall @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/status/" "icons/com.ublinux.${PKGNAME}.cancel-symbolic.svg" @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/status/" "icons/com.ublinux.${PKGNAME}.profile-settings-symbolic.svg" @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.save-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.lock-symbolic.svg" @install -Dm644 -t "${DESTDIR}/usr/share/${PKGNAME}/csv" "csv/hash_list.csv" @install -Dm644 -t "${DESTDIR}/usr/share/${PKGNAME}/csv" "csv/shell_list.csv" @install -Dm644 -t "${DESTDIR}/usr/share/polkit-1/actions/" "${CMAKE_BUILD_DIR}/com.ublinux.${PKGNAME}${PKGIDENT}.policy" diff --git a/icons/com.ublinux.ubl-settings-usergroups.lock-symbolic.svg b/icons/com.ublinux.ubl-settings-usergroups.lock-symbolic.svg new file mode 100644 index 0000000..132b656 --- /dev/null +++ b/icons/com.ublinux.ubl-settings-usergroups.lock-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 3d9902b..5926f1d 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -182,6 +182,7 @@ yon_confirmation_window *yon_delete_confirmation_new(){ g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); g_signal_connect(G_OBJECT(window->DeleteCell),"toggled",G_CALLBACK(on_delete_confirmation_delete_check),window); g_signal_connect(G_OBJECT(window->DeleteHomeCell),"toggled",G_CALLBACK(on_delete_confirmation_delete_home_check),window); + yon_window_config_custom_window_setup(GTK_WINDOW(window->Window),"DeleteConfirmationWindow"); return window; } @@ -342,6 +343,13 @@ void on_groups_multiple_clicked(GtkWidget *self, GtkEntry *output_target){ } +void on_passwords_encrypt(){ + int pid = fork(); + if (!pid){ + exit(system(encrypt_passwords_command)); + } +} + void on_password_change(GtkWidget *self, dictionary *entry_dict){ GtkComboBox *combo = yon_dictionary_get_data(entry_dict->first,GtkComboBox*); GtkEntry *output_target = yon_dictionary_get_data(entry_dict->first->next,GtkEntry*); @@ -437,6 +445,7 @@ ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_ window->RootPasswordEntry=yon_gtk_builder_get_widget(builder,"RootPasswordEntry"); window->RootPasswordButton=yon_gtk_builder_get_widget(builder,"RootPasswordButton"); window->PasswordHashCombo=yon_gtk_builder_get_widget(builder,"PasswordHashCombo"); + window->EncryptAllPasswordsButton=yon_gtk_builder_get_widget(builder,"EncryptAllPasswordsButton"); window->CancelButton=yon_gtk_builder_get_widget(builder,"CancelButton"); window->AcceptButton=yon_gtk_builder_get_widget(builder,"AcceptButton"); @@ -502,6 +511,8 @@ ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_ g_signal_connect(G_OBJECT(window->DefaultPasswordButton),"clicked",G_CALLBACK(on_password_change),default_dict); g_signal_connect(G_OBJECT(window->RootPasswordButton),"clicked",G_CALLBACK(on_password_change),root_dict); + g_signal_connect(G_OBJECT(window->EncryptAllPasswordsButton),"clicked",G_CALLBACK(on_passwords_encrypt),NULL); + g_signal_connect(G_OBJECT(window->RootPasswordCombo),"changed",G_CALLBACK(on_password_combo_changed),window->RootPasswordButton); g_signal_connect(G_OBJECT(window->PasswordHashCombo),"changed",G_CALLBACK(on_hash_changed),window); g_signal_connect(G_OBJECT(window->DefaultPasswordCombo),"changed",G_CALLBACK(on_password_combo_changed),window->DefaultPasswordButton); diff --git a/source/ubl-settings-usergroups.h b/source/ubl-settings-usergroups.h index c2c8dbd..2bbbd5c 100644 --- a/source/ubl-settings-usergroups.h +++ b/source/ubl-settings-usergroups.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +37,7 @@ #define LocalePath "/usr/share/locale" #define LocaleName "ubl-settings-usergroups" +#define encrypt_passwords_command "/usr/lib/ublinux/functions globalconf_convert_pass_plain_to_hash" #define get_default_hash_command "ubconfig --raw --source default get [users] HASHPASSWD" #define clear_config_global_command "ubconfig --target global remove TEMP_SECTION TEMP_PATAMETER" #define clear_config_local_command "ubconfig --target system remove TEMP_SECTION TEMP_PATAMETER" @@ -168,6 +170,7 @@ typedef struct{ GtkWidget *PasswordHashCombo; GtkWidget *CancelButton; GtkWidget *AcceptButton; + GtkWidget *EncryptAllPasswordsButton; } ubl_settings_usergroups_additional_settings_window; typedef struct{ diff --git a/ubl-settings-usergroups-additional-settings.glade b/ubl-settings-usergroups-additional-settings.glade index 7d7745b..b275db0 100644 --- a/ubl-settings-usergroups-additional-settings.glade +++ b/ubl-settings-usergroups-additional-settings.glade @@ -23,6 +23,11 @@ False com.ublinux.ubl-settings-usergroups.edit-symbolic + + True + False + com.ublinux.ubl-settings-usergroups.lock-symbolic + 600 False @@ -280,7 +285,7 @@ False True - 3 + 2 @@ -329,6 +334,21 @@ 1 + + + Encrypt all passwords + True + True + True + start + image5 + + + False + True + 2 + +