Extended hosting plans (quotas) option to block tenant from creating and

deleting top domains.
This commit is contained in:
robvde 2012-09-10 21:26:38 +04:00
parent 2f569ccd05
commit 0b31970c71
8 changed files with 43 additions and 4 deletions

View file

@ -1590,6 +1590,9 @@
<data name="Quota.OS.FileManager" xml:space="preserve">
<value>File Manager</value>
</data>
<data name="Quota.OS.AllowTenantCreateDomains" xml:space="preserve">
<value>Tenant Top-Level Domain creation Allowed</value>
</data>
<data name="Quota.SharePoint.Groups" xml:space="preserve">
<value>SharePoint Groups</value>
</data>

View file

@ -55,6 +55,21 @@ namespace WebsitePanel.Portal
DomainLink.Enabled = (cntx.Quotas.ContainsKey(Quotas.OS_DOMAINS) && !cntx.Quotas[Quotas.OS_DOMAINS].QuotaExhausted);
if (DomainLink.Enabled)
{
UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId);
if (user != null)
{
if (user.Role == UserRole.User)
{
DomainLink.Enabled = Utils.CheckQouta(Quotas.OS_ALLOWTENANTCREATEDOMAINS, cntx);
}
}
}
DomainInfo[] myDomains = ES.Services.Servers.GetMyDomains(PanelSecurity.PackageId);
bool enableSubDomains = false;
foreach(DomainInfo domain in myDomains)

View file

@ -142,6 +142,20 @@ namespace WebsitePanel.Portal
{
ResellersPanel.Visible = true;
}
if (!(domain.IsDomainPointer || domain.IsSubDomain || domain.IsInstantAlias))
{
UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId);
if (user != null)
{
if (user.Role == UserRole.User)
{
btnDelete.Enabled = Utils.CheckQouta(Quotas.OS_ALLOWTENANTCREATEDOMAINS, cntx);
}
}
}
}
catch (Exception ex)
{