merge commit
This commit is contained in:
commit
2f8344676c
55 changed files with 9227 additions and 400 deletions
|
@ -426,10 +426,19 @@ GO
|
|||
|
||||
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Hosted MS CRM 2011')
|
||||
BEGIN
|
||||
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (1201, 21, N'CRM', N'Hosted MS CRM 2011', N'WebsitePanel.Providers.HostedSolution.CRMProvider2011, WebsitePanel.Providers.HostedSolution.CRMProvider2011', N'CRM', NULL)
|
||||
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (1201, 21, N'CRM', N'Hosted MS CRM 2011', N'WebsitePanel.Providers.HostedSolution.CRMProvider2011, WebsitePanel.Providers.HostedSolution.CRM2011', N'CRM', NULL)
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
UPDATE Providers SET ProviderType = N'WebsitePanel.Providers.HostedSolution.CRMProvider2011, WebsitePanel.Providers.HostedSolution.CRMProvider2011' WHERE ProviderID = 1201
|
||||
UPDATE Providers SET ProviderType = N'WebsitePanel.Providers.HostedSolution.CRMProvider2011, WebsitePanel.Providers.HostedSolution.CRM2011' WHERE ProviderID = 1201
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Hosted SharePoint Foundation 2013')
|
||||
BEGIN
|
||||
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery])
|
||||
VALUES (1301, 20, N'HostedSharePoint2013', N'Hosted SharePoint Foundation 2013', N'WebsitePanel.Providers.HostedSolution.HostedSharePointServer2013, WebsitePanel.Providers.HostedSolution.SharePoint2013', N'HostedSharePoint30', NULL)
|
||||
END
|
||||
GO
|
||||
|
||||
UPDATE Providers SET ProviderType = N'WebsitePanel.Providers.HostedSolution.HostedSharePointServer2013, WebsitePanel.Providers.HostedSolution.SharePoint2013' WHERE ProviderID = 1301
|
||||
GO
|
|
@ -62,6 +62,8 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
|
|||
[System.Xml.Serialization.XmlIncludeAttribute(typeof(ResultObject))]
|
||||
[System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))]
|
||||
public partial class esOrganizations : Microsoft.Web.Services3.WebServicesClientProtocol {
|
||||
|
||||
private System.Threading.SendOrPostCallback CheckOrgIdExistsOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted;
|
||||
|
||||
|
@ -117,6 +119,9 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
|
|||
public esOrganizations() {
|
||||
this.Url = "http://localhost:9002/esOrganizations.asmx";
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public event CheckOrgIdExistsCompletedEventHandler CheckOrgIdExistsCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted;
|
||||
|
@ -192,6 +197,55 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
|
|||
|
||||
/// <remarks/>
|
||||
public event GetPasswordPolicyCompletedEventHandler GetPasswordPolicyCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckOrgIdExists", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public bool CheckOrgIdExists(string orgId)
|
||||
{
|
||||
object[] results = this.Invoke("CheckOrgIdExists", new object[] {
|
||||
orgId});
|
||||
return ((bool)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginCheckOrgIdExists(string orgId, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
return this.BeginInvoke("CheckOrgIdExists", new object[] {
|
||||
orgId}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public bool EndCheckOrgIdExists(System.IAsyncResult asyncResult)
|
||||
{
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((bool)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void CheckOrgIdExistsAsync(string orgId)
|
||||
{
|
||||
this.CheckOrgIdExistsAsync(orgId, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void CheckOrgIdExistsAsync(string orgId, object userState)
|
||||
{
|
||||
if ((this.CheckOrgIdExistsOperationCompleted == null))
|
||||
{
|
||||
this.CheckOrgIdExistsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckOrgIdExistsOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("CheckOrgIdExists", new object[] {
|
||||
orgId}, this.CheckOrgIdExistsOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnCheckOrgIdExistsOperationCompleted(object arg)
|
||||
{
|
||||
if ((this.CheckOrgIdExistsCompleted != null))
|
||||
{
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.CheckOrgIdExistsCompleted(this, new CheckOrgIdExistsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
|
@ -204,6 +258,8 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
|
|||
return ((int)(results[0]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginCreateOrganization(int packageId, string organizationID, string organizationName, string domainName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("CreateOrganization", new object[] {
|
||||
|
@ -1585,6 +1641,36 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
|
|||
base.CancelAsync(userState);
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")]
|
||||
public delegate void CheckOrgIdExistsCompletedEventHandler(object sender, CheckOrgIdExistsCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class CheckOrgIdExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
|
||||
{
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal CheckOrgIdExistsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState)
|
||||
{
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public bool Result
|
||||
{
|
||||
get
|
||||
{
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((bool)(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
|
|
|
@ -265,7 +265,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return itemId;
|
||||
}
|
||||
|
||||
private static bool OrganizationIdentifierExists(string organizationId)
|
||||
public static bool OrganizationIdentifierExists(string organizationId)
|
||||
{
|
||||
return DataProvider.ExchangeOrganizationExists(organizationId);
|
||||
}
|
||||
|
|
|
@ -45,6 +45,12 @@ namespace WebsitePanel.EnterpriseServer
|
|||
{
|
||||
#region Organizations
|
||||
|
||||
[WebMethod]
|
||||
public bool CheckOrgIdExists(string orgId)
|
||||
{
|
||||
return OrganizationController.OrganizationIdentifierExists(orgId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public int CreateOrganization(int packageId, string organizationID, string organizationName, string domainName)
|
||||
{
|
||||
|
|
|
@ -56,6 +56,8 @@ namespace WebsitePanel.Providers.Web
|
|||
private bool enableAnonymousAccess;
|
||||
private bool enableWindowsAuthentication;
|
||||
private bool enableBasicAuthentication;
|
||||
private bool enableDynamicCompression;
|
||||
private bool enableStaticCompression;
|
||||
private string defaultDocs;
|
||||
private string httpRedirect;
|
||||
private HttpError[] httpErrors;
|
||||
|
@ -167,6 +169,17 @@ namespace WebsitePanel.Providers.Web
|
|||
set { this.enableBasicAuthentication = value; }
|
||||
}
|
||||
|
||||
public bool EnableDynamicCompression
|
||||
{
|
||||
get { return this.enableDynamicCompression; }
|
||||
set { this.enableDynamicCompression = value; }
|
||||
}
|
||||
public bool EnableStaticCompression
|
||||
{
|
||||
get { return this.enableStaticCompression; }
|
||||
set { this.enableStaticCompression = value; }
|
||||
}
|
||||
|
||||
public bool AspInstalled
|
||||
{
|
||||
get { return this.aspInstalled; }
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\..\Lib\References\MySQL\MySql.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="SDNSAPI">
|
||||
<HintPath>..\..\Lib\References\SimpleDNS\SDNSAPI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\..\Lib\References\MySQL\MySql.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
|
|
|
@ -58,10 +58,12 @@
|
|||
<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Administration.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Management, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Management.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Management.Ftp, Version=7.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\</OutputPath>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\Crm2011\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
@ -25,53 +25,43 @@
|
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\</OutputPath>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\Crm2011\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Crm">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Crm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Crm.Admin.AdminService">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Crm.Admin.AdminService.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="microsoft.crm.sdk.proxy">
|
||||
<HintPath>..\..\Lib\References\Microsoft\microsoft.crm.sdk.proxy.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Crm.Setup.Common">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Crm.Setup.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Crm.Setup.DatabaseInstaller">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Crm.Setup.DatabaseInstaller.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Crm.Setup.Server.Utility">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Crm.Setup.Server.Utility.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Crm.Tools.Admin.DMSnapinLib">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Crm.Tools.Admin.DMSnapinLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="microsoft.xrm.client">
|
||||
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.client.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="microsoft.xrm.client.codegeneration">
|
||||
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.client.codegeneration.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="microsoft.xrm.portal">
|
||||
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.portal.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="microsoft.xrm.portal.files">
|
||||
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.portal.files.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="microsoft.xrm.sdk">
|
||||
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.sdk.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="microsoft.xrm.sdk.deployment">
|
||||
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.sdk.deployment.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="microsoft.xrm.sdk.workflow">
|
||||
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.sdk.workflow.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
@ -82,21 +72,29 @@
|
|||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WebsitePanel.Providers.Base">
|
||||
<HintPath>..\..\Bin\WebsitePanel.Providers.Base.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WebsitePanel.Providers.HostedSolution">
|
||||
<HintPath>..\WebsitePanel.Server\bin\WebsitePanel.Providers.HostedSolution.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WebsitePanel.Server.Utils">
|
||||
<HintPath>..\WebsitePanel.Server.Utils\bin\Debug\WebsitePanel.Server.Utils.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CRMProvider2011.cs" />
|
||||
<Compile Include="myorganizationcrmsdktypes.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WebsitePanel.Providers.Base\WebsitePanel.Providers.Base.csproj">
|
||||
<Project>{684C932A-6C75-46AC-A327-F3689D89EB42}</Project>
|
||||
<Name>WebsitePanel.Providers.Base</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WebsitePanel.Providers.HostedSolution\WebsitePanel.Providers.HostedSolution.csproj">
|
||||
<Project>{A06DE5E4-4331-47E1-8F46-7B846146B559}</Project>
|
||||
<Name>WebsitePanel.Providers.HostedSolution</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WebsitePanel.Server.Utils\WebsitePanel.Server.Utils.csproj">
|
||||
<Project>{E91E52F3-9555-4D00-B577-2B1DBDD87CA7}</Project>
|
||||
<Name>WebsitePanel.Server.Utils</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\</OutputPath>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\Exchange2013\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\</OutputPath>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\Exchange2013\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
@ -34,24 +34,31 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Exchange.Common">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Exchange2013\Microsoft.Exchange.Common.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Data">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Exchange2013\Microsoft.Exchange.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Data.Directory">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Exchange2013\Microsoft.Exchange.Data.Directory.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Data.Storage">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Exchange2013\Microsoft.Exchange.Data.Storage.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Diagnostics">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Exchange2013\Microsoft.Exchange.Diagnostics.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Extensibility.Internal">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Exchange2013\Microsoft.Exchange.Extensibility.Internal.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Net">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Exchange2013\Microsoft.Exchange.Net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
@ -59,6 +66,7 @@
|
|||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Windows2012\System.Management.Automation.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
@ -74,14 +82,17 @@
|
|||
<ProjectReference Include="..\WebsitePanel.Providers.Base\WebsitePanel.Providers.Base.csproj">
|
||||
<Project>{684c932a-6c75-46ac-a327-f3689d89eb42}</Project>
|
||||
<Name>WebsitePanel.Providers.Base</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WebsitePanel.Providers.HostedSolution\WebsitePanel.Providers.HostedSolution.csproj">
|
||||
<Project>{a06de5e4-4331-47e1-8f46-7b846146b559}</Project>
|
||||
<Name>WebsitePanel.Providers.HostedSolution</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WebsitePanel.Server.Utils\WebsitePanel.Server.Utils.csproj">
|
||||
<Project>{e91e52f3-9555-4d00-b577-2b1dbdd87ca7}</Project>
|
||||
<Name>WebsitePanel.Server.Utils</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
|
|
@ -0,0 +1,327 @@
|
|||
// 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.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Microsoft.Win32;
|
||||
using WebsitePanel.Providers.SharePoint;
|
||||
using WebsitePanel.Providers.Utils;
|
||||
using WebsitePanel.Server.Utils;
|
||||
|
||||
namespace WebsitePanel.Providers.HostedSolution
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides hosted SharePoint server functionality implementation.
|
||||
/// </summary>
|
||||
public class HostedSharePointServer2013 : HostingServiceProviderBase, IHostedSharePointServer
|
||||
{
|
||||
#region Delegate
|
||||
|
||||
private delegate TReturn SharePointAction<TReturn>(HostedSharePointServer2013Impl impl);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
|
||||
protected string LanguagePacksPath;
|
||||
protected string Wss3Registry32Key;
|
||||
protected string Wss3RegistryKey;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public string BackupTemporaryFolder
|
||||
{
|
||||
get { return ProviderSettings["BackupTemporaryFolder"]; }
|
||||
}
|
||||
|
||||
public Uri RootWebApplicationUri
|
||||
{
|
||||
get { return new Uri(ProviderSettings["RootWebApplicationUri"]); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public HostedSharePointServer2013()
|
||||
{
|
||||
Wss3RegistryKey = @"SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0";
|
||||
Wss3Registry32Key = @"SOFTWARE\Wow6432Node\Microsoft\Shared Tools\Web Server Extensions\15.0";
|
||||
LanguagePacksPath = @"%commonprogramfiles%\microsoft shared\Web Server Extensions\15\HCCab\";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>Gets list of supported languages by this installation of SharePoint.</summary>
|
||||
/// <returns>List of supported languages</returns>
|
||||
public int[] GetSupportedLanguages()
|
||||
{
|
||||
var impl = new HostedSharePointServer2013Impl();
|
||||
return impl.GetSupportedLanguages(RootWebApplicationUri);
|
||||
}
|
||||
|
||||
/// <summary>Gets list of SharePoint collections within root web application.</summary>
|
||||
/// <returns>List of SharePoint collections within root web application.</returns>
|
||||
public SharePointSiteCollection[] GetSiteCollections()
|
||||
{
|
||||
return ExecuteSharePointAction(impl => impl.GetSiteCollections(RootWebApplicationUri));
|
||||
}
|
||||
|
||||
/// <summary>Gets SharePoint collection within root web application with given name.</summary>
|
||||
/// <param name="url">Url that uniquely identifies site collection to be loaded.</param>
|
||||
/// <returns>SharePoint collection within root web application with given name.</returns>
|
||||
public SharePointSiteCollection GetSiteCollection(string url)
|
||||
{
|
||||
return ExecuteSharePointAction(impl => impl.GetSiteCollection(RootWebApplicationUri, url));
|
||||
}
|
||||
|
||||
/// <summary>Creates site collection within predefined root web application.</summary>
|
||||
/// <param name="siteCollection">Information about site coolection to be created.</param>
|
||||
public void CreateSiteCollection(SharePointSiteCollection siteCollection)
|
||||
{
|
||||
ExecuteSharePointAction<object>(delegate(HostedSharePointServer2013Impl impl)
|
||||
{
|
||||
impl.CreateSiteCollection(RootWebApplicationUri, siteCollection);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Deletes site collection under given url.</summary>
|
||||
/// <param name="siteCollection">The site collection to be deleted.</param>
|
||||
public void DeleteSiteCollection(SharePointSiteCollection siteCollection)
|
||||
{
|
||||
ExecuteSharePointAction<object>(delegate(HostedSharePointServer2013Impl impl)
|
||||
{
|
||||
impl.DeleteSiteCollection(RootWebApplicationUri, siteCollection);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Backups site collection under give url.</summary>
|
||||
/// <param name="url">Url that uniquely identifies site collection to be deleted.</param>
|
||||
/// <param name="filename">Resulting backup file name.</param>
|
||||
/// <param name="zip">A value which shows whether created backup must be archived.</param>
|
||||
/// <returns>Created backup full path.</returns>
|
||||
public string BackupSiteCollection(string url, string filename, bool zip)
|
||||
{
|
||||
return ExecuteSharePointAction(impl => impl.BackupSiteCollection(RootWebApplicationUri, url, filename, zip, BackupTemporaryFolder));
|
||||
}
|
||||
|
||||
/// <summary>Restores site collection under given url from backup.</summary>
|
||||
/// <param name="siteCollection">Site collection to be restored.</param>
|
||||
/// <param name="filename">Backup file name to restore from.</param>
|
||||
public void RestoreSiteCollection(SharePointSiteCollection siteCollection, string filename)
|
||||
{
|
||||
ExecuteSharePointAction<object>(delegate(HostedSharePointServer2013Impl impl)
|
||||
{
|
||||
impl.RestoreSiteCollection(RootWebApplicationUri, siteCollection, filename);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Gets binary data chunk of specified size from specified offset.</summary>
|
||||
/// <param name="path">Path to file to get bunary data chunk from.</param>
|
||||
/// <param name="offset">Offset from which to start data reading.</param>
|
||||
/// <param name="length">Binary data chunk length.</param>
|
||||
/// <returns>Binary data chunk read from file.</returns>
|
||||
public virtual byte[] GetTempFileBinaryChunk(string path, int offset, int length)
|
||||
{
|
||||
byte[] buffer = FileUtils.GetFileBinaryChunk(path, offset, length);
|
||||
|
||||
if (buffer.Length < length)
|
||||
{
|
||||
FileUtils.DeleteFile(path);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/// <summary>Appends supplied binary data chunk to file.</summary>
|
||||
/// <param name="fileName">Non existent file name to append to.</param>
|
||||
/// <param name="path">Full path to existent file to append to.</param>
|
||||
/// <param name="chunk">Binary data chunk to append to.</param>
|
||||
/// <returns>Path to file that was appended with chunk.</returns>
|
||||
public virtual string AppendTempFileBinaryChunk(string fileName, string path, byte[] chunk)
|
||||
{
|
||||
if (path == null)
|
||||
{
|
||||
path = Path.Combine(Path.GetTempPath(), fileName);
|
||||
if (FileUtils.FileExists(path))
|
||||
{
|
||||
FileUtils.DeleteFile(path);
|
||||
}
|
||||
}
|
||||
|
||||
FileUtils.AppendFileBinaryContent(path, chunk);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
public void UpdateQuotas(string url, long maxStorage, long warningStorage)
|
||||
{
|
||||
ExecuteSharePointAction<object>(delegate(HostedSharePointServer2013Impl impl)
|
||||
{
|
||||
impl.UpdateQuotas(RootWebApplicationUri, url, maxStorage, warningStorage);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
public SharePointSiteDiskSpace[] CalculateSiteCollectionsDiskSpace(string[] urls)
|
||||
{
|
||||
return ExecuteSharePointAction(impl => impl.CalculateSiteCollectionDiskSpace(RootWebApplicationUri, urls));
|
||||
}
|
||||
|
||||
public long GetSiteCollectionSize(string url)
|
||||
{
|
||||
return ExecuteSharePointAction(impl => impl.GetSiteCollectionSize(RootWebApplicationUri, url));
|
||||
}
|
||||
|
||||
public void SetPeoplePickerOu(string site, string ou)
|
||||
{
|
||||
ExecuteSharePointAction<object>(delegate(HostedSharePointServer2013Impl impl)
|
||||
{
|
||||
impl.SetPeoplePickerOu(site, ou);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public override bool IsInstalled()
|
||||
{
|
||||
return IsSharePointInstalled();
|
||||
}
|
||||
|
||||
/// <summary>Deletes service items that represent SharePoint site collection.</summary>
|
||||
/// <param name="items">Items to be deleted.</param>
|
||||
public override void DeleteServiceItems(ServiceProviderItem[] items)
|
||||
{
|
||||
foreach (ServiceProviderItem item in items)
|
||||
{
|
||||
var sharePointSiteCollection = item as SharePointSiteCollection;
|
||||
|
||||
if (sharePointSiteCollection != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeleteSiteCollection(sharePointSiteCollection);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("Error deleting '{0}' {1}", item.Name, item.GetType().Name), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Calculates diskspace used by supplied service items.</summary>
|
||||
/// <param name="items">Service items to get diskspace usage for.</param>
|
||||
/// <returns>Calculated disk space usage statistics.</returns>
|
||||
public override ServiceProviderItemDiskSpace[] GetServiceItemsDiskSpace(ServiceProviderItem[] items)
|
||||
{
|
||||
var itemsDiskspace = new List<ServiceProviderItemDiskSpace>();
|
||||
|
||||
foreach (ServiceProviderItem item in items)
|
||||
{
|
||||
if (item is SharePointSiteCollection)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart(String.Format("Calculating '{0}' site logs size", item.Name));
|
||||
|
||||
SharePointSiteCollection site = GetSiteCollection(item.Name);
|
||||
var diskspace = new ServiceProviderItemDiskSpace {ItemId = item.Id, DiskSpace = site.Diskspace};
|
||||
itemsDiskspace.Add(diskspace);
|
||||
|
||||
Log.WriteEnd(String.Format("Calculating '{0}' site logs size", item.Name));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return itemsDiskspace.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>Checks whether SharePoint 2013 is installed.</summary>
|
||||
/// <returns>true - if it is installed; false - otherwise.</returns>
|
||||
private bool IsSharePointInstalled()
|
||||
{
|
||||
RegistryKey spKey = Registry.LocalMachine.OpenSubKey(Wss3RegistryKey);
|
||||
RegistryKey spKey32 = Registry.LocalMachine.OpenSubKey(Wss3Registry32Key);
|
||||
|
||||
if (spKey == null && spKey32 == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var spVal = (string) spKey.GetValue("SharePoint");
|
||||
|
||||
return (String.Compare(spVal, "installed", true) == 0);
|
||||
}
|
||||
|
||||
/// <summary>Executes supplied action within separate application domain.</summary>
|
||||
/// <param name="action">Action to be executed.</param>
|
||||
/// <returns>Any object that results from action execution or null if nothing is supposed to be returned.</returns>
|
||||
/// <exception cref="ArgumentNullException">Is thrown in case supplied action is null.</exception>
|
||||
private static TReturn ExecuteSharePointAction<TReturn>(SharePointAction<TReturn> action)
|
||||
{
|
||||
if (action == null)
|
||||
{
|
||||
throw new ArgumentNullException("action");
|
||||
}
|
||||
|
||||
AppDomain domain = null;
|
||||
|
||||
try
|
||||
{
|
||||
Type type = typeof (HostedSharePointServer2013Impl);
|
||||
var info = new AppDomainSetup {ApplicationBase = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory), PrivateBinPath = "bin; bin/debug"};
|
||||
domain = AppDomain.CreateDomain("WSS30", null, info);
|
||||
var impl = (HostedSharePointServer2013Impl) domain.CreateInstanceAndUnwrap(type.Assembly.FullName, type.FullName);
|
||||
|
||||
return action(impl);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (domain != null)
|
||||
{
|
||||
AppDomain.Unload(domain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,851 @@
|
|||
// 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.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Management.Automation;
|
||||
using System.Management.Automation.Runspaces;
|
||||
using System.Security.Principal;
|
||||
using Microsoft.SharePoint;
|
||||
using Microsoft.SharePoint.Administration;
|
||||
using WebsitePanel.Providers.SharePoint;
|
||||
using WebsitePanel.Providers.Utils;
|
||||
|
||||
namespace WebsitePanel.Providers.HostedSolution
|
||||
{
|
||||
public class HostedSharePointServer2013Impl : MarshalByRefObject
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private static RunspaceConfiguration runspaceConfiguration;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
private string SharepointSnapInName
|
||||
{
|
||||
get { return "Microsoft.SharePoint.Powershell"; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>Gets list of SharePoint collections within root web application.</summary>
|
||||
/// <param name="rootWebApplicationUri"> The root web application Uri. </param>
|
||||
/// <returns>List of SharePoint collections within root web application.</returns>
|
||||
public SharePointSiteCollection[] GetSiteCollections(Uri rootWebApplicationUri)
|
||||
{
|
||||
return GetSPSiteCollections(rootWebApplicationUri).Select(pair => NewSiteCollection(pair.Value)).ToArray();
|
||||
}
|
||||
|
||||
/// <summary>Gets list of supported languages by this installation of SharePoint.</summary>
|
||||
/// <param name="rootWebApplicationUri"> The root web application Uri. </param>
|
||||
/// <returns>List of supported languages</returns>
|
||||
public int[] GetSupportedLanguages(Uri rootWebApplicationUri)
|
||||
{
|
||||
var languages = new List<int>();
|
||||
|
||||
try
|
||||
{
|
||||
WindowsImpersonationContext wic = WindowsIdentity.GetCurrent().Impersonate();
|
||||
|
||||
try
|
||||
{
|
||||
languages.AddRange(from SPLanguage lang in SPRegionalSettings.GlobalInstalledLanguages select lang.LCID);
|
||||
}
|
||||
finally
|
||||
{
|
||||
wic.Undo();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new InvalidOperationException("Failed to create site collection.", ex);
|
||||
}
|
||||
|
||||
return languages.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>Gets site collection size in bytes.</summary>
|
||||
/// <param name="rootWebApplicationUri">The root web application uri.</param>
|
||||
/// <param name="url">The site collection url.</param>
|
||||
/// <returns>Size in bytes.</returns>
|
||||
public long GetSiteCollectionSize(Uri rootWebApplicationUri, string url)
|
||||
{
|
||||
Dictionary<string, long> sizes = GetSitesCollectionSize(rootWebApplicationUri, new[] {url});
|
||||
|
||||
if (sizes.Count() == 1)
|
||||
{
|
||||
return sizes.First().Value;
|
||||
}
|
||||
|
||||
throw new ApplicationException(string.Format("SiteCollection {0} does not exist", url));
|
||||
}
|
||||
|
||||
/// <summary>Gets sites disk space.</summary>
|
||||
/// <param name="rootWebApplicationUri">The root web application uri.</param>
|
||||
/// <param name="urls">The sites urls.</param>
|
||||
/// <returns>The disk space.</returns>
|
||||
public SharePointSiteDiskSpace[] CalculateSiteCollectionDiskSpace(Uri rootWebApplicationUri, string[] urls)
|
||||
{
|
||||
return GetSitesCollectionSize(rootWebApplicationUri, urls).Select(pair => new SharePointSiteDiskSpace {Url = pair.Key, DiskSpace = (long) Math.Round(pair.Value/1024.0/1024.0)}).ToArray();
|
||||
}
|
||||
|
||||
/// <summary>Calculates size of the required seti collections.</summary>
|
||||
/// <param name="rootWebApplicationUri">The root web application uri.</param>
|
||||
/// <param name="urls">The sites urls.</param>
|
||||
/// <returns>Calculated sizes.</returns>
|
||||
private Dictionary<string, long> GetSitesCollectionSize(Uri rootWebApplicationUri, IEnumerable<string> urls)
|
||||
{
|
||||
Runspace runspace = null;
|
||||
var result = new Dictionary<string, long>();
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
|
||||
foreach (string url in urls)
|
||||
{
|
||||
string siteCollectionUrl = String.Format("{0}:{1}", url, rootWebApplicationUri.Port);
|
||||
var scripts = new List<string> {string.Format("$site=Get-SPSite -Identity \"{0}\"", siteCollectionUrl), "$site.RecalculateStorageUsed()", "$site.Usage.Storage"};
|
||||
Collection<PSObject> scriptResult = ExecuteShellCommand(runspace, scripts);
|
||||
|
||||
if (scriptResult != null && scriptResult.Any())
|
||||
{
|
||||
result.Add(url, Convert.ToInt64(scriptResult.First().BaseObject));
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>Sets people picker OU.</summary>
|
||||
/// <param name="site">The site.</param>
|
||||
/// <param name="ou">OU.</param>
|
||||
public void SetPeoplePickerOu(string site, string ou)
|
||||
{
|
||||
HostedSolutionLog.LogStart("SetPeoplePickerOu");
|
||||
HostedSolutionLog.LogInfo(" Site: {0}", site);
|
||||
HostedSolutionLog.LogInfo(" OU: {0}", ou);
|
||||
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
var cmd = new Command("Set-SPSite");
|
||||
cmd.Parameters.Add("Identity", site);
|
||||
cmd.Parameters.Add("UserAccountDirectoryPath", ou);
|
||||
ExecuteShellCommand(runspace, cmd);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("SetPeoplePickerOu");
|
||||
}
|
||||
|
||||
/// <summary>Gets SharePoint collection within root web application with given name.</summary>
|
||||
/// <param name="rootWebApplicationUri">Root web application uri.</param>
|
||||
/// <param name="url">Url that uniquely identifies site collection to be loaded.</param>
|
||||
/// <returns>SharePoint collection within root web application with given name.</returns>
|
||||
public SharePointSiteCollection GetSiteCollection(Uri rootWebApplicationUri, string url)
|
||||
{
|
||||
return NewSiteCollection(GetSPSiteCollection(rootWebApplicationUri, url));
|
||||
}
|
||||
|
||||
/// <summary>Deletes quota.</summary>
|
||||
/// <param name="name">The quota name.</param>
|
||||
private static void DeleteQuotaTemplate(string name)
|
||||
{
|
||||
SPFarm farm = SPFarm.Local;
|
||||
|
||||
var webService = farm.Services.GetValue<SPWebService>("");
|
||||
SPQuotaTemplateCollection quotaColl = webService.QuotaTemplates;
|
||||
quotaColl.Delete(name);
|
||||
}
|
||||
|
||||
/// <summary>Updates site collection quota.</summary>
|
||||
/// <param name="root">The root uri.</param>
|
||||
/// <param name="url">The site collection url.</param>
|
||||
/// <param name="maxStorage">The max storage.</param>
|
||||
/// <param name="warningStorage">The warning storage value.</param>
|
||||
public void UpdateQuotas(Uri root, string url, long maxStorage, long warningStorage)
|
||||
{
|
||||
if (maxStorage != -1)
|
||||
{
|
||||
maxStorage = maxStorage*1024*1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
maxStorage = 0;
|
||||
}
|
||||
|
||||
if (warningStorage != -1 && maxStorage != -1)
|
||||
{
|
||||
warningStorage = Math.Min(warningStorage, maxStorage)*1024*1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
warningStorage = 0;
|
||||
}
|
||||
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
GrantAccess(runspace, root);
|
||||
string siteCollectionUrl = String.Format("{0}:{1}", url, root.Port);
|
||||
var command = new Command("Set-SPSite");
|
||||
command.Parameters.Add("Identity", siteCollectionUrl);
|
||||
command.Parameters.Add("MaxSize", maxStorage);
|
||||
command.Parameters.Add("WarningSize", warningStorage);
|
||||
ExecuteShellCommand(runspace, command);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Grants acces to current user.</summary>
|
||||
/// <param name="runspace">The runspace.</param>
|
||||
/// <param name="rootWebApplicationUri">The root web application uri.</param>
|
||||
private void GrantAccess(Runspace runspace, Uri rootWebApplicationUri)
|
||||
{
|
||||
ExecuteShellCommand(runspace, new List<string> {string.Format("$webApp=Get-SPWebApplication {0}", rootWebApplicationUri.AbsoluteUri), string.Format("$webApp.GrantAccessToProcessIdentity(\"{0}\")", WindowsIdentity.GetCurrent().Name)});
|
||||
}
|
||||
|
||||
/// <summary>Deletes site collection.</summary>
|
||||
/// <param name="runspace">The runspace.</param>
|
||||
/// <param name="url">The site collection url.</param>
|
||||
/// <param name="deleteADAccounts">True - if active directory accounts should be deleted.</param>
|
||||
private void DeleteSiteCollection(Runspace runspace, string url, bool deleteADAccounts)
|
||||
{
|
||||
var command = new Command("Remove-SPSite");
|
||||
command.Parameters.Add("Identity", url);
|
||||
command.Parameters.Add("DeleteADAccounts", deleteADAccounts);
|
||||
ExecuteShellCommand(runspace, command);
|
||||
}
|
||||
|
||||
/// <summary> Creates site collection within predefined root web application.</summary>
|
||||
/// <param name="rootWebApplicationUri">Root web application uri.</param>
|
||||
/// <param name="siteCollection">Information about site coolection to be created.</param>
|
||||
/// <exception cref="InvalidOperationException">Is thrown in case requested operation fails for any reason.</exception>
|
||||
public void CreateSiteCollection(Uri rootWebApplicationUri, SharePointSiteCollection siteCollection)
|
||||
{
|
||||
HostedSolutionLog.LogStart("CreateSiteCollection");
|
||||
WindowsImpersonationContext wic = null;
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
wic = WindowsIdentity.GetCurrent().Impersonate();
|
||||
runspace = OpenRunspace();
|
||||
CreateCollection(runspace, rootWebApplicationUri, siteCollection);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
HostedSolutionLog.LogEnd("CreateSiteCollection");
|
||||
|
||||
if (wic != null)
|
||||
{
|
||||
wic.Undo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Creates site collection within predefined root web application.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <param name="rootWebApplicationUri">Root web application uri.</param>
|
||||
/// <param name="siteCollection">Information about site coolection to be created.</param>
|
||||
/// <exception cref="InvalidOperationException">Is thrown in case requested operation fails for any reason.</exception>
|
||||
private void CreateCollection(Runspace runspace, Uri rootWebApplicationUri, SharePointSiteCollection siteCollection)
|
||||
{
|
||||
string siteCollectionUrl = String.Format("{0}:{1}", siteCollection.Url, rootWebApplicationUri.Port);
|
||||
HostedSolutionLog.DebugInfo("siteCollectionUrl: {0}", siteCollectionUrl);
|
||||
|
||||
try
|
||||
{
|
||||
SPWebApplication rootWebApplication = SPWebApplication.Lookup(rootWebApplicationUri);
|
||||
rootWebApplication.Sites.Add(siteCollectionUrl, siteCollection.Title, siteCollection.Description, (uint) siteCollection.LocaleId, String.Empty, siteCollection.OwnerLogin, siteCollection.OwnerName, siteCollection.OwnerEmail, null, null, null, true);
|
||||
rootWebApplication.Update();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
DeleteSiteCollection(runspace, siteCollectionUrl, true);
|
||||
throw;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
GrantAccess(runspace, rootWebApplicationUri);
|
||||
var command = new Command("Set-SPSite");
|
||||
command.Parameters.Add("Identity", siteCollectionUrl);
|
||||
|
||||
if (siteCollection.MaxSiteStorage != -1)
|
||||
{
|
||||
command.Parameters.Add("MaxSize", siteCollection.MaxSiteStorage*1024*1024);
|
||||
}
|
||||
|
||||
if (siteCollection.WarningStorage != -1 && siteCollection.MaxSiteStorage != -1)
|
||||
{
|
||||
command.Parameters.Add("WarningSize", Math.Min(siteCollection.WarningStorage, siteCollection.MaxSiteStorage)*1024*1024);
|
||||
}
|
||||
|
||||
ExecuteShellCommand(runspace, command);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
DeleteQuotaTemplate(siteCollection.Title);
|
||||
DeleteSiteCollection(runspace, siteCollectionUrl, true);
|
||||
throw;
|
||||
}
|
||||
|
||||
AddHostsRecord(siteCollection);
|
||||
}
|
||||
|
||||
/// <summary>Deletes site collection under given url.</summary>
|
||||
/// <param name="rootWebApplicationUri">Root web application uri.</param>
|
||||
/// <param name="siteCollection">The site collection to be deleted.</param>
|
||||
/// <exception cref="InvalidOperationException">Is thrown in case requested operation fails for any reason.</exception>
|
||||
public void DeleteSiteCollection(Uri rootWebApplicationUri, SharePointSiteCollection siteCollection)
|
||||
{
|
||||
HostedSolutionLog.LogStart("DeleteSiteCollection");
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
string siteCollectionUrl = String.Format("{0}:{1}", siteCollection.Url, rootWebApplicationUri.Port);
|
||||
HostedSolutionLog.DebugInfo("siteCollectionUrl: {0}", siteCollectionUrl);
|
||||
runspace = OpenRunspace();
|
||||
DeleteSiteCollection(runspace, siteCollectionUrl, false);
|
||||
RemoveHostsRecord(siteCollection);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new InvalidOperationException("Failed to delete site collection.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
HostedSolutionLog.LogEnd("DeleteSiteCollection");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Backups site collection under give url.</summary>
|
||||
/// <param name="rootWebApplicationUri">Root web application uri.</param>
|
||||
/// <param name="url">Url that uniquely identifies site collection to be deleted.</param>
|
||||
/// <param name="filename">Resulting backup file name.</param>
|
||||
/// <param name="zip">A value which shows whether created backup must be archived.</param>
|
||||
/// <param name="tempPath">Custom temp path for backup</param>
|
||||
/// <returns>Full path to created backup.</returns>
|
||||
/// <exception cref="InvalidOperationException">Is thrown in case requested operation fails for any reason.</exception>
|
||||
public string BackupSiteCollection(Uri rootWebApplicationUri, string url, string filename, bool zip, string tempPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
string siteCollectionUrl = String.Format("{0}:{1}", url, rootWebApplicationUri.Port);
|
||||
HostedSolutionLog.LogStart("BackupSiteCollection");
|
||||
HostedSolutionLog.DebugInfo("siteCollectionUrl: {0}", siteCollectionUrl);
|
||||
|
||||
if (String.IsNullOrEmpty(tempPath))
|
||||
{
|
||||
tempPath = Path.GetTempPath();
|
||||
}
|
||||
|
||||
string backupFileName = Path.Combine(tempPath, (zip ? StringUtils.CleanIdentifier(siteCollectionUrl) + ".bsh" : StringUtils.CleanIdentifier(filename)));
|
||||
HostedSolutionLog.DebugInfo("backupFilePath: {0}", backupFileName);
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
var command = new Command("Backup-SPSite");
|
||||
command.Parameters.Add("Identity", siteCollectionUrl);
|
||||
command.Parameters.Add("Path", backupFileName);
|
||||
ExecuteShellCommand(runspace, command);
|
||||
|
||||
if (zip)
|
||||
{
|
||||
string zipFile = Path.Combine(tempPath, filename);
|
||||
string zipRoot = Path.GetDirectoryName(backupFileName);
|
||||
|
||||
FileUtils.ZipFiles(zipFile, zipRoot, new[] {Path.GetFileName(backupFileName)});
|
||||
FileUtils.DeleteFile(backupFileName);
|
||||
|
||||
backupFileName = zipFile;
|
||||
}
|
||||
|
||||
return backupFileName;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
HostedSolutionLog.LogEnd("BackupSiteCollection");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new InvalidOperationException("Failed to backup site collection.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Restores site collection under given url from backup.</summary>
|
||||
/// <param name="rootWebApplicationUri">Root web application uri.</param>
|
||||
/// <param name="siteCollection">Site collection to be restored.</param>
|
||||
/// <param name="filename">Backup file name to restore from.</param>
|
||||
/// <exception cref="InvalidOperationException">Is thrown in case requested operation fails for any reason.</exception>
|
||||
public void RestoreSiteCollection(Uri rootWebApplicationUri, SharePointSiteCollection siteCollection, string filename)
|
||||
{
|
||||
string url = siteCollection.Url;
|
||||
|
||||
try
|
||||
{
|
||||
string siteCollectionUrl = String.Format("{0}:{1}", url, rootWebApplicationUri.Port);
|
||||
HostedSolutionLog.LogStart("RestoreSiteCollection");
|
||||
HostedSolutionLog.DebugInfo("siteCollectionUrl: {0}", siteCollectionUrl);
|
||||
|
||||
HostedSolutionLog.DebugInfo("backupFilePath: {0}", filename);
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
string tempPath = Path.GetTempPath();
|
||||
string expandedFile = filename;
|
||||
|
||||
if (Path.GetExtension(filename).ToLower() == ".zip")
|
||||
{
|
||||
expandedFile = FileUtils.UnzipFiles(filename, tempPath)[0];
|
||||
|
||||
// Delete zip archive.
|
||||
FileUtils.DeleteFile(filename);
|
||||
}
|
||||
|
||||
runspace = OpenRunspace();
|
||||
DeleteSiteCollection(runspace, siteCollectionUrl, false);
|
||||
var command = new Command("Restore-SPSite");
|
||||
command.Parameters.Add("Identity", siteCollectionUrl);
|
||||
command.Parameters.Add("Path", filename);
|
||||
ExecuteShellCommand(runspace, command);
|
||||
|
||||
command = new Command("Set-SPSite");
|
||||
command.Parameters.Add("Identity", siteCollectionUrl);
|
||||
command.Parameters.Add("OwnerAlias", siteCollection.OwnerLogin);
|
||||
ExecuteShellCommand(runspace, command);
|
||||
|
||||
command = new Command("Set-SPUser");
|
||||
command.Parameters.Add("Identity", siteCollection.OwnerLogin);
|
||||
command.Parameters.Add("Email", siteCollection.OwnerEmail);
|
||||
command.Parameters.Add("DisplayName", siteCollection.Name);
|
||||
ExecuteShellCommand(runspace, command);
|
||||
|
||||
FileUtils.DeleteFile(expandedFile);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
HostedSolutionLog.LogEnd("RestoreSiteCollection");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new InvalidOperationException("Failed to restore site collection.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Creates new site collection with information from administration object.</summary>
|
||||
/// <param name="site">Administration object.</param>
|
||||
private static SharePointSiteCollection NewSiteCollection(SPSite site)
|
||||
{
|
||||
var siteUri = new Uri(site.Url);
|
||||
string url = (siteUri.Port > 0) ? site.Url.Replace(String.Format(":{0}", siteUri.Port), String.Empty) : site.Url;
|
||||
|
||||
return new SharePointSiteCollection {Url = url, OwnerLogin = site.Owner.LoginName, OwnerName = site.Owner.Name, OwnerEmail = site.Owner.Email, LocaleId = site.RootWeb.Locale.LCID, Title = site.RootWeb.Title, Description = site.RootWeb.Description, Bandwidth = site.Usage.Bandwidth, Diskspace = site.Usage.Storage, MaxSiteStorage = site.Quota.StorageMaximumLevel, WarningStorage = site.Quota.StorageWarningLevel};
|
||||
}
|
||||
|
||||
/// <summary>Gets SharePoint sites collection.</summary>
|
||||
/// <param name="rootWebApplicationUri">The root web application uri.</param>
|
||||
/// <returns>The SharePoint sites.</returns>
|
||||
private Dictionary<string, SPSite> GetSPSiteCollections(Uri rootWebApplicationUri)
|
||||
{
|
||||
Runspace runspace = null;
|
||||
var collections = new Dictionary<string, SPSite>();
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
var cmd = new Command("Get-SPSite");
|
||||
cmd.Parameters.Add("WebApplication", rootWebApplicationUri.AbsoluteUri);
|
||||
Collection<PSObject> result = ExecuteShellCommand(runspace, cmd);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
foreach (PSObject psObject in result)
|
||||
{
|
||||
var spSite = psObject.BaseObject as SPSite;
|
||||
|
||||
if (spSite != null)
|
||||
{
|
||||
collections.Add(spSite.Url, spSite);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
return collections;
|
||||
}
|
||||
|
||||
/// <summary>Gets SharePoint site collection.</summary>
|
||||
/// <param name="rootWebApplicationUri">The root web application uri.</param>
|
||||
/// <param name="url">The required site url.</param>
|
||||
/// <returns>The SharePoint sites.</returns>
|
||||
private SPSite GetSPSiteCollection(Uri rootWebApplicationUri, string url)
|
||||
{
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
string siteCollectionUrl = String.Format("{0}:{1}", url, rootWebApplicationUri.Port);
|
||||
runspace = OpenRunspace();
|
||||
var cmd = new Command("Get-SPSite");
|
||||
cmd.Parameters.Add("Identity", siteCollectionUrl);
|
||||
Collection<PSObject> result = ExecuteShellCommand(runspace, cmd);
|
||||
|
||||
if (result != null && result.Count() == 1)
|
||||
{
|
||||
var spSite = result.First().BaseObject as SPSite;
|
||||
|
||||
if (spSite == null)
|
||||
{
|
||||
throw new ApplicationException(string.Format("SiteCollection {0} does not exist", url));
|
||||
}
|
||||
|
||||
return result.First().BaseObject as SPSite;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ApplicationException(string.Format("SiteCollection {0} does not exist", url));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError(ex);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Opens PowerShell runspace.</summary>
|
||||
/// <returns>The runspace.</returns>
|
||||
private Runspace OpenRunspace()
|
||||
{
|
||||
HostedSolutionLog.LogStart("OpenRunspace");
|
||||
|
||||
if (runspaceConfiguration == null)
|
||||
{
|
||||
runspaceConfiguration = RunspaceConfiguration.Create();
|
||||
PSSnapInException exception;
|
||||
runspaceConfiguration.AddPSSnapIn(SharepointSnapInName, out exception);
|
||||
HostedSolutionLog.LogInfo("Sharepoint snapin loaded");
|
||||
|
||||
if (exception != null)
|
||||
{
|
||||
HostedSolutionLog.LogWarning("SnapIn error", exception);
|
||||
}
|
||||
}
|
||||
|
||||
Runspace runspace = RunspaceFactory.CreateRunspace(runspaceConfiguration);
|
||||
runspace.Open();
|
||||
runspace.SessionStateProxy.SetVariable("ConfirmPreference", "none");
|
||||
HostedSolutionLog.LogEnd("OpenRunspace");
|
||||
|
||||
return runspace;
|
||||
}
|
||||
|
||||
/// <summary>Closes runspace.</summary>
|
||||
/// <param name="runspace">The runspace.</param>
|
||||
private void CloseRunspace(Runspace runspace)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (runspace != null && runspace.RunspaceStateInfo.State == RunspaceState.Opened)
|
||||
{
|
||||
runspace.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("Runspace error", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Executes shell command.</summary>
|
||||
/// <param name="runspace">The runspace.</param>
|
||||
/// <param name="cmd">The command to be executed.</param>
|
||||
/// <returns>PSobjecs collection.</returns>
|
||||
private Collection<PSObject> ExecuteShellCommand(Runspace runspace, object cmd)
|
||||
{
|
||||
object[] errors;
|
||||
var command = cmd as Command;
|
||||
|
||||
if (command != null)
|
||||
{
|
||||
return ExecuteShellCommand(runspace, command, out errors);
|
||||
}
|
||||
|
||||
return ExecuteShellCommand(runspace, cmd as List<string>, out errors);
|
||||
}
|
||||
|
||||
/// <summary>Executes shell command.</summary>
|
||||
/// <param name="runspace">The runspace.</param>
|
||||
/// <param name="cmd">The command to be executed.</param>
|
||||
/// <param name="errors">The errors.</param>
|
||||
/// <returns>PSobjecs collection.</returns>
|
||||
private Collection<PSObject> ExecuteShellCommand(Runspace runspace, Command cmd, out object[] errors)
|
||||
{
|
||||
HostedSolutionLog.LogStart("ExecuteShellCommand");
|
||||
var errorList = new List<object>();
|
||||
Collection<PSObject> results;
|
||||
|
||||
using (Pipeline pipeLine = runspace.CreatePipeline())
|
||||
{
|
||||
pipeLine.Commands.Add(cmd);
|
||||
results = pipeLine.Invoke();
|
||||
|
||||
if (pipeLine.Error != null && pipeLine.Error.Count > 0)
|
||||
{
|
||||
foreach (object item in pipeLine.Error.ReadToEnd())
|
||||
{
|
||||
errorList.Add(item);
|
||||
string errorMessage = string.Format("Invoke error: {0}", item);
|
||||
HostedSolutionLog.LogWarning(errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
errors = errorList.ToArray();
|
||||
HostedSolutionLog.LogEnd("ExecuteShellCommand");
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
/// <summary>Executes shell command.</summary>
|
||||
/// <param name="runspace">The runspace.</param>
|
||||
/// <param name="scripts">The scripts to be executed.</param>
|
||||
/// <param name="errors">The errors.</param>
|
||||
/// <returns>PSobjecs collection.</returns>
|
||||
private Collection<PSObject> ExecuteShellCommand(Runspace runspace, List<string> scripts, out object[] errors)
|
||||
{
|
||||
HostedSolutionLog.LogStart("ExecuteShellCommand");
|
||||
var errorList = new List<object>();
|
||||
Collection<PSObject> results;
|
||||
|
||||
using (Pipeline pipeLine = runspace.CreatePipeline())
|
||||
{
|
||||
foreach (string script in scripts)
|
||||
{
|
||||
pipeLine.Commands.AddScript(script);
|
||||
}
|
||||
|
||||
results = pipeLine.Invoke();
|
||||
|
||||
if (pipeLine.Error != null && pipeLine.Error.Count > 0)
|
||||
{
|
||||
foreach (object item in pipeLine.Error.ReadToEnd())
|
||||
{
|
||||
errorList.Add(item);
|
||||
string errorMessage = string.Format("Invoke error: {0}", item);
|
||||
HostedSolutionLog.LogWarning(errorMessage);
|
||||
|
||||
throw new ArgumentException(scripts.First());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
errors = errorList.ToArray();
|
||||
HostedSolutionLog.LogEnd("ExecuteShellCommand");
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
/// <summary>Adds record to hosts file.</summary>
|
||||
/// <param name="siteCollection">The site collection object.</param>
|
||||
public void AddHostsRecord(SharePointSiteCollection siteCollection)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (siteCollection.RootWebApplicationInteralIpAddress != string.Empty)
|
||||
{
|
||||
string dirPath = FileUtils.EvaluateSystemVariables(@"%windir%\system32\drivers\etc");
|
||||
string path = dirPath + "\\hosts";
|
||||
|
||||
if (FileUtils.FileExists(path))
|
||||
{
|
||||
string content = FileUtils.GetFileTextContent(path);
|
||||
content = content.Replace("\r\n", "\n").Replace("\n\r", "\n");
|
||||
string[] contentArr = content.Split(new[] {'\n'});
|
||||
bool bRecordExist = false;
|
||||
|
||||
foreach (string s in contentArr)
|
||||
{
|
||||
if (s != string.Empty)
|
||||
{
|
||||
string hostName = string.Empty;
|
||||
|
||||
if (s[0] != '#')
|
||||
{
|
||||
bool bSeperator = false;
|
||||
|
||||
foreach (char c in s)
|
||||
{
|
||||
if ((c != ' ') & (c != '\t'))
|
||||
{
|
||||
if (bSeperator)
|
||||
{
|
||||
hostName += c;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bSeperator = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hostName.ToLower() == siteCollection.RootWebApplicationFQDN.ToLower())
|
||||
{
|
||||
bRecordExist = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bRecordExist)
|
||||
{
|
||||
string outPut = contentArr.Where(o => o != string.Empty).Aggregate(string.Empty, (current, o) => current + (o + "\r\n"));
|
||||
outPut += siteCollection.RootWebApplicationInteralIpAddress + '\t' + siteCollection.RootWebApplicationFQDN + "\r\n";
|
||||
FileUtils.UpdateFileTextContent(path, outPut);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Removes record from hosts file.</summary>
|
||||
/// <param name="siteCollection">The site collection object.</param>
|
||||
private void RemoveHostsRecord(SharePointSiteCollection siteCollection)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (siteCollection.RootWebApplicationInteralIpAddress != string.Empty)
|
||||
{
|
||||
string dirPath = FileUtils.EvaluateSystemVariables(@"%windir%\system32\drivers\etc");
|
||||
string path = dirPath + "\\hosts";
|
||||
|
||||
if (FileUtils.FileExists(path))
|
||||
{
|
||||
string content = FileUtils.GetFileTextContent(path);
|
||||
content = content.Replace("\r\n", "\n").Replace("\n\r", "\n");
|
||||
string[] contentArr = content.Split(new[] {'\n'});
|
||||
string outPut = string.Empty;
|
||||
|
||||
foreach (string s in contentArr)
|
||||
{
|
||||
if (s != string.Empty)
|
||||
{
|
||||
string hostName = string.Empty;
|
||||
|
||||
if (s[0] != '#')
|
||||
{
|
||||
bool bSeperator = false;
|
||||
|
||||
foreach (char c in s)
|
||||
{
|
||||
if ((c != ' ') & (c != '\t'))
|
||||
{
|
||||
if (bSeperator)
|
||||
{
|
||||
hostName += c;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bSeperator = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hostName.ToLower() != siteCollection.RootWebApplicationFQDN.ToLower())
|
||||
{
|
||||
outPut += s + "\r\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
outPut += s + "\r\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FileUtils.UpdateFileTextContent(path, outPut);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
// 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.
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("WebsitePanel.Providers.HostedSolution.SharePoint2013")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("WebsitePanel.Providers.HostedSolution.SharePoint2013")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("9bb9c655-3db4-4ca4-b856-1bce9cd727ba")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{24762DC8-6078-4F10-A524-C94ED59BD5D1}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>WebsitePanel.Providers.HostedSolution.SharePoint2013</RootNamespace>
|
||||
<AssemblyName>WebsitePanel.Providers.HostedSolution.SharePoint2013</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\Sharepoint2013\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\Sharepoint2013\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.SharePoint.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="HostedSharePointServer2013.cs" />
|
||||
<Compile Include="HostedSharePointServer2013Impl.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WebsitePanel.Providers.Base\WebsitePanel.Providers.Base.csproj">
|
||||
<Project>{684C932A-6C75-46AC-A327-F3689D89EB42}</Project>
|
||||
<Name>WebsitePanel.Providers.Base</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WebsitePanel.Providers.HostedSolution\WebsitePanel.Providers.HostedSolution.csproj">
|
||||
<Project>{A06DE5E4-4331-47E1-8F46-7B846146B559}</Project>
|
||||
<Name>WebsitePanel.Providers.HostedSolution</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WebsitePanel.Server.Utils\WebsitePanel.Server.Utils.csproj">
|
||||
<Project>{E91E52F3-9555-4D00-B577-2B1DBDD87CA7}</Project>
|
||||
<Name>WebsitePanel.Server.Utils</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -65,6 +65,7 @@
|
|||
</Reference>
|
||||
<Reference Include="Microsoft.Crm.Setup.Common">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Crm.Setup.Common.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Crm.Setup.DatabaseInstaller">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Crm.Setup.DatabaseInstaller.dll</HintPath>
|
||||
|
@ -81,39 +82,49 @@
|
|||
<Reference Include="Microsoft.Exchange.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Exchange.Common.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Data, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Exchange.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Data.Directory, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Exchange.Data.Directory.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Data.Storage, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Exchange.Data.Storage.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Diagnostics, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Exchange.Diagnostics.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Extensibility.Internal, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Exchange.Extensibility.Internal.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Exchange.Net, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Exchange.Net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rtc.Management.Core">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rtc.Management.Hosted">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.Hosted.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rtc.Management.WritableConfig">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.WritableConfig.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.SharePoint">
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.SharePoint.dll</HintPath>
|
||||
|
@ -183,10 +194,12 @@
|
|||
<ProjectReference Include="..\WebsitePanel.Providers.Base\WebsitePanel.Providers.Base.csproj">
|
||||
<Project>{684C932A-6C75-46AC-A327-F3689D89EB42}</Project>
|
||||
<Name>WebsitePanel.Providers.Base</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WebsitePanel.Server.Utils\WebsitePanel.Server.Utils.csproj">
|
||||
<Project>{E91E52F3-9555-4D00-B577-2B1DBDD87CA7}</Project>
|
||||
<Name>WebsitePanel.Server.Utils</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
// 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.
|
||||
|
||||
using System;
|
||||
using Microsoft.Web.Administration;
|
||||
using Microsoft.Web.Management.Server;
|
||||
using WebsitePanel.Providers.Web.Iis.Common;
|
||||
|
||||
namespace WebsitePanel.Providers.Web.Compression
|
||||
{
|
||||
|
||||
internal static class CompressionGlobals
|
||||
{
|
||||
public const int DynamicCompression = 1;
|
||||
public const int StaticCompression = 2;
|
||||
}
|
||||
|
||||
|
||||
internal sealed class CompressionModuleService : ConfigurationModuleService
|
||||
{
|
||||
public const string DynamicCompression = "doDynamicCompression";
|
||||
public const string StaticCompression = "doStaticCompression";
|
||||
|
||||
public PropertyBag GetSettings(ServerManager srvman, string siteId)
|
||||
{
|
||||
var config = srvman.GetApplicationHostConfiguration();
|
||||
//
|
||||
var section = config.GetSection(Constants.CompressionSection, siteId);
|
||||
//
|
||||
PropertyBag bag = new PropertyBag();
|
||||
//
|
||||
bag[CompressionGlobals.DynamicCompression] = Convert.ToBoolean(section.GetAttributeValue(DynamicCompression));
|
||||
bag[CompressionGlobals.StaticCompression] = Convert.ToBoolean(section.GetAttributeValue(StaticCompression));
|
||||
//
|
||||
return bag;
|
||||
}
|
||||
|
||||
public void SetSettings(string virtualPath, bool doDynamicCompression, bool doStaticCompression)
|
||||
{
|
||||
using (var srvman = GetServerManager())
|
||||
{
|
||||
var config = srvman.GetApplicationHostConfiguration();
|
||||
//
|
||||
var section = config.GetSection(Constants.CompressionSection, virtualPath);
|
||||
//
|
||||
section.SetAttributeValue(DynamicCompression, doDynamicCompression);
|
||||
section.SetAttributeValue(StaticCompression, doStaticCompression);
|
||||
|
||||
//
|
||||
srvman.CommitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -38,6 +38,7 @@ using WebsitePanel.Providers.HostedSolution;
|
|||
using WebsitePanel.Providers.OS;
|
||||
using WebsitePanel.Providers.ResultObjects;
|
||||
using WebsitePanel.Providers.Utils;
|
||||
using WebsitePanel.Providers.Web.Compression;
|
||||
using WebsitePanel.Providers.Web.Handlers;
|
||||
using WebsitePanel.Providers.Web.HttpRedirect;
|
||||
using WebsitePanel.Providers.Web.Iis.Authentication;
|
||||
|
@ -78,6 +79,7 @@ namespace WebsitePanel.Providers.Web
|
|||
public const string AnonymousAuthenticationSection = "system.webServer/security/authentication/anonymousAuthentication";
|
||||
public const string BasicAuthenticationSection = "system.webServer/security/authentication/basicAuthentication";
|
||||
public const string WindowsAuthenticationSection = "system.webServer/security/authentication/windowsAuthentication";
|
||||
public const string CompressionSection = "system.webServer/urlCompression";
|
||||
public const string StaticContentSection = "system.webServer/staticContent";
|
||||
public const string ModulesSection = "system.webServer/modules";
|
||||
public const string IsapiCgiRestrictionSection = "system.webServer/security/isapiCgiRestriction";
|
||||
|
@ -104,8 +106,11 @@ namespace WebsitePanel.Providers.Web
|
|||
public const string HeliconApeModulePrevName = "Helicon Ape";
|
||||
// true module name
|
||||
public const string HeliconApeModule = "Helicon.Ape";
|
||||
public const string HeliconApeModuleType = "Helicon.Ape.ApeModule";
|
||||
// true handler name
|
||||
public const string HeliconApeHandler = "Helicon.Ape Handler";
|
||||
public const string HeliconApeHandlerType = "Helicon.Ape.Handler";
|
||||
|
||||
public const string HeliconApeHandlerPath = "*.apehandler";
|
||||
|
||||
public const string IsapiModule = "IsapiModule";
|
||||
|
@ -344,6 +349,7 @@ namespace WebsitePanel.Providers.Web
|
|||
private AnonymAuthModuleService anonymAuthSvc;
|
||||
private WindowsAuthModuleService winAuthSvc;
|
||||
private BasicAuthModuleService basicAuthSvc;
|
||||
private CompressionModuleService comprSvc;
|
||||
private DefaultDocsModuleService defaultDocSvc;
|
||||
private CustomHttpErrorsModuleService customErrorsSvc;
|
||||
private CustomHttpHeadersModuleService customHeadersSvc;
|
||||
|
@ -516,6 +522,7 @@ namespace WebsitePanel.Providers.Web
|
|||
winAuthSvc = new WindowsAuthModuleService();
|
||||
anonymAuthSvc = new AnonymAuthModuleService();
|
||||
basicAuthSvc = new BasicAuthModuleService();
|
||||
comprSvc = new CompressionModuleService();
|
||||
defaultDocSvc = new DefaultDocsModuleService();
|
||||
classicAspSvc = new ClassicAspModuleService();
|
||||
httpRedirectSvc = new HttpRedirectModuleService();
|
||||
|
@ -620,6 +627,8 @@ namespace WebsitePanel.Providers.Web
|
|||
virtualDir.AnonymousUserPassword = (string)bag[AuthenticationGlobals.AnonymousAuthenticationPassword];
|
||||
virtualDir.EnableAnonymousAccess = (bool)bag[AuthenticationGlobals.Enabled];
|
||||
|
||||
|
||||
|
||||
// load windows auth
|
||||
bag = winAuthSvc.GetAuthenticationSettings(srvman, virtualDir.FullQualifiedPath);
|
||||
virtualDir.EnableWindowsAuthentication = (bool)bag[AuthenticationGlobals.Enabled];
|
||||
|
@ -633,10 +642,17 @@ namespace WebsitePanel.Providers.Web
|
|||
bag = classicAspSvc.GetClassicAspSettings(srvman, virtualDir.FullQualifiedPath);
|
||||
virtualDir.EnableParentPaths = (bool)bag[ClassicAspGlobals.EnableParentPaths];
|
||||
//
|
||||
|
||||
//gzip
|
||||
bag = comprSvc.GetSettings(srvman, virtualDir.FullQualifiedPath);
|
||||
virtualDir.EnableDynamicCompression = (bool)bag[CompressionGlobals.DynamicCompression];
|
||||
virtualDir.EnableStaticCompression = (bool)bag[CompressionGlobals.StaticCompression];
|
||||
|
||||
virtualDir.IIs7 = true;
|
||||
}
|
||||
|
||||
private void FillIISObjectFromVirtualDirectory(WebVirtualDirectory virtualDir)
|
||||
|
||||
private void FillIISObjectFromVirtualDirectory(WebVirtualDirectory virtualDir)
|
||||
{
|
||||
dirBrowseSvc.SetDirectoryBrowseEnabled(virtualDir.FullQualifiedPath, virtualDir.EnableDirectoryBrowsing);
|
||||
//
|
||||
|
@ -645,6 +661,8 @@ namespace WebsitePanel.Providers.Web
|
|||
winAuthSvc.SetEnabled(virtualDir.FullQualifiedPath, virtualDir.EnableWindowsAuthentication);
|
||||
//
|
||||
basicAuthSvc.SetAuthenticationSettings(virtualDir);
|
||||
//
|
||||
comprSvc.SetSettings(virtualDir.FullQualifiedPath, virtualDir.EnableDynamicCompression, virtualDir.EnableStaticCompression);
|
||||
//
|
||||
defaultDocSvc.SetDefaultDocumentSettings(virtualDir.FullQualifiedPath, virtualDir.DefaultDocs);
|
||||
//
|
||||
|
@ -1896,6 +1914,25 @@ namespace WebsitePanel.Providers.Web
|
|||
|
||||
private bool IsHeliconApeEnabled(ServerManager srvman, string siteId)
|
||||
{
|
||||
WebSite webSite = null;
|
||||
webSite = webObjectsSvc.GetWebSiteFromIIS(srvman, siteId);
|
||||
if (webSite == null)
|
||||
throw new ApplicationException(
|
||||
String.Format("Could not find a web site with the following identifier: {0}.", siteId));
|
||||
|
||||
// Fill ASP.NET settings
|
||||
FillAspNetSettingsFromIISObject(srvman, webSite);
|
||||
|
||||
var aphl = new WebAppPoolHelper(ProviderSettings);
|
||||
var currentPool = aphl.match_webapp_pool(webSite);
|
||||
|
||||
if (aphl.pipeline(currentPool.Mode) != SiteAppPoolMode.Integrated)
|
||||
{
|
||||
// Ape is not working in not Integrated pipeline mode
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
var appConfig = srvman.GetApplicationHostConfiguration();
|
||||
var modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId);
|
||||
var modulesCollection = modulesSection.GetCollection();
|
||||
|
@ -2280,40 +2317,44 @@ namespace WebsitePanel.Providers.Web
|
|||
|
||||
using (var srvman = webObjectsSvc.GetServerManager())
|
||||
{
|
||||
Configuration appConfig = srvman.GetApplicationHostConfiguration();
|
||||
|
||||
// add Helicon.Ape module
|
||||
ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId);
|
||||
ConfigurationElementCollection modulesCollection = modulesSection.GetCollection();
|
||||
if (!IsHeliconApeEnabled(srvman, siteId))
|
||||
{
|
||||
|
||||
// <add name="Helicon.Ape" />
|
||||
ConfigurationElement heliconApeModuleEntry = modulesCollection.CreateElement("add");
|
||||
heliconApeModuleEntry["name"] = Constants.HeliconApeModule;
|
||||
heliconApeModuleEntry["type"] = GetHeliconApeModuleType(siteId);
|
||||
|
||||
// this way make <clear/> and copy all modules list from ancestor
|
||||
//modulesCollection.AddAt(0, heliconApeModuleEntry);
|
||||
// this way just insert single ape module entry
|
||||
modulesCollection.Add(heliconApeModuleEntry);
|
||||
Configuration appConfig = srvman.GetApplicationHostConfiguration();
|
||||
|
||||
|
||||
|
||||
|
||||
// add Helicon.Ape handler
|
||||
ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId);
|
||||
ConfigurationElementCollection handlersCollection = handlersSection.GetCollection();
|
||||
// add Helicon.Ape module
|
||||
ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId);
|
||||
ConfigurationElementCollection modulesCollection = modulesSection.GetCollection();
|
||||
|
||||
// <add name="Helicon.Ape" />
|
||||
ConfigurationElement heliconApeHandlerEntry = handlersCollection.CreateElement("add");
|
||||
heliconApeHandlerEntry["name"] = Constants.HeliconApeHandler;
|
||||
heliconApeHandlerEntry["type"] = GetHeliconApeHandlerType(siteId);
|
||||
heliconApeHandlerEntry["path"] = Constants.HeliconApeHandlerPath;
|
||||
heliconApeHandlerEntry["verb"] = "*";
|
||||
heliconApeHandlerEntry["resourceType"] = "Unspecified";
|
||||
|
||||
handlersCollection.AddAt(0, heliconApeHandlerEntry);
|
||||
// <add name="Helicon.Ape" />
|
||||
ConfigurationElement heliconApeModuleEntry = modulesCollection.CreateElement("add");
|
||||
heliconApeModuleEntry["name"] = Constants.HeliconApeModule;
|
||||
heliconApeModuleEntry["type"] = GetHeliconApeModuleType(siteId);
|
||||
|
||||
srvman.CommitChanges();
|
||||
// this way make <clear/> and copy all modules list from ancestor
|
||||
//modulesCollection.AddAt(0, heliconApeModuleEntry);
|
||||
// this way just insert single ape module entry
|
||||
modulesCollection.Add(heliconApeModuleEntry);
|
||||
|
||||
|
||||
|
||||
|
||||
// add Helicon.Ape handler
|
||||
ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId);
|
||||
ConfigurationElementCollection handlersCollection = handlersSection.GetCollection();
|
||||
|
||||
// <add name="Helicon.Ape" />
|
||||
ConfigurationElement heliconApeHandlerEntry = handlersCollection.CreateElement("add");
|
||||
heliconApeHandlerEntry["name"] = Constants.HeliconApeHandler;
|
||||
heliconApeHandlerEntry["type"] = GetHeliconApeHandlerType(siteId);
|
||||
heliconApeHandlerEntry["path"] = Constants.HeliconApeHandlerPath;
|
||||
heliconApeHandlerEntry["verb"] = "*";
|
||||
heliconApeHandlerEntry["resourceType"] = "Unspecified";
|
||||
|
||||
handlersCollection.AddAt(0, heliconApeHandlerEntry);
|
||||
|
||||
srvman.CommitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2330,57 +2371,102 @@ namespace WebsitePanel.Providers.Web
|
|||
|
||||
using (var srvman = webObjectsSvc.GetServerManager())
|
||||
{
|
||||
bool alterConfiguration = false;
|
||||
//
|
||||
Configuration appConfig = srvman.GetApplicationHostConfiguration();
|
||||
|
||||
|
||||
|
||||
|
||||
// remove Helicon.Ape module
|
||||
ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId);
|
||||
ConfigurationElementCollection modulesCollection = modulesSection.GetCollection();
|
||||
List<ConfigurationElement> heliconApeModuleEntriesList = new List<ConfigurationElement>();
|
||||
foreach (ConfigurationElement moduleEntry in modulesCollection)
|
||||
//List<ConfigurationElement> heliconApeModuleEntriesList = new List<ConfigurationElement>();
|
||||
//foreach (ConfigurationElement moduleEntry in modulesCollection)
|
||||
//{
|
||||
// if (
|
||||
// String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)
|
||||
// ||
|
||||
// String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModulePrevName, StringComparison.InvariantCultureIgnoreCase)
|
||||
// )
|
||||
// {
|
||||
// heliconApeModuleEntriesList.Add(moduleEntry);
|
||||
// }
|
||||
//}
|
||||
//foreach (ConfigurationElement heliconApeElement in heliconApeModuleEntriesList)
|
||||
//{
|
||||
// modulesCollection.Remove(heliconApeElement);
|
||||
//}
|
||||
|
||||
for (int i = 0; i < modulesCollection.Count; )
|
||||
{
|
||||
if (
|
||||
String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)
|
||||
||
|
||||
String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModulePrevName, StringComparison.InvariantCultureIgnoreCase)
|
||||
)
|
||||
ConfigurationElement moduleEntry = modulesCollection[i];
|
||||
|
||||
string type = moduleEntry["type"].ToString();
|
||||
|
||||
if (type.IndexOf(Constants.HeliconApeModuleType, StringComparison.Ordinal) >= 0)
|
||||
{
|
||||
heliconApeModuleEntriesList.Add(moduleEntry);
|
||||
modulesCollection.RemoveAt(i);
|
||||
alterConfiguration = true;
|
||||
}
|
||||
}
|
||||
foreach (ConfigurationElement heliconApeElement in heliconApeModuleEntriesList)
|
||||
{
|
||||
modulesCollection.Remove(heliconApeElement);
|
||||
else
|
||||
{
|
||||
++i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// remove Helicon.Ape handler
|
||||
ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId);
|
||||
ConfigurationElementCollection handlersCollection = handlersSection.GetCollection();
|
||||
List<ConfigurationElement> heliconApeHandlerEntriesList = new List<ConfigurationElement>();
|
||||
foreach (ConfigurationElement handlerEntry in handlersCollection)
|
||||
//List<ConfigurationElement> heliconApeHandlerEntriesList = new List<ConfigurationElement>();
|
||||
//foreach (ConfigurationElement handlerEntry in handlersCollection)
|
||||
//{
|
||||
// if (
|
||||
// String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)
|
||||
// ||
|
||||
// String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeModulePrevName, StringComparison.InvariantCultureIgnoreCase)
|
||||
// ||
|
||||
// String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeHandler, StringComparison.InvariantCultureIgnoreCase)
|
||||
// )
|
||||
// {
|
||||
// heliconApeHandlerEntriesList.Add(handlerEntry);
|
||||
// }
|
||||
//}
|
||||
////
|
||||
//foreach (ConfigurationElement heliconApeHandlerEntry in heliconApeHandlerEntriesList)
|
||||
//{
|
||||
// handlersCollection.Remove(heliconApeHandlerEntry);
|
||||
//}
|
||||
|
||||
//// commit changes to metabase
|
||||
//if (heliconApeModuleEntriesList.Count > 0 || heliconApeHandlerEntriesList.Count > 0)
|
||||
//{
|
||||
// srvman.CommitChanges();
|
||||
//}
|
||||
|
||||
for (int i = 0; i < handlersCollection.Count; )
|
||||
{
|
||||
if (
|
||||
String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)
|
||||
||
|
||||
String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeModulePrevName, StringComparison.InvariantCultureIgnoreCase)
|
||||
||
|
||||
String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeHandler, StringComparison.InvariantCultureIgnoreCase)
|
||||
)
|
||||
|
||||
string type = handlersCollection[i]["type"].ToString();
|
||||
|
||||
if (type.IndexOf(Constants.HeliconApeHandlerType, StringComparison.Ordinal) >= 0)
|
||||
{
|
||||
heliconApeHandlerEntriesList.Add(handlerEntry);
|
||||
handlersCollection.RemoveAt(i);
|
||||
alterConfiguration = true;
|
||||
}
|
||||
}
|
||||
//
|
||||
foreach (ConfigurationElement heliconApeHandlerEntry in heliconApeHandlerEntriesList)
|
||||
{
|
||||
handlersCollection.Remove(heliconApeHandlerEntry);
|
||||
else
|
||||
{
|
||||
++i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// commit changes to metabase
|
||||
if (heliconApeModuleEntriesList.Count > 0 || heliconApeHandlerEntriesList.Count > 0)
|
||||
if (alterConfiguration)
|
||||
{
|
||||
srvman.CommitChanges();
|
||||
srvman.CommitChanges();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
<Compile Include="Common\FastCgiApplicationCollection.cs" />
|
||||
<Compile Include="Common\FastCgiSection.cs" />
|
||||
<Compile Include="Common\HttpErrorResponseMode.cs" />
|
||||
<Compile Include="Compression\CompressionModuleService.cs" />
|
||||
<Compile Include="DefaultDocuments\DefaultDocumentModuleService.cs" />
|
||||
<Compile Include="Delegation\DelegationRulesModuleService.cs" />
|
||||
<Compile Include="DirectoryBrowse\DirectoryBrowseGlobals.cs" />
|
||||
|
|
|
@ -2488,6 +2488,8 @@ namespace WebsitePanel.Providers.Web
|
|||
virtDir.EnableWindowsAuthentication = (bool)obj.Properties["AuthNTLM"].Value;
|
||||
virtDir.EnableAnonymousAccess = (bool)obj.Properties["AuthAnonymous"].Value;
|
||||
virtDir.EnableBasicAuthentication = (bool)obj.Properties["AuthBasic"].Value;
|
||||
//virtDir.EnableDynamicCompression = (bool)obj.Properties["DoDynamicCompression"].Value;
|
||||
//virtDir.EnableStaticCompression = (bool)obj.Properties["DoStaticCompression"].Value;
|
||||
virtDir.DefaultDocs = (string)obj.Properties["DefaultDoc"].Value;
|
||||
virtDir.EnableParentPaths = (bool)obj.Properties["AspEnableParentPaths"].Value;
|
||||
}
|
||||
|
@ -2506,6 +2508,9 @@ namespace WebsitePanel.Providers.Web
|
|||
obj.Properties["AuthNTLM"].Value = virtDir.EnableWindowsAuthentication;
|
||||
obj.Properties["AuthAnonymous"].Value = virtDir.EnableAnonymousAccess;
|
||||
obj.Properties["AuthBasic"].Value = virtDir.EnableBasicAuthentication;
|
||||
//obj.Properties["DoDynamicCompression"].Value = virtDir.EnableDynamicCompression;
|
||||
//obj.Properties["DoStaticCompression"].Value = virtDir.EnableStaticCompression;
|
||||
|
||||
obj.Properties["AspEnableParentPaths"].Value = virtDir.EnableParentPaths;
|
||||
if (virtDir.DefaultDocs != null && virtDir.DefaultDocs != "")
|
||||
obj.Properties["DefaultDoc"].Value = virtDir.DefaultDocs;
|
||||
|
|
|
@ -36,17 +36,17 @@
|
|||
<Reference Include="Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Deployment.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.PlatformInstaller, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.PlatformInstaller.WebDeployShim, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.WebDeployShim.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Runtime.Remoting" />
|
||||
|
|
|
@ -130,6 +130,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Host
|
|||
{E91E52F3-9555-4D00-B577-2B1DBDD87CA7} = {E91E52F3-9555-4D00-B577-2B1DBDD87CA7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.HostedSolution.SharePoint2013", "WebsitePanel.Providers.HostedSolution.SharePoint2013\WebsitePanel.Providers.HostedSolution.SharePoint2013.csproj", "{24762DC8-6078-4F10-A524-C94ED59BD5D1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -660,6 +662,16 @@ Global
|
|||
{E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{24762DC8-6078-4F10-A524-C94ED59BD5D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{24762DC8-6078-4F10-A524-C94ED59BD5D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{24762DC8-6078-4F10-A524-C94ED59BD5D1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{24762DC8-6078-4F10-A524-C94ED59BD5D1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{24762DC8-6078-4F10-A524-C94ED59BD5D1}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{24762DC8-6078-4F10-A524-C94ED59BD5D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{24762DC8-6078-4F10-A524-C94ED59BD5D1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{24762DC8-6078-4F10-A524-C94ED59BD5D1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{24762DC8-6078-4F10-A524-C94ED59BD5D1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{24762DC8-6078-4F10-A524-C94ED59BD5D1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -172,5 +172,8 @@
|
|||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<probing privatePath="bin/Crm2011;bin/Exchange2013;bin/Sharepoint2013"/>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -454,10 +454,10 @@
|
|||
<value>Secure User Properties</value>
|
||||
</data>
|
||||
<data name="ModuleTitle.HeliconApeFolderProperties" xml:space="preserve">
|
||||
<value>.htaccess Folder Properties</value>
|
||||
<value>Edit .htaccess</value>
|
||||
</data>
|
||||
<data name="ModuleTitle.HeliconApeFolderAuthProperties" xml:space="preserve">
|
||||
<value>.htaccess Folder Secure Properties</value>
|
||||
<value>.htaccess Secure Properties</value>
|
||||
</data>
|
||||
<data name="ModuleTitle.HeliconApeGroupProperties" xml:space="preserve">
|
||||
<value>Helicon Ape Group Properties</value>
|
||||
|
|
|
@ -36,9 +36,10 @@
|
|||
float: left;
|
||||
}
|
||||
|
||||
.FormButtonsBar .Right
|
||||
.FormButtonsBar Button2.Right
|
||||
{
|
||||
text-align: right;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.FormButtonsBarClean
|
||||
|
@ -1368,20 +1369,11 @@ UL.ActionButtons LI
|
|||
width:100px;
|
||||
}
|
||||
|
||||
table#toolbar
|
||||
{
|
||||
width: 100%;
|
||||
display: none;
|
||||
}
|
||||
.pnlControl input.NormalTextBox
|
||||
{
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.toolbar-space
|
||||
{
|
||||
width: 80%;
|
||||
}
|
||||
.disabled
|
||||
{
|
||||
width:20px;
|
||||
|
@ -1390,12 +1382,6 @@ table#toolbar
|
|||
border:medium none;
|
||||
}
|
||||
|
||||
.toolbar-button
|
||||
{
|
||||
padding: 0 1px;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.enabled
|
||||
{
|
||||
width:20px;
|
||||
|
@ -1404,4 +1390,14 @@ table#toolbar
|
|||
border:medium none;
|
||||
}
|
||||
|
||||
p.warningText {font-size:14px; color:Red; text-align:center;}
|
||||
p.warningText {
|
||||
font-size:14px;
|
||||
color:Red;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
|
||||
.Hidden
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -120,4 +120,7 @@
|
|||
<data name="secMailboxPassword.Text" xml:space="preserve">
|
||||
<value>User Password Policy</value>
|
||||
</data>
|
||||
<data name="secOrg.Text" xml:space="preserve">
|
||||
<value>Organization Id Policy</value>
|
||||
</data>
|
||||
</root>
|
|
@ -117,8 +117,11 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="btnApeDebugger.Text" xml:space="preserve">
|
||||
<value>Start Debug</value>
|
||||
<data name="btnApeDebuggerStart.Text" xml:space="preserve">
|
||||
<value>Start Debugging</value>
|
||||
</data>
|
||||
<data name="btnApeDebuggerStop.Text" xml:space="preserve">
|
||||
<value>Stop Debugging</value>
|
||||
</data>
|
||||
<data name="btnCancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
|
@ -130,6 +133,18 @@
|
|||
<value>Update</value>
|
||||
</data>
|
||||
<data name="lblFolderName.Text" xml:space="preserve">
|
||||
<value>Folder Path:</value>
|
||||
<value>.htaccess path: </value>
|
||||
</data>
|
||||
<data name="lblDebuggingPageLink.Text">
|
||||
<value xml:space="preserve">Debugging Page Link</value>
|
||||
</data>
|
||||
<data name="lblCLickLink.Text">
|
||||
<value xml:space="preserve">Click this link to open debugging page</value>
|
||||
</data>
|
||||
<data name="btnShowDebuggingPageLinkModal.Text">
|
||||
<value xml:space="preserve">Show debugging page link</value>
|
||||
</data>
|
||||
<data name="btnClose.Text">
|
||||
<value xml:space="preserve">Close</value>
|
||||
</data>
|
||||
</root>
|
|
@ -225,24 +225,6 @@
|
|||
<data name="gvGroupsName.Header" xml:space="preserve">
|
||||
<value>Groups</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeFolders.Empty" xml:space="preserve">
|
||||
<value>Click "Add .htaccess Folder" button to add .htaccess folder</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeFoldersName.Header" xml:space="preserve">
|
||||
<value>.htaccess Folders</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeUsers.Empty" xml:space="preserve">
|
||||
<value>Click "Add .htaccess User" button to add .htaccess user</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeUsersName.Header" xml:space="preserve">
|
||||
<value>.htaccess Users</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeGroups.Empty" xml:space="preserve">
|
||||
<value>Click "Add .htaccess Group" button to add .htaccess group</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeGroupsName.Header" xml:space="preserve">
|
||||
<value>.htaccess Groups</value>
|
||||
</data>
|
||||
<data name="gvMimeTypes.Empty" xml:space="preserve">
|
||||
<value>Custom MIME types are not defined</value>
|
||||
</data>
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="btnAddHeliconApeFolder.Text" xml:space="preserve">
|
||||
<value>Add .htaccess folder</value>
|
||||
<value>+ Add .htaccess</value>
|
||||
</data>
|
||||
<data name="cmdDeleteFolder.AlternateText" xml:space="preserve">
|
||||
<value>Delete Folder</value>
|
||||
|
@ -132,14 +132,26 @@
|
|||
<data name="EnableHeliconApe.Text" xml:space="preserve">
|
||||
<value>Enable Helicon Ape</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeUsers.Empty" xml:space="preserve">
|
||||
<value>Click "Add .htaccess User" button to add .htaccess user</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeUsersName.Header" xml:space="preserve">
|
||||
<value>.htaccess Users</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeGroups.Empty" xml:space="preserve">
|
||||
<value>Click "Add .htaccess Group" button to add .htaccess group</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeGroupsName.Header" xml:space="preserve">
|
||||
<value>.htaccess Groups</value>
|
||||
</data>
|
||||
<data name="EnableHeliconApeTrial.Text" xml:space="preserve">
|
||||
<value>Enable Helicon Ape (45 days trial)</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeFolders.Empty" xml:space="preserve">
|
||||
<value>Click "Add Folder" button to add .htaccess folder</value>
|
||||
<value>Click "Add .htaccess" button to add .htaccess</value>
|
||||
</data>
|
||||
<data name="gvHeliconApeFoldersName.Header" xml:space="preserve">
|
||||
<value>Helicon Ape Folders</value>
|
||||
<value>Folders containing .htaccess</value>
|
||||
</data>
|
||||
<data name="EnableFoldersIIs7Warning.Text" xml:space="preserve">
|
||||
<value>This feature will automatically change the following settings for the web site:\r\n\r\n- Enable Integration Pipeline;\r\n- Disable Secured Folders feature (if enabled);\r\n- Disable Integrated Windows Authentication;\r\n\r\nPlease click OK button to proceed or Cancel button if you would like to modify these settings manually.</value>
|
||||
|
@ -155,7 +167,7 @@
|
|||
mod_rewrite, mod_proxy, mod_auth, mod_gzip, mod_headers, mod_cache, mod_expires, mod_replace and others.</value>
|
||||
</data>
|
||||
<data name="btnAddHeliconApeGroup.Text" xml:space="preserve">
|
||||
<value>Add Group</value>
|
||||
<value>+ Add Group</value>
|
||||
</data>
|
||||
<data name="btnInstallHeliconApe.OnClientClick" xml:space="preserve">
|
||||
<value>ShowProgressDialog('Installing Helicon Ape.<br /><br /><small>It may take several minutes...</small>');</value>
|
||||
|
@ -170,6 +182,18 @@
|
|||
<value>http://www.helicontech.com/ape/doc/wsp.htm</value>
|
||||
</data>
|
||||
<data name="ModuleHelpLink.Text" xml:space="preserve">
|
||||
<value>Help</value>
|
||||
<value>About .htaccess support & Help</value>
|
||||
</data>
|
||||
<data name="labelSelectHtacesEdit.Text">
|
||||
<value xml:space="preserve">Select .htaccess to edit:</value>
|
||||
</data>
|
||||
<data name="btnAddHeliconApeUser.Text">
|
||||
<value xml:space="preserve">+ Add user</value>
|
||||
</data>
|
||||
<data name="HeliconApeUsersHeader.Text">
|
||||
<value xml:space="preserve">.htpasswd users</value>
|
||||
</data>
|
||||
<data name="HeliconApeGroupsHeader.Text">
|
||||
<value xml:space="preserve">.htpasswd groups</value>
|
||||
</data>
|
||||
</root>
|
|
@ -129,6 +129,12 @@
|
|||
<data name="chkAuthBasic.Text" xml:space="preserve">
|
||||
<value>Enable Basic Authentication</value>
|
||||
</data>
|
||||
<data name="chkDynamicCompression.Text" xml:space="preserve">
|
||||
<value>Enable Dynamic Compression</value>
|
||||
</data>
|
||||
<data name="chkStaticCompression.Text" xml:space="preserve">
|
||||
<value>Enable Static Compression</value>
|
||||
</data>
|
||||
<data name="chkAuthWindows.Text" xml:space="preserve">
|
||||
<value>Enable Integrated Windows Authentication</value>
|
||||
</data>
|
||||
|
@ -159,6 +165,9 @@
|
|||
<data name="lblAuthentication.Text" xml:space="preserve">
|
||||
<value>Authentication:</value>
|
||||
</data>
|
||||
<data name="lblCompression.Text" xml:space="preserve">
|
||||
<value>Compression:</value>
|
||||
</data>
|
||||
<data name="lblDefaultDocuments.Text" xml:space="preserve">
|
||||
<value>Default Documents:</value>
|
||||
</data>
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
|
@ -39,18 +37,19 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
DomainInfo[] domains = ES.Services.Servers.GetMyDomains(PanelSecurity.PackageId);
|
||||
|
||||
Organization[] orgs = ES.Services.Organizations.GetOrganizations(PanelSecurity.PackageId, false);
|
||||
|
||||
List<OrganizationDomainName> list = new List<OrganizationDomainName>();
|
||||
var list = new List<OrganizationDomainName>();
|
||||
SetPolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "OrgIdPolicy");
|
||||
|
||||
foreach (Organization o in orgs)
|
||||
{
|
||||
OrganizationDomainName[] tmpList = ES.Services.Organizations.GetOrganizationDomains(o.Id);
|
||||
|
||||
foreach (OrganizationDomainName name in tmpList) list.Add(name);
|
||||
foreach (OrganizationDomainName name in tmpList)
|
||||
{
|
||||
list.Add(name);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (DomainInfo d in domains)
|
||||
|
@ -65,9 +64,11 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
bAdd = false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (bAdd) ddlDomains.Items.Add(d.DomainName.ToLower());
|
||||
if (bAdd)
|
||||
{
|
||||
ddlDomains.Items.Add(d.DomainName.ToLower());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,6 +78,50 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
}
|
||||
}
|
||||
|
||||
public void SetPolicy(int packageId, string settingsName, string key)
|
||||
{
|
||||
PackageInfo package = PackagesHelper.GetCachedPackage(packageId);
|
||||
|
||||
if (package != null)
|
||||
{
|
||||
SetOrgIdPolicy(package.UserId, settingsName, key);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetOrgIdPolicy(int userId, string settingsName, string key)
|
||||
{
|
||||
UserInfo user = UsersHelper.GetCachedUser(userId);
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
UserSettings settings = ES.Services.Users.GetUserSettings(userId, settingsName);
|
||||
|
||||
if (settings != null && settings["OrgIdPolicy"] != null)
|
||||
{
|
||||
SetOrgIdPolicy(settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetOrgIdPolicy(UserSettings settings)
|
||||
{
|
||||
string policyValue = settings["OrgIdPolicy"];
|
||||
string[] values = policyValue.Split(';');
|
||||
|
||||
if (values.Length > 1 && Convert.ToBoolean(values[0]))
|
||||
{
|
||||
try
|
||||
{
|
||||
int maxLength = Convert.ToInt32(values[1]);
|
||||
txtOrganizationID.MaxLength = maxLength;
|
||||
valRequireCorrectOrgID.ValidationExpression = string.Format("[a-zA-Z0-9.-]{{1,{0}}}", maxLength);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnCreate_Click(object sender, EventArgs e)
|
||||
{
|
||||
CreateOrganization();
|
||||
|
@ -85,14 +130,13 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
private void CreateOrganization()
|
||||
{
|
||||
if (!Page.IsValid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
int itemId = ES.Services.Organizations.CreateOrganization(PanelSecurity.PackageId,
|
||||
txtOrganizationID.Text.Trim().ToLower(), txtOrganizationName.Text.Trim().ToLower(),
|
||||
ddlDomains.SelectedValue.Trim().ToLower());
|
||||
int itemId = ES.Services.Organizations.CreateOrganization(PanelSecurity.PackageId, txtOrganizationID.Text.Trim().ToLower(), txtOrganizationName.Text.Trim().ToLower(), ddlDomains.SelectedValue.Trim().ToLower());
|
||||
|
||||
if (itemId < 0)
|
||||
{
|
||||
|
@ -100,9 +144,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
return;
|
||||
}
|
||||
|
||||
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "organization_home",
|
||||
"ItemID=" + itemId));
|
||||
|
||||
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "organization_home", "ItemID=" + itemId));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
using WebsitePanel.Providers.DNS;
|
||||
|
@ -148,20 +149,11 @@ namespace WebsitePanel.Portal
|
|||
}
|
||||
|
||||
Organization org = ES.Services.Organizations.GetOrganization(OrganizationId);
|
||||
|
||||
if (org != null)
|
||||
{
|
||||
maxStorage.ParentQuotaValue = org.MaxSharePointStorage;
|
||||
maxStorage.QuotaValue = org.MaxSharePointStorage;
|
||||
|
||||
editMaxStorage.ParentQuotaValue = org.MaxSharePointStorage;
|
||||
|
||||
|
||||
|
||||
warningStorage.ParentQuotaValue = org.WarningSharePointStorage;
|
||||
warningStorage.QuotaValue = org.WarningSharePointStorage;
|
||||
editWarningStorage.ParentQuotaValue = org.WarningSharePointStorage;
|
||||
SetStorageQuotas(org, item);
|
||||
}
|
||||
|
||||
}
|
||||
//OrganizationDomainName[] domains = ES.Services.Organizations.GetOrganizationDomains(PanelRequest.ItemID);
|
||||
|
||||
|
@ -192,6 +184,51 @@ namespace WebsitePanel.Portal
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary> Checks and sets disk quotas values.</summary>
|
||||
/// <param name="organization"> The organization.</param>
|
||||
/// <param name="collection"> The site collection.</param>
|
||||
private void SetStorageQuotas(Organization organization, SharePointSiteCollection collection)
|
||||
{
|
||||
var quotaValue = organization.MaxSharePointStorage;
|
||||
|
||||
if (quotaValue != -1)
|
||||
{
|
||||
var spaceResrved = GetReservedDiskStorageSpace();
|
||||
|
||||
if (spaceResrved > quotaValue)
|
||||
{
|
||||
quotaValue = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
quotaValue -= spaceResrved;
|
||||
}
|
||||
|
||||
if (collection != null)
|
||||
{
|
||||
quotaValue += (int)collection.MaxSiteStorage;
|
||||
}
|
||||
}
|
||||
|
||||
maxStorage.ParentQuotaValue = quotaValue;
|
||||
maxStorage.QuotaValue = quotaValue;
|
||||
editMaxStorage.ParentQuotaValue = quotaValue;
|
||||
warningStorage.ParentQuotaValue = quotaValue;
|
||||
warningStorage.QuotaValue = quotaValue;
|
||||
editWarningStorage.ParentQuotaValue = quotaValue;
|
||||
|
||||
btnUpdate.Enabled = quotaValue != 0;
|
||||
}
|
||||
|
||||
/// <summary> Gets disk space reserved by existing site collections.</summary>
|
||||
/// <returns> Reserved disk space vallue.</returns>
|
||||
private int GetReservedDiskStorageSpace()
|
||||
{
|
||||
var existingCollections = ES.Services.HostedSharePointServers.GetSiteCollections(PanelSecurity.PackageId, false);
|
||||
|
||||
return (int)existingCollections.Sum(siteCollection => siteCollection.MaxSiteStorage);
|
||||
}
|
||||
|
||||
private void SaveItem()
|
||||
{
|
||||
if (!Page.IsValid)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SettingsExchangePolicy.ascx.cs" Inherits="WebsitePanel.Portal.SettingsExchangePolicy" %>
|
||||
<%@ Register Src="UserControls/PasswordPolicyEditor.ascx" TagName="PasswordPolicyEditor" TagPrefix="wsp" %>
|
||||
<%@ Register Src="UserControls/OrgIdPolicyEditor.ascx" TagName="OrgIdPolicyEditor" TagPrefix="wsp" %>
|
||||
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="UserControls/CollapsiblePanel.ascx" %>
|
||||
|
||||
<wsp:CollapsiblePanel id="secMailboxPassword" runat="server"
|
||||
|
@ -15,4 +16,17 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
|
||||
<wsp:CollapsiblePanel id="secOrg" runat="server" TargetControlID="OrgIdPanel" meta:resourcekey="secOrg" Text="Organization Id Policy"/>
|
||||
<asp:Panel ID="OrgIdPanel" runat="server" Height="0" style="overflow:hidden;">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="SubHead" width="150" nowrap>
|
||||
</td>
|
||||
<td>
|
||||
<wsp:OrgIdPolicyEditor id="orgIdPolicy" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
|
@ -26,33 +26,27 @@
|
|||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
|
||||
namespace WebsitePanel.Portal
|
||||
{
|
||||
public partial class SettingsExchangePolicy : WebsitePanelControlBase, IUserSettingsEditorControl
|
||||
public partial class SettingsExchangePolicy : WebsitePanelControlBase, IUserSettingsEditorControl
|
||||
{
|
||||
#region IUserSettingsEditorControl Members
|
||||
|
||||
public void BindSettings(UserSettings settings)
|
||||
{
|
||||
// mailbox
|
||||
mailboxPasswordPolicy.Value = settings["MailboxPasswordPolicy"];
|
||||
mailboxPasswordPolicy.Value = settings["MailboxPasswordPolicy"];
|
||||
orgIdPolicy.Value = settings["OrgIdPolicy"];
|
||||
}
|
||||
|
||||
public void SaveSettings(UserSettings settings)
|
||||
{
|
||||
// mailbox
|
||||
settings["MailboxPasswordPolicy"] = mailboxPasswordPolicy.Value;
|
||||
settings["MailboxPasswordPolicy"] = mailboxPasswordPolicy.Value;
|
||||
settings["OrgIdPolicy"] = orgIdPolicy.Value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -1,10 +1,37 @@
|
|||
// 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.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.1433
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
@ -39,5 +66,32 @@ namespace WebsitePanel.Portal {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.PasswordPolicyEditor mailboxPasswordPolicy;
|
||||
|
||||
/// <summary>
|
||||
/// secOrg control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.CollapsiblePanel secOrg;
|
||||
|
||||
/// <summary>
|
||||
/// OrgIdPanel 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.Panel OrgIdPanel;
|
||||
|
||||
/// <summary>
|
||||
/// orgIdPolicy control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.UserControls.OrgIdPolicyEditor orgIdPolicy;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="enablePolicyCheckBox.Text" xml:space="preserve">
|
||||
<value>Enable Policy</value>
|
||||
</data>
|
||||
<data name="lblMaximumLength.Text" xml:space="preserve">
|
||||
<value>Maximum OrgId length:</value>
|
||||
</data>
|
||||
<data name="valCorrectMaxLength.Text" xml:space="preserve">
|
||||
<value>*</value>
|
||||
</data>
|
||||
<data name="valRequireMaxLength.Text" xml:space="preserve">
|
||||
<value>*</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,18 @@
|
|||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrgIdPolicyEditor.ascx.cs" Inherits="WebsitePanel.Portal.UserControls.OrgIdPolicyEditor" %>
|
||||
<asp:UpdatePanel runat="server" ID="OrgIdPolicyPanel" UpdateMode="Conditional" ChildrenAsTriggers="true">
|
||||
<ContentTemplate>
|
||||
<asp:CheckBox id="enablePolicyCheckBox" runat="server" meta:resourcekey="enablePolicyCheckBox" Text="Enable Policy" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="EnablePolicy_CheckedChanged"/>
|
||||
<table id="PolicyTable" runat="server" cellpadding="2">
|
||||
<tr>
|
||||
<td class="Normal" style="width:150px;">
|
||||
<asp:Label ID="lblMaximumLength" runat="server" meta:resourcekey="lblMaximumLength" Text="Maximum OrgId length:"/>
|
||||
</td>
|
||||
<td class="Normal">
|
||||
<asp:TextBox ID="txtMaximumLength" runat="server" CssClass="NormalTextBox" Width="40px"/>
|
||||
<asp:RequiredFieldValidator ID="valRequireMaxLength" runat="server" ControlToValidate="txtMaximumLength" meta:resourcekey="valRequireMaxLength" ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"/>
|
||||
<asp:RegularExpressionValidator ID="valCorrectMaxLength" runat="server" ControlToValidate="txtMaximumLength" meta:resourcekey="valCorrectMaxLength" Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
|
@ -0,0 +1,97 @@
|
|||
// 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.
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace WebsitePanel.Portal.UserControls
|
||||
{
|
||||
public partial class OrgIdPolicyEditor : UserControl
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append(enablePolicyCheckBox.Checked.ToString()).Append(";");
|
||||
sb.Append(txtMaximumLength.Text).Append(";");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
if (String.IsNullOrEmpty(value))
|
||||
{
|
||||
enablePolicyCheckBox.Checked = true;
|
||||
txtMaximumLength.Text = "128";
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] parts = value.Split(';');
|
||||
enablePolicyCheckBox.Checked = Utils.ParseBool(parts[0], false);
|
||||
txtMaximumLength.Text = parts[1];
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
ToggleControls();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void ToggleControls()
|
||||
{
|
||||
PolicyTable.Visible = enablePolicyCheckBox.Checked;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
protected void EnablePolicy_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ToggleControls();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
// 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.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WebsitePanel.Portal.UserControls {
|
||||
|
||||
|
||||
public partial class OrgIdPolicyEditor {
|
||||
|
||||
/// <summary>
|
||||
/// OrgIdPolicyPanel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.UpdatePanel OrgIdPolicyPanel;
|
||||
|
||||
/// <summary>
|
||||
/// enablePolicyCheckBox 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.CheckBox enablePolicyCheckBox;
|
||||
|
||||
/// <summary>
|
||||
/// PolicyTable 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.HtmlTable PolicyTable;
|
||||
|
||||
/// <summary>
|
||||
/// lblMaximumLength 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 lblMaximumLength;
|
||||
|
||||
/// <summary>
|
||||
/// txtMaximumLength 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 txtMaximumLength;
|
||||
|
||||
/// <summary>
|
||||
/// valRequireMaxLength 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 valRequireMaxLength;
|
||||
|
||||
/// <summary>
|
||||
/// valCorrectMaxLength 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.RegularExpressionValidator valCorrectMaxLength;
|
||||
}
|
||||
}
|
|
@ -27,8 +27,11 @@
|
|||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
|
||||
namespace WebsitePanel.Portal
|
||||
{
|
||||
|
@ -173,11 +176,18 @@ namespace WebsitePanel.Portal
|
|||
UserInfo user = UsersHelper.GetUser(PanelSecurity.SelectedUserId);
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
{
|
||||
if (user.Role != UserRole.Reseller)
|
||||
{
|
||||
UserSettings settings = ES.Services.Users.GetUserSettings(user.UserId, UserSettings.EXCHANGE_POLICY);
|
||||
string orgId = domainName.ToLower();
|
||||
|
||||
ES.Services.Organizations.CreateOrganization(result.Result, domainName.ToLower(), domainName.ToLower(), domainName.ToLower());
|
||||
if (settings != null && settings["OrgIdPolicy"] != null)
|
||||
{
|
||||
orgId = GetOrgId(settings["OrgIdPolicy"], domainName, result.Result);
|
||||
}
|
||||
|
||||
ES.Services.Organizations.CreateOrganization(result.Result, orgId, domainName.ToLower(), domainName.ToLower());
|
||||
|
||||
if (result.Result < 0)
|
||||
{
|
||||
|
@ -199,6 +209,39 @@ namespace WebsitePanel.Portal
|
|||
Response.Redirect(PortalUtils.GetSpaceHomePageUrl(result.Result));
|
||||
}
|
||||
|
||||
private string GetOrgId(string orgIdPolicy, string domainName, int packageId)
|
||||
{
|
||||
string[] values = orgIdPolicy.Split(';');
|
||||
|
||||
if (values.Length > 1 && Convert.ToBoolean(values[0]))
|
||||
{
|
||||
try
|
||||
{
|
||||
int maxLength = Convert.ToInt32(values[1]);
|
||||
|
||||
if (domainName.Length > maxLength)
|
||||
{
|
||||
domainName = domainName.Substring(0, maxLength);
|
||||
string orgId = domainName;
|
||||
int counter = 0;
|
||||
|
||||
while (ES.Services.Organizations.CheckOrgIdExists(orgId))
|
||||
{
|
||||
counter++;
|
||||
orgId = maxLength > 3 ? string.Format("{0}{1}", orgId.Substring(0, orgId.Length - 3), counter.ToString("d3")) : counter.ToString("d3");
|
||||
}
|
||||
|
||||
return orgId;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return domainName;
|
||||
}
|
||||
|
||||
protected void ddlPlans_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
BindHostingPlan();
|
||||
|
|
|
@ -1,80 +1,99 @@
|
|||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebSitesEditHeliconApeFolder.ascx.cs"
|
||||
Inherits="WebsitePanel.Portal.WebSitesEditHeliconApeFolder" %>
|
||||
<%@ Register Src="UserControls/FileLookup.ascx" TagName="FileLookup" TagPrefix="uc1" %>
|
||||
<%@ Register Src="UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %>
|
||||
<link rel="stylesheet" href="/JavaScript/codemirror/codemirror.css" />
|
||||
<script type="text/javascript" src="/JavaScript/jquery.min.js?v=1.4.4"></script>
|
||||
<script type="text/javascript" src="/JavaScript/codemirror/codemirror.js"></script>
|
||||
<script type="text/javascript" src="/JavaScript/codemirror/htaccess.js"></script>
|
||||
<script type="text/javascript">
|
||||
function pageLoad() {
|
||||
$('input:hidden').each(function (index, el) {
|
||||
if ($(this).attr('id').indexOf('ApeDebuggerUrl') >= 0) {
|
||||
if (this.value) {
|
||||
$('#toolbar-start-debug').show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
function openDebugWindow() {
|
||||
$('input:hidden').each(function (index, el) {
|
||||
if ($(this).attr('id').indexOf('ApeDebuggerUrl') >= 0) {
|
||||
if (this.value) {
|
||||
window.open(this.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
$(document).ready(function () {
|
||||
$('.LinkDebuggingPage').click(function () {
|
||||
//$find('').hide();
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.CodeMirror {
|
||||
border: 1px solid #444;
|
||||
padding: 2px;
|
||||
font-family: Consolas, monospace;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
<div class="FormBody">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="5" width="100%">
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Label ID="lblFolderName" runat="server" meta:resourcekey="lblFolderName" Text="Folder Path:"></asp:Label>
|
||||
</td>
|
||||
<td class="NormalBold">
|
||||
<uc1:FileLookup id="folderPath" runat="server" Width="400">
|
||||
</uc1:FileLookup>
|
||||
<asp:HiddenField ID="contentPath" runat="server" />
|
||||
<asp:HiddenField ID="ApeDebuggerUrl" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table id="toolbar">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Button ID="btnApeDebug" runat="server" Text="Start Debug" meta:resourcekey="btnApeDebugger"
|
||||
CssClass="toolbar-button" OnClick="btnApeDebug_Click" />
|
||||
</td>
|
||||
<td>
|
||||
<button id="toolbar-start-debug" cssclass="toolbar-button" style="display: none;"
|
||||
onclick="return openDebugWindow();">
|
||||
Open Debug window</button>
|
||||
</td>
|
||||
<td class="toolbar-space"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<asp:TextBox ID="htaccessContent" runat="server" TextMode="MultiLine" class="htaccess CodeEditor"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cellspacing="0" cellpadding="5" width="100%">
|
||||
<tr>
|
||||
<td class="SubHead" style="white-space: nowrap;">
|
||||
<asp:Label ID="lblFolderName" runat="server" meta:resourcekey="lblFolderName"></asp:Label>
|
||||
</td>
|
||||
<td class="NormalBold" style="white-space: nowrap;">
|
||||
<asp:Label runat="server" ID="LabelWebSiteName"></asp:Label>
|
||||
|
||||
<uc1:FileLookup id="folderPath" runat="server" Width="400">
|
||||
</uc1:FileLookup>
|
||||
<asp:HiddenField ID="contentPath" runat="server" />
|
||||
<asp:HiddenField ID="DebuggerUrlField" runat="server" />
|
||||
</td>
|
||||
<td style="width: 40%">
|
||||
<asp:Button ID="ButtonDebuggerStart" runat="server" Text="Start Debugging" meta:resourcekey="btnApeDebuggerStart"
|
||||
CssClass="Button1" OnClick="DebugStartClick" />
|
||||
<asp:Button ID="ButtonDebuggerStop" runat="server" Text="Stop Debugging" meta:resourcekey="btnApeDebuggerStop"
|
||||
CssClass="Button1" OnClick="DebugStopClick" />
|
||||
<asp:Button ID="BUttonShowDebuggingPageLinkModal" runat="server" Text="Show debugging page link" meta:resourcekey="btnShowDebuggingPageLinkModal"
|
||||
CssClass="Button1 Hidden" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<asp:Panel runat="server" ID="DebuggerFramePanel" Visible="False">
|
||||
<iframe runat="server" ID="DebuggerFrame" width="100%" height="400px"></iframe>
|
||||
</asp:Panel>
|
||||
|
||||
<asp:TextBox ID="htaccessContent" runat="server" TextMode="MultiLine" class="CodeEditor"></asp:TextBox>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="FormFooter">
|
||||
<asp:Button ID="btnUpdate" runat="server" Text="Update" meta:resourcekey="btnUpdate"
|
||||
CssClass="Button1" OnClick="btnUpdate_Click" />
|
||||
<asp:Button ID="btnSave" runat="server" Text="Save and continue editing" meta:resourcekey="btnSave"
|
||||
CssClass="Button1" OnClick="btnSave_Click" />
|
||||
<asp:Button ID="btnCancel" runat="server" Text="Cancel" meta:resourcekey="btnCancel"
|
||||
CssClass="Button1" CausesValidation="false" OnClick="btnCancel_Click" />
|
||||
CssClass="Button1" CausesValidation="false" OnClick="BtnCancelClick" />
|
||||
</div>
|
||||
|
||||
<asp:Panel ID="DebuggingPageLinkPanel" runat="server" CssClass="PopupContainer" style="display:none" DefaultButton="btnCancelDebuggingPageLinkPanel">
|
||||
<wsp:PopupHeader runat="server" meta:resourcekey="lblDebuggingPageLink" Text="Debugging Page Link" />
|
||||
<div class="Content">
|
||||
<div class="Body">
|
||||
<br />
|
||||
<div class="FormRow">
|
||||
<asp:Label ID="LabelClickLink" runat="server" meta:resourcekey="lblCLickLink" Text="Click this link to open debugging page"></asp:Label>:
|
||||
<br/>
|
||||
<br/>
|
||||
<asp:HyperLink runat="server" ID="LinkDebuggingPage" Target="ape-debugging-page" CssClass="LinkDebuggingPage"></asp:HyperLink>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
<div class="FormFooter">
|
||||
<asp:Button ID="btnCancelDebuggingPageLinkPanel" runat="server" CssClass="Button1" meta:resourcekey="btnClose" Text="Close" CausesValidation="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
|
||||
<ajaxToolkit:ModalPopupExtender ID="DebuggingPageLinkModal" runat="server"
|
||||
PopupControlID="DebuggingPageLinkPanel" TargetControlID="BUttonShowDebuggingPageLinkModal"
|
||||
BackgroundCssClass="modalBackground" DropShadow="false" CancelControlID="btnCancelDebuggingPageLinkPanel" />
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
CodeMirror.fromTextArea(($('.CodeEditor')[0]),
|
||||
{
|
||||
lineNumbers: true,
|
||||
autofocus: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -31,6 +31,7 @@ using System.Data;
|
|||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
|
@ -65,22 +66,30 @@ namespace WebsitePanel.Portal
|
|||
{
|
||||
// read httpd.conf
|
||||
folder = ES.Services.WebServers.GetHeliconApeHttpdFolder(int.Parse(spaceId));
|
||||
btnApeDebug.Visible = false;
|
||||
ButtonDebuggerStart.Visible = false;
|
||||
ButtonDebuggerStop.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// read web site
|
||||
WebSite site = ES.Services.WebServers.GetWebSite(PanelRequest.ItemID);
|
||||
WebSite site = GetWebSite();
|
||||
|
||||
if (site == null)
|
||||
{
|
||||
RedirectToBrowsePage();
|
||||
return;
|
||||
}
|
||||
|
||||
LabelWebSiteName.Text = site.Name;
|
||||
|
||||
folderPath.RootFolder = site.ContentPath;
|
||||
folderPath.PackageId = site.PackageId;
|
||||
htaccessContent.Text = "# Helicon Ape\n";
|
||||
|
||||
ButtonDebuggerStart.Visible = true;
|
||||
ButtonDebuggerStop.Visible = false;
|
||||
|
||||
|
||||
if (String.IsNullOrEmpty(PanelRequest.Name))
|
||||
return;
|
||||
|
||||
|
@ -102,14 +111,16 @@ namespace WebsitePanel.Portal
|
|||
{
|
||||
htaccessContent.Text = "# Helicon Ape\n";
|
||||
}
|
||||
|
||||
ApeDebuggerUrl.Value = "";
|
||||
|
||||
/*
|
||||
DebuggerUrlField.Value = "";
|
||||
|
||||
if ( RE_APE_DEBUGGER_ENABLED.IsMatch(htaccessContent.Text) )
|
||||
{
|
||||
btnApeDebug.Text = "Stop Debug";
|
||||
GetApeDebuggerUrl();
|
||||
btnApeDebug.Text = (string)GetLocalResourceObject("btnApeDebuggerStop.Text");
|
||||
GetDebuggerUrl();
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
@ -123,19 +134,6 @@ namespace WebsitePanel.Portal
|
|||
string spaceId = Request.QueryString["SpaceID"];
|
||||
|
||||
|
||||
if (RE_APE_DEBUGGER_ENABLED.IsMatch(htaccessContent.Text))
|
||||
{
|
||||
btnApeDebug.Text = "Stop Debug";
|
||||
GetApeDebuggerUrl();
|
||||
}
|
||||
else
|
||||
if (RE_APE_DEBUGGER_DISABLED.IsMatch(htaccessContent.Text))
|
||||
{
|
||||
btnApeDebug.Text = "Start Debug";
|
||||
GetApeDebuggerUrl();
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
if (folder.Path == HtaccessFolder.HTTPD_CONF_FILE && !string.IsNullOrEmpty(spaceId))
|
||||
|
@ -177,70 +175,171 @@ namespace WebsitePanel.Portal
|
|||
|
||||
protected readonly Regex RE_APE_DEBUGGER_ENABLED = new Regex(@"^[ \t]*(SetEnv\s+mod_developer\s+secure-key-([\d]+))", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||
protected readonly Regex RE_APE_DEBUGGER_DISABLED = new Regex(@"^[ \t]*#[ \t]*(SetEnv\s+mod_developer\s+secure-key-([\d]+))", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||
protected string ApeDebuggerSecureKey = "";
|
||||
//protected string ApeDebuggerUrl = "";
|
||||
|
||||
protected string DebuggerSecureKey = "";
|
||||
protected string DebuggerSessionId = "";
|
||||
protected string DebuggerUrl = "";
|
||||
protected string DebuggingPageUrl = "";
|
||||
|
||||
protected void btnApeDebug_Click(object sender, EventArgs e)
|
||||
protected void DebugStartClick(object sender, EventArgs e)
|
||||
{
|
||||
var code = htaccessContent.Text;
|
||||
bool needUpdate = false;
|
||||
|
||||
if ( RE_APE_DEBUGGER_DISABLED.IsMatch(code) )
|
||||
{
|
||||
// already disabled, enable it!
|
||||
ApeDebuggerSecureKey = RE_APE_DEBUGGER_DISABLED.Match(code).Groups[2].Value;
|
||||
DebuggerSecureKey = RE_APE_DEBUGGER_DISABLED.Match(code).Groups[2].Value;
|
||||
code = RE_APE_DEBUGGER_DISABLED.Replace(code, "$1");
|
||||
btnApeDebug.Text = "Stop Debug";
|
||||
needUpdate = true;
|
||||
}
|
||||
else if ( RE_APE_DEBUGGER_ENABLED.IsMatch(code) )
|
||||
else if (RE_APE_DEBUGGER_ENABLED.IsMatch(code))
|
||||
{
|
||||
// alerdy enable, disable it!
|
||||
ApeDebuggerSecureKey = "";
|
||||
code = RE_APE_DEBUGGER_ENABLED.Replace(code, "# $1");
|
||||
btnApeDebug.Text = "Start Debug";
|
||||
// already enabled
|
||||
DebuggerSecureKey = RE_APE_DEBUGGER_ENABLED.Match(code).Groups[2].Value;
|
||||
needUpdate = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApeDebuggerSecureKey = new Random().Next(100000000, 999999999).ToString();
|
||||
code = code + "\nSetEnv mod_developer secure-key-" + ApeDebuggerSecureKey +"\n";
|
||||
btnApeDebug.Text = "Stop Debug";
|
||||
DebuggerSecureKey = new Random().Next(100000000, 999999999).ToString(CultureInfo.InvariantCulture);
|
||||
code = code + "\nSetEnv mod_developer secure-key-" + DebuggerSecureKey + "\n";
|
||||
needUpdate = true;
|
||||
}
|
||||
|
||||
htaccessContent.Text = code;
|
||||
SaveFolder();
|
||||
if (needUpdate)
|
||||
{
|
||||
htaccessContent.Text = code;
|
||||
SaveFolder();
|
||||
}
|
||||
|
||||
GetApeDebuggerUrl();
|
||||
StartDebugger();
|
||||
}
|
||||
|
||||
private void GetApeDebuggerUrl()
|
||||
protected void DebugStopClick(object sender, EventArgs e)
|
||||
{
|
||||
if (RE_APE_DEBUGGER_ENABLED.IsMatch(htaccessContent.Text))
|
||||
var code = htaccessContent.Text;
|
||||
if (RE_APE_DEBUGGER_ENABLED.IsMatch(code))
|
||||
{
|
||||
// already disabled, enable it!
|
||||
ApeDebuggerSecureKey = RE_APE_DEBUGGER_ENABLED.Match(htaccessContent.Text).Groups[2].Value;
|
||||
// alerdy enable, disable it!
|
||||
code = RE_APE_DEBUGGER_ENABLED.Replace(code, "# $1");
|
||||
htaccessContent.Text = code;
|
||||
SaveFolder();
|
||||
}
|
||||
|
||||
ApeDebuggerUrl.Value = "";
|
||||
if ( !string.IsNullOrEmpty(ApeDebuggerSecureKey) )
|
||||
|
||||
StopDebugger();
|
||||
}
|
||||
|
||||
private void GetDebuggerUrl()
|
||||
{
|
||||
// TODO: interactive binding selection
|
||||
|
||||
if ( !string.IsNullOrEmpty(DebuggerSecureKey) )
|
||||
{
|
||||
WebSite site = ES.Services.WebServers.GetWebSite(PanelRequest.ItemID);
|
||||
WebSite site = GetWebSite();
|
||||
|
||||
if ( null != site)
|
||||
{
|
||||
if (site.Bindings.Length > 0)
|
||||
{
|
||||
ServerBinding serverBinding = site.Bindings[0];
|
||||
ApeDebuggerUrl.Value = string.Format("{0}://{1}:{2}{3}?ape_debug={4}",
|
||||
serverBinding.Protocol,
|
||||
serverBinding.Host ?? serverBinding.IP,
|
||||
serverBinding.Port,
|
||||
folderPath.SelectedFile.Replace('\\', '/'),
|
||||
ApeDebuggerSecureKey
|
||||
);
|
||||
DebuggerUrl = string.Format(
|
||||
"{0}://{1}:{2}{3}/_ape_start_developer_session?ape_debug=secure-key-{4}_{5}",
|
||||
serverBinding.Protocol,
|
||||
serverBinding.Host ?? serverBinding.IP,
|
||||
serverBinding.Port,
|
||||
folderPath.SelectedFile.Replace('\\', '/'),
|
||||
DebuggerSecureKey,
|
||||
DebuggerSessionId
|
||||
);
|
||||
DebuggerUrlField.Value = DebuggerUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: throw error if debugger url is empty
|
||||
}
|
||||
|
||||
protected void btnCancel_Click(object sender, EventArgs e)
|
||||
private WebSite GetWebSite()
|
||||
{
|
||||
WebSite webSite = ViewState["HtaccessWebSite"] as WebSite;
|
||||
if (null == webSite)
|
||||
{
|
||||
webSite = ES.Services.WebServers.GetWebSite(PanelRequest.ItemID);
|
||||
// TODO: ViewState["HtaccessWebSite"] = webSite;
|
||||
}
|
||||
|
||||
return webSite;
|
||||
}
|
||||
|
||||
private void GetDebuggingPageUrl()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(DebuggerSecureKey))
|
||||
{
|
||||
WebSite site = GetWebSite();
|
||||
|
||||
if (null != site)
|
||||
{
|
||||
if (site.Bindings.Length > 0)
|
||||
{
|
||||
ServerBinding serverBinding = site.Bindings[0];
|
||||
|
||||
DebuggingPageUrl = string.Format(
|
||||
"{0}://{1}:{2}{3}/?ape_debug=secure-key-{4}_{5}",
|
||||
serverBinding.Protocol,
|
||||
serverBinding.Host ?? serverBinding.IP,
|
||||
serverBinding.Port,
|
||||
folderPath.SelectedFile.Replace('\\', '/'),
|
||||
DebuggerSecureKey,
|
||||
DebuggerSessionId
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: throw error if url is empty
|
||||
}
|
||||
|
||||
|
||||
private void StartDebugger()
|
||||
{
|
||||
ButtonDebuggerStart.Visible = false;
|
||||
ButtonDebuggerStop.Visible = true;
|
||||
|
||||
// session id
|
||||
DebuggerSessionId = new Random().Next(100000000, 999999999).ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
// debugger url
|
||||
GetDebuggerUrl();
|
||||
|
||||
// debugging page url
|
||||
GetDebuggingPageUrl();
|
||||
|
||||
// show debugger iframe
|
||||
DebuggerFramePanel.Visible = true;
|
||||
DebuggerFrame.Attributes["src"] = DebuggerUrl;
|
||||
|
||||
// debugging page link
|
||||
LinkDebuggingPage.NavigateUrl = DebuggingPageUrl;
|
||||
LinkDebuggingPage.Text = DebuggingPageUrl;
|
||||
DebuggingPageLinkModal.Show();
|
||||
|
||||
}
|
||||
|
||||
private void StopDebugger()
|
||||
{
|
||||
ButtonDebuggerStart.Visible = true;
|
||||
ButtonDebuggerStop.Visible = false;
|
||||
|
||||
DebuggerUrl = "";
|
||||
DebuggingPageUrl = "";
|
||||
DebuggerSessionId = "";
|
||||
|
||||
// hide debugger iframe
|
||||
DebuggerFramePanel.Visible = false;
|
||||
}
|
||||
|
||||
protected void BtnCancelClick(object sender, EventArgs e)
|
||||
{
|
||||
ReturnBack();
|
||||
}
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
// 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.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
|
@ -21,6 +49,15 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblFolderName;
|
||||
|
||||
/// <summary>
|
||||
/// LabelWebSiteName 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 LabelWebSiteName;
|
||||
|
||||
/// <summary>
|
||||
/// folderPath control.
|
||||
/// </summary>
|
||||
|
@ -40,22 +77,58 @@ namespace WebsitePanel.Portal {
|
|||
protected global::System.Web.UI.WebControls.HiddenField contentPath;
|
||||
|
||||
/// <summary>
|
||||
/// ApeDebuggerUrl control.
|
||||
/// DebuggerUrlField 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.HiddenField ApeDebuggerUrl;
|
||||
protected global::System.Web.UI.WebControls.HiddenField DebuggerUrlField;
|
||||
|
||||
/// <summary>
|
||||
/// btnApeDebug control.
|
||||
/// ButtonDebuggerStart 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.Button btnApeDebug;
|
||||
protected global::System.Web.UI.WebControls.Button ButtonDebuggerStart;
|
||||
|
||||
/// <summary>
|
||||
/// ButtonDebuggerStop 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.Button ButtonDebuggerStop;
|
||||
|
||||
/// <summary>
|
||||
/// BUttonShowDebuggingPageLinkModal 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.Button BUttonShowDebuggingPageLinkModal;
|
||||
|
||||
/// <summary>
|
||||
/// DebuggerFramePanel 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.Panel DebuggerFramePanel;
|
||||
|
||||
/// <summary>
|
||||
/// DebuggerFrame 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.HtmlGenericControl DebuggerFrame;
|
||||
|
||||
/// <summary>
|
||||
/// htaccessContent control.
|
||||
|
@ -92,5 +165,50 @@ namespace WebsitePanel.Portal {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnCancel;
|
||||
|
||||
/// <summary>
|
||||
/// DebuggingPageLinkPanel 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.Panel DebuggingPageLinkPanel;
|
||||
|
||||
/// <summary>
|
||||
/// LabelClickLink 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 LabelClickLink;
|
||||
|
||||
/// <summary>
|
||||
/// LinkDebuggingPage 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.HyperLink LinkDebuggingPage;
|
||||
|
||||
/// <summary>
|
||||
/// btnCancelDebuggingPageLinkPanel 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.Button btnCancelDebuggingPageLinkPanel;
|
||||
|
||||
/// <summary>
|
||||
/// DebuggingPageLinkModal control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::AjaxControlToolkit.ModalPopupExtender DebuggingPageLinkModal;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,66 +2,89 @@
|
|||
Inherits="WebsitePanel.Portal.WebSitesHeliconApeControl" %>
|
||||
<%@ Import Namespace="WebsitePanel.Portal" %>
|
||||
|
||||
<div class="FormRow">
|
||||
<asp:Panel runat="server" ID="panelHeliconApeIsNotInstalledMessage" Visible="false">
|
||||
<p>
|
||||
<asp:Localize runat="server" meta:resourcekey="ApeModuleNotes" /></p>
|
||||
</asp:Panel>
|
||||
<asp:Panel runat="server" ID="panelHeliconApeIsNotEnabledMessage" Visible="false">
|
||||
<p>
|
||||
<asp:Localize runat="server" meta:resourcekey="ApeProductNotes" /></p>
|
||||
</asp:Panel>
|
||||
<asp:Button ID="btnToggleHeliconApe" runat="server" meta:resourcekey="btnToggleHeliconApe"
|
||||
Text="Enable Helicon Ape" CssClass="Button2" CausesValidation="false" OnClick="btnToggleHeliconApe_Click" />
|
||||
<div style="float: right;">
|
||||
<asp:HyperLink runat="server" Target="_blank" NavigateUrl="http://www.helicontech.com/ape/doc/wsp.htm"
|
||||
meta:resourcekey="ModuleHelpLink" />
|
||||
</div>
|
||||
</div>
|
||||
<asp:Panel ID="HeliconApeFoldersPanel" runat="server">
|
||||
<div class="FormButtonsBar">
|
||||
<asp:Button ID="btnAddHeliconApeFolder" runat="server" meta:resourcekey="btnAddHeliconApeFolder"
|
||||
Text="Add Folder" CssClass="Button2" CausesValidation="false" OnClick="btnAddHeliconApeFolder_Click" />
|
||||
</div>
|
||||
<style type="text/css">
|
||||
.HtaccessPanel {
|
||||
margin: 1em 0 3em 0;
|
||||
}
|
||||
.DelButton {
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<asp:Panel ID="HeliconApeFoldersPanel" runat="server" CssClass="HtaccessPanel">
|
||||
|
||||
<table class="FormButtonsBar" width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label runat="server" CssClass="NormalBold" meta:resourcekey="labelSelectHtacesEdit"></asp:Label>
|
||||
</td>
|
||||
<td align="right">
|
||||
<asp:Button ID="btnAddHeliconApeFolder" runat="server" meta:resourcekey="btnAddHeliconApeFolder"
|
||||
Text="Add .htaccess" CssClass="Button2" CausesValidation="false" OnClick="btnAddHeliconApeFolder_Click" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="gvHeliconApeFolders" runat="server" EnableViewState="True" AutoGenerateColumns="false"
|
||||
ShowHeader="true" CssSelectorClass="NormalGridView" EmptyDataText="gvHeliconApeFolders"
|
||||
DataKeyNames="Path,ContentPath" OnRowDeleting="gvHeliconApeFolders_RowDeleting">
|
||||
ShowHeader="False" CssSelectorClass="LightGridView" EmptyDataText="gvHeliconApeFolders"
|
||||
DataKeyNames="Path,ContentPath" OnRowDeleting="gvHeliconApeFolders_RowDeleting" Width="100%">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="gvHeliconApeFoldersName" ItemStyle-Width="100%">
|
||||
<ItemStyle CssClass="NormalBold"></ItemStyle>
|
||||
<asp:TemplateField HeaderText="gvHeliconApeFoldersName" ItemStyle-Width="782px">
|
||||
<ItemStyle CssClass="NormalText"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="lnkEditHeliconApeFolder" runat="server" NavigateUrl='<%# GetEditControlUrl("edit_htaccessfolder", Eval("Path").ToString()) %>'>
|
||||
<%# Eval("Path")%>
|
||||
<asp:HyperLink ID="lnkEditHeliconApeFolder" runat="server"
|
||||
NavigateUrl='<%# GetEditControlUrl("edit_htaccessfolder", Eval("Path").ToString()) %>'
|
||||
CssClass="NormalBold">
|
||||
<%# GetHtaccessPathOnSite((string)Eval("Path")) %>
|
||||
</asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="110px">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="lnkEditHeliconApeFolderAuth" runat="server" NavigateUrl='<%# GetEditControlUrl("edit_htaccessfolderauth", Eval("Path").ToString()) %>'
|
||||
title="Helicon Ape Folder Security Properties">
|
||||
<image src="/App_Themes/Default/Images/shield.png" style="border: 0;" />
|
||||
title="Folder Security Properties (.htpasswd)">
|
||||
<image src="/App_Themes/Default/Images/shield.png" style="border: 0; vertical-align: top; margin-right: 3px;" />Security options
|
||||
</asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="cmdDeleteHeliconApeFolder" runat="server" SkinID="DeleteSmall"
|
||||
CommandName="delete" CausesValidation="false" meta:resourcekey="cmdDeleteHeliconApeFolder"
|
||||
OnClientClick="return confirm('Delete?');"></asp:ImageButton>
|
||||
<asp:ImageButton ID="cmdDeleteHeliconApeFolder" runat="server" SkinID="DeleteSmall" CssClass="DelButton"
|
||||
CommandName="delete" CausesValidation="false"
|
||||
OnClientClick="return confirm('Delete .htaccess?');"></asp:ImageButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<br />
|
||||
<div class="FormButtonsBar">
|
||||
<asp:Button ID="btnAddHeliconApeUser" runat="server" meta:resourcekey="btnAddHeliconApeUser"
|
||||
Text="Add User" CssClass="Button2" CausesValidation="false" OnClick="btnAddHeliconApeUser_Click" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="Button2" id="ShowSecurityPanelButton" value="Show Security Options (.htpasswd)" type="button" />
|
||||
<div id="SecurityPanel" class="Hidden">
|
||||
<table class="FormButtonsBar" width="100%" style="margin-top: 2em;">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label runat="server" CssClass="NormalBold" meta:resourcekey="HeliconApeUsersHeader"></asp:Label>
|
||||
</td>
|
||||
<td align="right">
|
||||
<asp:Button ID="btnAddHeliconApeUser" runat="server" meta:resourcekey="btnAddHeliconApeUser"
|
||||
Text="Add User" CssClass="Button2" CausesValidation="false" OnClick="btnAddHeliconApeUser_Click" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="gvHeliconApeUsers" runat="server" EnableViewState="True" AutoGenerateColumns="false"
|
||||
ShowHeader="true" CssSelectorClass="NormalGridView" EmptyDataText="gvHeliconApeUsers"
|
||||
DataKeyNames="Name" OnRowDeleting="gvHeliconApeUsers_RowDeleting">
|
||||
ShowHeader="False" CssSelectorClass="LightGridView" EmptyDataText="gvHeliconApeUsers"
|
||||
DataKeyNames="Name" OnRowDeleting="gvHeliconApeUsers_RowDeleting" Width="100%">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="gvHeliconApeUsersName" ItemStyle-Width="100%">
|
||||
<asp:TemplateField ItemStyle-Width="100%">
|
||||
<ItemStyle CssClass="NormalBold"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="lnkEditUser" runat="server" NavigateUrl='<%# GetEditControlUrl("edit_htaccessuser", Eval("Name").ToString()) %>'>
|
||||
|
@ -69,25 +92,38 @@
|
|||
</asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="30px">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="cmdDeleteUser" runat="server" SkinID="DeleteSmall" CommandName="delete"
|
||||
CausesValidation="false" meta:resourcekey="cmdDeleteUser" OnClientClick="return confirm('Delete?');">
|
||||
<asp:ImageButton ID="cmdDeleteUser" runat="server" SkinID="DeleteSmall" CommandName="delete" CssClass="DelButton"
|
||||
CausesValidation="false" OnClientClick="return confirm('Delete user?');">
|
||||
</asp:ImageButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<br />
|
||||
<div class="FormButtonsBar">
|
||||
<asp:Button ID="btnAddHeliconApeGroup" runat="server" meta:resourcekey="btnAddHeliconApeGroup"
|
||||
Text="Add Group" CssClass="Button2" CausesValidation="false" OnClick="btnAddHeliconApeGroup_Click" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table class="FormButtonsBar" width="100%" style="margin-top: 3em;">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label ID="Label1" runat="server" CssClass="NormalBold" meta:resourcekey="HeliconApeGroupsHeader"></asp:Label>
|
||||
</td>
|
||||
<td align="right">
|
||||
<asp:Button ID="btnAddHeliconApeGroup" runat="server" meta:resourcekey="btnAddHeliconApeGroup"
|
||||
Text="Add Group" CssClass="Button2" CausesValidation="false" OnClick="btnAddHeliconApeGroup_Click" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<asp:GridView ID="gvHeliconApeGroups" runat="server" EnableViewState="True" AutoGenerateColumns="false"
|
||||
ShowHeader="true" EmptyDataText="gvHeliconApeGroups" CssSelectorClass="NormalGridView"
|
||||
DataKeyNames="Name" OnRowDeleting="gvHeliconApeGroups_RowDeleting">
|
||||
ShowHeader="False" EmptyDataText="gvHeliconApeGroups" CssSelectorClass="LightGridView"
|
||||
DataKeyNames="Name" OnRowDeleting="gvHeliconApeGroups_RowDeleting" Width="100%">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="gvHeliconApeGroupsName" ItemStyle-Width="100%">
|
||||
<asp:TemplateField ItemStyle-Width="100%">
|
||||
<ItemStyle CssClass="NormalBold"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="lnkEditGroup" runat="server" NavigateUrl='<%# GetEditControlUrl("edit_htaccessgroup", Eval("Name").ToString()) %>'>
|
||||
|
@ -95,13 +131,45 @@
|
|||
</asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="30px">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="cmdDeleteGroup" runat="server" SkinID="DeleteSmall" CommandName="delete"
|
||||
CausesValidation="false" meta:resourcekey="cmdDeleteGroup" OnClientClick="return confirm('Delete?');">
|
||||
<asp:ImageButton ID="cmdDeleteGroup" runat="server" SkinID="DeleteSmall" CommandName="delete" CssClass="DelButton"
|
||||
CausesValidation="false" OnClientClick="return confirm('Delete group?');">
|
||||
</asp:ImageButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="FormButtonsBar">
|
||||
<asp:Panel runat="server" ID="panelHeliconApeIsNotInstalledMessage" Visible="false">
|
||||
<p>
|
||||
<asp:Localize ID="Localize1" runat="server" meta:resourcekey="ApeModuleNotes" /></p>
|
||||
</asp:Panel>
|
||||
<asp:Panel runat="server" ID="panelHeliconApeIsNotEnabledMessage" Visible="false">
|
||||
<p>
|
||||
<asp:Localize ID="Localize2" runat="server" meta:resourcekey="ApeProductNotes" /></p>
|
||||
</asp:Panel>
|
||||
<asp:Button ID="btnToggleHeliconApe" runat="server" meta:resourcekey="btnToggleHeliconApe"
|
||||
Text="Enable Helicon Ape" CssClass="Button2" CausesValidation="false" OnClick="btnToggleHeliconApe_Click" />
|
||||
<div style="float: right;">
|
||||
<asp:HyperLink ID="HyperLink1" runat="server" Target="_blank" NavigateUrl="http://www.helicontech.com/ape/doc/wsp.htm"
|
||||
meta:resourcekey="ModuleHelpLink" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/JavaScript/jquery-1.4.4.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('#ShowSecurityPanelButton').click(function () {
|
||||
$('#ShowSecurityPanelButton').slideUp();
|
||||
$('#SecurityPanel').slideDown();
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -359,5 +359,17 @@ namespace WebsitePanel.Portal
|
|||
e.Cancel = true;
|
||||
}
|
||||
|
||||
protected string GetHtaccessPathOnSite(string path)
|
||||
{
|
||||
path = path.Replace('\\', '/');
|
||||
if (!path.EndsWith("/"))
|
||||
{
|
||||
path += "/";
|
||||
}
|
||||
|
||||
path += ".htaccess";
|
||||
|
||||
return path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
// 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.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
|
@ -12,33 +40,6 @@ namespace WebsitePanel.Portal {
|
|||
|
||||
public partial class WebSitesHeliconApeControl {
|
||||
|
||||
/// <summary>
|
||||
/// panelHeliconApeIsNotInstalledMessage 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.Panel panelHeliconApeIsNotInstalledMessage;
|
||||
|
||||
/// <summary>
|
||||
/// panelHeliconApeIsNotEnabledMessage 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.Panel panelHeliconApeIsNotEnabledMessage;
|
||||
|
||||
/// <summary>
|
||||
/// btnToggleHeliconApe 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.Button btnToggleHeliconApe;
|
||||
|
||||
/// <summary>
|
||||
/// HeliconApeFoldersPanel control.
|
||||
/// </summary>
|
||||
|
@ -84,6 +85,15 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView gvHeliconApeUsers;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 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;
|
||||
|
||||
/// <summary>
|
||||
/// btnAddHeliconApeGroup control.
|
||||
/// </summary>
|
||||
|
@ -101,5 +111,59 @@ namespace WebsitePanel.Portal {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView gvHeliconApeGroups;
|
||||
|
||||
/// <summary>
|
||||
/// panelHeliconApeIsNotInstalledMessage 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.Panel panelHeliconApeIsNotInstalledMessage;
|
||||
|
||||
/// <summary>
|
||||
/// Localize1 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 Localize1;
|
||||
|
||||
/// <summary>
|
||||
/// panelHeliconApeIsNotEnabledMessage 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.Panel panelHeliconApeIsNotEnabledMessage;
|
||||
|
||||
/// <summary>
|
||||
/// Localize2 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 Localize2;
|
||||
|
||||
/// <summary>
|
||||
/// btnToggleHeliconApe 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.Button btnToggleHeliconApe;
|
||||
|
||||
/// <summary>
|
||||
/// HyperLink1 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.HyperLink HyperLink1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
<td><asp:checkbox id="chkDedicatedPool" meta:resourcekey="chkDedicatedPool" Text="Dedicated Application Pool" Runat="server"></asp:checkbox></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<asp:PlaceHolder runat="server" id="pnlCustomAuth">
|
||||
<br />
|
||||
<table class="Normal" cellSpacing="0" cellPadding="3">
|
||||
|
@ -69,8 +70,25 @@
|
|||
<tr>
|
||||
<td nowrap><asp:checkbox id="chkAuthBasic" meta:resourcekey="chkAuthBasic" Text="Basic authentication" Runat="server"></asp:checkbox></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</table>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
|
||||
<table class="Normal" cellSpacing="0" cellPadding="3">
|
||||
<tr>
|
||||
<td class="NormalBold">
|
||||
<asp:Label ID="lblCompression" runat="server" meta:resourcekey="lblCompression" Text="Compression:"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap><asp:checkbox id="chkDynamicCompression" meta:resourcekey="chkDynamicCompression" Text="Enable dynamic compression" Runat="server"></asp:checkbox></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap><asp:checkbox id="chkStaticCompression" meta:resourcekey="chkStaticCompression" Text="Enable static compression" Runat="server"></asp:checkbox></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td width="30" nowrap></td>
|
||||
<td valign="top">
|
||||
|
|
|
@ -81,6 +81,8 @@ namespace WebsitePanel.Portal
|
|||
chkAuthAnonymous.Checked = item.EnableAnonymousAccess;
|
||||
chkAuthWindows.Checked = item.EnableWindowsAuthentication;
|
||||
chkAuthBasic.Checked = item.EnableBasicAuthentication;
|
||||
chkDynamicCompression.Checked = item.EnableDynamicCompression;
|
||||
chkStaticCompression.Checked = item.EnableStaticCompression;
|
||||
|
||||
// default documents
|
||||
txtDefaultDocs.Text = String.Join("\n", item.DefaultDocs.Split(',', ';'));
|
||||
|
@ -131,6 +133,9 @@ namespace WebsitePanel.Portal
|
|||
item.EnableAnonymousAccess = chkAuthAnonymous.Checked;
|
||||
item.EnableWindowsAuthentication = chkAuthWindows.Checked;
|
||||
item.EnableBasicAuthentication = chkAuthBasic.Checked;
|
||||
item.EnableDynamicCompression = chkDynamicCompression.Checked;
|
||||
item.EnableStaticCompression = chkStaticCompression.Checked;
|
||||
|
||||
|
||||
// default documents
|
||||
item.DefaultDocs = String.Join(",", Utils.ParseDelimitedString(txtDefaultDocs.Text, '\n', '\r', ';', ','));
|
||||
|
|
|
@ -1,22 +1,43 @@
|
|||
// 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.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.312
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WebsitePanel.Portal {
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// WebSitesHomeFolderControl class.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated class.
|
||||
/// </remarks>
|
||||
public partial class WebSitesHomeFolderControl {
|
||||
|
||||
/// <summary>
|
||||
|
@ -163,6 +184,33 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkAuthBasic;
|
||||
|
||||
/// <summary>
|
||||
/// lblCompression 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 lblCompression;
|
||||
|
||||
/// <summary>
|
||||
/// chkDynamicCompression 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.CheckBox chkDynamicCompression;
|
||||
|
||||
/// <summary>
|
||||
/// chkStaticCompression 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.CheckBox chkStaticCompression;
|
||||
|
||||
/// <summary>
|
||||
/// pnlDefaultDocuments control.
|
||||
/// </summary>
|
||||
|
|
|
@ -419,6 +419,13 @@
|
|||
<Compile Include="UserControls\EditFeedsList.ascx.designer.cs">
|
||||
<DependentUpon>EditFeedsList.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControls\OrgIdPolicyEditor.ascx.cs">
|
||||
<DependentUpon>OrgIdPolicyEditor.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UserControls\OrgIdPolicyEditor.ascx.designer.cs">
|
||||
<DependentUpon>OrgIdPolicyEditor.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VPSForPC\MonitoringPage.aspx.cs">
|
||||
<DependentUpon>MonitoringPage.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
@ -3870,6 +3877,7 @@
|
|||
<Content Include="SettingsExchangeMailboxPlansPolicy.ascx" />
|
||||
<Content Include="SettingsLyncUserPlansPolicy.ascx" />
|
||||
<Content Include="UserControls\EditFeedsList.ascx" />
|
||||
<Content Include="UserControls\OrgIdPolicyEditor.ascx" />
|
||||
<Content Include="VPSForPC\MonitoringPage.aspx" />
|
||||
<Content Include="VPSForPC\VdcAccountVLanAdd.ascx" />
|
||||
<Content Include="VPSForPC\VdcAccountVLanNetwork.ascx" />
|
||||
|
@ -4945,7 +4953,9 @@
|
|||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="ScheduleTaskControls\App_LocalResources\NotifyOverusedDatabases.ascx.resx" />
|
||||
<Content Include="App_LocalResources\WebSitesEditHeliconApeFolder.ascx.resx" />
|
||||
<Content Include="App_LocalResources\WebSitesEditHeliconApeFolder.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="App_LocalResources\WebSitesEditHeliconApeFolderAuth.ascx.resx" />
|
||||
<Content Include="App_LocalResources\WebSitesEditHeliconApeGroup.ascx.resx" />
|
||||
<Content Include="App_LocalResources\WebSitesEditHeliconApeUser.ascx.resx" />
|
||||
|
@ -5008,6 +5018,7 @@
|
|||
<Content Include="ExchangeServer\App_LocalResources\OrganizationAddDomainName.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="UserControls\App_LocalResources\OrgIdPolicyEditor.ascx.resx" />
|
||||
<None Include="Resources\Windows2008_Settings.ascx.resx" />
|
||||
<Content Include="App_LocalResources\WebSitesHeliconZooControl.ascx.resx" />
|
||||
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
|
||||
|
|
|
@ -0,0 +1,245 @@
|
|||
/* BASICS */
|
||||
|
||||
.CodeMirror {
|
||||
/* Set height, width, borders, and global font properties here */
|
||||
font-family: monospace;
|
||||
height: 300px;
|
||||
}
|
||||
.CodeMirror-scroll {
|
||||
/* Set scrolling behaviour here */
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* PADDING */
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0; /* Vertical padding around content */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler {
|
||||
background-color: white; /* The little square between H and V scrollbars */
|
||||
}
|
||||
|
||||
/* GUTTER */
|
||||
|
||||
.CodeMirror-gutters {
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
.CodeMirror-linenumbers {}
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* CURSOR */
|
||||
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
border-left: 1px solid black;
|
||||
}
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
background: rgba(0, 200, 0, .4);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
||||
}
|
||||
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
||||
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id) {
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
||||
}
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-default .cm-keyword {color: #708;}
|
||||
.cm-s-default .cm-atom {color: #219;}
|
||||
.cm-s-default .cm-number {color: #164;}
|
||||
.cm-s-default .cm-def {color: #00f;}
|
||||
.cm-s-default .cm-variable {color: black;}
|
||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||
.cm-s-default .cm-variable-3 {color: #085;}
|
||||
.cm-s-default .cm-property {color: black;}
|
||||
.cm-s-default .cm-operator {color: black;}
|
||||
.cm-s-default .cm-comment {color: #a50;}
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
.cm-s-default .cm-meta {color: #555;}
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-s-default .cm-qualifier {color: #555;}
|
||||
.cm-s-default .cm-builtin {color: #30a;}
|
||||
.cm-s-default .cm-bracket {color: #997;}
|
||||
.cm-s-default .cm-tag {color: #170;}
|
||||
.cm-s-default .cm-attribute {color: #00c;}
|
||||
.cm-s-default .cm-header {color: blue;}
|
||||
.cm-s-default .cm-quote {color: #090;}
|
||||
.cm-s-default .cm-hr {color: #999;}
|
||||
.cm-s-default .cm-link {color: #00c;}
|
||||
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-emstrong {font-style: italic; font-weight: bold;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
|
||||
/* STOP */
|
||||
|
||||
/* The rest of this file contains styles related to the mechanics of
|
||||
the editor. You probably shouldn't touch them. */
|
||||
|
||||
.CodeMirror {
|
||||
line-height: 1;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
padding-bottom: 30px; padding-right: 30px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actuall scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
z-index: 6;
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute; left: 0; top: 0;
|
||||
height: 100%;
|
||||
padding-bottom: 30px;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-gutter {
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
/* Hack to make IE7 behave */
|
||||
*zoom:1;
|
||||
*display:inline;
|
||||
}
|
||||
.CodeMirror-gutter-elt {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
}
|
||||
.CodeMirror pre {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
}
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-widget {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.CodeMirror-wrap .CodeMirror-scroll {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%; height: 0px;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
.CodeMirror-focused div.CodeMirror-cursor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||
|
||||
.cm-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
||||
.CodeMirror span { *vertical-align: text-bottom; }
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,220 @@
|
|||
CodeMirror.defineMode('htaccess', function() {
|
||||
|
||||
var words = {};
|
||||
function define(style, string) {
|
||||
var split = string.split(' ');
|
||||
for(var i = 0; i < split.length; i++) {
|
||||
words[split[i]] = style;
|
||||
}
|
||||
};
|
||||
|
||||
// Atoms
|
||||
define('atom', 'On Off yes no');
|
||||
|
||||
// Keywords
|
||||
//define('keyword', 'Files Location');
|
||||
|
||||
// Commands
|
||||
define('builtin', 'AddInputFilter AddLanguage AddModuleInfo AddOutputFilter AddOutputFilterbyType AddType Alias AliasMatch Allow AllowConnect AllowEncodedslashes AllowOverride Anonymous Anonymous_LogEmail Anonymous_MustGiveEmail Anonymous_NoUserid Anonymous_VerifyEmail AuthBasicAuthoritative AuthBasicProvider AuthDbdUserpwQuery AuthDbdUserRealmQuery AuthDbmGroupFile AuthDbmType AuthDbmUserFile AuthDefaultAuthoritative AuthDigestAlgorithm AuthDigestDomain AuthDigestProvider AuthGroupFile AuthName AuthType AuthUserFile AuthzDbmAuthoritative AuthzDbmType AuthzDefaultAuthoritative AuthzGroupFileAuthoritative AuthzOwnerAuthoritative AuthzUserAuthoritative BalancerMember BrowserMatch BrowserMatchnocase CacheDebugHeader CacheDefaultExpire CacheDirLength CacheDirLevels CacheDisable CacheEnable CacheFile CacheignoreCachecontrol CacheignoreHeaders CacheignoreNoLastMod CacheignoreQueryString CacheLastModifiedFactor CacheMaxExpire CacheMaxFileSize CacheMinFileSize CacheRoot CacheStoreNoStore CacheStorePrivate CacheVaryByHeaders CacheVaryByParams CheckCaseOnly CheckSpelling CheckBaseName CookieDomain CookieExpires CookieLog CookieName Cookiestyle Cookietracking CustomLog DbdKeep DbdMax DbdMin DbdParams DbdPersist DbdPrepareSql DbDriver Deny DirectoryIndex DirectoryMatch DirectorySlash DOSHashTableSize DOSWhiteList DOSPageCount DOSsiteCount DOSPageInterval DOSsiteInterval DOSBlockingPeriod DOSCloseSocket DOSSystemCommand ErrorDocument ErrorLog ExpiresActive ExpiresByType ExpiresDefault FilterChain FilterDeclare FilterProtocol FilterProvider FreeSites GracefulShutdownTimeout Group Header HeaderName HostNameLookups Include KeepAlive keepAliveTimeout Listen ListenBackLog LoadFile LoadModule LockFile LogFormat LogLevel MCacheMaxObjectCount MCacheMaxObjectSize MCacheMaxStreaMingBuffer MCacheMinObjectSize MCacheRemovalAlgorithm MCacheSize mod_gzip_on mod_gzip_add_header_count mod_gzip_compression_level mod_gzip_keep_workfiles mod_gzip_dechunk mod_gzip_min_http mod_gzip_minimum_file_size mod_gzip_maximum_file_size mod_gzip_maximum_inmem_size mod_gzip_temp_dir mod_gzip_item_include mod_gzip_item_exclude mod_gzip_command_version mod_gzip_can_negotiate mod_gzip_handle_methods mod_gzip_static_suffix mod_gzip_send_vary mod_gzip_update_static NameVirtualHost NoProxy Options Order PassEnv ProxyBadHeader ProxyBlock ProxyDomain ProxyErrorOverride ProxyIoBufferSize ProxyMaxForwards ProxyPass ProxyPassinterpolateEnv ProxyPassMatch ProxyPassReverse ProxyPassReverseCookieDomain ProxyPassReverseCookiepath ProxyPreserveHost ProxyReceiveBufferSize ProxyRemote ProxyRemoteMatch ProxyRequests ProxySet ProxyStatus ProxyTimeout ProxyVia ReceiveBufferSize Redirect RedirectMatch Redirectpermanent Redirecttemp RegistrationName Registrationcode RemoveHandler RemoveInputFilter RemoveLanguage RemoveOutputFilter RemoveType ReplaceFilterDefine ReplacePattern RequestHeader Require RewriteBase RewriteCond RewriteEngine RewriteHeader RewriteLock RewriteLog RewriteLogLevel RewriteMap RewriteOptions RewriteRule RewriteProxy Satisfy SendBufferSize ServerAdmin ServerAlias ServerLimit ServerName ServerPath ServerRoot ServerSignature ServerTokens SetEnv SetEnvif SetEnvifnocase SetHandler SetInputFilter SetOutputFilter SeoRule Substitute Timeout TraceEnable TransferLog TypesConfig UnsetEnv UseCanonicalName UseCanonicalPhysicalPort UserDir VirtualDocumentRoot VirtualDocumentRootip VirtualscriptAlias VirtualscriptAliasIp HotlinkInvolveIp HotlinkExpires HotlinkProtect HotlinkSignature HotlinkType HotlinkError HotlinkAllow HotlinkDeny LinkFreezeEngine LinkFreezePageSizeLimit LinkFreezeRule');
|
||||
|
||||
function tokenBase(stream, state) {
|
||||
|
||||
var sol = stream.sol();
|
||||
var ch = stream.next();
|
||||
|
||||
if (ch === '\'' || ch === '"' || ch === '`') {
|
||||
state.tokens.unshift(tokenString(ch));
|
||||
return tokenize(stream, state);
|
||||
}
|
||||
if (ch === '#') {
|
||||
if (sol && stream.eat('!')) {
|
||||
stream.skipToEnd();
|
||||
return 'meta'; // 'comment'?
|
||||
}
|
||||
stream.skipToEnd();
|
||||
return 'comment';
|
||||
}
|
||||
if (ch === '$') {
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
return 'def';
|
||||
}
|
||||
if (ch === '%') {
|
||||
stream.eatWhile(/[\w\_{}]/);
|
||||
return 'tag';
|
||||
}
|
||||
if (ch === '+' || ch === '=') {
|
||||
return 'operator';
|
||||
}
|
||||
if (ch === '<') {
|
||||
stream.eat('/');
|
||||
stream.eatWhile(/[^>]/);
|
||||
return 'attribute';
|
||||
}
|
||||
if (ch === '>') {
|
||||
return 'attribute';
|
||||
}
|
||||
|
||||
/*
|
||||
if (ch === '-') {
|
||||
stream.eat('-');
|
||||
stream.eatWhile(/\w/);
|
||||
return 'attribute';
|
||||
}
|
||||
*/
|
||||
if (/\d/.test(ch)) {
|
||||
stream.eatWhile(/\d/);
|
||||
if(!/\w/.test(stream.peek())) {
|
||||
return 'number';
|
||||
}
|
||||
}
|
||||
stream.eatWhile(/\w/);
|
||||
var cur = stream.current();
|
||||
return words.hasOwnProperty(cur) ? words[cur] : null;
|
||||
}
|
||||
|
||||
function tokenString(quote) {
|
||||
return function(stream, state) {
|
||||
var next, end = false, escaped = false;
|
||||
while ((next = stream.next()) != null) {
|
||||
if (next === quote && !escaped) {
|
||||
end = true;
|
||||
break;
|
||||
}
|
||||
if (next === '$' && !escaped && quote !== '\'') {
|
||||
escaped = true;
|
||||
stream.backUp(1);
|
||||
state.tokens.unshift(tokenDollar);
|
||||
break;
|
||||
}
|
||||
escaped = !escaped && next === '\\';
|
||||
}
|
||||
if (end || !escaped) {
|
||||
state.tokens.shift();
|
||||
}
|
||||
return (quote === '`' || quote === ')' ? 'quote' : 'string');
|
||||
};
|
||||
};
|
||||
|
||||
function tokenize(stream, state) {
|
||||
return (state.tokens[0] || tokenBase) (stream, state);
|
||||
};
|
||||
|
||||
return {
|
||||
startState: function() {return {tokens:[]};},
|
||||
token: function(stream, state) {
|
||||
if (stream.eatSpace()) return null;
|
||||
return tokenize(stream, state);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME('text/x-htaccess', 'htaccess');
|
||||
CodeMirror.defineMIME('text/x-apache-conf', 'htaccess');
|
||||
|
||||
(function() {
|
||||
CodeMirror.htaccessHint = function(editor, getHints, givenOptions) {
|
||||
// Determine effective options based on given values and defaults.
|
||||
var options = {}, defaults = CodeMirror.htaccessHint.defaults;
|
||||
for (var opt in defaults)
|
||||
if (defaults.hasOwnProperty(opt))
|
||||
options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt];
|
||||
|
||||
function collectHints(previousToken) {
|
||||
// We want a single cursor position.
|
||||
if (editor.somethingSelected()) return;
|
||||
|
||||
var tempToken = editor.getTokenAt(editor.getCursor());
|
||||
|
||||
// Don't show completions if token has changed and the option is set.
|
||||
if (options.closeOnTokenChange && previousToken != null &&
|
||||
(tempToken.start != previousToken.start || tempToken.type != previousToken.type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//var result = getHints(editor, givenOptions);
|
||||
var result = {
|
||||
list: ['RewriteRule', 'RewriteEngine']
|
||||
};
|
||||
if (!result || !result.list.length) return;
|
||||
var completions = result.list;
|
||||
function insert(str) {
|
||||
editor.replaceRange(str, result.from, result.to);
|
||||
}
|
||||
// When there is only one completion, use it directly.
|
||||
if (options.completeSingle && completions.length == 1) {
|
||||
insert(completions[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Build the select widget
|
||||
var complete = document.createElement("div");
|
||||
complete.className = "CodeMirror-completions";
|
||||
var sel = complete.appendChild(document.createElement("select"));
|
||||
// Opera doesn't move the selection when pressing up/down in a
|
||||
// multi-select, but it does properly support the size property on
|
||||
// single-selects, so no multi-select is necessary.
|
||||
if (!window.opera) sel.multiple = true;
|
||||
for (var i = 0; i < completions.length; ++i) {
|
||||
var opt = sel.appendChild(document.createElement("option"));
|
||||
opt.appendChild(document.createTextNode(completions[i]));
|
||||
}
|
||||
sel.firstChild.selected = true;
|
||||
sel.size = Math.min(10, completions.length);
|
||||
var pos = editor.cursorCoords(options.alignWithWord ? result.from : null);
|
||||
complete.style.left = pos.left + "px";
|
||||
complete.style.top = pos.bottom + "px";
|
||||
document.body.appendChild(complete);
|
||||
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
|
||||
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
|
||||
if(winW - pos.left < sel.clientWidth)
|
||||
complete.style.left = (pos.left - sel.clientWidth) + "px";
|
||||
// Hack to hide the scrollbar.
|
||||
if (completions.length <= 10)
|
||||
complete.style.width = (sel.clientWidth - 1) + "px";
|
||||
|
||||
var done = false;
|
||||
function close() {
|
||||
if (done) return;
|
||||
done = true;
|
||||
complete.parentNode.removeChild(complete);
|
||||
}
|
||||
function pick() {
|
||||
insert(completions[sel.selectedIndex]);
|
||||
close();
|
||||
setTimeout(function(){editor.focus();}, 50);
|
||||
}
|
||||
CodeMirror.on(sel, "blur", close);
|
||||
CodeMirror.on(sel, "keydown", function(event) {
|
||||
var code = event.keyCode;
|
||||
// Enter
|
||||
if (code == 13) {CodeMirror.e_stop(event); pick();}
|
||||
// Escape
|
||||
else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();}
|
||||
else if (code != 38 && code != 40 && code != 33 && code != 34 && !CodeMirror.isModifierKey(event)) {
|
||||
close(); editor.focus();
|
||||
// Pass the event to the CodeMirror instance so that it can handle things like backspace properly.
|
||||
editor.triggerOnKeyDown(event);
|
||||
// Don't show completions if the code is backspace and the option is set.
|
||||
if (!options.closeOnBackspace || code != 8) {
|
||||
setTimeout(function(){collectHints(tempToken);}, 50);
|
||||
}
|
||||
}
|
||||
});
|
||||
CodeMirror.on(sel, "dblclick", pick);
|
||||
|
||||
sel.focus();
|
||||
// Opera sometimes ignores focusing a freshly created node
|
||||
if (window.opera) setTimeout(function(){if (!done) sel.focus();}, 100);
|
||||
return true;
|
||||
}
|
||||
return collectHints();
|
||||
};
|
||||
CodeMirror.htaccessHint.defaults = {
|
||||
closeOnBackspace: true,
|
||||
closeOnTokenChange: false,
|
||||
completeSingle: true,
|
||||
alignWithWord: true
|
||||
};
|
||||
})();
|
||||
|
||||
|
|
@ -0,0 +1,234 @@
|
|||
AddInputFilter
|
||||
AddLanguage
|
||||
AddModuleInfo
|
||||
AddOutputFilter
|
||||
AddOutputFilterbyType
|
||||
AddType
|
||||
Alias
|
||||
AliasMatch
|
||||
Allow
|
||||
AllowConnect
|
||||
AllowEncodedslashes
|
||||
AllowOverride
|
||||
Anonymous
|
||||
Anonymous_LogEmail
|
||||
Anonymous_MustGiveEmail
|
||||
Anonymous_NoUserid
|
||||
Anonymous_VerifyEmail
|
||||
AuthBasicAuthoritative
|
||||
AuthBasicProvider
|
||||
AuthDbdUserpwQuery
|
||||
AuthDbdUserRealmQuery
|
||||
AuthDbmGroupFile
|
||||
AuthDbmType
|
||||
AuthDbmUserFile
|
||||
AuthDefaultAuthoritative
|
||||
AuthDigestAlgorithm
|
||||
AuthDigestDomain
|
||||
AuthDigestProvider
|
||||
AuthGroupFile
|
||||
AuthName
|
||||
AuthType
|
||||
AuthUserFile
|
||||
AuthzDbmAuthoritative
|
||||
AuthzDbmType
|
||||
AuthzDefaultAuthoritative
|
||||
AuthzGroupFileAuthoritative
|
||||
AuthzOwnerAuthoritative
|
||||
AuthzUserAuthoritative
|
||||
BalancerMember
|
||||
BrowserMatch
|
||||
BrowserMatchnocase
|
||||
CacheDebugHeader
|
||||
CacheDefaultExpire
|
||||
CacheDirLength
|
||||
CacheDirLevels
|
||||
CacheDisable
|
||||
CacheEnable
|
||||
CacheFile
|
||||
CacheignoreCachecontrol
|
||||
CacheignoreHeaders
|
||||
CacheignoreNoLastMod
|
||||
CacheignoreQueryString
|
||||
CacheLastModifiedFactor
|
||||
CacheMaxExpire
|
||||
CacheMaxFileSize
|
||||
CacheMinFileSize
|
||||
CacheRoot
|
||||
CacheStoreNoStore
|
||||
CacheStorePrivate
|
||||
CacheVaryByHeaders
|
||||
CacheVaryByParams
|
||||
CheckCaseOnly
|
||||
CheckSpelling
|
||||
CheckBaseName
|
||||
CookieDomain
|
||||
CookieExpires
|
||||
CookieLog
|
||||
CookieName
|
||||
Cookiestyle
|
||||
Cookietracking
|
||||
CustomLog
|
||||
DbdKeep
|
||||
DbdMax
|
||||
DbdMin
|
||||
DbdParams
|
||||
DbdPersist
|
||||
DbdPrepareSql
|
||||
DbDriver
|
||||
Deny
|
||||
DirectoryIndex
|
||||
DirectoryMatch
|
||||
DirectorySlash
|
||||
DOSHashTableSize
|
||||
DOSWhiteList
|
||||
DOSPageCount
|
||||
DOSsiteCount
|
||||
DOSPageInterval
|
||||
DOSsiteInterval
|
||||
DOSBlockingPeriod
|
||||
DOSCloseSocket
|
||||
DOSSystemCommand
|
||||
ErrorDocument
|
||||
ErrorLog
|
||||
ExpiresActive
|
||||
ExpiresByType
|
||||
ExpiresDefault
|
||||
FilterChain
|
||||
FilterDeclare
|
||||
FilterProtocol
|
||||
FilterProvider
|
||||
FreeSites
|
||||
GracefulShutdownTimeout
|
||||
Group
|
||||
Header
|
||||
HeaderName
|
||||
HostNameLookups
|
||||
Include
|
||||
KeepAlive
|
||||
keepAliveTimeout
|
||||
Listen
|
||||
ListenBackLog
|
||||
LoadFile
|
||||
LoadModule
|
||||
LockFile
|
||||
LogFormat
|
||||
LogLevel
|
||||
MCacheMaxObjectCount
|
||||
MCacheMaxObjectSize
|
||||
MCacheMaxStreaMingBuffer
|
||||
MCacheMinObjectSize
|
||||
MCacheRemovalAlgorithm
|
||||
MCacheSize
|
||||
mod_gzip_on
|
||||
mod_gzip_add_header_count
|
||||
mod_gzip_compression_level
|
||||
mod_gzip_keep_workfiles
|
||||
mod_gzip_dechunk
|
||||
mod_gzip_min_http
|
||||
mod_gzip_minimum_file_size
|
||||
mod_gzip_maximum_file_size
|
||||
mod_gzip_maximum_inmem_size
|
||||
mod_gzip_temp_dir
|
||||
mod_gzip_item_include
|
||||
mod_gzip_item_exclude
|
||||
mod_gzip_command_version
|
||||
mod_gzip_can_negotiate
|
||||
mod_gzip_handle_methods
|
||||
mod_gzip_static_suffix
|
||||
mod_gzip_send_vary
|
||||
mod_gzip_update_static
|
||||
NameVirtualHost
|
||||
NoProxy
|
||||
Options
|
||||
Order
|
||||
PassEnv
|
||||
ProxyBadHeader
|
||||
ProxyBlock
|
||||
ProxyDomain
|
||||
ProxyErrorOverride
|
||||
ProxyIoBufferSize
|
||||
ProxyMaxForwards
|
||||
ProxyPass
|
||||
ProxyPassinterpolateEnv
|
||||
ProxyPassMatch
|
||||
ProxyPassReverse
|
||||
ProxyPassReverseCookieDomain
|
||||
ProxyPassReverseCookiepath
|
||||
ProxyPreserveHost
|
||||
ProxyReceiveBufferSize
|
||||
ProxyRemote
|
||||
ProxyRemoteMatch
|
||||
ProxyRequests
|
||||
ProxySet
|
||||
ProxyStatus
|
||||
ProxyTimeout
|
||||
ProxyVia
|
||||
ReceiveBufferSize
|
||||
Redirect
|
||||
RedirectMatch
|
||||
Redirectpermanent
|
||||
Redirecttemp
|
||||
RegistrationName
|
||||
Registrationcode
|
||||
RemoveHandler
|
||||
RemoveInputFilter
|
||||
RemoveLanguage
|
||||
RemoveOutputFilter
|
||||
RemoveType
|
||||
ReplaceFilterDefine
|
||||
ReplacePattern
|
||||
RequestHeader
|
||||
Require
|
||||
RewriteBase
|
||||
RewriteCond
|
||||
RewriteEngine
|
||||
RewriteHeader
|
||||
RewriteLock
|
||||
RewriteLog
|
||||
RewriteLogLevel
|
||||
RewriteMap
|
||||
RewriteOptions
|
||||
RewriteRule
|
||||
RewriteProxy
|
||||
Satisfy
|
||||
SendBufferSize
|
||||
ServerAdmin
|
||||
ServerAlias
|
||||
ServerLimit
|
||||
ServerName
|
||||
ServerPath
|
||||
ServerRoot
|
||||
ServerSignature
|
||||
ServerTokens
|
||||
SetEnv
|
||||
SetEnvif
|
||||
SetEnvifnocase
|
||||
SetHandler
|
||||
SetInputFilter
|
||||
SetOutputFilter
|
||||
SeoRule
|
||||
Substitute
|
||||
Timeout
|
||||
TraceEnable
|
||||
TransferLog
|
||||
TypesConfig
|
||||
UnsetEnv
|
||||
UseCanonicalName
|
||||
UseCanonicalPhysicalPort
|
||||
UserDir
|
||||
VirtualDocumentRoot
|
||||
VirtualDocumentRootip
|
||||
VirtualscriptAlias
|
||||
VirtualscriptAliasIp
|
||||
HotlinkInvolveIp
|
||||
HotlinkExpires
|
||||
HotlinkProtect
|
||||
HotlinkSignature
|
||||
HotlinkType
|
||||
HotlinkError
|
||||
HotlinkAllow
|
||||
HotlinkDeny
|
||||
LinkFreezeEngine
|
||||
LinkFreezePageSizeLimit
|
||||
LinkFreezeRule
|
|
@ -0,0 +1,67 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<style type="text/css">
|
||||
.CodeMirror {
|
||||
height: 800px !important;
|
||||
font-family: Consolas !important;
|
||||
font-size: 15px;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<textarea id='code'>
|
||||
# Helicon Ape
|
||||
|
||||
# mod_rewrite rules
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule . index.php [NC,L]
|
||||
|
||||
RewriteRule .*\.png$ crm.png [L]
|
||||
Header set CacheControl max-age=13,public
|
||||
|
||||
RewriteRule (.*)\.png$ $1.png [L]
|
||||
|
||||
|
||||
<Location index.php>
|
||||
ExpiresByType "text/html; charset=UTF-8" A30
|
||||
CacheEnable mem
|
||||
CacheVaryByHeaders Original-Url
|
||||
</Location>
|
||||
|
||||
# expiration
|
||||
ExpiresActive On
|
||||
ExpiresByType image/jpeg "access plus 1 days"
|
||||
ExpiresByType image/gif "access plus 1 days"
|
||||
ExpiresByType text/css "access plus 1 days"
|
||||
ExpiresByType application/x-javascript "access plus 1 days"
|
||||
|
||||
# gzipping
|
||||
mod_gzip_on yes
|
||||
mod_gzip_item_include Mime ^text/.*
|
||||
|
||||
<Files index.php>
|
||||
ExpiresByType "text/html; charset=UTF-8" A30
|
||||
CacheEnable mem
|
||||
CacheVaryByHeaders Original-Url
|
||||
</Files>
|
||||
|
||||
Header set Server "Apache/2.2.9 (Unix)"
|
||||
</textarea>
|
||||
</body>
|
||||
<script src="codemirror.js"></script>
|
||||
<link rel="stylesheet" href="codemirror.css">
|
||||
<link rel="stylesheet" href="show-hint.css">
|
||||
<link rel="stylesheet" href="simple-hint.css">
|
||||
<script src="show-hint.js"></script>
|
||||
<script src="htaccess.js"></script>
|
||||
<script type="text/javascript">
|
||||
CodeMirror.commands.autocomplete = function(cm) {
|
||||
CodeMirror.showHint(cm, CodeMirror.htaccessHint);
|
||||
}
|
||||
var myCodeMirror = CodeMirror.fromTextArea(document.getElementById('code'), {
|
||||
lineNumbers: true,
|
||||
extraKeys: {"Ctrl-Space": "autocomplete"}
|
||||
});
|
||||
</script>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue