Merge Commit
This commit is contained in:
commit
95a4e4e16c
18 changed files with 2016 additions and 470 deletions
|
@ -845,154 +845,6 @@ RETURN
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE PROCEDURE AddHostingPlan
|
||||
(
|
||||
@ActorID int,
|
||||
@PlanID int OUTPUT,
|
||||
@UserID int,
|
||||
@PackageID int,
|
||||
@PlanName nvarchar(200),
|
||||
@PlanDescription ntext,
|
||||
@Available bit,
|
||||
@ServerID int,
|
||||
@SetupPrice money,
|
||||
@RecurringPrice money,
|
||||
@RecurrenceLength int,
|
||||
@RecurrenceUnit int,
|
||||
@IsAddon bit,
|
||||
@QuotasXml ntext
|
||||
)
|
||||
AS
|
||||
|
||||
-- check rights
|
||||
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
|
||||
RAISERROR('You are not allowed to access this account', 16, 1)
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
IF @ServerID = 0
|
||||
SELECT @ServerID = ServerID FROM Packages
|
||||
WHERE PackageID = @PackageID
|
||||
|
||||
IF @IsAddon = 1
|
||||
SET @ServerID = NULL
|
||||
|
||||
IF @PackageID = 0 SET @PackageID = NULL
|
||||
|
||||
INSERT INTO HostingPlans
|
||||
(
|
||||
UserID,
|
||||
PackageID,
|
||||
PlanName,
|
||||
PlanDescription,
|
||||
Available,
|
||||
ServerID,
|
||||
SetupPrice,
|
||||
RecurringPrice,
|
||||
RecurrenceLength,
|
||||
RecurrenceUnit,
|
||||
IsAddon
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
@UserID,
|
||||
@PackageID,
|
||||
@PlanName,
|
||||
@PlanDescription,
|
||||
@Available,
|
||||
@ServerID,
|
||||
@SetupPrice,
|
||||
@RecurringPrice,
|
||||
@RecurrenceLength,
|
||||
@RecurrenceUnit,
|
||||
@IsAddon
|
||||
)
|
||||
|
||||
SET @PlanID = SCOPE_IDENTITY()
|
||||
|
||||
-- save quotas
|
||||
EXEC UpdateHostingPlanQuotas @ActorID, @PlanID, @QuotasXml
|
||||
|
||||
COMMIT TRAN
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -33514,110 +33366,6 @@ WHERE MailboxPlanId = @MailboxPlanId
|
|||
|
||||
RETURN
|
||||
|
||||
GO
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE PROCEDURE UpdateHostingPlan
|
||||
(
|
||||
@ActorID int,
|
||||
@PlanID int,
|
||||
@PackageID int,
|
||||
@ServerID int,
|
||||
@PlanName nvarchar(200),
|
||||
@PlanDescription ntext,
|
||||
@Available bit,
|
||||
@SetupPrice money,
|
||||
@RecurringPrice money,
|
||||
@RecurrenceLength int,
|
||||
@RecurrenceUnit int,
|
||||
@QuotasXml ntext
|
||||
)
|
||||
AS
|
||||
|
||||
-- check rights
|
||||
DECLARE @UserID int
|
||||
SELECT @UserID = UserID FROM HostingPlans
|
||||
WHERE PlanID = @PlanID
|
||||
|
||||
-- check rights
|
||||
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
|
||||
RAISERROR('You are not allowed to access this account', 16, 1)
|
||||
|
||||
IF @ServerID = 0
|
||||
SELECT @ServerID = ServerID FROM Packages
|
||||
WHERE PackageID = @PackageID
|
||||
|
||||
IF @PackageID = 0 SET @PackageID = NULL
|
||||
IF @ServerID = 0 SET @ServerID = NULL
|
||||
|
||||
-- update record
|
||||
UPDATE HostingPlans SET
|
||||
PackageID = @PackageID,
|
||||
ServerID = @ServerID,
|
||||
PlanName = @PlanName,
|
||||
PlanDescription = @PlanDescription,
|
||||
Available = @Available,
|
||||
SetupPrice = @SetupPrice,
|
||||
RecurringPrice = @RecurringPrice,
|
||||
RecurrenceLength = @RecurrenceLength,
|
||||
RecurrenceUnit = @RecurrenceUnit
|
||||
WHERE PlanID = @PlanID
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
-- update quotas
|
||||
EXEC UpdateHostingPlanQuotas @ActorID, @PlanID, @QuotasXml
|
||||
|
||||
DECLARE @ExceedingQuotas AS TABLE (QuotaID int, QuotaName nvarchar(50), QuotaValue int)
|
||||
INSERT INTO @ExceedingQuotas
|
||||
SELECT * FROM dbo.GetPackageExceedingQuotas(@PackageID) WHERE QuotaValue > 0
|
||||
|
||||
SELECT * FROM @ExceedingQuotas
|
||||
|
||||
IF EXISTS(SELECT * FROM @ExceedingQuotas)
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
RETURN
|
||||
END
|
||||
|
||||
COMMIT TRAN
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
@ -33788,6 +33536,195 @@ RETURN
|
|||
|
||||
|
||||
|
||||
GO
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE PROCEDURE UpdateHostingPlan
|
||||
(
|
||||
@ActorID int,
|
||||
@PlanID int,
|
||||
@PackageID int,
|
||||
@ServerID int,
|
||||
@PlanName nvarchar(200),
|
||||
@PlanDescription ntext,
|
||||
@Available bit,
|
||||
@SetupPrice money,
|
||||
@RecurringPrice money,
|
||||
@RecurrenceLength int,
|
||||
@RecurrenceUnit int,
|
||||
@QuotasXml ntext
|
||||
)
|
||||
AS
|
||||
|
||||
-- check rights
|
||||
DECLARE @UserID int
|
||||
SELECT @UserID = UserID FROM HostingPlans
|
||||
WHERE PlanID = @PlanID
|
||||
|
||||
-- check rights
|
||||
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
|
||||
RAISERROR('You are not allowed to access this account', 16, 1)
|
||||
|
||||
IF @ServerID = 0
|
||||
SELECT @ServerID = ServerID FROM Packages
|
||||
WHERE PackageID = @PackageID
|
||||
|
||||
IF @PackageID = 0 SET @PackageID = NULL
|
||||
IF @ServerID = 0 SET @ServerID = NULL
|
||||
|
||||
-- update record
|
||||
UPDATE HostingPlans SET
|
||||
PackageID = @PackageID,
|
||||
ServerID = @ServerID,
|
||||
PlanName = @PlanName,
|
||||
PlanDescription = @PlanDescription,
|
||||
Available = @Available,
|
||||
SetupPrice = @SetupPrice,
|
||||
RecurringPrice = @RecurringPrice,
|
||||
RecurrenceLength = @RecurrenceLength,
|
||||
RecurrenceUnit = @RecurrenceUnit
|
||||
WHERE PlanID = @PlanID
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
-- update quotas
|
||||
EXEC UpdateHostingPlanQuotas @ActorID, @PlanID, @QuotasXml
|
||||
|
||||
DECLARE @ExceedingQuotas AS TABLE (QuotaID int, QuotaName nvarchar(50), QuotaValue int)
|
||||
INSERT INTO @ExceedingQuotas
|
||||
SELECT * FROM dbo.GetPackageExceedingQuotas(@PackageID) WHERE QuotaValue > 0
|
||||
|
||||
SELECT * FROM @ExceedingQuotas
|
||||
|
||||
IF EXISTS(SELECT * FROM @ExceedingQuotas)
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
RETURN
|
||||
END
|
||||
|
||||
COMMIT TRAN
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
CREATE PROCEDURE AddHostingPlan
|
||||
(
|
||||
@ActorID int,
|
||||
@PlanID int OUTPUT,
|
||||
@UserID int,
|
||||
@PackageID int,
|
||||
@PlanName nvarchar(200),
|
||||
@PlanDescription ntext,
|
||||
@Available bit,
|
||||
@ServerID int,
|
||||
@SetupPrice money,
|
||||
@RecurringPrice money,
|
||||
@RecurrenceLength int,
|
||||
@RecurrenceUnit int,
|
||||
@IsAddon bit,
|
||||
@QuotasXml ntext
|
||||
)
|
||||
AS
|
||||
|
||||
-- check rights
|
||||
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
|
||||
RAISERROR('You are not allowed to access this account', 16, 1)
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
IF @ServerID = 0
|
||||
SELECT @ServerID = ServerID FROM Packages
|
||||
WHERE PackageID = @PackageID
|
||||
|
||||
IF @IsAddon = 1
|
||||
SET @ServerID = NULL
|
||||
|
||||
IF @PackageID = 0 SET @PackageID = NULL
|
||||
|
||||
INSERT INTO HostingPlans
|
||||
(
|
||||
UserID,
|
||||
PackageID,
|
||||
PlanName,
|
||||
PlanDescription,
|
||||
Available,
|
||||
ServerID,
|
||||
SetupPrice,
|
||||
RecurringPrice,
|
||||
RecurrenceLength,
|
||||
RecurrenceUnit,
|
||||
IsAddon
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
@UserID,
|
||||
@PackageID,
|
||||
@PlanName,
|
||||
@PlanDescription,
|
||||
@Available,
|
||||
@ServerID,
|
||||
@SetupPrice,
|
||||
@RecurringPrice,
|
||||
@RecurrenceLength,
|
||||
@RecurrenceUnit,
|
||||
@IsAddon
|
||||
)
|
||||
|
||||
SET @PlanID = SCOPE_IDENTITY()
|
||||
|
||||
-- save quotas
|
||||
EXEC UpdateHostingPlanQuotas @ActorID, @PlanID, @QuotasXml
|
||||
|
||||
COMMIT TRAN
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -34018,75 +33955,6 @@ WHERE LyncUserPlanId = @LyncUserPlanId
|
|||
|
||||
RETURN
|
||||
|
||||
GO
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER OFF
|
||||
GO
|
||||
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[UpdatePackage]
|
||||
(
|
||||
@ActorID int,
|
||||
@PackageID int,
|
||||
@PackageName nvarchar(300),
|
||||
@PackageComments ntext,
|
||||
@StatusID int,
|
||||
@PlanID int,
|
||||
@PurchaseDate datetime,
|
||||
@OverrideQuotas bit,
|
||||
@QuotasXml ntext
|
||||
)
|
||||
AS
|
||||
|
||||
-- check rights
|
||||
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
|
||||
RAISERROR('You are not allowed to access this package', 16, 1)
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
DECLARE @ParentPackageID int
|
||||
DECLARE @OldPlanID int
|
||||
|
||||
SELECT @ParentPackageID = ParentPackageID, @OldPlanID = PlanID FROM Packages
|
||||
WHERE PackageID = @PackageID
|
||||
|
||||
-- update package
|
||||
UPDATE Packages SET
|
||||
PackageName = @PackageName,
|
||||
PackageComments = @PackageComments,
|
||||
StatusID = @StatusID,
|
||||
PlanID = @PlanID,
|
||||
PurchaseDate = @PurchaseDate,
|
||||
OverrideQuotas = @OverrideQuotas
|
||||
WHERE
|
||||
PackageID = @PackageID
|
||||
|
||||
-- update quotas (if required)
|
||||
EXEC UpdatePackageQuotas @ActorID, @PackageID, @QuotasXml
|
||||
|
||||
-- check resulting quotas
|
||||
DECLARE @ExceedingQuotas AS TABLE (QuotaID int, QuotaName nvarchar(50), QuotaValue int)
|
||||
|
||||
-- check exceeding quotas if plan has been changed
|
||||
IF (@OldPlanID <> @PlanID) OR (@OverrideQuotas = 1)
|
||||
BEGIN
|
||||
INSERT INTO @ExceedingQuotas
|
||||
SELECT * FROM dbo.GetPackageExceedingQuotas(@ParentPackageID) WHERE QuotaValue > 0
|
||||
END
|
||||
|
||||
SELECT * FROM @ExceedingQuotas
|
||||
|
||||
IF EXISTS(SELECT * FROM @ExceedingQuotas)
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
RETURN
|
||||
END
|
||||
|
||||
|
||||
COMMIT TRAN
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
@ -36656,6 +36524,100 @@ END
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER OFF
|
||||
GO
|
||||
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[UpdatePackage]
|
||||
(
|
||||
@ActorID int,
|
||||
@PackageID int,
|
||||
@PackageName nvarchar(300),
|
||||
@PackageComments ntext,
|
||||
@StatusID int,
|
||||
@PlanID int,
|
||||
@PurchaseDate datetime,
|
||||
@OverrideQuotas bit,
|
||||
@QuotasXml ntext
|
||||
)
|
||||
AS
|
||||
|
||||
-- check rights
|
||||
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
|
||||
RAISERROR('You are not allowed to access this package', 16, 1)
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
DECLARE @ParentPackageID int
|
||||
DECLARE @OldPlanID int
|
||||
|
||||
SELECT @ParentPackageID = ParentPackageID, @OldPlanID = PlanID FROM Packages
|
||||
WHERE PackageID = @PackageID
|
||||
|
||||
-- update package
|
||||
UPDATE Packages SET
|
||||
PackageName = @PackageName,
|
||||
PackageComments = @PackageComments,
|
||||
StatusID = @StatusID,
|
||||
PlanID = @PlanID,
|
||||
PurchaseDate = @PurchaseDate,
|
||||
OverrideQuotas = @OverrideQuotas
|
||||
WHERE
|
||||
PackageID = @PackageID
|
||||
|
||||
-- update quotas (if required)
|
||||
EXEC UpdatePackageQuotas @ActorID, @PackageID, @QuotasXml
|
||||
|
||||
-- check resulting quotas
|
||||
DECLARE @ExceedingQuotas AS TABLE (QuotaID int, QuotaName nvarchar(50), QuotaValue int)
|
||||
|
||||
-- check exceeding quotas if plan has been changed
|
||||
IF (@OldPlanID <> @PlanID) OR (@OverrideQuotas = 1)
|
||||
BEGIN
|
||||
INSERT INTO @ExceedingQuotas
|
||||
SELECT * FROM dbo.GetPackageExceedingQuotas(@ParentPackageID) WHERE QuotaValue > 0
|
||||
END
|
||||
|
||||
SELECT * FROM @ExceedingQuotas
|
||||
|
||||
IF EXISTS(SELECT * FROM @ExceedingQuotas)
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
RETURN
|
||||
END
|
||||
|
||||
|
||||
COMMIT TRAN
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -433,6 +433,7 @@ GO
|
|||
|
||||
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])
|
||||
|
@ -441,4 +442,11 @@ END
|
|||
GO
|
||||
|
||||
UPDATE Providers SET ProviderType = N'WebsitePanel.Providers.HostedSolution.HostedSharePointServer2013, WebsitePanel.Providers.HostedSolution.SharePoint2013' WHERE ProviderID = 1301
|
||||
GO
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'Lync2013')
|
||||
BEGIN
|
||||
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery])
|
||||
VALUES (1401, 41, N'Lync2013', N'Microsoft Lync Server 2013 Multitenant Hosting Pack', N'WebsitePanel.Providers.HostedSolution.Lync2013, WebsitePanel.Providers.HostedSolution.Lync2013', N'Lync', NULL)
|
||||
END
|
||||
GO
|
|
@ -30,68 +30,64 @@ using System.Collections.Generic;
|
|||
|
||||
namespace WebsitePanel.Providers.HostedSolution
|
||||
{
|
||||
internal class LyncTransaction
|
||||
public class LyncTransaction
|
||||
{
|
||||
List<TransactionAction> actions = null;
|
||||
#region Fields
|
||||
|
||||
private readonly List<TransactionAction> actions;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public List<TransactionAction> Actions
|
||||
{
|
||||
get { return actions; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public LyncTransaction()
|
||||
{
|
||||
actions = new List<TransactionAction>();
|
||||
}
|
||||
|
||||
internal List<TransactionAction> Actions
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public void RegisterNewSipDomain(string id)
|
||||
{
|
||||
get { return actions; }
|
||||
Actions.Add(new TransactionAction { ActionType = TransactionAction.TransactionActionTypes.LyncNewSipDomain, Id = id });
|
||||
}
|
||||
|
||||
internal void RegisterNewSipDomain(string id)
|
||||
public void RegisterNewSimpleUrl(string sipDomain, string tenantID)
|
||||
{
|
||||
TransactionAction action = new TransactionAction();
|
||||
action.ActionType = TransactionAction.TransactionActionTypes.LyncNewSipDomain;
|
||||
action.Id = id;
|
||||
Actions.Add(action);
|
||||
Actions.Add(new TransactionAction { ActionType = TransactionAction.TransactionActionTypes.LyncNewSimpleUrl, Id = sipDomain, Account = tenantID });
|
||||
}
|
||||
|
||||
internal void RegisterNewSimpleUrl(string sipDomain, string tenantID)
|
||||
public void RegisterNewConferencingPolicy(string id)
|
||||
{
|
||||
TransactionAction action = new TransactionAction();
|
||||
action.ActionType = TransactionAction.TransactionActionTypes.LyncNewSimpleUrl;
|
||||
action.Id = sipDomain;
|
||||
action.Account = tenantID;
|
||||
Actions.Add(action);
|
||||
Actions.Add(new TransactionAction { ActionType = TransactionAction.TransactionActionTypes.LyncNewConferencingPolicy, Id = id });
|
||||
}
|
||||
|
||||
|
||||
internal void RegisterNewConferencingPolicy(string id)
|
||||
public void RegisterNewCsExternalAccessPolicy(string id)
|
||||
{
|
||||
TransactionAction action = new TransactionAction();
|
||||
action.ActionType = TransactionAction.TransactionActionTypes.LyncNewConferencingPolicy;
|
||||
action.Id = id;
|
||||
Actions.Add(action);
|
||||
Actions.Add(new TransactionAction { ActionType = TransactionAction.TransactionActionTypes.LyncNewExternalAccessPolicy, Id = id });
|
||||
}
|
||||
|
||||
internal void RegisterNewCsExternalAccessPolicy(string id)
|
||||
public void RegisterNewCsMobilityPolicy(string id)
|
||||
{
|
||||
TransactionAction action = new TransactionAction();
|
||||
action.ActionType = TransactionAction.TransactionActionTypes.LyncNewExternalAccessPolicy;
|
||||
action.Id = id;
|
||||
Actions.Add(action);
|
||||
Actions.Add(new TransactionAction { ActionType = TransactionAction.TransactionActionTypes.LyncNewMobilityPolicy, Id = id });
|
||||
}
|
||||
|
||||
internal void RegisterNewCsMobilityPolicy(string id)
|
||||
public void RegisterNewCsUser(string id)
|
||||
{
|
||||
TransactionAction action = new TransactionAction();
|
||||
action.ActionType = TransactionAction.TransactionActionTypes.LyncNewMobilityPolicy;
|
||||
action.Id = id;
|
||||
Actions.Add(action);
|
||||
Actions.Add(new TransactionAction { ActionType = TransactionAction.TransactionActionTypes.LyncNewUser, Id = id });
|
||||
}
|
||||
|
||||
internal void RegisterNewCsUser(string id)
|
||||
{
|
||||
TransactionAction action = new TransactionAction();
|
||||
action.ActionType = TransactionAction.TransactionActionTypes.LyncNewUser;
|
||||
action.Id = id;
|
||||
Actions.Add(action);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
|
@ -63,6 +63,7 @@
|
|||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
|
@ -90,6 +91,7 @@
|
|||
<Compile Include="HostedSolution\LyncErrorCodes.cs" />
|
||||
<Compile Include="HostedSolution\LyncFederationDomain.cs" />
|
||||
<Compile Include="HostedSolution\LyncOrganizationStatistics.cs" />
|
||||
<Compile Include="HostedSolution\LyncTransaction.cs" />
|
||||
<Compile Include="HostedSolution\LyncUserStatistics.cs" />
|
||||
<Compile Include="HostedSolution\LyncStatisticsReport.cs" />
|
||||
<Compile Include="HostedSolution\LyncUser.cs" />
|
||||
|
|
|
@ -0,0 +1,749 @@
|
|||
// 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.DirectoryServices;
|
||||
using System.Linq;
|
||||
using System.Management.Automation;
|
||||
using System.Management.Automation.Runspaces;
|
||||
using Microsoft.Rtc.Management.WritableConfig.Settings.Edge;
|
||||
|
||||
namespace WebsitePanel.Providers.HostedSolution
|
||||
{
|
||||
public class Lync2013 : LyncBase
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
static Lync2013()
|
||||
{
|
||||
LyncRegistryPath = "SOFTWARE\\Microsoft\\Real-Time Communications";
|
||||
LyncVersion = "5";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
#region Organizations
|
||||
|
||||
/// <summary> Creates organization. </summary>
|
||||
/// <param name="organizationId"> The organization identifier. </param>
|
||||
/// <param name="sipDomain"> The sip domain. </param>
|
||||
/// <param name="enableConferencingVideo"> True - if conferencing video should be enabled.</param>
|
||||
/// <param name="maxConferenceSize"> The max conference size.</param>
|
||||
/// <param name="enabledFederation"> True - if federations should be enabled.</param>
|
||||
/// <param name="enabledEnterpriseVoice"> True - if enterprise voice should be enabled.</param>
|
||||
/// <returns> The tenant identifier. </returns>
|
||||
internal override string CreateOrganizationInternal(string organizationId, string sipDomain, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice)
|
||||
{
|
||||
sipDomain = sipDomain.ToLower();
|
||||
HostedSolutionLog.LogStart("CreateOrganizationInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId);
|
||||
HostedSolutionLog.DebugInfo("sipDomain: {0}", sipDomain);
|
||||
string tenantId;
|
||||
LyncTransaction transaction = StartTransaction();
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
var command = new Command("New-CsSipDomain");
|
||||
command.Parameters.Add("Identity", sipDomain);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
transaction.RegisterNewSipDomain(sipDomain);
|
||||
Guid id = Guid.NewGuid();
|
||||
|
||||
AddAdDomainName(organizationId, sipDomain);
|
||||
|
||||
CreateSimpleUrl(runspace, id);
|
||||
transaction.RegisterNewSimpleUrl(sipDomain, id.ToString());
|
||||
|
||||
command = new Command("New-CsConferencingPolicy");
|
||||
command.Parameters.Add("Identity", organizationId);
|
||||
command.Parameters.Add("MaxMeetingSize", ((maxConferenceSize == -1) | (maxConferenceSize > 250)) ? 250 : maxConferenceSize);
|
||||
command.Parameters.Add("AllowIPVideo", enableConferencingVideo);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
transaction.RegisterNewConferencingPolicy(organizationId);
|
||||
|
||||
command = new Command("New-CsExternalAccessPolicy");
|
||||
command.Parameters.Add("Identity", organizationId);
|
||||
command.Parameters.Add("EnableFederationAccess", true);
|
||||
command.Parameters.Add("EnableOutsideAccess", true);
|
||||
command.Parameters.Add("EnablePublicCloudAccess", false);
|
||||
command.Parameters.Add("EnablePublicCloudAudioVideoAccess", false);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
transaction.RegisterNewCsExternalAccessPolicy(organizationId);
|
||||
|
||||
var allowList = new AllowList();
|
||||
var domain = new DomainPattern(sipDomain);
|
||||
allowList.AllowedDomain.Add(domain);
|
||||
|
||||
AddFederationDomainInternal("", domain.Domain, PoolFQDN);
|
||||
|
||||
command = new Command("New-CsMobilityPolicy");
|
||||
command.Parameters.Add("Identity", organizationId + " EnableOutSideVoice");
|
||||
command.Parameters.Add("EnableMobility", true);
|
||||
command.Parameters.Add("EnableOutsideVoice", true);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
transaction.RegisterNewCsMobilityPolicy(organizationId + " EnableOutSideVoice");
|
||||
|
||||
command = new Command("New-CsMobilityPolicy");
|
||||
command.Parameters.Add("Identity", organizationId + " DisableOutSideVoice");
|
||||
command.Parameters.Add("EnableMobility", true);
|
||||
command.Parameters.Add("EnableOutsideVoice", false);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
transaction.RegisterNewCsMobilityPolicy(organizationId + " DisableOutSideVoice");
|
||||
|
||||
command = new Command("Invoke-CsManagementStoreReplication");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
tenantId = id.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("CreateOrganizationInternal", ex);
|
||||
RollbackTransaction(transaction);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("CreateOrganizationInternal");
|
||||
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
/// <summary> Deletes organization.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <param name="sipDomain"> The sip domain.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal override bool DeleteOrganizationInternal(string organizationId, string sipDomain)
|
||||
{
|
||||
HostedSolutionLog.LogStart("DeleteOrganizationInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId);
|
||||
HostedSolutionLog.DebugInfo("sipDomain: {0}", sipDomain);
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
string path = AddADPrefix(GetOrganizationPath(organizationId));
|
||||
DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path);
|
||||
string[] sipDs = ActiveDirectoryUtils.GetADObjectPropertyMultiValue(ou, "Url");
|
||||
|
||||
foreach (string sipD in sipDs)
|
||||
{
|
||||
DeleteSipDomain(runspace, sipD);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
DeleteConferencingPolicy(runspace, organizationId);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
DeleteExternalAccessPolicy(runspace, organizationId);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
DeleteMobilityPolicy(runspace, organizationId + " EnableOutSideVoice");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
DeleteMobilityPolicy(runspace, organizationId + " DisableOutSideVoice");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
var command = new Command("Invoke-CsManagementStoreReplication");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("DeleteOrganizationInternal", ex);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("DeleteOrganizationInternal");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Users
|
||||
|
||||
/// <summary> Creates the user.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <param name="userUpn"> The user UPN.</param>
|
||||
/// <param name="plan"> The Lync user plan.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal override bool CreateUserInternal(string organizationId, string userUpn, LyncUserPlan plan)
|
||||
{
|
||||
HostedSolutionLog.LogStart("CreateUserInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId);
|
||||
HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn);
|
||||
LyncTransaction transaction = StartTransaction();
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
Guid guid = GetObjectGuid(organizationId, runspace);
|
||||
string[] tmp = userUpn.Split('@');
|
||||
|
||||
if (tmp.Length < 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var command = new Command("Get-CsSipDomain");
|
||||
Collection<PSObject> sipDomains = ExecuteShellCommand(runspace, command, false);
|
||||
bool bSipDomainExists = sipDomains.Select(domain => (string) GetPSObjectProperty(domain, "Name")).Any(d => d.ToLower() == tmp[1].ToLower());
|
||||
|
||||
if (!bSipDomainExists)
|
||||
{
|
||||
command = new Command("New-CsSipDomain");
|
||||
command.Parameters.Add("Identity", tmp[1].ToLower());
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
transaction.RegisterNewSipDomain(tmp[1].ToLower());
|
||||
AddAdDomainName(organizationId, tmp[1].ToLower());
|
||||
CreateSimpleUrl(runspace, guid);
|
||||
transaction.RegisterNewSimpleUrl(tmp[1].ToLower(), guid.ToString());
|
||||
}
|
||||
|
||||
command = new Command("Enable-CsUser");
|
||||
command.Parameters.Add("Identity", userUpn);
|
||||
command.Parameters.Add("RegistrarPool", PoolFQDN);
|
||||
command.Parameters.Add("SipAddressType", "UserPrincipalName");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
transaction.RegisterNewCsUser(userUpn);
|
||||
|
||||
command = new Command("Get-CsAdUser");
|
||||
command.Parameters.Add("Identity", userUpn);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
SetLyncUserPlanInternal(organizationId, userUpn, plan, runspace);
|
||||
command = new Command("Update-CsAddressBook");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
command = new Command("Update-CsUserDatabase");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("CreateUserInternal", ex);
|
||||
RollbackTransaction(transaction);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("CreateUserInternal");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary> Gets users general settings.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <param name="userUpn"> The user UPN.</param>
|
||||
/// <returns> User settings.</returns>
|
||||
internal override LyncUser GetLyncUserGeneralSettingsInternal(string organizationId, string userUpn)
|
||||
{
|
||||
HostedSolutionLog.LogStart("GetLyncUserGeneralSettingsInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId);
|
||||
HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn);
|
||||
var lyncUser = new LyncUser();
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
|
||||
var command = new Command("Get-CsUser");
|
||||
command.Parameters.Add("Identity", userUpn);
|
||||
Collection<PSObject> result = ExecuteShellCommand(runspace, command, false);
|
||||
PSObject user = result[0];
|
||||
|
||||
lyncUser.DisplayName = (string) GetPSObjectProperty(user, "DisplayName");
|
||||
lyncUser.SipAddress = (string) GetPSObjectProperty(user, "SipAddress");
|
||||
lyncUser.LineUri = (string) GetPSObjectProperty(user, "LineURI");
|
||||
|
||||
lyncUser.SipAddress = lyncUser.SipAddress.ToLower().Replace("sip:", "");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("GetLyncUserGeneralSettingsInternal", ex);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("GetLyncUserGeneralSettingsInternal");
|
||||
|
||||
return lyncUser;
|
||||
}
|
||||
|
||||
/// <summary> Sets users general settings.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <param name="userUpn"> The user UPN.</param>
|
||||
/// <param name="lyncUser"> The lync user settings.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal override bool SetLyncUserGeneralSettingsInternal(string organizationId, string userUpn, LyncUser lyncUser)
|
||||
{
|
||||
HostedSolutionLog.LogStart("SetLyncUserGeneralSettingsInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId);
|
||||
HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn);
|
||||
|
||||
bool ret = true;
|
||||
Runspace runspace = null;
|
||||
LyncTransaction transaction = StartTransaction();
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
Guid tenantId = GetObjectGuid(organizationId, runspace);
|
||||
string[] tmp = userUpn.Split('@');
|
||||
|
||||
if (tmp.Length < 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var command = new Command("Get-CsSipDomain");
|
||||
Collection<PSObject> sipDomains = ExecuteShellCommand(runspace, command, false);
|
||||
bool bSipDomainExists = sipDomains.Select(domain => (string) GetPSObjectProperty(domain, "Name")).Any(d => d.ToLower() == tmp[1].ToLower());
|
||||
|
||||
if (!bSipDomainExists)
|
||||
{
|
||||
command = new Command("New-CsSipDomain");
|
||||
command.Parameters.Add("Identity", tmp[1].ToLower());
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
transaction.RegisterNewSipDomain(tmp[1].ToLower());
|
||||
|
||||
string path = AddADPrefix(GetOrganizationPath(organizationId));
|
||||
DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path);
|
||||
string[] sipDs = ActiveDirectoryUtils.GetADObjectPropertyMultiValue(ou, "Url");
|
||||
var listSipDs = new List<string>();
|
||||
listSipDs.AddRange(sipDs);
|
||||
listSipDs.Add(tmp[1]);
|
||||
|
||||
ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "Url", listSipDs.ToArray());
|
||||
ou.CommitChanges();
|
||||
|
||||
CreateSimpleUrl(runspace, tenantId);
|
||||
transaction.RegisterNewSimpleUrl(tmp[1].ToLower(), tenantId.ToString());
|
||||
|
||||
path = AddADPrefix(GetResultObjectDN(organizationId, runspace));
|
||||
DirectoryEntry user = ActiveDirectoryUtils.GetADObject(path);
|
||||
|
||||
if (tmp.Length > 0)
|
||||
{
|
||||
string Url = SimpleUrlRoot + tmp[1];
|
||||
ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-BaseSimpleUrl", Url.ToLower());
|
||||
}
|
||||
|
||||
user.CommitChanges();
|
||||
}
|
||||
|
||||
command = new Command("Set-CsUser");
|
||||
command.Parameters.Add("Identity", userUpn);
|
||||
|
||||
if (!string.IsNullOrEmpty(lyncUser.SipAddress))
|
||||
{
|
||||
command.Parameters.Add("SipAddress", "SIP:" + lyncUser.SipAddress);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(lyncUser.SipAddress))
|
||||
{
|
||||
command.Parameters.Add("LineUri", lyncUser.LineUri);
|
||||
}
|
||||
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
command = new Command("Update-CsAddressBook");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
command = new Command("Update-CsUserDatabase");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ret = false;
|
||||
HostedSolutionLog.LogError("SetLyncUserGeneralSettingsInternal", ex);
|
||||
RollbackTransaction(transaction);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("SetLyncUserGeneralSettingsInternal");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary> Sets users lync plan.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <param name="userUpn"> The user UPN.</param>
|
||||
/// <param name="plan"> The lync plan.</param>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal override bool SetLyncUserPlanInternal(string organizationId, string userUpn, LyncUserPlan plan, Runspace runspace)
|
||||
{
|
||||
HostedSolutionLog.LogStart("SetLyncUserPlanInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId);
|
||||
HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn);
|
||||
bool bCloseRunSpace = false;
|
||||
|
||||
try
|
||||
{
|
||||
if (runspace == null)
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
bCloseRunSpace = true;
|
||||
}
|
||||
|
||||
var command = new Command("Grant-CsExternalAccessPolicy");
|
||||
command.Parameters.Add("Identity", userUpn);
|
||||
command.Parameters.Add("PolicyName", plan.Federation ? organizationId : null);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
command = new Command("Grant-CsConferencingPolicy");
|
||||
command.Parameters.Add("Identity", userUpn);
|
||||
command.Parameters.Add("PolicyName", plan.Federation ? organizationId : null);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
command = new Command("Grant-CsMobilityPolicy");
|
||||
command.Parameters.Add("Identity", userUpn);
|
||||
|
||||
if (plan.Mobility)
|
||||
{
|
||||
command.Parameters.Add("PolicyName", plan.MobilityEnableOutsideVoice ? organizationId + " EnableOutSideVoice" : organizationId + " DisableOutSideVoice");
|
||||
}
|
||||
else
|
||||
{
|
||||
command.Parameters.Add("PolicyName", null);
|
||||
}
|
||||
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
command = new Command("Update-CsUserDatabase");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("SetLyncUserPlanInternal", ex);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (bCloseRunSpace)
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("SetLyncUserPlanInternal");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary> Deletes user.</summary>
|
||||
/// <param name="userUpn"> The user UPN.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal override bool DeleteUserInternal(string userUpn)
|
||||
{
|
||||
HostedSolutionLog.LogStart("DeleteUserInternal");
|
||||
HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn);
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
DeleteUser(runspace, userUpn);
|
||||
|
||||
var command = new Command("Get-CsAdUser");
|
||||
command.Parameters.Add("Identity", userUpn);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
command = new Command("Update-CsAddressBook");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
command = new Command("Update-CsUserDatabase");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("DeleteUserInternal", ex);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("DeleteUserInternal");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sytsem Related Methods
|
||||
|
||||
/// <summary> Refreshes configuration.</summary>
|
||||
internal override void ReloadConfigurationInternal()
|
||||
{
|
||||
HostedSolutionLog.LogStart("ReloadConfigurationInternal");
|
||||
Runspace runspace = null;
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
|
||||
var command = new Command("Enable-CsComputer");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("ReloadConfigurationInternal", ex);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
HostedSolutionLog.LogEnd("ReloadConfigurationInternal");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Federation Domains
|
||||
|
||||
/// <summary> Gets allowed domains.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <returns> Allowed domains.</returns>
|
||||
internal override LyncFederationDomain[] GetFederationDomainsInternal(string organizationId)
|
||||
{
|
||||
HostedSolutionLog.LogStart("GetFederationDomainsInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId);
|
||||
LyncFederationDomain[] domains;
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
domains = GetFederationDomainsInternal(runspace);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("GetFederationDomainsInternal", ex);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("GetFederationDomainsInternal");
|
||||
|
||||
return domains;
|
||||
}
|
||||
|
||||
/// <summary> Gets allowed domains. </summary>
|
||||
/// <param name="runspace">The runspace.</param>
|
||||
/// <returns> Allowed domains.</returns>
|
||||
private LyncFederationDomain[] GetFederationDomainsInternal(Runspace runspace)
|
||||
{
|
||||
var domains = new List<LyncFederationDomain>();
|
||||
var command = new Command("Get-CsAllowedDomain");
|
||||
Collection<PSObject> result = ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
if ((result != null) && (result.Count > 0))
|
||||
{
|
||||
domains = result.Select(psObject => new LyncFederationDomain {DomainName = psObject.Properties["Domain"].Value.ToString()}).ToList();
|
||||
}
|
||||
|
||||
return domains.ToArray();
|
||||
}
|
||||
|
||||
/// <summary> Adds domain to allowed list.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <param name="domainName"> The domain name.</param>
|
||||
/// <param name="proxyFqdn"> The ProxyFQDN.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal override bool AddFederationDomainInternal(string organizationId, string domainName, string proxyFqdn)
|
||||
{
|
||||
domainName = domainName.ToLower();
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
var command = new Command("Get-CsAllowedDomain");
|
||||
command.Parameters.Add("Identity", domainName);
|
||||
Collection<PSObject> result = ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
if (result != null && !result.Any())
|
||||
{
|
||||
command = new Command("New-CsAllowedDomain");
|
||||
command.Parameters.Add("Identity", domainName);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
command = new Command("Set-CsAllowedDomain");
|
||||
command.Parameters.Add("Identity", domainName);
|
||||
command.Parameters.Add("ProxyFQDN", PoolFQDN);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("AddFederationDomainInternal", ex);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("AddFederationDomainInternal");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary> Removes domain from allowed list.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <param name="domainName"> The domain name.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal override bool RemoveFederationDomainInternal(string organizationId, string domainName)
|
||||
{
|
||||
HostedSolutionLog.LogStart("RemoveFederationDomainInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId);
|
||||
HostedSolutionLog.DebugInfo("domainName: {0}", domainName);
|
||||
Runspace runspace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
var command = new Command("Remove-CsAllowedDomain");
|
||||
command.Parameters.Add("Identity", domainName);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("RemoveFederationDomainInternal", ex);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
|
||||
HostedSolutionLog.LogEnd("RemoveFederationDomainInternal");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary> Gets organization lync identifier.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <returns> Organization lync identifier.</returns>
|
||||
private Guid GetObjectGuid(string organizationId, Runspace runspace)
|
||||
{
|
||||
string path = GetOrganizationPath(organizationId);
|
||||
var scripts = new List<string> {string.Format("Get-ADOrganizationalUnit -Identity \"{0}\"", path)};
|
||||
Collection<PSObject> result = ExecuteShellCommand(runspace, scripts);
|
||||
|
||||
if (result != null && result.Any())
|
||||
{
|
||||
return new Guid(result.First().Properties["ObjectGuid"].Value.ToString());
|
||||
}
|
||||
|
||||
return Guid.NewGuid();
|
||||
}
|
||||
|
||||
/// <summary> Gets organization distinguished name.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <returns> The distinguished name.</returns>
|
||||
private string GetResultObjectDN(string organizationId, Runspace runspace)
|
||||
{
|
||||
HostedSolutionLog.LogStart("GetResultObjectDN");
|
||||
|
||||
string path = GetOrganizationPath(organizationId);
|
||||
var scripts = new List<string> {string.Format("Get-ADOrganizationalUnit -Identity \"{0}\"", path)};
|
||||
Collection<PSObject> result = ExecuteShellCommand(runspace, scripts);
|
||||
|
||||
if (result != null && result.Any())
|
||||
{
|
||||
return result.First().Properties["DistinguishedName"].Value.ToString();
|
||||
}
|
||||
|
||||
throw new ArgumentException("Execution result does not contain DistinguishedName property");
|
||||
}
|
||||
|
||||
/// <summary> Adds domain to AD.</summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <param name="domainName"> The domain name.</param>
|
||||
private void AddAdDomainName(string organizationId, string domainName)
|
||||
{
|
||||
string path = AddADPrefix(GetOrganizationPath(organizationId));
|
||||
DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path);
|
||||
ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "Url", new[] {domainName});
|
||||
ou.CommitChanges();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,639 @@
|
|||
// 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.Linq;
|
||||
using System.Management.Automation;
|
||||
using System.Management.Automation.Runspaces;
|
||||
using System.Text;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace WebsitePanel.Providers.HostedSolution
|
||||
{
|
||||
public class LyncBase : HostingServiceProviderBase, ILyncServer
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private static InitialSessionState session;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
internal static string LyncRegistryPath { get; set; }
|
||||
internal static string LyncVersion { get; set; }
|
||||
|
||||
internal string PoolFQDN
|
||||
{
|
||||
get { return ProviderSettings[LyncConstants.PoolFQDN]; }
|
||||
}
|
||||
|
||||
internal string SimpleUrlRoot
|
||||
{
|
||||
get { return ProviderSettings[LyncConstants.SimpleUrlRoot]; }
|
||||
}
|
||||
|
||||
internal string PrimaryDomainController
|
||||
{
|
||||
get { return ProviderSettings["PrimaryDomainController"]; }
|
||||
}
|
||||
|
||||
internal string RootOU
|
||||
{
|
||||
get { return ProviderSettings["RootOU"]; }
|
||||
}
|
||||
|
||||
internal string RootDomain
|
||||
{
|
||||
get { return ServerSettings.ADRootDomain; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice)
|
||||
{
|
||||
return CreateOrganizationInternal(organizationId, sipDomain, enableConferencingVideo, maxConferenceSize, enabledFederation, enabledEnterpriseVoice);
|
||||
}
|
||||
|
||||
public virtual bool DeleteOrganization(string organizationId, string sipDomain)
|
||||
{
|
||||
return DeleteOrganizationInternal(organizationId, sipDomain);
|
||||
}
|
||||
|
||||
public virtual bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan)
|
||||
{
|
||||
return CreateUserInternal(organizationId, userUpn, plan);
|
||||
}
|
||||
|
||||
public virtual LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn)
|
||||
{
|
||||
return GetLyncUserGeneralSettingsInternal(organizationId, userUpn);
|
||||
}
|
||||
|
||||
public virtual bool SetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser)
|
||||
{
|
||||
return SetLyncUserGeneralSettingsInternal(organizationId, userUpn, lyncUser);
|
||||
}
|
||||
|
||||
public virtual bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan)
|
||||
{
|
||||
return SetLyncUserPlanInternal(organizationId, userUpn, plan, null);
|
||||
}
|
||||
|
||||
public virtual bool DeleteUser(string userUpn)
|
||||
{
|
||||
return DeleteUserInternal(userUpn);
|
||||
}
|
||||
|
||||
public virtual LyncFederationDomain[] GetFederationDomains(string organizationId)
|
||||
{
|
||||
return GetFederationDomainsInternal(organizationId);
|
||||
}
|
||||
|
||||
public virtual bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn)
|
||||
{
|
||||
return AddFederationDomainInternal(organizationId, domainName, proxyFqdn);
|
||||
}
|
||||
|
||||
public virtual bool RemoveFederationDomain(string organizationId, string domainName)
|
||||
{
|
||||
return RemoveFederationDomainInternal(organizationId, domainName);
|
||||
}
|
||||
|
||||
public virtual void ReloadConfiguration()
|
||||
{
|
||||
ReloadConfigurationInternal();
|
||||
}
|
||||
|
||||
public override bool IsInstalled()
|
||||
{
|
||||
bool bResult = false;
|
||||
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(LyncRegistryPath);
|
||||
|
||||
if (registryKey != null)
|
||||
{
|
||||
var value = (string) registryKey.GetValue("ProductVersion", null);
|
||||
|
||||
if (value.StartsWith(LyncVersion))
|
||||
{
|
||||
bResult = true;
|
||||
}
|
||||
|
||||
registryKey.Close();
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
internal virtual string CreateOrganizationInternal(string organizationId, string sipDomain, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal virtual bool DeleteOrganizationInternal(string organizationId, string sipDomain)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal virtual bool CreateUserInternal(string organizationId, string userUpn, LyncUserPlan plan)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal virtual LyncUser GetLyncUserGeneralSettingsInternal(string organizationId, string userUpn)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal virtual bool SetLyncUserGeneralSettingsInternal(string organizationId, string userUpn, LyncUser lyncUser)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal virtual bool SetLyncUserPlanInternal(string organizationId, string userUpn, LyncUserPlan plan, Runspace runspace)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal virtual bool DeleteUserInternal(string userUpn)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal virtual LyncFederationDomain[] GetFederationDomainsInternal(string organizationId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal virtual bool AddFederationDomainInternal(string organizationId, string domainName, string proxyFqdn)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal virtual bool RemoveFederationDomainInternal(string organizationId, string domainName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal virtual void ReloadConfigurationInternal()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#region PowerShell integration
|
||||
|
||||
/// <summary> Opens runspace.</summary>
|
||||
/// <returns> The runspace.</returns>
|
||||
internal Runspace OpenRunspace()
|
||||
{
|
||||
HostedSolutionLog.LogStart("OpenRunspace");
|
||||
|
||||
if (session == null)
|
||||
{
|
||||
session = InitialSessionState.CreateDefault();
|
||||
session.ImportPSModule(new[] {"ActiveDirectory", "Lync"});
|
||||
}
|
||||
|
||||
Runspace runspace = RunspaceFactory.CreateRunspace(session);
|
||||
runspace.Open();
|
||||
runspace.SessionStateProxy.SetVariable("ConfirmPreference", "none");
|
||||
HostedSolutionLog.LogEnd("OpenRunspace");
|
||||
|
||||
return runspace;
|
||||
}
|
||||
|
||||
/// <summary> Closes runspace.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
internal 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="scripts"> Scripts list.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal Collection<PSObject> ExecuteShellCommand(Runspace runspace, List<string> scripts)
|
||||
{
|
||||
object[] errors;
|
||||
return ExecuteShellCommand(runspace, scripts, out errors);
|
||||
}
|
||||
|
||||
/// <summary> Executes shell command.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <param name="command"> The command.</param>
|
||||
/// <param name="useDomainController"> True - if domain controller should be used.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal Collection<PSObject> ExecuteShellCommand(Runspace runspace, Command command, bool useDomainController)
|
||||
{
|
||||
object[] errors;
|
||||
return ExecuteShellCommand(runspace, command, useDomainController, out errors);
|
||||
}
|
||||
|
||||
/// <summary> Executes shell command.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <param name="command"> The command.</param>
|
||||
/// <param name="errors"> Errors list.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal Collection<PSObject> ExecuteShellCommand(Runspace runspace, Command command, out object[] errors)
|
||||
{
|
||||
return ExecuteShellCommand(runspace, command, true, out errors);
|
||||
}
|
||||
|
||||
/// <summary> Executes shell command.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <param name="command"> The command.</param>
|
||||
/// <param name="useDomainController"> True - if domain controller should be used.</param>
|
||||
/// <param name="errors"> Errors list.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal Collection<PSObject> ExecuteShellCommand(Runspace runspace, Command command, bool useDomainController, out object[] errors)
|
||||
{
|
||||
HostedSolutionLog.LogStart("ExecuteShellCommand");
|
||||
var errorList = new List<object>();
|
||||
|
||||
if (useDomainController)
|
||||
{
|
||||
var dc = new CommandParameter("DomainController", PrimaryDomainController);
|
||||
if (!command.Parameters.Contains(dc))
|
||||
{
|
||||
command.Parameters.Add(dc);
|
||||
}
|
||||
}
|
||||
|
||||
HostedSolutionLog.DebugCommand(command);
|
||||
Collection<PSObject> results;
|
||||
Pipeline pipeLine = runspace.CreatePipeline();
|
||||
|
||||
using (pipeLine)
|
||||
{
|
||||
pipeLine.Commands.Add(command);
|
||||
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"> Scripts list.</param>
|
||||
/// <param name="errors"> Errors list.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal 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> Gets PSObject property value.</summary>
|
||||
/// <param name="obj"> The object.</param>
|
||||
/// <param name="name"> The property name.</param>
|
||||
/// <returns> The property value.</returns>
|
||||
internal object GetPSObjectProperty(PSObject obj, string name)
|
||||
{
|
||||
return obj.Members[name].Value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Transactions
|
||||
|
||||
/// <summary> Starts the transaction.</summary>
|
||||
/// <returns> The transaction.</returns>
|
||||
internal LyncTransaction StartTransaction()
|
||||
{
|
||||
return new LyncTransaction();
|
||||
}
|
||||
|
||||
/// <summary> Rollbacks the transaction.</summary>
|
||||
/// <param name="transaction"> The transaction.</param>
|
||||
internal void RollbackTransaction(LyncTransaction transaction)
|
||||
{
|
||||
HostedSolutionLog.LogStart("RollbackTransaction");
|
||||
Runspace runspace = null;
|
||||
try
|
||||
{
|
||||
runspace = OpenRunspace();
|
||||
|
||||
for (int i = transaction.Actions.Count - 1; i > -1; i--)
|
||||
{
|
||||
try
|
||||
{
|
||||
RollbackAction(transaction.Actions[i], runspace);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("Rollback error", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HostedSolutionLog.LogError("Rollback error", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
HostedSolutionLog.LogEnd("RollbackTransaction");
|
||||
}
|
||||
|
||||
/// <summary> Rollbacks lync action.</summary>
|
||||
/// <param name="action"> The action.</param>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
private void RollbackAction(TransactionAction action, Runspace runspace)
|
||||
{
|
||||
HostedSolutionLog.LogInfo("Rollback action: {0}", action.ActionType);
|
||||
switch (action.ActionType)
|
||||
{
|
||||
case TransactionAction.TransactionActionTypes.LyncNewSipDomain:
|
||||
DeleteSipDomain(runspace, action.Id);
|
||||
break;
|
||||
case TransactionAction.TransactionActionTypes.LyncNewUser:
|
||||
DeleteUser(runspace, action.Id);
|
||||
break;
|
||||
case TransactionAction.TransactionActionTypes.LyncNewConferencingPolicy:
|
||||
DeleteConferencingPolicy(runspace, action.Id);
|
||||
break;
|
||||
case TransactionAction.TransactionActionTypes.LyncNewExternalAccessPolicy:
|
||||
DeleteExternalAccessPolicy(runspace, action.Id);
|
||||
break;
|
||||
case TransactionAction.TransactionActionTypes.LyncNewMobilityPolicy:
|
||||
DeleteMobilityPolicy(runspace, action.Id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Helpers
|
||||
|
||||
/// <summary> Gets organizations AD path. </summary>
|
||||
/// <param name="organizationId"> The organization identifier.</param>
|
||||
/// <returns> The organization AD path.</returns>
|
||||
internal string GetOrganizationPath(string organizationId)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
AppendOUPath(sb, organizationId);
|
||||
AppendOUPath(sb, RootOU);
|
||||
AppendDomainPath(sb, RootDomain);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary> Appends organizational unit path.</summary>
|
||||
/// <param name="sb"> The string builder.</param>
|
||||
/// <param name="ou"> The organizational unit.</param>
|
||||
internal static void AppendOUPath(StringBuilder sb, string ou)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ou))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string path = ou.Replace("/", "\\");
|
||||
string[] parts = path.Split('\\');
|
||||
for (int i = parts.Length - 1; i != -1; i--)
|
||||
{
|
||||
sb.Append("OU=").Append(parts[i]).Append(",");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Appends domain path.</summary>
|
||||
/// <param name="sb"> The string builder.</param>
|
||||
/// <param name="domain"> The domain name.</param>
|
||||
internal static void AppendDomainPath(StringBuilder sb, string domain)
|
||||
{
|
||||
if (string.IsNullOrEmpty(domain))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string[] parts = domain.Split('.');
|
||||
|
||||
for (int i = 0; i < parts.Length; i++)
|
||||
{
|
||||
sb.Append("DC=").Append(parts[i]);
|
||||
|
||||
if (i < (parts.Length - 1))
|
||||
{
|
||||
sb.Append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Adds AD prefix.</summary>
|
||||
/// <param name="path"> The path.</param>
|
||||
/// <returns> The result.</returns>
|
||||
internal string AddADPrefix(string path)
|
||||
{
|
||||
string dn = path;
|
||||
if (!dn.ToUpper().StartsWith("LDAP://"))
|
||||
{
|
||||
dn = string.Format("LDAP://{0}/{1}", PrimaryDomainController, dn);
|
||||
}
|
||||
return dn;
|
||||
}
|
||||
|
||||
/// <summary> Deletes sip domain.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <param name="id"> The identifier.</param>
|
||||
internal void DeleteSipDomain(Runspace runspace, string id)
|
||||
{
|
||||
HostedSolutionLog.LogStart("DeleteSipDomain");
|
||||
HostedSolutionLog.DebugInfo("SipDomain : {0}", id);
|
||||
var command = new Command("Remove-CsSipDomain");
|
||||
command.Parameters.Add("Identity", id);
|
||||
command.Parameters.Add("Confirm", false);
|
||||
command.Parameters.Add("Force", true);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
HostedSolutionLog.LogEnd("DeleteSipDomain");
|
||||
}
|
||||
|
||||
/// <summary> Deletes user.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <param name="userUpn"> The user UPN.</param>
|
||||
internal void DeleteUser(Runspace runspace, string userUpn)
|
||||
{
|
||||
HostedSolutionLog.LogStart("DeleteUser");
|
||||
HostedSolutionLog.DebugInfo("userUpn : {0}", userUpn);
|
||||
|
||||
var command = new Command("Disable-CsUser");
|
||||
command.Parameters.Add("Identity", userUpn);
|
||||
command.Parameters.Add("Confirm", false);
|
||||
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
HostedSolutionLog.LogEnd("DeleteUser");
|
||||
}
|
||||
|
||||
/// <summary> Deletes conferencing policy.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <param name="policyName"> The policy name.</param>
|
||||
internal void DeleteConferencingPolicy(Runspace runspace, string policyName)
|
||||
{
|
||||
HostedSolutionLog.LogStart("DeleteConferencingPolicy");
|
||||
HostedSolutionLog.DebugInfo("policyName : {0}", policyName);
|
||||
|
||||
var command = new Command("Remove-CsConferencingPolicy");
|
||||
command.Parameters.Add("Identity", policyName);
|
||||
command.Parameters.Add("Confirm", false);
|
||||
command.Parameters.Add("Force", true);
|
||||
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
HostedSolutionLog.LogEnd("DeleteConferencingPolicy");
|
||||
}
|
||||
|
||||
/// <summary> Deletes external access policy.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <param name="policyName"> The policy name.</param>
|
||||
internal void DeleteExternalAccessPolicy(Runspace runspace, string policyName)
|
||||
{
|
||||
HostedSolutionLog.LogStart("DeleteExternalAccessPolicy");
|
||||
HostedSolutionLog.DebugInfo("policyName : {0}", policyName);
|
||||
|
||||
var command = new Command("Remove-CsExternalAccessPolicy");
|
||||
command.Parameters.Add("Identity", policyName);
|
||||
command.Parameters.Add("Confirm", false);
|
||||
command.Parameters.Add("Force", true);
|
||||
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
HostedSolutionLog.LogEnd("DeleteExternalAccessPolicy");
|
||||
}
|
||||
|
||||
/// <summary> Deletes mobility policy.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <param name="policyName"> The policy name.</param>
|
||||
internal void DeleteMobilityPolicy(Runspace runspace, string policyName)
|
||||
{
|
||||
HostedSolutionLog.LogStart("DeleteMobilityPolicy");
|
||||
HostedSolutionLog.DebugInfo("policyName : {0}", policyName);
|
||||
|
||||
var command = new Command("Remove-CsMobilityPolicy");
|
||||
command.Parameters.Add("Identity", policyName);
|
||||
command.Parameters.Add("Confirm", false);
|
||||
command.Parameters.Add("Force", true);
|
||||
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
HostedSolutionLog.LogEnd("DeleteMobilityPolicy");
|
||||
}
|
||||
|
||||
/// <summary> Creates simple url.</summary>
|
||||
/// <param name="runspace"> The runspace.</param>
|
||||
/// <param name="id"> The identifier.</param>
|
||||
internal void CreateSimpleUrl(Runspace runspace, Guid id)
|
||||
{
|
||||
var command = new Command("Get-CsSipDomain");
|
||||
Collection<PSObject> sipDomains = ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
IList<PSObject> SimpleUrls = new List<PSObject>();
|
||||
|
||||
foreach (PSObject domain in sipDomains)
|
||||
{
|
||||
var d = (string) GetPSObjectProperty(domain, "Name");
|
||||
string Url = SimpleUrlRoot + d;
|
||||
|
||||
command = new Command("New-CsSimpleUrlEntry");
|
||||
command.Parameters.Add("Url", Url);
|
||||
Collection<PSObject> simpleUrlEntry = ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
command = new Command("New-CsSimpleUrl");
|
||||
command.Parameters.Add("Component", "meet");
|
||||
command.Parameters.Add("Domain", d);
|
||||
command.Parameters.Add("SimpleUrl", simpleUrlEntry[0]);
|
||||
command.Parameters.Add("ActiveUrl", Url);
|
||||
Collection<PSObject> simpleUrl = ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
SimpleUrls.Add(simpleUrl[0]);
|
||||
}
|
||||
|
||||
command = new Command("Set-CsSimpleUrlConfiguration");
|
||||
command.Parameters.Add("Identity", "Global");
|
||||
command.Parameters.Add("Tenant", id);
|
||||
command.Parameters.Add("SimpleUrl", SimpleUrls);
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#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.Lync2013")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("WebsitePanel.Providers.HostedSolution.Lync2013")]
|
||||
[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("24c20bdd-51ad-406c-9999-96e432477a79")]
|
||||
|
||||
// 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,79 @@
|
|||
<?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>{EF36A05F-5573-4ED2-A47D-689F1CA1A209}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>WebsitePanel.Providers.HostedSolution.Lync2013</RootNamespace>
|
||||
<AssemblyName>WebsitePanel.Providers.HostedSolution.Lync2013</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\Lync2013\</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\Lync2013\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Rtc.Management.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rtc.Management.WritableConfig, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.WritableConfig.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.DirectoryServices" />
|
||||
<Reference Include="System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Web" />
|
||||
<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="Lync2013.cs" />
|
||||
<Compile Include="LyncBase.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>
|
||||
</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>
|
|
@ -122,7 +122,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
return res;
|
||||
}
|
||||
|
||||
internal static void DebugCommand(Command cmd)
|
||||
public static void DebugCommand(Command cmd)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(cmd.CommandText);
|
||||
foreach (CommandParameter parameter in cmd.Parameters)
|
||||
|
|
|
@ -156,7 +156,6 @@
|
|||
<Compile Include="Exchange2010SP2.cs" />
|
||||
<Compile Include="HostedSharePointServer2010.cs" />
|
||||
<Compile Include="Lync2010.cs" />
|
||||
<Compile Include="LyncTransaction.cs" />
|
||||
<Compile Include="OCSEdge2007R2.cs" />
|
||||
<Compile Include="OCS2007R2.cs" />
|
||||
<Compile Include="CRMProvider.cs" />
|
||||
|
|
|
@ -70,8 +70,18 @@ namespace WebsitePanel.Providers.Web.HeliconZoo
|
|||
{
|
||||
Configuration appConfig = srvman.GetApplicationHostConfiguration();
|
||||
|
||||
ConfigurationSection heliconZooServer = appConfig.GetSection("system.webServer/heliconZooServer");
|
||||
|
||||
ConfigurationSection heliconZooServer;
|
||||
try
|
||||
{
|
||||
heliconZooServer = appConfig.GetSection("system.webServer/heliconZooServer");
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
// heliconZooServer is not found
|
||||
// looks like zoo is not installed
|
||||
return result.ToArray();
|
||||
}
|
||||
|
||||
ConfigurationElement engines = heliconZooServer.GetChildElement("engines");
|
||||
ConfigurationElementCollection enginesCollection = engines.GetCollection();
|
||||
|
||||
|
@ -278,7 +288,18 @@ namespace WebsitePanel.Providers.Web.HeliconZoo
|
|||
using (var srvman = new ServerManager())
|
||||
{
|
||||
Configuration appConfig = srvman.GetApplicationHostConfiguration();
|
||||
ConfigurationSection zooServer = appConfig.GetSection("system.webServer/heliconZooServer", siteId);
|
||||
ConfigurationSection zooServer;
|
||||
try
|
||||
{
|
||||
zooServer = appConfig.GetSection("system.webServer/heliconZooServer", siteId);
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
// heliconZooServer is not found
|
||||
// looks like zoo is not installed
|
||||
return engines.ToArray();
|
||||
|
||||
}
|
||||
ConfigurationElement switchboard = zooServer.GetChildElement("switchboard");
|
||||
ConfigurationElementCollection switchboardCollection = switchboard.GetCollection();
|
||||
|
||||
|
|
|
@ -1914,22 +1914,27 @@ 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)
|
||||
if (!string.IsNullOrEmpty(siteId))
|
||||
{
|
||||
// Ape is not working in not Integrated pipeline mode
|
||||
return false;
|
||||
// Check the web site app pool in integrated pipeline mode
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1960,7 +1965,7 @@ namespace WebsitePanel.Providers.Web
|
|||
public new void GrantWebDeployPublishingAccess(string siteName, string accountName, string accountPassword)
|
||||
{
|
||||
// Web Publishing Access feature requires FullControl permissions on the web site's wwwroot folder
|
||||
GrantWebManagementAccessInternally(siteName, accountName, accountPassword, NTFSPermission.FullControl);
|
||||
//GrantWebManagementAccessInternally(siteName, accountName, accountPassword, NTFSPermission.FullControl);
|
||||
//
|
||||
EnforceDelegationRulesRestrictions(siteName, accountName);
|
||||
}
|
||||
|
@ -1974,7 +1979,7 @@ namespace WebsitePanel.Providers.Web
|
|||
public new void RevokeWebDeployPublishingAccess(string siteName, string accountName)
|
||||
{
|
||||
// Web Publishing Access feature requires FullControl permissions on the web site's wwwroot folder
|
||||
RevokeWebManagementAccess(siteName, accountName);
|
||||
//RevokeWebManagementAccess(siteName, accountName);
|
||||
//
|
||||
RemoveDelegationRulesRestrictions(siteName, accountName);
|
||||
}
|
||||
|
@ -3829,7 +3834,7 @@ namespace WebsitePanel.Providers.Web
|
|||
else
|
||||
{
|
||||
//
|
||||
SystemUser user = SecurityUtils.GetUser(accountName, ServerSettings, String.Empty);
|
||||
SystemUser user = SecurityUtils.GetUser(GetNonQualifiedAccountName(accountName), ServerSettings, String.Empty);
|
||||
//
|
||||
user.Password = accountPassword;
|
||||
//
|
||||
|
@ -3872,14 +3877,14 @@ namespace WebsitePanel.Providers.Web
|
|||
if (adEnabled)
|
||||
{
|
||||
ManagementAuthorization.Revoke(GetFullQualifiedAccountName(accountName), fqWebPath);
|
||||
SecurityUtils.RemoveNtfsPermissions(contentPath, accountName, ServerSettings, UsersOU, GroupsOU);
|
||||
SecurityUtils.DeleteUser(accountName, ServerSettings, UsersOU);
|
||||
SecurityUtils.RemoveNtfsPermissions(contentPath, GetNonQualifiedAccountName(accountName), ServerSettings, UsersOU, GroupsOU);
|
||||
SecurityUtils.DeleteUser(GetNonQualifiedAccountName(accountName), ServerSettings, UsersOU);
|
||||
}
|
||||
else
|
||||
{
|
||||
ManagementAuthorization.Revoke(GetFullQualifiedAccountName(accountName), fqWebPath);
|
||||
SecurityUtils.RemoveNtfsPermissions(contentPath, accountName, ServerSettings, String.Empty, String.Empty);
|
||||
SecurityUtils.DeleteUser(accountName, ServerSettings, String.Empty);
|
||||
SecurityUtils.RemoveNtfsPermissions(contentPath, GetNonQualifiedAccountName(accountName), ServerSettings, String.Empty, String.Empty);
|
||||
SecurityUtils.DeleteUser(GetNonQualifiedAccountName(accountName), ServerSettings, String.Empty);
|
||||
}
|
||||
}
|
||||
// Restore setting back
|
||||
|
|
|
@ -132,6 +132,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Host
|
|||
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
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.HostedSolution.Lync2013", "WebsitePanel.Providers.HostedSolution.Lync2013\WebsitePanel.Providers.HostedSolution.Lync2013.csproj", "{EF36A05F-5573-4ED2-A47D-689F1CA1A209}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -672,6 +674,16 @@ Global
|
|||
{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
|
||||
{EF36A05F-5573-4ED2-A47D-689F1CA1A209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EF36A05F-5573-4ED2-A47D-689F1CA1A209}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EF36A05F-5573-4ED2-A47D-689F1CA1A209}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{EF36A05F-5573-4ED2-A47D-689F1CA1A209}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{EF36A05F-5573-4ED2-A47D-689F1CA1A209}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{EF36A05F-5573-4ED2-A47D-689F1CA1A209}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EF36A05F-5573-4ED2-A47D-689F1CA1A209}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EF36A05F-5573-4ED2-A47D-689F1CA1A209}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{EF36A05F-5573-4ED2-A47D-689F1CA1A209}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{EF36A05F-5573-4ED2-A47D-689F1CA1A209}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -1,51 +1,46 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<!-- Custom configuration sections -->
|
||||
<configSections>
|
||||
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3"/>
|
||||
<section name="websitepanel.server" type="WebsitePanel.Server.ServerConfiguration, WebsitePanel.Server"/>
|
||||
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching"/>
|
||||
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3" />
|
||||
<section name="websitepanel.server" type="WebsitePanel.Server.ServerConfiguration, WebsitePanel.Server" />
|
||||
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching" />
|
||||
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
|
||||
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
|
||||
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
|
||||
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
|
||||
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
|
||||
</sectionGroup>
|
||||
</sectionGroup>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<appSettings>
|
||||
<add key="WebsitePanel.HyperV.UseDiskPartClearReadOnlyFlag" value="false"/>
|
||||
<add key="WebsitePanel.Exchange.ClearQueryBaseDN" value="false"/>
|
||||
<add key="WebsitePanel.Exchange.enableSP2abp" value="false"/>
|
||||
<add key="SCVMMServerName" value=""/>
|
||||
<add key="SCVMMServerPort" value=""/>
|
||||
<add key="WebsitePanel.HyperV.UseDiskPartClearReadOnlyFlag" value="false" />
|
||||
<add key="WebsitePanel.Exchange.ClearQueryBaseDN" value="false" />
|
||||
<add key="WebsitePanel.Exchange.enableSP2abp" value="false" />
|
||||
<add key="SCVMMServerName" value="" />
|
||||
<add key="SCVMMServerPort" value="" />
|
||||
</appSettings>
|
||||
<system.diagnostics>
|
||||
<switches>
|
||||
<add name="Log" value="2"/>
|
||||
<add name="Log" value="2" />
|
||||
<!-- 0 - Off, 1 - Error, 2 - Warning, 3 - Info, 4 - Verbose -->
|
||||
</switches>
|
||||
<trace autoflush="true">
|
||||
<listeners>
|
||||
<add name="DefaultListener" type="WebsitePanel.Server.Utils.EventLogTraceListener, WebsitePanel.Server.Utils" initializeData="WebsitePanel"/>
|
||||
<add name="DefaultListener" type="WebsitePanel.Server.Utils.EventLogTraceListener, WebsitePanel.Server.Utils" initializeData="WebsitePanel" />
|
||||
<!-- Writes log to the file
|
||||
<add name="DefaultListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="WebsitePanel.Server.log" />
|
||||
-->
|
||||
<remove name="Default"/>
|
||||
<remove name="Default" />
|
||||
</listeners>
|
||||
</trace>
|
||||
</system.diagnostics>
|
||||
<!-- Caching Configuration -->
|
||||
<cachingConfiguration defaultCacheManager="Default Cache Manager">
|
||||
<backingStores>
|
||||
<add name="inMemory" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching"/>
|
||||
<add name="inMemory" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching" />
|
||||
</backingStores>
|
||||
<cacheManagers>
|
||||
<add name="Default Cache Manager" expirationPollFrequencyInSeconds="43200" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="inMemory"/>
|
||||
<add name="Default Cache Manager" expirationPollFrequencyInSeconds="43200" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="inMemory" />
|
||||
</cacheManagers>
|
||||
</cachingConfiguration>
|
||||
<!-- WebsitePanel Configuration -->
|
||||
|
@ -53,127 +48,127 @@
|
|||
<!-- Security settings -->
|
||||
<security>
|
||||
<!-- Perform security check -->
|
||||
<enabled value="true"/>
|
||||
<enabled value="true" />
|
||||
<!-- Server password -->
|
||||
<password value="W6ph5Mm5Pz8GgiULbPgzG37mj9g="/>
|
||||
<password value="+uxnDOdf55yuH6iZYXgYAxsfIBw=" />
|
||||
</security>
|
||||
</websitepanel.server>
|
||||
<system.web>
|
||||
<!-- Disable any authentication -->
|
||||
<authentication mode="None"/>
|
||||
<authentication mode="None" />
|
||||
<!-- Correct HTTP runtime settings -->
|
||||
<httpRuntime executionTimeout="3600" maxRequestLength="16384"/>
|
||||
<httpRuntime executionTimeout="3600" maxRequestLength="16384" />
|
||||
<!-- Set globalization settings -->
|
||||
<globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8"/>
|
||||
<globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />
|
||||
<!-- Web Services settings -->
|
||||
<webServices>
|
||||
<protocols>
|
||||
<remove name="HttpPost"/>
|
||||
<remove name="HttpPostLocalhost"/>
|
||||
<remove name="HttpGet"/>
|
||||
<remove name="HttpPost" />
|
||||
<remove name="HttpPostLocalhost" />
|
||||
<remove name="HttpGet" />
|
||||
</protocols>
|
||||
<soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3"/>
|
||||
<soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3" />
|
||||
</webServices>
|
||||
<compilation debug="true">
|
||||
<assemblies>
|
||||
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
<pages>
|
||||
<controls>
|
||||
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</controls>
|
||||
</pages>
|
||||
<httpHandlers>
|
||||
<remove verb="*" path="*.asmx"/>
|
||||
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<remove verb="*" path="*.asmx" />
|
||||
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</httpHandlers>
|
||||
<httpModules>
|
||||
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</httpModules>
|
||||
</system.web>
|
||||
<!-- WSE 3.0 settings -->
|
||||
<microsoft.web.services3>
|
||||
<diagnostics>
|
||||
<trace enabled="false" input="InputTrace.webinfo" output="OutputTrace.webinfo"/>
|
||||
<trace enabled="false" input="InputTrace.webinfo" output="OutputTrace.webinfo" />
|
||||
</diagnostics>
|
||||
<messaging>
|
||||
<maxMessageLength value="-1"/>
|
||||
<mtom serverMode="optional" clientMode="On"/>
|
||||
<maxMessageLength value="-1" />
|
||||
<mtom serverMode="optional" clientMode="On" />
|
||||
</messaging>
|
||||
<security>
|
||||
<securityTokenManager>
|
||||
<add type="WebsitePanel.Server.ServerUsernameTokenManager, WebsitePanel.Server" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken"/>
|
||||
<add type="WebsitePanel.Server.ServerUsernameTokenManager, WebsitePanel.Server" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken" />
|
||||
</securityTokenManager>
|
||||
<timeToleranceInSeconds value="86400"/>
|
||||
<timeToleranceInSeconds value="86400" />
|
||||
</security>
|
||||
<policy fileName="WsePolicyCache.Config"/>
|
||||
<policy fileName="WsePolicyCache.Config" />
|
||||
</microsoft.web.services3>
|
||||
<system.serviceModel>
|
||||
<bindings>
|
||||
<wsHttpBinding>
|
||||
<binding name="WSHttpBinding_IVirtualMachineManagementService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="10485760" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
|
||||
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
|
||||
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
|
||||
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
|
||||
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
|
||||
<security mode="Message">
|
||||
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
|
||||
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/>
|
||||
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
|
||||
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
|
||||
</security>
|
||||
</binding>
|
||||
<binding name="WSHttpBinding_IMonitoringService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="10485760" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
|
||||
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
|
||||
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
|
||||
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
|
||||
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
|
||||
<security mode="Message">
|
||||
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
|
||||
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/>
|
||||
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
|
||||
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
|
||||
</security>
|
||||
</binding>
|
||||
</wsHttpBinding>
|
||||
</bindings>
|
||||
</system.serviceModel>
|
||||
<system.codedom>
|
||||
<compilers>
|
||||
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
|
||||
<providerOption name="CompilerVersion" value="v3.5"/>
|
||||
<providerOption name="WarnAsError" value="false"/>
|
||||
<compilers>
|
||||
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
|
||||
<providerOption name="CompilerVersion" value="v3.5" />
|
||||
<providerOption name="WarnAsError" value="false" />
|
||||
</compiler>
|
||||
</compilers>
|
||||
</system.codedom>
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false"/>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
<modules>
|
||||
<remove name="ScriptModule"/>
|
||||
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<remove name="ScriptModule" />
|
||||
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</modules>
|
||||
<handlers>
|
||||
<remove name="WebServiceHandlerFactory-Integrated"/>
|
||||
<remove name="ScriptHandlerFactory"/>
|
||||
<remove name="ScriptHandlerFactoryAppServices"/>
|
||||
<remove name="ScriptResource"/>
|
||||
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<remove name="WebServiceHandlerFactory-Integrated" />
|
||||
<remove name="ScriptHandlerFactory" />
|
||||
<remove name="ScriptHandlerFactoryAppServices" />
|
||||
<remove name="ScriptResource" />
|
||||
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
|
||||
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
|
||||
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
|
||||
<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"/>
|
||||
<probing privatePath="bin/Crm2011;bin/Exchange2013;bin/Sharepoint2013;bin/Lync2013" />
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -112,10 +112,10 @@
|
|||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="btnCancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
|
@ -246,4 +246,7 @@
|
|||
<data name="secHistory.Text" xml:space="preserve">
|
||||
<value>History Log</value>
|
||||
</data>
|
||||
<data name="btnUpdate.OnClientClick" xml:space="preserve">
|
||||
<value>ShowProgressDialog('Saving Scheduled Task...');</value>
|
||||
</data>
|
||||
</root>
|
|
@ -85,16 +85,18 @@ span.ValidationMessageBlock {
|
|||
</fieldset>
|
||||
|
||||
|
||||
<asp:Panel runat="server" ID="EnginesPanel">
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
<span>Helicon Zoo engine quotas settings</span>
|
||||
</legend>
|
||||
<div class="FormBody">
|
||||
<asp:CheckBox runat="server" ID="QuotasEnabled" Text="Enable Quotas"/>
|
||||
</div>
|
||||
<legend>
|
||||
<span>Helicon Zoo engine quotas settings</span>
|
||||
</legend>
|
||||
<div class="FormBody">
|
||||
<asp:CheckBox runat="server" ID="QuotasEnabled" Text="Enable Quotas"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<asp:Panel runat="server" ID="EnginesPanel">
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
<span>Engines management</span>
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="UserControls/CollapsiblePanel.ascx" %>
|
||||
<%@ Register Src="UserControls/UserLookup.ascx" TagName="UserLookup" TagPrefix="uc1" %>
|
||||
<%@ Register Src="UserControls/ParameterEditor.ascx" TagName="ParameterEditor" TagPrefix="uc1" %>
|
||||
<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
||||
|
||||
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server" />
|
||||
<div class="FormBody">
|
||||
<table cellspacing="0" cellpadding="4" width="100%">
|
||||
<tr>
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.3074
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
@ -13,6 +12,15 @@ namespace WebsitePanel.Portal {
|
|||
|
||||
public partial class SchedulesEditSchedule {
|
||||
|
||||
/// <summary>
|
||||
/// asyncTasks control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
|
||||
|
||||
/// <summary>
|
||||
/// lblTaskName control.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue