Fixed issue where peer account cannot create a mailbox

OrganizatioHome adaptive for contacts, list, folder (if 0 dont show)

Hosted Organization for consumers menu updated to show only essential
items for peers

Create Mailbox for consumers adjusted not to create room or equipment mbx

Appearance of demo account check boxes optional by putting
<HideDemoCheckbox>true</HideDemoCheckbox> in SiteSettings.config
This commit is contained in:
robvde 2012-09-03 18:41:34 +04:00
parent 02c59802db
commit b47c96bad5
11 changed files with 144 additions and 40 deletions

View file

@ -20957,9 +20957,6 @@ CREATE PROCEDURE [dbo].[GetPackages]
)
AS
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
SELECT
P.PackageID,
P.ParentPackageID,

View file

@ -5184,3 +5184,50 @@ END
DROP TABLE #TempBlackBerryUsers
GO
ALTER PROCEDURE [dbo].[GetPackages]
(
@ActorID int,
@UserID int
)
AS
SELECT
P.PackageID,
P.ParentPackageID,
P.PackageName,
P.StatusID,
P.PurchaseDate,
-- server
ISNULL(P.ServerID, 0) AS ServerID,
ISNULL(S.ServerName, 'None') AS ServerName,
ISNULL(S.Comments, '') AS ServerComments,
ISNULL(S.VirtualServer, 1) AS VirtualServer,
-- hosting plan
P.PlanID,
HP.PlanName,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.RoleID,
U.Email
FROM Packages AS P
INNER JOIN Users AS U ON P.UserID = U.UserID
INNER JOIN Servers AS S ON P.ServerID = S.ServerID
INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID
WHERE
P.UserID = @UserID
RETURN
GO

View file

@ -121,8 +121,6 @@
<td>
<asp:RadioButtonList ID="rbMailboxType" runat="server">
<asp:ListItem Value="1" Selected="true" meta:resourcekey="UserMailbox">User mailbox</asp:ListItem>
<asp:ListItem Value="5" meta:resourcekey="RoomMailbox">Room mailbox</asp:ListItem>
<asp:ListItem Value="6" meta:resourcekey="EquipmentMailbox">Equipment mailbox</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>

View file

@ -86,6 +86,8 @@ namespace WebsitePanel.Portal.ExchangeServer
if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1)
{
locSubscriberNumber.Visible = txtSubscriberNumber.Visible = valRequireSubscriberNumber.Enabled = false;
rbMailboxType.Items.Add(new System.Web.UI.WebControls.ListItem(GetLocalizedString("RoomMailbox"),"5"));
rbMailboxType.Items.Add(new System.Web.UI.WebControls.ListItem(GetLocalizedString("EquipmentMailbox"),"6"));
}
}

View file

@ -344,14 +344,5 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1;
/// <summary>
/// FormComments 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 FormComments;
}
}

View file

@ -86,7 +86,7 @@
<wsp:QuotaViewer ID="mailboxesStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">
<tr class="OrgStatsRow" id="rowContacts" runat="server">
<td align="right" nowrap>
<asp:HyperLink ID="lnkContacts" runat="server" meta:resourcekey="lnkContacts"></asp:HyperLink>
</td>
@ -94,7 +94,7 @@
<wsp:QuotaViewer ID="contactsStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">
<tr class="OrgStatsRow" id="rowLists" runat="server">
<td align="right" nowrap>
<asp:HyperLink ID="lnkLists" runat="server" meta:resourcekey="lnkLists"></asp:HyperLink>
</td>
@ -102,7 +102,7 @@
<wsp:QuotaViewer ID="listsStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow" >
<tr class="OrgStatsRow" id="rowFolders" runat="server">
<td align="right" nowrap>
<asp:HyperLink ID="lnkFolders" runat="server" meta:resourcekey="lnkFolders"></asp:HyperLink>
</td>

View file

@ -67,21 +67,34 @@ namespace WebsitePanel.Portal.ExchangeServer
mailboxesStats.QuotaValue = exchangeOrgStats.AllocatedMailboxes;
if (exchangeOrgStats.AllocatedMailboxes != -1) mailboxesStats.QuotaAvailable = exchangeTenantStats.AllocatedMailboxes - exchangeTenantStats.CreatedMailboxes;
contactsStats.QuotaUsedValue = exchangeOrgStats.CreatedContacts;
contactsStats.QuotaValue = exchangeOrgStats.AllocatedContacts;
if (exchangeOrgStats.AllocatedContacts != -1) contactsStats.QuotaAvailable = exchangeTenantStats.AllocatedContacts - exchangeTenantStats.CreatedContacts;
listsStats.QuotaUsedValue = exchangeOrgStats.CreatedDistributionLists;
listsStats.QuotaValue = exchangeOrgStats.AllocatedDistributionLists;
if (exchangeOrgStats.AllocatedDistributionLists != -1) listsStats.QuotaAvailable = exchangeTenantStats.AllocatedDistributionLists - exchangeTenantStats.CreatedDistributionLists;
if (exchangeTenantStats.AllocatedContacts == 0) this.rowContacts.Style.Add("display", "none");
else
{
contactsStats.QuotaUsedValue = exchangeOrgStats.CreatedContacts;
contactsStats.QuotaValue = exchangeOrgStats.AllocatedContacts;
if (exchangeOrgStats.AllocatedContacts != -1) contactsStats.QuotaAvailable = exchangeTenantStats.AllocatedContacts - exchangeTenantStats.CreatedContacts;
}
if (exchangeTenantStats.AllocatedDistributionLists == 0) this.rowLists.Style.Add("display", "none");
else
{
listsStats.QuotaUsedValue = exchangeOrgStats.CreatedDistributionLists;
listsStats.QuotaValue = exchangeOrgStats.AllocatedDistributionLists;
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;
foldersStats.QuotaUsedValue = exchangeOrgStats.CreatedPublicFolders;
foldersStats.QuotaValue = exchangeOrgStats.AllocatedPublicFolders;
if (exchangeOrgStats.AllocatedPublicFolders != -1) foldersStats.QuotaAvailable = exchangeTenantStats.AllocatedPublicFolders - exchangeTenantStats.CreatedPublicFolders;
if (exchangeTenantStats.AllocatedPublicFolders == 0) this.rowFolders.Style.Add("display", "none");
else
{
foldersStats.QuotaUsedValue = exchangeOrgStats.CreatedPublicFolders;
foldersStats.QuotaValue = exchangeOrgStats.AllocatedPublicFolders;
if (exchangeOrgStats.AllocatedPublicFolders != -1) foldersStats.QuotaAvailable = exchangeTenantStats.AllocatedPublicFolders - exchangeTenantStats.CreatedPublicFolders;
}
}
private void BindOrgStats()

View file

@ -183,6 +183,15 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer mailboxesStats;
/// <summary>
/// rowContacts control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow rowContacts;
/// <summary>
/// lnkContacts control.
/// </summary>
@ -201,6 +210,15 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer contactsStats;
/// <summary>
/// rowLists control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow rowLists;
/// <summary>
/// lnkLists control.
/// </summary>
@ -219,6 +237,15 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer listsStats;
/// <summary>
/// rowFolders control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow rowFolders;
/// <summary>
/// lnkFolders control.
/// </summary>

View file

@ -111,6 +111,15 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
private void PrepareExchangeMenu(PackageContext cntx, List<MenuGroup> groups, string imagePath)
{
bool hideItems = false;
UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId);
if (user != null)
{
if ((user.Role == UserRole.User) & (CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx)))
hideItems = true;
}
MenuGroup exchangeGroup = new MenuGroup(GetLocalizedString("Text.ExchangeGroup"), imagePath + "exchange24.png");
@ -126,16 +135,19 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
if (CheckQouta(Quotas.EXCHANGE2007_PUBLICFOLDERS, cntx))
exchangeGroup.MenuItems.Add(CreateMenuItem("PublicFolders", "public_folders"));
if (CheckQouta(Quotas.EXCHANGE2007_ACTIVESYNCALLOWED, cntx))
exchangeGroup.MenuItems.Add(CreateMenuItem("ActiveSyncPolicy", "activesync_policy"));
if (!hideItems)
if (CheckQouta(Quotas.EXCHANGE2007_ACTIVESYNCALLOWED, cntx))
exchangeGroup.MenuItems.Add(CreateMenuItem("ActiveSyncPolicy", "activesync_policy"));
if (CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx))
exchangeGroup.MenuItems.Add(CreateMenuItem("MailboxPlans", "mailboxplans"));
if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx))
exchangeGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains"));
if (!hideItems)
if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx))
exchangeGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains"));
exchangeGroup.MenuItems.Add(CreateMenuItem("StorageUsage", "storage_usage"));
if (!hideItems)
exchangeGroup.MenuItems.Add(CreateMenuItem("StorageUsage", "storage_usage"));
if (exchangeGroup.MenuItems.Count > 0)
groups.Add(exchangeGroup);
@ -144,14 +156,27 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
private void PrepareOrganizationMenu(PackageContext cntx, List<MenuGroup> groups, string imagePath)
{
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))
organizationGroup.MenuItems.Add(CreateMenuItem("Users", "users"));
bool hideItems = false;
if (organizationGroup.MenuItems.Count >0)
groups.Add(organizationGroup);
UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId);
if (user != null)
{
if ((user.Role == UserRole.User) & (CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx)))
hideItems = true;
}
if (!hideItems)
{
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))
organizationGroup.MenuItems.Add(CreateMenuItem("Users", "users"));
if (organizationGroup.MenuItems.Count > 0)
groups.Add(organizationGroup);
}
}

View file

@ -49,6 +49,8 @@ namespace WebsitePanel.Portal
if (!IsPostBack)
{
BindUser();
if (PortalUtils.GetHideDemoCheckbox()) chkDemo.Visible = lblDemoAccount.Visible= false;
}
}

View file

@ -40,6 +40,8 @@ namespace WebsitePanel.Portal
if (!IsPostBack)
{
BindUser();
if (PortalUtils.GetHideDemoCheckbox()) rowDemo.Visible = false;
}
}