From 7ce43121dbc706db236787744ccb44e939558cec Mon Sep 17 00:00:00 2001 From: robvde Date: Sat, 5 Jan 2013 10:31:06 +0400 Subject: [PATCH] Fixed not persisting IIS7 settings PArtial checkin litigation hold Fixed HideQuota enforce in space resources overview --- WebsitePanel/Database/update_db.sql | 49 +++++++++++++++++++ .../Exchange2007.cs | 6 +-- .../Exchange2010.cs | 29 ++++++++--- .../ProviderControls/IIS70_Settings.ascx.cs | 9 +++- 4 files changed, 82 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 6769ad82..3c4cc705 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -267,3 +267,52 @@ GO + + + + +ALTER PROCEDURE [dbo].[UpdateServiceProperties] +( + @ServiceID int, + @Xml ntext +) +AS + +-- delete old properties +BEGIN TRAN +DECLARE @idoc int +--Create an internal representation of the XML document. +EXEC sp_xml_preparedocument @idoc OUTPUT, @xml + +-- Execute a SELECT statement that uses the OPENXML rowset provider. +DELETE FROM ServiceProperties +WHERE ServiceID = @ServiceID +AND PropertyName COLLATE Latin1_General_CI_AS IN +( + SELECT PropertyName + FROM OPENXML(@idoc, '/properties/property', 1) + WITH (PropertyName nvarchar(50) '@name') +) + +INSERT INTO ServiceProperties +( + ServiceID, + PropertyName, + PropertyValue +) +SELECT + @ServiceID, + PropertyName, + PropertyValue +FROM OPENXML(@idoc, '/properties/property',1) WITH +( + PropertyName nvarchar(50) '@name', + PropertyValue nvarchar(1000) '@value' +) as PV + +-- remove document +exec sp_xml_removedocument @idoc + +COMMIT TRAN +RETURN +GO \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index a23552fa..df3cb07d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -5060,9 +5060,9 @@ namespace WebsitePanel.Providers.HostedSolution string path = AddADPrefix(id); - Command cmd = new Command("Update-OfflineAddressBook"); - cmd.Parameters.Add("Identity", id); - ExecuteShellCommand(runSpace, cmd); + //Command cmd = new Command("Update-OfflineAddressBook"); + //cmd.Parameters.Add("Identity", id); + //ExecuteShellCommand(runSpace, cmd); AdjustADSecurity(path, securityGroup, true); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs index d4a8b7ec..fd55a78e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs @@ -214,12 +214,6 @@ namespace WebsitePanel.Providers.HostedSolution uint? itemCount = (uint?)GetPSObjectProperty(statistics, "ItemCount"); info.TotalItems = ConvertNullableToInt32(itemCount); - - totalItemSize = (Unlimited)GetPSObjectProperty(statistics, "FolderAndSubfolderSize"); - info.LitigationHoldTotalSize = ConvertUnlimitedToBytes(totalItemSize); - - itemCount = (uint?)GetPSObjectProperty(statistics, "ItemsInFolder"); - info.LitigationHoldTotalItems = ConvertNullableToInt32(itemCount); DateTime? lastLogoffTime = (DateTime?)GetPSObjectProperty(statistics, "LastLogoffTime"); DateTime? lastLogonTime = (DateTime?)GetPSObjectProperty(statistics, "LastLogonTime"); @@ -233,6 +227,29 @@ namespace WebsitePanel.Providers.HostedSolution info.LastLogoff = DateTime.MinValue; info.LastLogon = DateTime.MinValue; } + + if (info.LitigationHoldEnabled) + { + cmd = new Command("Get-MailboxFolderStatistics"); + cmd.Parameters.Add("FolderScope", "RecoverableItems"); + cmd.Parameters.Add("Identity", id); + result = ExecuteShellCommand(runSpace, cmd); + if (result.Count > 0) + { + PSObject statistics = result[0]; + Unlimited totalItemSize = (Unlimited)GetPSObjectProperty(statistics, "FolderAndSubfolderSize"); + info.LitigationHoldTotalSize = ConvertUnlimitedToBytes(totalItemSize); + + uint? itemCount = (uint?)GetPSObjectProperty(statistics, "ItemsInFolder"); + info.LitigationHoldTotalItems = ConvertNullableToInt32(itemCount); + } + } + else + { + info.LitigationHoldTotalSize = 0; + info.LitigationHoldTotalItems = 0; + } + } finally { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs index c414927e..5cd2d3a4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs @@ -275,7 +275,12 @@ namespace WebsitePanel.Portal.ProviderControls // Helicon Ape bool registerHeliconApeGlobbally = chkHeliconApeGlobalRegistration.Checked; - if (registerHeliconApeGlobbally != (bool)ViewState["HeliconApeInitiallyEnabled"]) + + bool bHeliconApeInitiallyEnabled = false; + if (ViewState["HeliconApeInitiallyEnabled"] != null) + bHeliconApeInitiallyEnabled = (bool)ViewState["HeliconApeInitiallyEnabled"]; + + if (registerHeliconApeGlobbally != bHeliconApeInitiallyEnabled) { if (registerHeliconApeGlobbally) { @@ -286,8 +291,8 @@ namespace WebsitePanel.Portal.ProviderControls ES.Services.WebServers.DisableHeliconApeGlobally(int.Parse(Request.QueryString["ServiceID"])); } } - + if (WDeployEnabledCheckBox.Checked) {