From d9a071d8f161ff19edc281d22f2d1b6f879b73e4 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 15 Oct 2025 18:04:17 +0600 Subject: [PATCH 1/4] WIP added OU field --- source/ubl-settings-system.c | 8 ++++-- source/ubl-settings-system.h | 4 ++- ubl-settings-system-connection.glade | 40 ++++++++++++++++++++++++++-- 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/source/ubl-settings-system.c b/source/ubl-settings-system.c index cdac32e..a5e036b 100644 --- a/source/ubl-settings-system.c +++ b/source/ubl-settings-system.c @@ -461,16 +461,18 @@ void on_domain_connect(GtkWidget *, dictionary *dict){ char *password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); 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 *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); - yon_debug_output("%s\n",domain_connect_command(adress,login,password,final)); + char *command = domain_connect_command(adress,login,password,final,ou); + 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); gtk_window_set_title(GTK_WINDOW(dialog->Window),DOMAIN_CONNECTING_LABEL); - yon_terminal_integrated_start(dialog->ExecuteTerminal,domain_connect_command(adress,login,password,final)); + yon_terminal_integrated_start(dialog->ExecuteTerminal,command); dictionary *dc = NULL; yon_dictionary_add_or_create_if_exists_with_data(dc,"widgets",widgets); yon_dictionary_add_or_create_if_exists_with_data(dc,"window",window->Window); @@ -568,7 +570,9 @@ connection_window *yon_connection_window_new(){ 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")); + 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); diff --git a/source/ubl-settings-system.h b/source/ubl-settings-system.h index d4f91eb..6cd6725 100644 --- a/source/ubl-settings-system.h +++ b/source/ubl-settings-system.h @@ -65,7 +65,7 @@ #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) 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,"\"", addition,NULL) +#define domain_connect_command(target,user,password, addition,ou) yon_char_unite("ubconfig set [network] DOMAIN[ou]='",!yon_char_is_empty(ou)?ou:"","';"," 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,"\"", 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) @@ -167,6 +167,8 @@ typedef struct { GtkWidget *StatusBox; GtkWidget *HeadLabel; + + GtkWidget *OuEntry; GtkWidget *CancelButton; GtkWidget *SaveButton; diff --git a/ubl-settings-system-connection.glade b/ubl-settings-system-connection.glade index 3d5afc2..01ce417 100644 --- a/ubl-settings-system-connection.glade +++ b/ubl-settings-system-connection.glade @@ -1,5 +1,5 @@ - + @@ -306,6 +306,42 @@ 1 + + + True + False + 5 + + + True + False + OU, Organizational Unit: + + + False + True + 0 + + + + + True + True + The name of the OU in which we want to create the computer account in the domain. If the account already exists, it will be updated. Example: ubhosts\units + + + True + True + 1 + + + + + False + True + 2 + + True @@ -346,7 +382,7 @@ False True - 2 + 3 -- 2.35.1 From 825b9f11215e3bdb017b65e3bca085f78acedfde Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 16 Oct 2025 10:33:19 +0600 Subject: [PATCH 2/4] Changed domain connection command --- source/ubl-settings-system.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubl-settings-system.h b/source/ubl-settings-system.h index 6cd6725..9f09629 100644 --- a/source/ubl-settings-system.h +++ b/source/ubl-settings-system.h @@ -65,7 +65,7 @@ #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("ubconfig set [network] DOMAIN[ou]='",!yon_char_is_empty(ou)?ou:"","';"," 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,"\"", addition,NULL) +#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_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) -- 2.35.1 From 50430ff509c0d24312ce3bdd325e2ea4dd1b9b90 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 16 Oct 2025 10:44:02 +0600 Subject: [PATCH 3/4] Localisation update --- locale/ubl-settings-system.pot | 3 +++ locale/ubl-settings-system_ru.po | 6 ++++++ source/ubl-strings.h | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/locale/ubl-settings-system.pot b/locale/ubl-settings-system.pot index 237fb55..2ab5416 100644 --- a/locale/ubl-settings-system.pot +++ b/locale/ubl-settings-system.pot @@ -237,6 +237,9 @@ msgstr "" msgid "Check" msgstr "" +msgid "OU, Organizational Unit:" +msgstr "" + msgid "Domain connection" msgstr "" diff --git a/locale/ubl-settings-system_ru.po b/locale/ubl-settings-system_ru.po index d3f0cf6..6cad57e 100644 --- a/locale/ubl-settings-system_ru.po +++ b/locale/ubl-settings-system_ru.po @@ -241,6 +241,12 @@ msgstr "Проверка" msgid "Domain connection" msgstr "Соединение домена" +msgid "OU, Organizational Unit:" +msgstr "Подразделение:" + +msgid "The name of the OU in which we want to create the computer account in the domain. If the account already exists, it will be updated. Example: ubhosts\\units" +msgstr "Имя OU, в котором мы хотим создать учётную запись компьютера в домене. Если учётная запись уже существует, то она будет обновлена. Пример: ubhosts\\units" + msgid "Afrikaans, South Africa" msgstr "Африканский, Южная Африка" diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 67a69c4..d454423 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -64,4 +64,6 @@ #define DOMAIN_DISCONNECTED_LABEL _("Disconnected from domain") #define LOADING_LABEL _("Loading...") -#define CHECK_CONNECTION_LABEL _("Check") \ No newline at end of file +#define CHECK_CONNECTION_LABEL _("Check") +#define OU_LABEL _("OU, Organizational Unit:") +#define OU_TOOLTIP_LABEL _("The name of the OU in which we want to create the computer account in the domain. If the account already exists, it will be updated. Example: ubhosts\units") \ No newline at end of file -- 2.35.1 From dda79862846304a99f2099b9445cbb0c18d6067d Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 16 Oct 2025 13:41:31 +0600 Subject: [PATCH 4/4] Tooltip change --- locale/ubl-settings-system.pot | 3 +++ locale/ubl-settings-system_ru.po | 4 ++-- source/ubl-strings.h | 2 +- ubl-settings-system-connection.glade | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/locale/ubl-settings-system.pot b/locale/ubl-settings-system.pot index 2ab5416..2b6c3af 100644 --- a/locale/ubl-settings-system.pot +++ b/locale/ubl-settings-system.pot @@ -240,6 +240,9 @@ msgstr "" msgid "OU, Organizational Unit:" msgstr "" +msgid "The name of the OU in which we want to create the computer account in the domain. If the account already exists, it will be updated. Example: \"ubhosts\" or \"OU=UBL Servers,OU=KOM,DC=ad,DC=holding,DC=com\"" +msgstr "" + msgid "Domain connection" msgstr "" diff --git a/locale/ubl-settings-system_ru.po b/locale/ubl-settings-system_ru.po index 6cad57e..1befc8d 100644 --- a/locale/ubl-settings-system_ru.po +++ b/locale/ubl-settings-system_ru.po @@ -244,8 +244,8 @@ msgstr "Соединение домена" msgid "OU, Organizational Unit:" msgstr "Подразделение:" -msgid "The name of the OU in which we want to create the computer account in the domain. If the account already exists, it will be updated. Example: ubhosts\\units" -msgstr "Имя OU, в котором мы хотим создать учётную запись компьютера в домене. Если учётная запись уже существует, то она будет обновлена. Пример: ubhosts\\units" +msgid "The name of the OU in which we want to create the computer account in the domain. If the account already exists, it will be updated. Example: \"ubhosts\" or \"OU=UBL Servers,OU=KOM,DC=ad,DC=holding,DC=com\"" +msgstr "Имя OU, в котором мы хотим создать учётную запись компьютера в домене. Если учётная запись уже существует, то она будет обновлена. Пример: \"ubhosts\" или \"OU=UBL Servers,OU=KOM,DC=ad,DC=holding,DC=com\"" msgid "Afrikaans, South Africa" msgstr "Африканский, Южная Африка" diff --git a/source/ubl-strings.h b/source/ubl-strings.h index d454423..301174c 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -66,4 +66,4 @@ #define LOADING_LABEL _("Loading...") #define CHECK_CONNECTION_LABEL _("Check") #define OU_LABEL _("OU, Organizational Unit:") -#define OU_TOOLTIP_LABEL _("The name of the OU in which we want to create the computer account in the domain. If the account already exists, it will be updated. Example: ubhosts\units") \ No newline at end of file +#define OU_TOOLTIP_LABEL _("The name of the OU in which we want to create the computer account in the domain. If the account already exists, it will be updated. Example: \"ubhosts\" or \"OU=UBL Servers,OU=KOM,DC=ad,DC=holding,DC=com\"") \ No newline at end of file diff --git a/ubl-settings-system-connection.glade b/ubl-settings-system-connection.glade index 01ce417..455221e 100644 --- a/ubl-settings-system-connection.glade +++ b/ubl-settings-system-connection.glade @@ -1,5 +1,5 @@ - + @@ -327,7 +327,7 @@ True True - The name of the OU in which we want to create the computer account in the domain. If the account already exists, it will be updated. Example: ubhosts\units + The name of the OU in which we want to create the computer account in the domain. If the account already exists, it will be updated. Example: "ubhosts" or "OU=UBL Servers,OU=KOM,DC=ad,DC=holding,DC=com" True -- 2.35.1