From aa7d887376ffdef3f46afc91d729a14bc8cca3c9 Mon Sep 17 00:00:00 2001 From: Olov Karlsson Date: Sat, 3 Jan 2015 19:21:13 +0100 Subject: [PATCH] Fix in SecurityUtils.GetUser to handle AD Users with no givenname and/or surname --- .../Sources/WebsitePanel.Server.Utils/SecurityUtils.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Utils/SecurityUtils.cs b/WebsitePanel/Sources/WebsitePanel.Server.Utils/SecurityUtils.cs index 27ddaa75..639ce3bd 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Utils/SecurityUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Utils/SecurityUtils.cs @@ -503,8 +503,8 @@ namespace WebsitePanel.Providers.Utils // fill user SystemUser user = new SystemUser(); user.Name = GetObjectProperty(objUser, "cn").ToString(); - user.FullName = GetObjectProperty(objUser, "givenName").ToString() + " " + - GetObjectProperty(objUser, "sn").ToString(); + user.FullName = (GetObjectProperty(objUser, "givenName").ToString() + " " + + GetObjectProperty(objUser, "sn").ToString()).Trim(); user.Description = GetObjectProperty(objUser, "description").ToString(); ADAccountOptions userFlags = (ADAccountOptions)objUser.Properties["userAccountControl"].Value;