This commit is contained in:
dev_amdtel 2014-06-10 17:15:00 +04:00
commit 77f2e98a5f
16 changed files with 265 additions and 29 deletions

View file

@ -3210,22 +3210,26 @@ GO
IF EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.SecurityGroupManagement' AND [QuotaID] = 423)
BEGIN
UPDATE [dbo].[Quotas]
SET [QuotaDescription] = N'Security Groups',
UPDATE [dbo].[Quotas]
SET [QuotaDescription] = N'Security Groups',
[QuotaName] = N'HostedSolution.SecurityGroups',
[QuotaTypeID] = 2
WHERE [QuotaID] = 423
WHERE [QuotaID] = 423
UPDATE [dbo].[HostingPlanQuotas]
SET [QuotaValue] = -1
WHERE [QuotaID] = 423
UPDATE [dbo].[PackageQuotas]
SET [QuotaValue] = -1
WHERE [QuotaID] = 423
UPDATE [dbo].[HostingPlanQuotas]
SET [QuotaValue] = -1
WHERE [QuotaID] = 423
UPDATE [dbo].[PackageQuotas]
SET [QuotaValue] = -1
WHERE [QuotaID] = 423
END
ELSE
BEGIN
--add Security Groups Quota
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.SecurityGroups')
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (423, 13, 5, N'HostedSolution.SecurityGroups', N'Security Groups', 2, 0, NULL, NULL)
END
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetOrganizationStatistics')

View file

@ -412,7 +412,7 @@ namespace WebsitePanel.EnterpriseServer
static void PurgeCompletedTasks(object obj)
{
List<BackgroundTask> tasks = TaskController.GetTasks();
List<BackgroundTask> tasks = TaskController.GetProcessTasks(BackgroundTaskStatus.Run);
foreach (BackgroundTask task in tasks)
{

View file

@ -66,6 +66,10 @@ namespace WebsitePanel.Providers.Common
public const string UtilityPath = "UtilityPath";
public const string HandheldcleanupPath = "HandheldcleanupPath";
public const string MAPIProfile = "MAPIProfile";
public const string EnterpriseServer = "EnterpriseServer";
public const string EnterpriseServerFQDN = "EnterpriseServerFQDN";

View file

@ -42,6 +42,8 @@
public const string CANNOT_EXECUTE_COMMAND = "CANNOT_EXECUTE_COMMAND";
public const string CANNOT_EXECUTE_COMMAND_HANDHELDCLEANUP = "CANNOT_EXECUTE_COMMAND_HANDHELDCLEANUP";
public const string CANNOT_GET_BLACKBERRY_PROXY = "CANNOT_GET_BLACKBERRY_PROXY";
public const string CANNOT_ADD_BLACKBERRY_USER = "CANNOT_ADD_BLACKBERRY_USER";

View file

@ -344,7 +344,8 @@ namespace WebsitePanel.Providers.EnterpriseStorage
public override bool IsInstalled()
{
Server.Utils.OS.WindowsVersion version = WebsitePanel.Server.Utils.OS.GetVersion();
return version == WebsitePanel.Server.Utils.OS.WindowsVersion.WindowsServer2012;
return version == WebsitePanel.Server.Utils.OS.WindowsVersion.WindowsServer2012 ||
version == WebsitePanel.Server.Utils.OS.WindowsVersion.WindowsServer2012R2;
}
protected WebDavSetting GetWebDavSetting(WebDavSetting setting)

View file

@ -65,7 +65,9 @@ namespace WebsitePanel.Providers.HostedSolution
ResultObject res = HostedSolutionLog.StartLog<ResultObject>("CreateBlackBerryUser5Internal");
string file = Path.Combine(UtilityPath, "besuseradminclient.exe");
string file2 = Path.Combine(HandheldcleanupPath, "handheldcleanup.exe");
//Add user to Blackberry Server
if (!File.Exists(file))
{
HostedSolutionLog.EndLog("CreateBlackBerry5UserInternal", res, BlackBerryErrorsCodes.FILE_PATH_IS_INVALID);
@ -79,6 +81,8 @@ namespace WebsitePanel.Providers.HostedSolution
EnterpriseServer,
EnterpriseServerFQDN);
//run besuseradminclient.exe
try
{
string output;
@ -93,15 +97,46 @@ namespace WebsitePanel.Providers.HostedSolution
{
throw new ApplicationException(
string.Format("Excit code is not 0. {0}, ExitCode = {1}", output, exitCode));
string.Format("Exit code is not 0. {0}, ExitCode = {1}", output, exitCode));
}
}
catch (Exception ex)
{
HostedSolutionLog.EndLog("CreateBlackBerry5UserInternal", res, BlackBerryErrorsCodes.CANNOT_EXECUTE_COMMAND, ex);
return res;
}
//run handheldcleanup.exe
if (File.Exists(file2))
{
string arguments2 = string.Format("-u -p {0}",
MAPIProfile);
try
{
string output;
int exitCode = Execute2(file2, arguments2, out output);
if (exitCode == 0)
{
Log.WriteInfo(output);
}
else
{
throw new ApplicationException(
string.Format("Exit code is not 0. {0}, ExitCode = {1}", arguments2, output, exitCode));
}
}
catch (Exception ex)
{
HostedSolutionLog.EndLog("CreateBlackBerry5UserInternal", res, BlackBerryErrorsCodes.CANNOT_EXECUTE_COMMAND_HANDHELDCLEANUP, ex);
return res;
}
}
HostedSolutionLog.EndLog("CreateBlackBerry5UserInternal");
return res;

View file

@ -50,7 +50,20 @@ namespace WebsitePanel.Providers.HostedSolution
return ProviderSettings[Constants.UtilityPath];
}
}
public string HandheldcleanupPath
{
get
{
return ProviderSettings[Constants.HandheldcleanupPath];
}
}
public string MAPIProfile
{
get
{
return ProviderSettings[Constants.MAPIProfile];
}
}
public string Password
{
get
@ -172,6 +185,53 @@ namespace WebsitePanel.Providers.HostedSolution
return res;
}
protected int Execute2(string file, string arguments, out string output, out string error)
{
string oldDir = Directory.GetCurrentDirectory();
Directory.SetCurrentDirectory(HandheldcleanupPath);
ProcessStartInfo startInfo = new ProcessStartInfo(file, arguments);
startInfo.UseShellExecute = false;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardInput = true;
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process proc = Process.Start(startInfo);
StreamWriter inputWriter = proc.StandardInput;
inputWriter.WriteLine(EnterpriseServer);
inputWriter.Flush();
inputWriter.Close();
if (proc == null)
throw new ApplicationException("Proc is null.");
StreamReader outputReader = proc.StandardOutput;
output = outputReader.ReadToEnd();
StreamReader errorReader = proc.StandardError;
error = errorReader.ReadToEnd();
Directory.SetCurrentDirectory(oldDir);
return proc.ExitCode;
}
protected int Execute2(string file, string arguments, out string output)
{
Log.WriteInfo(file);
Log.WriteInfo(arguments);
string outputData;
string errorData;
int res = Execute2(file, arguments, out outputData, out errorData);
output = outputData.Length > 0 ? "Output stream:" + outputData : string.Empty;
output += errorData.Length > 0 ? "Error stream:" + errorData : string.Empty;
return res;
}
public ResultObject DeleteBlackBerryUser(string primaryEmailAddress)
{

View file

@ -588,6 +588,9 @@
<Module moduleDefinitionID="UserAccountMenu" title="UserMenu" container="Clear.ascx">
<ModuleData ref="UserMenu"/>
</Module>
<Module moduleDefinitionID="SpaceMenu" title="SpaceMenu" container="Clear.ascx">
<ModuleData ref="SpaceMenu"/>
</Module>
<Module moduleDefinitionID="OrganizationMenu" title="OrganizationMenu" container="Clear.ascx">
</Module>
</Content>
@ -638,11 +641,21 @@
</Content>
<Pages>
<Page name="DiskspaceReport" roles="Administrator,Reseller,PlatformCSR,ResellerCSR,PlatformHelpdesk,ResellerHelpdesk,User" skin="Browse1.ascx">
<Content id="LeftPane">
<Module moduleDefinitionID="UserAccountMenu" title="UserMenu" container="Clear.ascx">
<ModuleData ref="UserMenu"/>
</Module>
</Content>
<Content id="ContentPane">
<Module moduleDefinitionID="DiskspaceReport" title="DiskspaceReport" container="Edit.ascx" icon="table_zoom_48.png" />
</Content>
</Page>
<Page name="BandwidthReport" roles="Administrator,Reseller,PlatformCSR,ResellerCSR,PlatformHelpdesk,ResellerHelpdesk,User" skin="Browse1.ascx">
<Content id="LeftPane">
<Module moduleDefinitionID="UserAccountMenu" title="UserMenu" container="Clear.ascx">
<ModuleData ref="UserMenu"/>
</Module>
</Content>
<Content id="ContentPane">
<Module moduleDefinitionID="BandwidthReport" title="BandwidthReport" container="Edit.ascx" icon="table_zoom_48.png" />
</Content>
@ -652,26 +665,51 @@
<Page name="Configuration" roles="Administrator" enabled="false" align="left">
<Pages>
<Page name="VirtualServers" roles="Administrator" skin="Browse1.ascx">
<Content id="LeftPane">
<Module moduleDefinitionID="UserAccountMenu" title="UserMenu" container="Clear.ascx">
<ModuleData ref="UserMenu"/>
</Module>
</Content>
<Content id="ContentPane">
<Module moduleDefinitionID="VirtualServers" title="VirtualServers" container="Edit.ascx" icon="network_48.png" />
</Content>
</Page>
<Page name="Servers" roles="Administrator" skin="Browse1.ascx">
<Content id="LeftPane">
<Module moduleDefinitionID="UserAccountMenu" title="UserMenu" container="Clear.ascx">
<ModuleData ref="UserMenu"/>
</Module>
</Content>
<Content id="ContentPane">
<Module moduleDefinitionID="Servers" title="Servers" container="Edit.ascx" icon="computer_48.png" />
</Content>
</Page>
<Page name="IPAddresses" roles="Administrator" skin="Browse1.ascx">
<Content id="LeftPane">
<Module moduleDefinitionID="UserAccountMenu" title="UserMenu" container="Clear.ascx">
<ModuleData ref="UserMenu"/>
</Module>
</Content>
<Content id="ContentPane">
<Module moduleDefinitionID="IPAddresses" title="IPAddresses" container="Edit.ascx" icon="adress_48.png" />
</Content>
</Page>
<Page name="PhoneNumbers" roles="Administrator" skin="Browse1.ascx">
<Content id="LeftPane">
<Module moduleDefinitionID="UserAccountMenu" title="UserMenu" container="Clear.ascx">
<ModuleData ref="UserMenu"/>
</Module>
</Content>
<Content id="ContentPane">
<Module moduleDefinitionID="PhoneNumbers" title="PhoneNumbers" container="Edit.ascx" icon="adress_48.png" />
</Content>
</Page>
<Page name="SystemSettings" roles="Administrator" skin="Browse1.ascx">
<Content id="LeftPane">
<Module moduleDefinitionID="UserAccountMenu" title="UserMenu" container="Clear.ascx">
<ModuleData ref="UserMenu"/>
</Module>
</Content>
<Content id="ContentPane">
<Module moduleDefinitionID="SystemSettings" title="SystemSettings" container="Edit.ascx" icon="tool_48.png" />
</Content>

View file

@ -33,7 +33,9 @@
</div>
<div id="TopMenu">
<wsp:TopMenu ID="menu" runat="server" />
<wsp:TopMenu ID="leftMenu" runat="server" Align="left" />
<asp:PlaceHolder ID="LeftPane" runat="server"></asp:PlaceHolder>
<wsp:TopMenu ID="rightMenu" runat="server" Align="right" />
</div>
<div id="Top">

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

View file

@ -15,10 +15,15 @@
.TopMenu ul.AspNet-Menu ul ul
{
top: -0.3em;
top: -1em;
z-index: 502;
}
.TopMenu ul.AspNet-Menu li ul li.AspNet-Menu-WithChildren
{
cursor: pointer;
}
.TopMenu ul.AspNet-Menu li ul li.AspNet-Menu-WithChildren span
{
color: #000000 !important;
@ -47,6 +52,16 @@
background-image: none !important;
}
.TopMenu li.AspNet-Menu-Leaf a img
{
border-style:None;
height:16px;
width:16px;
border-width:0px;
padding-right: 3px;
position:relative;
}
/*
.TopMenu ul.AspNet-Menu li
{
@ -66,7 +81,6 @@
.TopMenu ul.AspNet-Menu li span
{
cursor: pointer;
color: #ffffff;
padding: 8px 25px 8px 15px;
background: transparent url(../Images/menu_popup.gif) right center no-repeat;

View file

@ -67,7 +67,7 @@ namespace WebsitePanel.Portal
MenuItem item = new MenuItem(
GetLocalizedString("Text.OrganizationHome"),
"",
"",
imagePath + "home24.png",
PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), "organization_home", "SpaceID=" + PanelSecurity.PackageId));
items.Add(item);

View file

@ -123,6 +123,12 @@
<data name="lblEnterpriseServerFQDN.Text" xml:space="preserve">
<value>BlackBerry Enterprise Server FQDN:</value>
</data>
<data name="lblHandheldcleanupPath.Text" xml:space="preserve">
<value>handheldcleanup.exe utility Path:</value>
</data>
<data name="lblMAPIProfile.Text" xml:space="preserve">
<value>BlackBerry MAPI Profile:</value>
</data>
<data name="lblPassword.Text" xml:space="preserve">
<value>Authentication password:</value>
</data>

View file

@ -8,14 +8,19 @@
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap><asp:Label runat="server" ID="Label1" meta:resourcekey="lblUser" /></td>
<td class="SubHead" width="200" nowrap><asp:Label runat="server" ID="lblHandheldcleanupPath" meta:resourcekey="lblHandheldcleanupPath" /></td>
<td>
<asp:TextBox runat="server" ID="txtHandheldcleanupPath" MaxLength="256" Width="200px" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtHandheldcleanupPath" Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap><asp:Label runat="server" ID="lblUser" meta:resourcekey="lblUser" /></td>
<td>
<asp:TextBox runat="server" ID="txtUser" MaxLength="256" Width="200px" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtUser" Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap><asp:Label runat="server" ID="lblPassword" meta:resourcekey="lblPassword" /></td>
<td>
@ -39,5 +44,12 @@
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap><asp:Label runat="server" ID="lblMAPIProfile" meta:resourcekey="lblMAPIProfile" /></td>
<td>
<asp:TextBox runat="server" ID="txtMAPIProfile" MaxLength="256" Width="200px" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtMAPIProfile" Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
</table>

View file

@ -42,9 +42,11 @@ namespace WebsitePanel.Portal.ProviderControls
public void BindSettings(StringDictionary settings)
{
txtPath.Text = settings[Constants.UtilityPath];
txtHandheldcleanupPath.Text = settings[Constants.HandheldcleanupPath];
txtPassword.Text = settings[Constants.Password];
txtEnterpriseServer.Text = settings[Constants.EnterpriseServer];
txtEnterpriseServerFQDN.Text = settings[Constants.EnterpriseServerFQDN];
txtMAPIProfile.Text = settings[Constants.MAPIProfile];
ViewState["PWD"] = settings[Constants.Password];
txtUser.Text = settings[Constants.UserName];
}
@ -52,10 +54,12 @@ namespace WebsitePanel.Portal.ProviderControls
public void SaveSettings(StringDictionary settings)
{
settings[Constants.UtilityPath] = txtPath.Text;
settings[Constants.HandheldcleanupPath] = txtHandheldcleanupPath.Text;
settings[Constants.EnterpriseServer] = txtEnterpriseServer.Text;
settings[Constants.EnterpriseServerFQDN] = txtEnterpriseServerFQDN.Text;
settings[Constants.Password] = (txtPassword.Text.Length > 0) ? txtPassword.Text : (string)ViewState["PWD"];
settings[Constants.UserName] = txtUser.Text;
settings[Constants.MAPIProfile] = txtMAPIProfile.Text;
}
}
}

View file

@ -40,13 +40,40 @@ namespace WebsitePanel.Portal.ProviderControls {
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
/// <summary>
/// Label1 control.
/// lblHandheldcleanupPath 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.Label Label1;
protected global::System.Web.UI.WebControls.Label lblHandheldcleanupPath;
/// <summary>
/// txtHandheldcleanupPath 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.TextBox txtHandheldcleanupPath;
/// <summary>
/// RequiredFieldValidator7 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.RequiredFieldValidator RequiredFieldValidator7;
/// <summary>
/// lblUser 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.Label lblUser;
/// <summary>
/// txtUser control.
@ -146,5 +173,32 @@ namespace WebsitePanel.Portal.ProviderControls {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator5;
/// <summary>
/// lblMAPIProfile 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.Label lblMAPIProfile;
/// <summary>
/// txtMAPIProfile 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.TextBox txtMAPIProfile;
/// <summary>
/// RequiredFieldValidator6 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.RequiredFieldValidator RequiredFieldValidator6;
}
}