From 76f6ea43cf40e8336bbfbc4f8cd25015b4b5fda6 Mon Sep 17 00:00:00 2001 From: robvde Date: Wed, 25 Jul 2012 23:22:54 +0400 Subject: [PATCH] Fix on: If you want to add another user with some specific Public folders permission during PF creation, it crashes with information that \user@domain.com does not exist. There is unwanted "\" character before user's UPN. Fix on: You can create new public folder, can see in Public Folder Management Console that it was created OK, with correct implicit rights (Anonymous = Create items, Default = None, my.hosted.org = Reviewer). But you are not able to see this Public Folder in WebsitePanel. Cannot add other accounts because there is nothing to choose. Applied fix: if account contains a '@' no '\' will be applied GetExchangeAccounts sp modified: LEFT OUTER JOIN instead of INNER JOIN --- WebsitePanel/Database/install_db.sql | 2 +- WebsitePanel/Database/update_db.sql | 2 +- .../Exchange2007.cs | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Database/install_db.sql b/WebsitePanel/Database/install_db.sql index e6409576..3f2cb24a 100644 --- a/WebsitePanel/Database/install_db.sql +++ b/WebsitePanel/Database/install_db.sql @@ -192,7 +192,7 @@ SELECT E.SubscriberNumber FROM ExchangeAccounts AS E -INNER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId WHERE E.ItemID = @ItemID AND (E.AccountType = @AccountType OR @AccountType IS NULL) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index d3d09146..1e76c264 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -2332,7 +2332,7 @@ SELECT E.SubscriberNumber FROM ExchangeAccounts AS E -INNER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId WHERE E.ItemID = @ItemID AND (E.AccountType = @AccountType OR @AccountType IS NULL) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index 60c3e411..533abfe4 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -4393,7 +4393,10 @@ namespace WebsitePanel.Providers.HostedSolution { try { - RemovePublicFolderClientPermission(runSpace, folder, @"\" + existingAccount.AccountName, existingAccount.PublicFolderPermission); + RemovePublicFolderClientPermission( runSpace, + folder, + existingAccount.AccountName.Contains("@") ? existingAccount.AccountName : @"\" + existingAccount.AccountName, + existingAccount.PublicFolderPermission); } catch (Exception) { @@ -4406,7 +4409,10 @@ namespace WebsitePanel.Providers.HostedSolution { try { - AddPublicFolderClientPermission(runSpace, folder, @"\" + newAccount.AccountName, newAccount.PublicFolderPermission); + AddPublicFolderClientPermission(runSpace, + folder, + newAccount.AccountName.Contains("@") ? newAccount.AccountName : @"\" + newAccount.AccountName, + newAccount.PublicFolderPermission); } catch (Exception) {