diff --git a/gresource.xml b/gresource.xml
index 7c9a2e1..1cdc8f0 100644
--- a/gresource.xml
+++ b/gresource.xml
@@ -6,6 +6,7 @@
ubl-settings-system-domain.glade
ubl-settings-system-connection.glade
ubl-settings-system-domain-view.glade
+ ubl-settings-system-domain-options.glade
ubl-settings-system.css
diff --git a/locale/ubl-settings-system.pot b/locale/ubl-settings-system.pot
index 7a131fe..94ff138 100644
--- a/locale/ubl-settings-system.pot
+++ b/locale/ubl-settings-system.pot
@@ -291,3 +291,7 @@ msgstr ""
#: source/ubl-strings.h:78
msgid "Remove language"
msgstr ""
+
+#: source/ubl-strings.h:78
+msgid "Additional authentication profile options"
+msgstr ""
diff --git a/locale/ubl-settings-system_ru.po b/locale/ubl-settings-system_ru.po
index 2d07c63..a62c96c 100644
--- a/locale/ubl-settings-system_ru.po
+++ b/locale/ubl-settings-system_ru.po
@@ -298,3 +298,7 @@ msgstr "Удалить язык"
msgid "Domain connection"
msgstr "Соединение домена"
+
+#: source/ubl-strings.h:78
+msgid "Additional authentication profile options"
+msgstr "Дополнительные опции профиля аутентификации"
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 19f115b..7413032 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -35,6 +35,7 @@ set(DEPENDFILES
../ubl-settings-system-domain.glade
../ubl-settings-system-connection.glade
../ubl-settings-system-domain-view.glade
+ ../ubl-settings-system-domain-options.glade
../ubl-settings-system-layouts.glade
../gresource.xml
../ubl-settings-system.css
diff --git a/source/ubl-settings-system-domain.c b/source/ubl-settings-system-domain.c
index e7d6006..e986c01 100644
--- a/source/ubl-settings-system-domain.c
+++ b/source/ubl-settings-system-domain.c
@@ -41,12 +41,13 @@ void on_domain_connect(GtkWidget *, dictionary *dict){
char *kerberos = (char*)gtk_entry_get_text(GTK_ENTRY(window->KerberosServerEntry));
char *dns = (char*)gtk_entry_get_text(GTK_ENTRY(window->DNSEntry));
char *ou = (char*)gtk_entry_get_text(GTK_ENTRY(window->OuEntry));
+ char *options = (char*)gtk_entry_get_text(GTK_ENTRY(window->AdditionalParametersEntry));
char *client = NULL;
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->ClientCombo))){
client = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->ClientCombo));
}
char *final = yon_char_unite(!yon_char_is_empty(kerberos)?kerberos_addition_command(kerberos):"",!yon_char_is_empty(kerberos)?" ":"",!yon_char_is_empty(dns)?dns_addition_command(dns):"",!yon_char_is_empty(dns)?" ":"",!yon_char_is_empty(client)?client_addition_command(client):"",!yon_char_is_empty(client)?" ":"",NULL);
- char *command = domain_connect_command(adress,login,password,final,ou);
+ char *command = domain_connect_command(adress,login,password,final,ou,options);
yon_debug_output("%s\n",command);
domain_info_window *dialog = yon_information_window_new();
gtk_label_set_text(GTK_LABEL(dialog->HeadLabel),DOMAIN_CONNECTING_LABEL);
@@ -131,6 +132,101 @@ gboolean on_main_window_domain_status_update(connection_window *window){
return 1;
}
+void yon_domain_client_changed(GtkWidget*,connection_window *window){
+ gtk_entry_set_text(GTK_ENTRY(window->AdditionalParametersEntry),"");
+ const char *id = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->ClientCombo));
+ if (gtk_switch_get_active(GTK_SWITCH(window->AdditionalParametersDefaultSwitch))&&!yon_char_is_empty(id)&&strcmp(id,"none")){
+ gtk_widget_set_sensitive(window->EditButton,1);
+ gtk_widget_set_sensitive(window->AdditionalParametersEntry,1);
+ } else {
+ gtk_widget_set_sensitive(window->EditButton,0);
+ gtk_widget_set_sensitive(window->AdditionalParametersEntry,1);
+ }
+
+}
+
+void yon_domain_client_changed_switch(GtkWidget*,int ,connection_window *window){
+ yon_domain_client_changed(NULL,window);
+}
+
+void on_domain_options_accept(GtkWidget *,domain_options_window *dialog){
+ connection_window *window = g_object_get_data(G_OBJECT(dialog->Window),"connection_window");
+ const char *options = gtk_entry_get_text(GTK_ENTRY(dialog->OptionsEntry));
+ gtk_entry_set_text(GTK_ENTRY(window->AdditionalParametersEntry),options?options:"");
+ on_subwindow_close(dialog->Window);
+}
+
+void on_domain_options_cell_toggled(GtkCellRenderer*, gchar *path,domain_options_window *window){
+ char *options = (char*)gtk_entry_get_text(GTK_ENTRY(window->OptionsEntry));
+ GtkTreeModel *model = GTK_TREE_MODEL(window->List);
+ GtkTreeIter iter;
+ if (gtk_tree_model_get_iter_from_string(model,&iter,path)){
+ int status;
+ char *target;
+ gtk_tree_model_get(model,&iter,0,&status,1,&target,-1);
+ gtk_list_store_set(window->List,&iter,0,!status,-1);
+ if (!status){
+ char *temp = yon_char_append_element(options,target,",");
+ gtk_entry_set_text(GTK_ENTRY(window->OptionsEntry),temp);
+ if (!yon_char_is_empty(temp)) free(temp);
+ } else {
+ char *temp = yon_char_remove_element(options,target,",");
+ gtk_entry_set_text(GTK_ENTRY(window->OptionsEntry),temp);
+ if (!yon_char_is_empty(temp)) free(temp);
+ }
+ }
+}
+
+domain_options_window *yon_domain_options_window_new(){
+ domain_options_window *window = malloc(sizeof(domain_options_window));
+ GtkBuilder *builder = gtk_builder_new_from_resource(glade_domain_options_path);
+ window->Window = yon_gtk_builder_get_widget(builder,"Window");
+ window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
+ window->TitleLabel = yon_gtk_builder_get_widget(builder,"TitleLabel");
+ window->OptionsTree = yon_gtk_builder_get_widget(builder,"OptionsTree");
+ window->OptionsEntry = yon_gtk_builder_get_widget(builder,"OptionsEntry");
+ window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
+ window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
+ window->List = GTK_LIST_STORE(gtk_builder_get_object(builder,"List"));
+ window->ChooseCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"ChooseCell"));
+
+ g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_domain_options_accept),window);
+ g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
+ g_signal_connect(G_OBJECT(window->ChooseCell),"toggled",G_CALLBACK(on_domain_options_cell_toggled),window);
+ return window;
+}
+
+void yon_domain_additional_options_open(GtkWidget *, connection_window *window){
+ char *command = NULL;
+ const char *id = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->ClientCombo));
+ if (yon_char_is_empty(id)||!strcmp(id,"none")){
+ } else if (!strcmp(id,"realmd_sssd")){
+ command = sssd_client_parameters_command;
+ } else if (!strcmp(id,"realmd_winbind")){
+ command = windbind_client_parameters_command;
+ } else if (!strcmp(id,"samba")){
+ command = samba_client_parameters_command;
+ }
+
+ if (yon_char_is_empty(command)){
+ return;
+ } else {
+ GtkTreeIter iter;
+
+ domain_options_window *dialog = yon_domain_options_window_new();
+ yon_gtk_window_setup(GTK_WINDOW(dialog->Window),GTK_WINDOW(window->Window),ADDITIONAL_OPTIONS_LABEL,main_icon,"options_window");
+ g_object_set_data(G_OBJECT(dialog->Window),"connection_window",window);
+ int size;
+ config_str options = yon_config_load(command,&size);
+ for (int i=0;iList,&iter);
+ gtk_list_store_set(dialog->List,&iter,1,options[i],-1);
+ }
+ yon_char_parsed_free(options,size);
+ }
+}
+
connection_window *yon_connection_window_new(){
GtkBuilder *builder = gtk_builder_new_from_resource(glade_connection_path);
connection_window *window = malloc(sizeof(connection_window));
@@ -143,18 +239,20 @@ connection_window *yon_connection_window_new(){
window->KerberosServerEntry = yon_gtk_builder_get_widget(builder,"KerberosServerEntry");
window->DNSEntry = yon_gtk_builder_get_widget(builder,"DNSEntry");
window->ClientCombo = yon_gtk_builder_get_widget(builder,"ClientCombo");
- window->AdditionalCombo = yon_gtk_builder_get_widget(builder,"AdditionalCombo");
- window->EditButton = yon_gtk_builder_get_widget(builder,"EditButton");
- window->SettingsTree = yon_gtk_builder_get_widget(builder,"SettingsTree");
window->SaveButton = yon_gtk_builder_get_widget(builder,"SaveButton");
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
window->CheckButton = yon_gtk_builder_get_widget(builder,"CheckButton");
window->OuEntry = yon_gtk_builder_get_widget(builder,"OuEntry");
- window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
+ window->EditButton = yon_gtk_builder_get_widget(builder,"EditButton");
+ window->AdditionalParametersEntry = yon_gtk_builder_get_widget(builder,"AdditionalParametersEntry");
+ window->AdditionalParametersDefaultSwitch = yon_gtk_builder_get_widget(builder,"AdditionalParametersDefaultSwitch");
yon_gtk_entry_block_symbols(GTK_ENTRY(window->OuEntry),"!\"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~.");
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
g_signal_connect(G_OBJECT(window->StatusEntry),"clicked",G_CALLBACK(on_status_clicked),window);
g_signal_connect(G_OBJECT(window->CheckButton),"clicked",G_CALLBACK(yon_update_thread),window);
+ g_signal_connect(G_OBJECT(window->ClientCombo),"changed",G_CALLBACK(yon_domain_client_changed),window);
+ g_signal_connect(G_OBJECT(window->AdditionalParametersDefaultSwitch),"state-set",G_CALLBACK(yon_domain_client_changed_switch),window);
+ g_signal_connect(G_OBJECT(window->EditButton),"clicked",G_CALLBACK(yon_domain_additional_options_open),window);
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->PasswordEntry));
return window;
diff --git a/source/ubl-settings-system-language.c b/source/ubl-settings-system-language.c
index 40c3359..528342f 100644
--- a/source/ubl-settings-system-language.c
+++ b/source/ubl-settings-system-language.c
@@ -73,7 +73,7 @@ void *yon_locales_load_func(language_window *window){
data_struct->lang = yon_char_new(parsed[1]);
data_struct->territory = yon_char_new(parsed[2]);
- if (config_parsed_size&&yon_char_parsed_check_exist(config_parsed,config_parsed_size,parsed[2])>-1){
+ if (config_parsed_size&&yon_char_parsed_check_exist(config_parsed,config_parsed_size,parsed[0])>-1){
data_struct->chosen=1;
} else {
data_struct->chosen=0;
diff --git a/source/ubl-settings-system.h b/source/ubl-settings-system.h
index 55d5f71..e4040f9 100644
--- a/source/ubl-settings-system.h
+++ b/source/ubl-settings-system.h
@@ -25,7 +25,7 @@
#define glade_connection_path "/com/ublinux/ui/ubl-settings-system-connection.glade"
#define glade_domain_view_path "/com/ublinux/ui/ubl-settings-system-domain-view.glade"
#define glade_locales_path "/com/ublinux/ui/ubl-settings-system-layouts.glade"
-#define banner_path "/com/ublinux/images/ubl-settings-system-banner.png"
+#define glade_domain_options_path "/com/ublinux/ui/ubl-settings-system-domain-options.glade"
#define CssPath "/com/ublinux/css/ubl-settings-system.css"
#define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL)
#define locale_transcriptions_path "/usr/share/ubl-settings-system/csv/locales.csv"
@@ -52,12 +52,22 @@
#define check_domain_access_command(targeet) yon_char_append("adcli info --domain ",target)
#define get_domain_info_command "ubdomain-client list "
#define domains_seek_command "ubdomain-client discover"
-#define domain_connect_command(target,user,password, addition,ou) yon_char_unite("ubdomain-client join",!yon_char_is_empty(user)?" --user \"":"",!yon_char_is_empty(user)?user:"",!yon_char_is_empty(user)?"\"":"",!yon_char_is_empty(password)?" --password \"":"",!yon_char_is_empty(password)?password:"",!yon_char_is_empty(password)?"\"":""," --domain \"",target,"\"",!yon_char_is_empty(ou)?" --ou \"":"",!yon_char_is_empty(ou)?ou:"",!yon_char_is_empty(ou)?"\"":"", addition,NULL)
+#define domain_connect_command(target,user,password, addition,ou,options) yon_char_unite("ubdomain-client join",\
+!yon_char_is_empty(user)?" --user \"":"",!yon_char_is_empty(user)?user:"",!yon_char_is_empty(user)?"\"":"",\
+!yon_char_is_empty(password)?" --password \"":"",!yon_char_is_empty(password)?password:"",!yon_char_is_empty(password)?"\"":"",\
+" --domain \"",target,"\"",\
+!yon_char_is_empty(ou)?" --ou \"":"",!yon_char_is_empty(ou)?ou:"",!yon_char_is_empty(ou)?"\"":"",\
+!yon_char_is_empty(options)?" --authpam_opt \"":"",!yon_char_is_empty(options)?options:"",!yon_char_is_empty(options)?"\"":"",\
+ addition,NULL)
#define domain_disconnect_command(target,user,password) yon_char_unite("ubdomain-client leave",!yon_char_is_empty(user)?" --user \"":"",!yon_char_is_empty(user)?user:"",!yon_char_is_empty(user)?"\"":"",!yon_char_is_empty(password)?" --password \"":"",!yon_char_is_empty(password)?password:"",!yon_char_is_empty(password)?"\"":""," --domain \"",target,"\"",NULL)
#define kerberos_addition_command(target) yon_char_unite(" --domain_server \"",target,"\"",NULL)
#define dns_addition_command(target) yon_char_unite(" --dns \"",target,"\"",NULL)
#define client_addition_command(target) yon_char_unite(" --domain_client \"",target,"\"",NULL)
+#define sssd_client_parameters_command "authselect list-features sssd"
+#define windbind_client_parameters_command "authselect list-features winbind"
+#define samba_client_parameters_command "authselect list-features winbind"
+
#define domain_info(target) yon_char_unite("ubdomain-client discover --domain \"",target,"\"",NULL)
#define domain_connected_icon "com.ublinux.ubl-settings-system.plug-connected-symbolic"
@@ -187,10 +197,9 @@ typedef struct {
GtkWidget *CheckButton;
GtkWidget *KerberosServerEntry;
GtkWidget *ClientCombo;
- GtkWidget *AdditionalCombo;
+ GtkWidget *AdditionalParametersEntry;
+ GtkWidget *AdditionalParametersDefaultSwitch;
GtkWidget *EditButton;
- GtkWidget *SettingsTree;
- GtkListStore *list;
guint timer_id;
} connection_window;
@@ -204,6 +213,18 @@ typedef struct {
GtkWidget *TerminalScroll;
} domain_info_window;
+typedef struct {
+ GtkWidget *Window;
+ GtkWidget *StatusBox;
+ GtkWidget *TitleLabel;
+ GtkWidget *OptionsTree;
+ GtkWidget *OptionsEntry;
+ GtkWidget *AcceptButton;
+ GtkWidget *CancelButton;
+ GtkListStore *List;
+ GtkCellRenderer *ChooseCell;
+} domain_options_window;
+
struct locales_struct {
char *locale;
char *lang;
@@ -272,4 +293,10 @@ void on_language_default_toggled(GtkWidget *, int status, main_window *widgets);
void on_language_remove(GtkWidget *, main_window *widgets);
gboolean yon_locale_window_set_locales(struct locales_struct *data);
void *yon_locales_load_func(language_window *window);
-gboolean yon_locale_window_unlock(GtkWidget *spinner);
\ No newline at end of file
+gboolean yon_locale_window_unlock(GtkWidget *spinner);
+void yon_domain_client_changed(GtkWidget*,connection_window *window);
+void on_domain_options_accept(GtkWidget *,domain_options_window *dialog);
+void on_domain_options_cell_toggled(GtkCellRenderer*, gchar *path,domain_options_window *window);
+domain_options_window *yon_domain_options_window_new();
+void yon_domain_additional_options_open(GtkWidget *, connection_window *window);
+void yon_domain_client_changed_switch(GtkWidget*,int ,connection_window *window);
\ No newline at end of file
diff --git a/source/ubl-strings.h b/source/ubl-strings.h
index 5258ea7..8579eea 100644
--- a/source/ubl-strings.h
+++ b/source/ubl-strings.h
@@ -78,4 +78,5 @@
#define ADD_LANGUAGE_TITLE_LABEL _("Add locales")
#define ADD_LANGUAGE_TOOLTIP_LABEL _("Add locale")
#define REMOVE_LANGUAGE_LABEL _("Remove language")
-#define RESTRICTED_SYMBOLS_LABEL _("OU, Organizational Unit restricted symbols: ! \" # $ % & \' ( ) * + , - . / : ; < = > ? @ [ \\ ] ^ _ ` { | } ~.")
\ No newline at end of file
+#define RESTRICTED_SYMBOLS_LABEL _("OU, Organizational Unit restricted symbols: ! \" # $ % & \' ( ) * + , - . / : ; < = > ? @ [ \\ ] ^ _ ` { | } ~.")
+#define ADDITIONAL_OPTIONS_LABEL _("Additional authentication profile options")
\ No newline at end of file
diff --git a/ubl-settings-system-connection.glade b/ubl-settings-system-connection.glade
index 455221e..eb421b8 100644
--- a/ubl-settings-system-connection.glade
+++ b/ubl-settings-system-connection.glade
@@ -1,5 +1,5 @@
-
+
@@ -13,13 +13,12 @@
False
document-edit-symbolic
-
+
diff --git a/ubl-settings-system-domain-options.glade b/ubl-settings-system-domain-options.glade
new file mode 100644
index 0000000..0cb7021
--- /dev/null
+++ b/ubl-settings-system-domain-options.glade
@@ -0,0 +1,200 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ False
+ com.ublinux.libublsettingsui-gtk3.cancel-uncolored-symbolic
+
+
+ True
+ False
+ com.ublinux.libublsettingsui-gtk3.accept-symbolic
+
+
+ 450
+ 400
+ True
+ False
+ True
+ com.ublinux.ubl-settings-system
+
+
+ True
+ False
+ vertical
+ 5
+
+
+ True
+ False
+ vertical
+
+
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ 5
+ 5
+ 5
+ 5
+ 5
+ vertical
+ 5
+
+
+ True
+ False
+ vertical
+ 5
+
+
+ True
+ True
+ never
+ in
+
+
+ True
+ True
+ List
+ False
+ False
+
+
+
+
+
+ 0
+
+
+
+
+
+
+ Option
+
+
+
+ 1
+
+
+
+
+
+
+
+
+ True
+ True
+ 0
+
+
+
+
+ False
+ 5
+
+
+ True
+ True
+
+
+ True
+ True
+ 1
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ True
+ 0
+
+
+
+
+ True
+ True
+ 1
+
+
+
+
+
+
+
+
+