From ba71e9b29c45613d44b51512c2e3fa92fe80f105 Mon Sep 17 00:00:00 2001 From: robvde Date: Tue, 4 Sep 2012 15:07:38 +0400 Subject: [PATCH] Narrowed down the capabilities of peer accounts within a consumer organization --- .../WebsitePanel/Code/Framework/Utils.cs | 9 +++ .../ExchangeMailboxGeneralSettings.ascx.cs | 20 +++++++ .../ExchangeServer/OrganizationHome.ascx | 4 +- .../ExchangeServer/OrganizationHome.ascx.cs | 57 +++++++++++++------ .../OrganizationHome.ascx.designer.cs | 46 ++++++--------- .../UserControls/MailboxTabs.ascx.cs | 23 ++++++-- .../ExchangeServer/UserControls/Menu.ascx.cs | 30 ++++------ .../WebsitePanel/SpaceDetails.ascx.cs | 13 +++++ .../WebsitePanel/SpaceQuotas.ascx.cs | 13 +++++ .../WebsitePanel/SpaceTools.ascx.cs | 14 +++++ .../WebsitePanel/UserAccountTools.ascx.cs | 17 ++++++ 11 files changed, 177 insertions(+), 69 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs index bfcc3c85..d5e2f0ce 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs @@ -39,6 +39,7 @@ using System.Globalization; using System.Text.RegularExpressions; using System.Security.Cryptography; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal { @@ -286,5 +287,13 @@ namespace WebsitePanel.Portal return sb.ToString(); } + + public static bool CheckQouta(string key, PackageContext cntx) + { + return cntx.Quotas.ContainsKey(key) && + ((cntx.Quotas[key].QuotaAllocatedValue == 1 && cntx.Quotas[key].QuotaTypeId == 1) || + (cntx.Quotas[key].QuotaTypeId != 1 && (cntx.Quotas[key].QuotaAllocatedValue > 0 || cntx.Quotas[key].QuotaAllocatedValue == -1))); + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs index a06f972b..cc870235 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs @@ -39,10 +39,30 @@ namespace WebsitePanel.Portal.ExchangeServer if (!IsPostBack) { BindSettings(); + + UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId); + + if (user != null) + { + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) + { + chkHideAddressBook.Visible = false; + chkDisable.Visible = false; + } + } + } } + private bool CheckQouta(string key, PackageContext cntx) + { + return cntx.Quotas.ContainsKey(key) && + ((cntx.Quotas[key].QuotaAllocatedValue == 1 && cntx.Quotas[key].QuotaTypeId == 1) || + (cntx.Quotas[key].QuotaTypeId != 1 && (cntx.Quotas[key].QuotaAllocatedValue > 0 || cntx.Quotas[key].QuotaAllocatedValue == -1))); + } + private void BindSettings() { try diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx index 39e932a2..9350c339 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx @@ -48,6 +48,7 @@
+ + - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs index a173dbbe..321cec28 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs @@ -43,7 +43,7 @@ namespace WebsitePanel.Portal.ExchangeServer } - private void BindExchangeStats() + private void BindExchangeStats(bool hideItems) { OrganizationStatistics exchangeOrgStats = ES.Services.ExchangeServer.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID); OrganizationStatistics exchangeTenantStats = ES.Services.ExchangeServer.GetOrganizationStatistics(PanelRequest.ItemID); @@ -84,9 +84,14 @@ namespace WebsitePanel.Portal.ExchangeServer if (exchangeOrgStats.AllocatedDistributionLists != -1) listsStats.QuotaAvailable = exchangeTenantStats.AllocatedDistributionLists - exchangeTenantStats.CreatedDistributionLists; } - exchangeStorageStats.QuotaUsedValue = exchangeOrgStats.UsedDiskSpace; - exchangeStorageStats.QuotaValue = exchangeOrgStats.AllocatedDiskSpace; - if (exchangeOrgStats.AllocatedDiskSpace != -1) exchangeStorageStats.QuotaAvailable = exchangeTenantStats.AllocatedDiskSpace - exchangeTenantStats.UsedDiskSpace; + if (!hideItems) + { + exchangeStorageStats.QuotaUsedValue = exchangeOrgStats.UsedDiskSpace; + exchangeStorageStats.QuotaValue = exchangeOrgStats.AllocatedDiskSpace; + if (exchangeOrgStats.AllocatedDiskSpace != -1) exchangeStorageStats.QuotaAvailable = exchangeTenantStats.AllocatedDiskSpace - exchangeTenantStats.UsedDiskSpace; + } + else + this.rowExchangeStorage.Style.Add("display", "none"); if (exchangeTenantStats.AllocatedPublicFolders == 0) this.rowFolders.Style.Add("display", "none"); else @@ -100,42 +105,59 @@ namespace WebsitePanel.Portal.ExchangeServer private void BindOrgStats() { Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID); + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + bool hideItems = false; + + UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId); + + if (user != null) + { + if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) + hideItems = true; + } + lblOrganizationNameValue.Text = org.Name; lblOrganizationIDValue.Text = org.OrganizationId; lblCreatedValue.Text = org.CreatedDate.Date.ToShortDateString(); - OrganizationStatistics orgStats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID); OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); if (orgStats == null) return; - domainStats.QuotaUsedValue = orgStats.CreatedDomains; - domainStats.QuotaValue = orgStats.AllocatedDomains; - if (orgStats.AllocatedDomains != -1) domainStats.QuotaAvailable = tenantStats.AllocatedDomains - tenantStats.CreatedDomains; + if (!hideItems) + { - userStats.QuotaUsedValue = orgStats.CreatedUsers; - userStats.QuotaValue = orgStats.AllocatedUsers; - if (orgStats.AllocatedUsers != -1) userStats.QuotaAvailable = tenantStats.AllocatedUsers - tenantStats.CreatedUsers; + domainStats.QuotaUsedValue = orgStats.CreatedDomains; + domainStats.QuotaValue = orgStats.AllocatedDomains; + if (orgStats.AllocatedDomains != -1) domainStats.QuotaAvailable = tenantStats.AllocatedDomains - tenantStats.CreatedDomains; + + userStats.QuotaUsedValue = orgStats.CreatedUsers; + userStats.QuotaValue = orgStats.AllocatedUsers; + if (orgStats.AllocatedUsers != -1) userStats.QuotaAvailable = tenantStats.AllocatedUsers - tenantStats.CreatedUsers; - lnkDomains.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "domains", - "SpaceID=" + PanelSecurity.PackageId); + lnkDomains.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "domains", + "SpaceID=" + PanelSecurity.PackageId); - lnkUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "users", - "SpaceID=" + PanelSecurity.PackageId); + lnkUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "users", + "SpaceID=" + PanelSecurity.PackageId); + } + else + organizationStatsPanel.Visible = false; - PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if (cntx.Groups.ContainsKey(ResourceGroups.Exchange)) { exchangeStatsPanel.Visible = true; - BindExchangeStats(); + BindExchangeStats(hideItems); } else exchangeStatsPanel.Visible = false; @@ -233,6 +255,5 @@ namespace WebsitePanel.Portal.ExchangeServer "SpaceID=" + PanelSecurity.PackageId.ToString()); } - } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs index e9012f49..a006e1fe 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -130,6 +102,15 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.Label lblCreatedValue; + /// + /// organizationStatsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel organizationStatsPanel; + /// /// locHeadStatistics control. /// @@ -292,6 +273,15 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::WebsitePanel.Portal.QuotaViewer foldersStats; + /// + /// rowExchangeStorage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow rowExchangeStorage; + /// /// lnkExchangeStorage control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxTabs.ascx.cs index 4b575d52..0b9392be 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxTabs.ascx.cs @@ -29,6 +29,8 @@ using System; using System.Collections.Generic; using WebsitePanel.Portal.Code.UserControls; +using WebsitePanel.WebPortal; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer.UserControls { @@ -49,14 +51,25 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls private void BindTabs() { + bool hideItems = false; + + UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId); + + if (user != null) + { + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) + hideItems = true; + } + List tabsList = new List(); tabsList.Add(CreateTab("edit_user", "Tab.General")); tabsList.Add(CreateTab("mailbox_settings", "Tab.Settings")); - tabsList.Add(CreateTab("mailbox_addresses", "Tab.Addresses")); - tabsList.Add(CreateTab("mailbox_mailflow", "Tab.Mailflow")); - tabsList.Add(CreateTab("mailbox_permissions", "Tab.Permissions")); + if (!hideItems) tabsList.Add(CreateTab("mailbox_addresses", "Tab.Addresses")); + if (!hideItems) tabsList.Add(CreateTab("mailbox_mailflow", "Tab.Mailflow")); + if (!hideItems) tabsList.Add(CreateTab("mailbox_permissions", "Tab.Permissions")); tabsList.Add(CreateTab("mailbox_setup", "Tab.Setup")); - tabsList.Add(CreateTab("mailbox_mobile", "Tab.Mobile")); + if (!hideItems) tabsList.Add(CreateTab("mailbox_mobile", "Tab.Mobile")); //tabsList.Add(CreateTab("mailbddox_spam", "Tab.Spam")); @@ -83,5 +96,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls "ItemID=" + PanelRequest.ItemID.ToString(), "Context=Mailbox")); } + + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs index 456a1855..d0817799 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs @@ -102,13 +102,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls set { selectedItem = value; } } - private bool CheckQouta(string key, PackageContext cntx) - { - return cntx.Quotas.ContainsKey(key) && - ((cntx.Quotas[key].QuotaAllocatedValue == 1 && cntx.Quotas[key].QuotaTypeId == 1) || - (cntx.Quotas[key].QuotaTypeId != 1 && (cntx.Quotas[key].QuotaAllocatedValue > 0 || cntx.Quotas[key].QuotaAllocatedValue == -1))); - } - + private void PrepareExchangeMenu(PackageContext cntx, List groups, string imagePath) { bool hideItems = false; @@ -117,34 +111,34 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (user != null) { - if ((user.Role == UserRole.User) & (CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) + if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) hideItems = true; } MenuGroup exchangeGroup = new MenuGroup(GetLocalizedString("Text.ExchangeGroup"), imagePath + "exchange24.png"); - if (CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx)) + if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("Mailboxes", "mailboxes")); - if (CheckQouta(Quotas.EXCHANGE2007_CONTACTS, cntx)) + if (Utils.CheckQouta(Quotas.EXCHANGE2007_CONTACTS, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("Contacts", "contacts")); - if (CheckQouta(Quotas.EXCHANGE2007_DISTRIBUTIONLISTS, cntx)) + if (Utils.CheckQouta(Quotas.EXCHANGE2007_DISTRIBUTIONLISTS, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("DistributionLists", "dlists")); - if (CheckQouta(Quotas.EXCHANGE2007_PUBLICFOLDERS, cntx)) + if (Utils.CheckQouta(Quotas.EXCHANGE2007_PUBLICFOLDERS, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("PublicFolders", "public_folders")); if (!hideItems) - if (CheckQouta(Quotas.EXCHANGE2007_ACTIVESYNCALLOWED, cntx)) + if (Utils.CheckQouta(Quotas.EXCHANGE2007_ACTIVESYNCALLOWED, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("ActiveSyncPolicy", "activesync_policy")); if (!hideItems) - if (CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx)) + if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("MailboxPlans", "mailboxplans")); if (!hideItems) - if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) + if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); if (!hideItems) @@ -163,7 +157,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (user != null) { - if ((user.Role == UserRole.User) & (CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) + if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) hideItems = true; } @@ -172,7 +166,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls MenuGroup organizationGroup = new MenuGroup(GetLocalizedString("Text.OrganizationGroup"), imagePath + "company24.png"); //if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) // organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); - if (CheckQouta(Quotas.ORGANIZATION_USERS, cntx)) + if (Utils.CheckQouta(Quotas.ORGANIZATION_USERS, cntx)) organizationGroup.MenuItems.Add(CreateMenuItem("Users", "users")); if (organizationGroup.MenuItems.Count > 0) @@ -237,7 +231,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls lyncGroup.MenuItems.Add(CreateMenuItem("LyncUserPlans", "lync_userplans")); - if (CheckQouta(Quotas.LYNC_FEDERATION, cntx)) + if (Utils.CheckQouta(Quotas.LYNC_FEDERATION, cntx)) lyncGroup.MenuItems.Add(CreateMenuItem("LyncFederationDomains", "lync_federationdomains")); groups.Add(lyncGroup); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceDetails.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceDetails.ascx.cs index 2f9fec9d..cd3a48a1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceDetails.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceDetails.ascx.cs @@ -46,6 +46,19 @@ namespace WebsitePanel.Portal protected void Page_Load(object sender, EventArgs e) { BindSpace(); + + UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId); + + if (user != null) + { + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) + { + lnkSummaryLetter.Visible = false; + } + + } + } private void BindSpace() diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs index c3e77d55..323d0be3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs @@ -76,6 +76,19 @@ namespace WebsitePanel.Portal { // bind quotas BindQuotas(); + + UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId); + + if (user != null) + { + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) + { + btnViewQuotas.Visible = lnkViewDiskspaceDetails.Visible = false; + } + + } + } private void BindQuotas() diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceTools.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceTools.ascx.cs index 5b153679..45c708bf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceTools.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceTools.ascx.cs @@ -58,6 +58,20 @@ namespace WebsitePanel.Portal lnkBackup.Visible = lnkRestore.Visible = ToolsHeader.Visible; } + + UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId); + + if (user != null) + { + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) + { + lnkBackup.Visible = lnkRestore.Visible = ToolsHeader.Visible = false; + } + + } + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountTools.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountTools.ascx.cs index 10546554..1bfe2d91 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountTools.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountTools.ascx.cs @@ -37,6 +37,9 @@ using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; +using WebsitePanel.WebPortal; +using WebsitePanel.EnterpriseServer; + namespace WebsitePanel.Portal { public partial class UserAccountTools : WebsitePanelModuleBase @@ -52,6 +55,20 @@ namespace WebsitePanel.Portal { lnkBackup.Visible = lnkRestore.Visible = ToolsHeader.Visible = false; } + + UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId); + + if (user != null) + { + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx))) + { + lnkBackup.Visible = lnkRestore.Visible = ToolsHeader.Visible = false; + } + + } + } + } } \ No newline at end of file
@@ -110,7 +112,7 @@