Merge
This commit is contained in:
commit
7ef077a0ba
12 changed files with 266 additions and 35 deletions
|
@ -1670,11 +1670,11 @@ END
|
|||
GO
|
||||
|
||||
--add SecurityGroupManagement Quota
|
||||
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.SecurityGroupManagement')
|
||||
BEGIN
|
||||
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (423, 13, 5, N'HostedSolution.SecurityGroupManagement', N'Allow Security Group Management', 1, 0, NULL, NULL)
|
||||
END
|
||||
GO
|
||||
--IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.SecurityGroupManagement')
|
||||
--BEGIN
|
||||
--INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (423, 13, 5, N'HostedSolution.SecurityGroupManagement', N'Allow Security Group Management', 1, 0, NULL, NULL)
|
||||
--END
|
||||
--GO
|
||||
|
||||
-- Lync Enterprise Voice
|
||||
|
||||
|
@ -3206,6 +3206,190 @@ SET @FolderID = SCOPE_IDENTITY()
|
|||
RETURN
|
||||
GO
|
||||
|
||||
-- Security Groups Quota update
|
||||
|
||||
UPDATE [dbo].[Quotas]
|
||||
SET [QuotaDescription] = N'Security Groups',
|
||||
[QuotaName] = N'HostedSolution.SecurityGroups',
|
||||
[QuotaTypeID] = 2
|
||||
WHERE [QuotaID] = 423
|
||||
GO
|
||||
|
||||
UPDATE [dbo].[HostingPlanQuotas]
|
||||
SET [QuotaValue] = -1
|
||||
WHERE [QuotaID] = 423
|
||||
GO
|
||||
|
||||
UPDATE [dbo].[PackageQuotas]
|
||||
SET [QuotaValue] = -1
|
||||
WHERE [QuotaID] = 423
|
||||
GO
|
||||
|
||||
|
||||
|
||||
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetOrganizationStatistics')
|
||||
DROP PROCEDURE [dbo].[GetOrganizationStatistics]
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE [dbo].[GetOrganizationStatistics]
|
||||
(
|
||||
@ItemID int
|
||||
)
|
||||
AS
|
||||
SELECT
|
||||
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 7 OR AccountType = 1 OR AccountType = 6 OR AccountType = 5) AND ItemID = @ItemID) AS CreatedUsers,
|
||||
(SELECT COUNT(*) FROM ExchangeOrganizationDomains WHERE ItemID = @ItemID) AS CreatedDomains,
|
||||
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 8 OR AccountType = 9) AND ItemID = @ItemID) AS CreatedGroups
|
||||
RETURN
|
||||
GO
|
||||
|
||||
|
||||
ALTER FUNCTION [dbo].[CalculateQuotaUsage]
|
||||
(
|
||||
@PackageID int,
|
||||
@QuotaID int
|
||||
)
|
||||
RETURNS int
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
DECLARE @QuotaTypeID int
|
||||
SELECT @QuotaTypeID = QuotaTypeID FROM Quotas
|
||||
WHERE QuotaID = @QuotaID
|
||||
|
||||
IF @QuotaTypeID <> 2
|
||||
RETURN 0
|
||||
|
||||
DECLARE @Result int
|
||||
|
||||
IF @QuotaID = 52 -- diskspace
|
||||
SET @Result = dbo.CalculatePackageDiskspace(@PackageID)
|
||||
ELSE IF @QuotaID = 51 -- bandwidth
|
||||
SET @Result = dbo.CalculatePackageBandwidth(@PackageID)
|
||||
ELSE IF @QuotaID = 53 -- domains
|
||||
SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT
|
||||
INNER JOIN Domains AS D ON D.PackageID = PT.PackageID
|
||||
WHERE IsSubDomain = 0 AND IsInstantAlias = 0 AND IsDomainPointer = 0 AND PT.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 54 -- sub-domains
|
||||
SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT
|
||||
INNER JOIN Domains AS D ON D.PackageID = PT.PackageID
|
||||
WHERE IsSubDomain = 1 AND IsInstantAlias = 0 AND IsDomainPointer = 0 AND PT.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 220 -- domain pointers
|
||||
SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT
|
||||
INNER JOIN Domains AS D ON D.PackageID = PT.PackageID
|
||||
WHERE IsDomainPointer = 1 AND PT.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 71 -- scheduled tasks
|
||||
SET @Result = (SELECT COUNT(S.ScheduleID) FROM PackagesTreeCache AS PT
|
||||
INNER JOIN Schedule AS S ON S.PackageID = PT.PackageID
|
||||
WHERE PT.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 305 -- RAM of VPS
|
||||
SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
|
||||
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
|
||||
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID
|
||||
WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 306 -- HDD of VPS
|
||||
SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
|
||||
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
|
||||
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID
|
||||
WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 309 -- External IP addresses of VPS
|
||||
SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP
|
||||
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
|
||||
INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID
|
||||
WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3)
|
||||
ELSE IF @QuotaID = 100 -- Dedicated Web IP addresses
|
||||
SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP
|
||||
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
|
||||
INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID
|
||||
WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 2)
|
||||
ELSE IF @QuotaID = 350 -- RAM of VPSforPc
|
||||
SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
|
||||
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
|
||||
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID
|
||||
WHERE SIP.PropertyName = 'Memory' AND PT.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 351 -- HDD of VPSforPc
|
||||
SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
|
||||
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
|
||||
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID
|
||||
WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 354 -- External IP addresses of VPSforPc
|
||||
SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP
|
||||
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
|
||||
INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID
|
||||
WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3)
|
||||
ELSE IF @QuotaID = 319 -- BB Users
|
||||
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea
|
||||
INNER JOIN BlackBerryUsers bu ON ea.AccountID = bu.AccountID
|
||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||
WHERE pt.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 320 -- OCS Users
|
||||
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea
|
||||
INNER JOIN OCSUsers ocs ON ea.AccountID = ocs.AccountID
|
||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||
WHERE pt.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 206 -- HostedSolution.Users
|
||||
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
|
||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||
WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (1,5,6,7))
|
||||
ELSE IF @QuotaID = 78 -- Exchange2007.Mailboxes
|
||||
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
|
||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||
WHERE pt.ParentPackageID = @PackageID
|
||||
AND ea.AccountType IN (1)
|
||||
AND ea.MailboxPlanId IS NOT NULL)
|
||||
ELSE IF @QuotaID = 77 -- Exchange2007.DiskSpace
|
||||
SET @Result = (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS ea
|
||||
INNER JOIN ExchangeMailboxPlans AS B ON ea.MailboxPlanId = B.MailboxPlanId
|
||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||
WHERE pt.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 370 -- Lync.Users
|
||||
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
|
||||
INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID
|
||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||
WHERE pt.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 376 -- Lync.EVUsers
|
||||
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
|
||||
INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID
|
||||
INNER JOIN LyncUserPlans lp ON lu.LyncUserPlanId = lp.LyncUserPlanId
|
||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||
WHERE pt.ParentPackageID = @PackageID AND lp.EnterpriseVoice = 1)
|
||||
ELSE IF @QuotaID = 381 -- Dedicated Lync Phone Numbers
|
||||
SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP
|
||||
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
|
||||
INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID
|
||||
WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 5)
|
||||
ELSE IF @QuotaID = 430 -- Enterprise Storage
|
||||
SET @Result = (SELECT SUM(ESF.FolderQuota) FROM EnterpriseFolders AS ESF
|
||||
INNER JOIN ServiceItems SI ON ESF.ItemID = SI.ItemID
|
||||
INNER JOIN PackagesTreeCache PT ON SI.PackageID = PT.PackageID
|
||||
WHERE PT.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 431 -- Enterprise Storage Folders
|
||||
SET @Result = (SELECT COUNT(ESF.EnterpriseFolderID) FROM EnterpriseFolders AS ESF
|
||||
INNER JOIN ServiceItems SI ON ESF.ItemID = SI.ItemID
|
||||
INNER JOIN PackagesTreeCache PT ON SI.PackageID = PT.PackageID
|
||||
WHERE PT.ParentPackageID = @PackageID)
|
||||
ELSE IF @QuotaID = 423 -- HostedSolution.SecurityGroups
|
||||
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
|
||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||
WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (8,9))
|
||||
ELSE
|
||||
SET @Result = (SELECT COUNT(SI.ItemID) FROM Quotas AS Q
|
||||
INNER JOIN ServiceItems AS SI ON SI.ItemTypeID = Q.ItemTypeID
|
||||
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID AND PT.ParentPackageID = @PackageID
|
||||
WHERE Q.QuotaID = @QuotaID)
|
||||
|
||||
RETURN @Result
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- CRM2013
|
||||
|
|
|
@ -158,7 +158,8 @@ order by rg.groupOrder
|
|||
public const string ORGANIZATION_USERS = "HostedSolution.Users";
|
||||
public const string ORGANIZATION_DOMAINS = "HostedSolution.Domains";
|
||||
public const string ORGANIZATION_ALLOWCHANGEUPN = "HostedSolution.AllowChangeUPN";
|
||||
public const string ORGANIZATION_SECURITYGROUPMANAGEMENT = "HostedSolution.SecurityGroupManagement";
|
||||
//public const string ORGANIZATION_SECURITYGROUPMANAGEMENT = "HostedSolution.SecurityGroupManagement";
|
||||
public const string ORGANIZATION_SECURITYGROUPS = "HostedSolution.SecurityGroups";
|
||||
|
||||
public const string CRM_USERS = "HostedCRM.Users";
|
||||
public const string CRM_ORGANIZATION = "HostedCRM.Organization";
|
||||
|
|
|
@ -921,16 +921,10 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
stats.CreatedUsers = tempStats.CreatedUsers;
|
||||
stats.CreatedDomains = tempStats.CreatedDomains;
|
||||
stats.CreatedGroups = tempStats.CreatedGroups;
|
||||
|
||||
PackageContext cntxTmp = PackageController.GetPackageContext(org.PackageId);
|
||||
|
||||
if (cntxTmp.Quotas.ContainsKey(Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT) &&
|
||||
(cntxTmp.Quotas[Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT].QuotaAllocatedValue == 1 &&
|
||||
cntxTmp.Quotas[Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT].QuotaTypeId == 1))
|
||||
{
|
||||
stats.CreatedGroups = GetOrganizationSecurityGroupsPaged(org.Id, string.Empty, string.Empty, string.Empty, 0, int.MaxValue).RecordsCount;
|
||||
}
|
||||
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
{
|
||||
SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, org.Id, string.Empty, string.Empty, string.Empty, 0, 0);
|
||||
|
@ -1001,16 +995,10 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
stats.CreatedUsers += tempStats.CreatedUsers;
|
||||
stats.CreatedDomains += tempStats.CreatedDomains;
|
||||
stats.CreatedGroups += tempStats.CreatedGroups;
|
||||
|
||||
PackageContext cntxTmp = PackageController.GetPackageContext(org.PackageId);
|
||||
|
||||
if (cntxTmp.Quotas.ContainsKey(Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT) &&
|
||||
(cntxTmp.Quotas[Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT].QuotaAllocatedValue == 1 &&
|
||||
cntxTmp.Quotas[Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT].QuotaTypeId == 1))
|
||||
{
|
||||
stats.CreatedGroups = GetOrganizationSecurityGroupsPaged(org.Id, string.Empty, string.Empty, string.Empty, 0, int.MaxValue).RecordsCount;
|
||||
}
|
||||
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
{
|
||||
SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, o.Id, string.Empty, string.Empty, string.Empty, 0, 0);
|
||||
|
@ -1069,13 +1057,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
PackageContext cntx = PackageController.GetPackageContext(org.PackageId);
|
||||
stats.AllocatedUsers = cntx.Quotas[Quotas.ORGANIZATION_USERS].QuotaAllocatedValue;
|
||||
stats.AllocatedDomains = cntx.Quotas[Quotas.ORGANIZATION_DOMAINS].QuotaAllocatedValue;
|
||||
|
||||
if (cntx.Quotas.ContainsKey(Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT) &&
|
||||
(cntx.Quotas[Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT].QuotaAllocatedValue == 1 &&
|
||||
cntx.Quotas[Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT].QuotaTypeId == 1))
|
||||
{
|
||||
stats.AllocatedGroups = -1;
|
||||
}
|
||||
stats.AllocatedGroups = cntx.Quotas[Quotas.ORGANIZATION_SECURITYGROUPS].QuotaAllocatedValue;
|
||||
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
{
|
||||
|
|
|
@ -3310,8 +3310,8 @@
|
|||
<data name="Quota.HostedSolution.Domains" xml:space="preserve">
|
||||
<value>Domains per Organization</value>
|
||||
</data>
|
||||
<data name="Quota.HostedSolution.SecurityGroupManagement" xml:space="preserve">
|
||||
<value>Allow Security Group Management</value>
|
||||
<data name="Quota.HostedSolution.SecurityGroups" xml:space="preserve">
|
||||
<value>Security Groups per Organization</value>
|
||||
</data>
|
||||
<data name="ResourceGroup.Hosted SharePoint" xml:space="preserve">
|
||||
<value>Hosted SharePoint</value>
|
||||
|
|
|
@ -153,4 +153,7 @@
|
|||
<data name="gvGroupsNotes.Header" xml:space="preserve">
|
||||
<value>Notes</value>
|
||||
</data>
|
||||
<data name="locQuota.Text" xml:space="preserve">
|
||||
<value>Total Groups Created:</value>
|
||||
</data>
|
||||
</root>
|
|
@ -53,15 +53,24 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
}
|
||||
|
||||
OrganizationStatistics organizationStats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
|
||||
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
|
||||
|
||||
if (organizationStats.AllocatedEnterpriseStorageSpace != -1)
|
||||
{
|
||||
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
|
||||
|
||||
rangeFolderSize.MaximumValue = Math.Round((tenantStats.AllocatedEnterpriseStorageSpace - (decimal)tenantStats.UsedEnterpriseStorageSpace) / OneGb
|
||||
+ Utils.ParseDecimal(txtFolderSize.Text, 0), 2).ToString();
|
||||
rangeFolderSize.ErrorMessage = string.Format("The quota you’ve entered exceeds the available quota for tenant ({0}Gb)", rangeFolderSize.MaximumValue);
|
||||
}
|
||||
|
||||
if (organizationStats.AllocatedGroups != -1)
|
||||
{
|
||||
int groupsAvailable = tenantStats.AllocatedGroups - tenantStats.CreatedGroups;
|
||||
|
||||
if (groupsAvailable <= 0)
|
||||
{
|
||||
chkAddDefaultGroup.Enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
|
||||
|
||||
<div id="ExchangeContainer">
|
||||
<div class="Module">
|
||||
<div class="Left">
|
||||
</div>
|
||||
<div class="Content">
|
||||
|
|
|
@ -164,13 +164,13 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
lnkUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "users",
|
||||
"SpaceID=" + PanelSecurity.PackageId);
|
||||
|
||||
if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT, cntx))
|
||||
if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPS, cntx))
|
||||
{
|
||||
securGroupsStat.Visible = true;
|
||||
|
||||
groupStats.QuotaUsedValue = orgStats.CreatedGroups;
|
||||
groupStats.QuotaValue = orgStats.AllocatedGroups;
|
||||
if (orgStats.AllocatedUsers != -1) groupStats.QuotaAvailable = tenantStats.AllocatedGroups - tenantStats.CreatedGroups;
|
||||
if (orgStats.AllocatedGroups != -1) groupStats.QuotaAvailable = tenantStats.AllocatedGroups - tenantStats.CreatedGroups;
|
||||
|
||||
lnkGroups.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "secur_groups",
|
||||
"SpaceID=" + PanelSecurity.PackageId);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSecurityGroups.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationSecurityGroups" %>
|
||||
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %>
|
||||
|
||||
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
|
||||
|
||||
|
@ -78,6 +79,10 @@
|
|||
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<br/>
|
||||
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Total Groups Created:"></asp:Localize>
|
||||
|
||||
<wsp:QuotaViewer ID="groupsQuota" runat="server" QuotaTypeId="2" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -48,7 +48,29 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BindStats();
|
||||
}
|
||||
}
|
||||
|
||||
private void BindStats()
|
||||
{
|
||||
// quota values
|
||||
OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
|
||||
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
|
||||
groupsQuota.QuotaUsedValue = stats.CreatedGroups;
|
||||
groupsQuota.QuotaValue = stats.AllocatedGroups;
|
||||
|
||||
if (stats.AllocatedGroups != -1)
|
||||
{
|
||||
int groupsAvailable = groupsQuota.QuotaAvailable = tenantStats.AllocatedGroups - tenantStats.CreatedGroups;
|
||||
|
||||
if (groupsAvailable <= 0)
|
||||
{
|
||||
btnCreateGroup.Enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnCreateGroup_Click(object sender, EventArgs e)
|
||||
|
@ -96,6 +118,9 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
// rebind grid
|
||||
gvGroups.DataBind();
|
||||
|
||||
// bind stats
|
||||
BindStats();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -117,7 +142,10 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
gvGroups.PageSize = Convert.ToInt16(ddlPageSize.SelectedValue);
|
||||
|
||||
// rebind grid
|
||||
gvGroups.DataBind();
|
||||
gvGroups.DataBind();
|
||||
|
||||
// bind stats
|
||||
BindStats();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,5 +156,23 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsSecurityGroupsPaged;
|
||||
|
||||
/// <summary>
|
||||
/// locQuota control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locQuota;
|
||||
|
||||
/// <summary>
|
||||
/// groupsQuota control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.QuotaViewer groupsQuota;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ namespace WebsitePanel.Portal
|
|||
if (Utils.CheckQouta(Quotas.ORGANIZATION_USERS, cntx))
|
||||
items.Add(CreateMenuItem("Users", "users"));
|
||||
|
||||
if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT, cntx))
|
||||
if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPS, cntx))
|
||||
items.Add(CreateMenuItem("SecurityGroups", "secur_groups"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue