From a041a155022418acffff1b611a8775b0b1178f24 Mon Sep 17 00:00:00 2001 From: alphaeusmote <41258468-alphaeusmote@users.noreply.replit.com> Date: Thu, 10 Apr 2025 21:45:40 +0000 Subject: [PATCH] Add option to automatically include rootDSE in OU paths Replit-Commit-Author: Agent Replit-Commit-Session-Id: 705f2157-ef97-4fbd-89e4-8c7f2ecaea90 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ed01c5f-a82d-405a-b728-b2e3d127c60c/5ed4a3a4-e383-48c9-beb9-321c509bc354.jpg --- .../components/dynamic-groups/rule-editor.tsx | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/client/src/components/dynamic-groups/rule-editor.tsx b/client/src/components/dynamic-groups/rule-editor.tsx index 9b40567..0b33d8f 100644 --- a/client/src/components/dynamic-groups/rule-editor.tsx +++ b/client/src/components/dynamic-groups/rule-editor.tsx @@ -82,6 +82,7 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } createOUIfNotExists: boolean; createGroupForEachAttributeValue: boolean; createOUForEachAttributeValue: boolean; + autoAddRootDSE: boolean; enabled: boolean; variablePattern: string; connections: number[]; @@ -94,6 +95,7 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } createOUIfNotExists: rule?.createOUIfNotExists || false, createGroupForEachAttributeValue: rule?.createGroupForEachAttributeValue || false, createOUForEachAttributeValue: rule?.createOUForEachAttributeValue || false, + autoAddRootDSE: true, // Default to true for better user experience enabled: rule?.enabled ?? true, variablePattern: rule?.variablePattern || '', connections: rule?.connectionIds || [] @@ -167,10 +169,15 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } return domainParts.map(part => `DC=${part}`).join(','); }; - // Ensure OU path has rootDSE appended + // Ensure OU path has rootDSE appended if autoAddRootDSE is enabled const ensureRootDSE = (ouPath: string) => { if (!ouPath) return ''; + // If autoAddRootDSE is disabled, return the path as is + if (!formData.autoAddRootDSE) { + return ouPath; + } + // Check if the path already contains DC= if (ouPath.includes('DC=')) { return ouPath; @@ -474,6 +481,15 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } /> + +
+ handleToggleChange('autoAddRootDSE', checked)} + /> + +
@@ -636,6 +652,12 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } {formData.createOUIfNotExists ? 'Yes' : 'No'}
+
+
Auto-add root DSE:
+
+ {formData.autoAddRootDSE ? 'Yes' : 'No'} +
+
Create groups per attribute value: