From 9f39d8f7e0157f983e2276413795ceb791067e05 Mon Sep 17 00:00:00 2001 From: Kozyrev Yuri Date: Sat, 16 May 2026 00:36:42 +0400 Subject: [PATCH 1/4] Remove extra space in full name Full name of a new user in CreateUserDialog is a combination of first, midle and last names separated by spaces, but when midle name is empty full name ends up having an extra space to separate empty midle name from last name --- src/admc/utils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/admc/utils.cpp b/src/admc/utils.cpp index e148d637c..dd93f615b 100755 --- a/src/admc/utils.cpp +++ b/src/admc/utils.cpp @@ -404,12 +404,18 @@ void setup_full_name_autofill(QLineEdit *first_name_edit, QLineEdit *last_name_e const QString middle_name = middle_name_edit->text().trimmed(); const bool last_name_first = settings_get_variant(SETTING_last_name_before_first_name).toBool(); - if (!first_name.isEmpty() && !last_name.isEmpty()) { + if (!first_name.isEmpty() && !middle_name.isEmpty() && !last_name.isEmpty()) { if (last_name_first) { return last_name + " " + first_name + " " + middle_name; } else { return first_name + " " + middle_name + " " + last_name; } + } else if (!first_name.isEmpty() && !last_name.isEmpty()) { + if (last_name_first) { + return last_name + " " + first_name; + } else { + return first_name + " " + last_name; + } } else if (!first_name.isEmpty()) { return first_name + middle_name; } else if (!last_name.isEmpty()) { From 9b9edb75b8c81e373ad7e9fdbd0422ff651fde28 Mon Sep 17 00:00:00 2001 From: Kozyrev Yuri Date: Sat, 16 May 2026 02:21:08 +0400 Subject: [PATCH 2/4] 0.23.3-alt1 - Remove extra space in full name --- .gear/admc.spec | 5 ++++- CHANGELOG.txt | 6 ++++++ CHANGELOG_ru.txt | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.gear/admc.spec b/.gear/admc.spec index cee7747c8..82faf8d44 100644 --- a/.gear/admc.spec +++ b/.gear/admc.spec @@ -10,7 +10,7 @@ %endif Name: admc -Version: 0.23.2 +Version: 0.23.3 Release: alt1 Summary: Active Directory Management Center @@ -125,6 +125,9 @@ Tests for ADMC %_bindir/admc_test_find_policy_dialog %changelog +* Sat May 16 2026 Kozyrev Yuri 0.23.3-alt1 +- Remove extra space in full name + * Tue Apr 28 2026 Semyon Knyazev 0.23.2-alt1 - Disabled the "Show Non-Container Objects in Console Tree" and "Advanced Features" options for the password settings subtree display. diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5691ebe6b..8ccb886ad 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,12 @@ admc CHANGELOG +----------------------------------------------------------------------- + VERSION 0.23.3 +----------------------------------------------------------------------- +- Removed extra space in full name of a new user in user creation + dialog + ----------------------------------------------------------------------- VERSION 0.23.2 ----------------------------------------------------------------------- diff --git a/CHANGELOG_ru.txt b/CHANGELOG_ru.txt index c94beb7c7..b98853da9 100644 --- a/CHANGELOG_ru.txt +++ b/CHANGELOG_ru.txt @@ -1,6 +1,12 @@ admc ЖУРНАЛ ИЗМЕНЕНИЙ +----------------------------------------------------------------------- + ВЕРСИЯ 0.23.2 +----------------------------------------------------------------------- +- Исправлено добавление лишнего пробела в полном имени создаваемого + пользователя + ----------------------------------------------------------------------- ВЕРСИЯ 0.23.2 ----------------------------------------------------------------------- From 9105660341543b09477b2d3cb93563d562049748 Mon Sep 17 00:00:00 2001 From: Kozyrev Yuri Date: Thu, 28 May 2026 01:09:05 +0400 Subject: [PATCH 3/4] Utilize real default password settings --- src/adldap/ad_defines.h | 11 ++++++ .../pso_results_widget/pso_edit_widget.cpp | 39 ++++++++++++------- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/adldap/ad_defines.h b/src/adldap/ad_defines.h index 825b6209e..d68e59bfa 100644 --- a/src/adldap/ad_defines.h +++ b/src/adldap/ad_defines.h @@ -149,6 +149,10 @@ enum SystemFlagsBit { #define ATTRIBUTE_MAX_PWD_AGE "maxPwdAge" #define ATTRIBUTE_MIN_PWD_AGE "minPwdAge" #define ATTRIBUTE_LOCKOUT_DURATION "lockoutDuration" +#define ATTRIBUTE_PWD_PROPERTIES "pwdProperties" +#define ATTRIBUTE_PWD_HISTORY_LENGTH "pwdHistoryLength" +#define ATTRIBUTE_MIN_PWD_LENGTH "minPwdLength" +#define ATTRIBUTE_LOCKOUT_THRESHOLD "lockoutThreshold" #define ATTRIBUTE_IS_CRITICAL_SYSTEM_OBJECT "isCriticalSystemObject" #define ATTRIBUTE_GPC_FILE_SYS_PATH "gPCFileSysPath" #define ATTRIBUTE_GPC_FUNCTIONALITY_VERSION "gpCFunctionalityVersion" @@ -407,6 +411,13 @@ const long long MILLIS_TO_100_NANOS = 10000LL; #define ETYPES_AES128_CTS_HMAC_SHA1_96 0x00000008 #define ETYPES_AES256_CTS_HMAC_SHA1_96 0x00000010 +#define SAM_MASK_DOMAIN_PASSWORD_COMPLEX 1 +#define SAM_MASK_DOMAIN_PASSWORD_NO_ANON_CHANGE 2 +#define SAM_MASK_DOMAIN_PASSWORD_NO_CLEAR_CHANGE 4 +#define SAM_MASK_DOMAIN_LOCKOUT_ADMINS 8 +#define SAM_MASK_DOMAIN_PASSWORD_STORE_CLEARTEXT 16 +#define SAM_MASK_DOMAIN_REFUSE_PASSWORD_CHANGE 32 + enum SearchScope { SearchScope_Object, SearchScope_Children, diff --git a/src/admc/results_widgets/pso_results_widget/pso_edit_widget.cpp b/src/admc/results_widgets/pso_results_widget/pso_edit_widget.cpp index cc9acb73b..fa8ccf64a 100644 --- a/src/admc/results_widgets/pso_results_widget/pso_edit_widget.cpp +++ b/src/admc/results_widgets/pso_results_widget/pso_edit_widget.cpp @@ -18,6 +18,7 @@ */ #include "pso_edit_widget.h" +#include "ad_defines.h" #include "ui_pso_edit_widget.h" #include "ad_interface.h" #include "ad_object.h" @@ -26,6 +27,7 @@ #include "managers/icon_manager.h" #include "status.h" #include "globals.h" +#include "ad_config.h" #include @@ -189,19 +191,30 @@ bool PSOEditWidget::settings_are_default() { } void PSOEditWidget::update_defaults() { - // TODO: Get defaults from Default Domain Policy. - - ui->min_passwd_len_spinbox->setValue(7); - ui->history_length_spinbox->setValue(24); - ui->logon_attempts_spinbox->setValue(0); - - ui->lockout_duration_spinbox->setValue(30); - ui->reset_lockout_spinbox->setValue(30); - ui->min_age_spinbox->setValue(1); - ui->max_age_spinbox->setValue(42); - - ui->complexity_req_checkbox->setChecked(true); - ui->store_passwd_checkbox->setChecked(false); + AdInterface ad; + if (!ad.is_connected()) { + return; + } + AdObject result = ad.search_object(g_adconfig->domain_dn(), {ATTRIBUTE_PWD_PROPERTIES, + ATTRIBUTE_PWD_HISTORY_LENGTH, + ATTRIBUTE_MIN_PWD_LENGTH, + ATTRIBUTE_MIN_PWD_AGE, + ATTRIBUTE_MAX_PWD_AGE, + ATTRIBUTE_LOCKOUT_DURATION, + ATTRIBUTE_LOCKOUT_THRESHOLD, + ATTRIBUTE_LOCKOUT_OBSERVATION_WINDOW}); + + ui->min_passwd_len_spinbox->setValue(result.get_int(ATTRIBUTE_MIN_PWD_LENGTH)); + ui->history_length_spinbox->setValue(result.get_int(ATTRIBUTE_PWD_HISTORY_LENGTH)); + ui->logon_attempts_spinbox->setValue(result.get_int(ATTRIBUTE_LOCKOUT_THRESHOLD)); + + ui->lockout_duration_spinbox->setValue(spinbox_timespan_units(result, ATTRIBUTE_LOCKOUT_DURATION)); + ui->reset_lockout_spinbox->setValue(spinbox_timespan_units(result, ATTRIBUTE_LOCKOUT_OBSERVATION_WINDOW)); + ui->min_age_spinbox->setValue(spinbox_timespan_units(result, ATTRIBUTE_MIN_PWD_AGE)); + ui->max_age_spinbox->setValue(spinbox_timespan_units(result, ATTRIBUTE_MAX_PWD_AGE)); + + ui->complexity_req_checkbox->setChecked(result.get_int(ATTRIBUTE_PWD_PROPERTIES) & SAM_MASK_DOMAIN_PASSWORD_COMPLEX); + ui->store_passwd_checkbox->setChecked(result.get_int(ATTRIBUTE_PWD_PROPERTIES) & SAM_MASK_DOMAIN_PASSWORD_STORE_CLEARTEXT); ui->applied_list_widget->clear(); } From 10959c693a7e56fe911cef551db049cfea7c0fb7 Mon Sep 17 00:00:00 2001 From: Kozyrev Yuri Date: Wed, 3 Jun 2026 14:43:11 +0400 Subject: [PATCH 4/4] feat: added properties to general_computer_tab in main view --- .../console_impls/object_impl/object_impl.cpp | 13 +++++-- .../console_impls/object_impl/object_impl.h | 2 ++ src/admc/tabs/general_computer_tab.cpp | 35 ++++++++++++++++--- src/admc/tabs/general_computer_tab.h | 10 ++++++ 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/src/admc/console_impls/object_impl/object_impl.cpp b/src/admc/console_impls/object_impl/object_impl.cpp index 89dcadbea..fa420ecbc 100755 --- a/src/admc/console_impls/object_impl/object_impl.cpp +++ b/src/admc/console_impls/object_impl/object_impl.cpp @@ -481,8 +481,10 @@ void ObjectImpl::selected_as_scope(const QModelIndex &index) else if (object.is_class(CLASS_SUBNET)) { stacked_widget->setCurrentWidget(subnet_results_widget); subnet_results_widget->update(object); - } - else { + } else if (object.is_class(CLASS_COMPUTER)) { + stacked_widget->setCurrentWidget(computer_results_widget); + computer_results_widget->update(ad, object); + } else { stacked_widget->setCurrentWidget(view()); } } @@ -509,6 +511,11 @@ void ObjectImpl::update_results_widget(const QModelIndex &index) const { return; } + if (object.is_class(CLASS_COMPUTER)) { + computer_results_widget->update(ad, object); + return; + } + if (object.is_class(CLASS_CONTACT) || object.is_class(CLASS_USER) || object.is_class(CLASS_INET_ORG_PERSON)) { @@ -950,9 +957,11 @@ void ObjectImpl::setup_widgets() { set_results_view(new ResultsView(console)); group_results_widget = new GeneralGroupTab(); user_results_widget = new GeneralUserTab(); + computer_results_widget = new GeneralComputerTab(); pso_results_widget = new PSOResultsWidget(); subnet_results_widget = new SubnetResultsWidget(); stacked_widget->addWidget(group_results_widget); + stacked_widget->addWidget(computer_results_widget); stacked_widget->addWidget(user_results_widget); stacked_widget->addWidget(pso_results_widget); stacked_widget->addWidget(subnet_results_widget); diff --git a/src/admc/console_impls/object_impl/object_impl.h b/src/admc/console_impls/object_impl/object_impl.h index 647b2cbc7..7e8b233cc 100644 --- a/src/admc/console_impls/object_impl/object_impl.h +++ b/src/admc/console_impls/object_impl/object_impl.h @@ -31,6 +31,7 @@ #include "console_widget/console_impl.h" #include "console_widget/console_widget.h" #include "console_object_operations.h" +#include "tabs/general_computer_tab.h" class QStandardItem; class AdObject; @@ -151,6 +152,7 @@ private slots: QStackedWidget *stacked_widget; GeneralGroupTab *group_results_widget; GeneralUserTab *user_results_widget; + GeneralComputerTab *computer_results_widget; PSOResultsWidget *pso_results_widget; SubnetResultsWidget *subnet_results_widget; diff --git a/src/admc/tabs/general_computer_tab.cpp b/src/admc/tabs/general_computer_tab.cpp index b62a5dd8c..53d73cb1e 100644 --- a/src/admc/tabs/general_computer_tab.cpp +++ b/src/admc/tabs/general_computer_tab.cpp @@ -31,6 +31,33 @@ GeneralComputerTab::GeneralComputerTab(QList *edit_list, QWidge ui = new Ui::GeneralComputerTab(); ui->setupUi(this); + edit_list->append(create_edits()); +} + +GeneralComputerTab::GeneralComputerTab(QWidget *parent) +: QWidget(parent) { + ui = new Ui::GeneralComputerTab(); + ui->setupUi(this); + + m_edit_list = create_edits(); + + ui->name_label->setVisible(false); + ui->description_edit->setReadOnly(true); + ui->dns_host_name_edit->setReadOnly(true); + ui->sam_name_domain_edit->setReadOnly(true); + ui->sam_name_edit->setReadOnly(true); + ui->location_edit->setReadOnly(true); +} + +void GeneralComputerTab::update(AdInterface &ad, const AdObject &object) { + AttributeEdit::load(m_edit_list, ad, object); +} + +GeneralComputerTab::~GeneralComputerTab() { + delete ui; +} + +QList GeneralComputerTab::create_edits() { auto name_edit = new GeneralNameEdit(ui->name_label, this); auto sam_name_edit = new ComputerSamNameEdit(ui->sam_name_edit, ui->sam_name_domain_edit, this); auto dns_edit = new StringEdit(ui->dns_host_name_edit, ATTRIBUTE_DNS_HOST_NAME, this); @@ -40,15 +67,13 @@ GeneralComputerTab::GeneralComputerTab(QList *edit_list, QWidge sam_name_edit->set_enabled(false); dns_edit->set_enabled(false); - edit_list->append({ + QList edit_list = { name_edit, sam_name_edit, dns_edit, description_edit, location_edit, - }); -} + }; -GeneralComputerTab::~GeneralComputerTab() { - delete ui; + return edit_list; } diff --git a/src/admc/tabs/general_computer_tab.h b/src/admc/tabs/general_computer_tab.h index 05c6eb8cf..58f4e9f9a 100644 --- a/src/admc/tabs/general_computer_tab.h +++ b/src/admc/tabs/general_computer_tab.h @@ -23,6 +23,8 @@ #include +#include "ad_interface.h" + class AttributeEdit; class AdObject; @@ -37,7 +39,15 @@ class GeneralComputerTab final : public QWidget { Ui::GeneralComputerTab *ui; GeneralComputerTab(QList *edit_list, QWidget *parent); + GeneralComputerTab(QWidget *parent = nullptr); ~GeneralComputerTab(); + + void update(AdInterface &ad, const AdObject &object); + +private: + QList m_edit_list; + + QList create_edits(); }; #endif /* GENERAL_COMPUTER_TAB_H */