diff --git a/src/Controllers/SettingsController.cs b/src/Controllers/SettingsController.cs index fa01430..5aab3d7 100644 --- a/src/Controllers/SettingsController.cs +++ b/src/Controllers/SettingsController.cs @@ -33,7 +33,7 @@ public class SettingsController : Controller public async Task AdminAsync() { AdminSettingsModel adminSettingsModel = await _ldap.GetAdminSettingsModelAsync(); - return View(); + return View(adminSettingsModel); } [Authorize(Roles = "CanManageSettings")] diff --git a/src/Views/Home/Users.cshtml b/src/Views/Home/Users.cshtml index 4e6d35e..47770e8 100644 --- a/src/Views/Home/Users.cshtml +++ b/src/Views/Home/Users.cshtml @@ -235,33 +235,6 @@ diff --git a/src/wwwroot/js/site.js b/src/wwwroot/js/site.js index bfdde28..5ba6601 100644 --- a/src/wwwroot/js/site.js +++ b/src/wwwroot/js/site.js @@ -239,4 +239,30 @@ function validatePassword(password) { const strongPasswordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_\-+=\[{\]};:'",<.>/?\\|`~]).{8,}$/; return strongPasswordRegex.test(password); -} \ No newline at end of file +} + +function unflatten(obj) { + const result = {}; + for (const [key, value] of Object.entries(obj)) { + const parts = key.split("."); + let current = result; + for (let i = 0; i < parts.length; i++) { + const part = parts[i]; + if (i === parts.length - 1) { + if (typeof value === "string" && /^[\[{]/.test(value.trim())) { + try { + current[part] = JSON.parse(value); + } catch { + current[part] = value; + } + } else { + current[part] = value; + } + } else { + current[part] = current[part] || {}; + current = current[part]; + } + } + } + return result; +}