From 2cecf7f8d6b77c97f4ba1d244dd7c9e31f348f1e Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Tue, 11 Nov 2014 15:45:12 +0300 Subject: [PATCH 001/146] wsp-10233 New TLD's in DNS --- .../DesktopModules/WebsitePanel/DomainsAddDomain.ascx | 2 +- .../DesktopModules/WebsitePanel/UserCreateSpace.ascx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx index 2f5a009f..a7b93c8b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx @@ -15,7 +15,7 @@ ControlToValidate="DomainName" Display="Dynamic" ValidationGroup="Domain" SetFocusOnError="true"> + ValidationExpression="^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.){1,10}[a-zA-Z]{2,15}$">

diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx index 366ff2ec..12ccdeeb 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx @@ -79,7 +79,7 @@ ControlToValidate="txtDomainName" Display="Dynamic" ValidationGroup="CreateSpace" SetFocusOnError="true"> + ValidationExpression="^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.){1,10}[a-zA-Z]{2,15}$"> From 804a04c156b46b5254ca8a2fe10a8fcb32d22012 Mon Sep 17 00:00:00 2001 From: Olov Karlsson Date: Tue, 11 Nov 2014 14:00:02 +0100 Subject: [PATCH 002/146] Permission problem solved and UI-fix for IceWarp provider --- .../Mail/MailDomain.cs | 4 +++ .../IceWarp.cs | 5 +++- .../IceWarp_EditAccount.ascx.resx | 3 ++ .../ProviderControls/IceWarp_EditAccount.ascx | 2 +- .../IceWarp_EditDomain.ascx.cs | 29 ++----------------- 5 files changed, 15 insertions(+), 28 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Mail/MailDomain.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Mail/MailDomain.cs index a452d66d..d93c54cd 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Mail/MailDomain.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Mail/MailDomain.cs @@ -368,6 +368,10 @@ namespace WebsitePanel.Providers.Mail #region IceWarp + public bool UseDomainDiskQuota { get; set; } + public bool UseDomainLimits { get; set; } + public bool UseUserLimits { get; set; } + public int MegaByteSendLimit { get; set; } public int NumberSendLimit { get; set; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs index b622ae19..08ee1d7f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs @@ -624,7 +624,10 @@ namespace WebsitePanel.Providers.Mail DefaultUserQuotaInMB = Convert.ToInt32((object) domain.GetProperty("D_UserMailbox"))/1024, DefaultUserMaxMessageSizeMegaByte = Convert.ToInt32((object) domain.GetProperty("D_UserMsg"))/1024, DefaultUserMegaByteSendLimit = Convert.ToInt32((object) domain.GetProperty("D_UserMB")), - DefaultUserNumberSendLimit = Convert.ToInt32((object) domain.GetProperty("D_UserNumber")) + DefaultUserNumberSendLimit = Convert.ToInt32((object) domain.GetProperty("D_UserNumber")), + UseDomainDiskQuota = Convert.ToBoolean(ProviderSettings["UseDomainDiskQuota"]), + UseDomainLimits = Convert.ToBoolean(ProviderSettings["UseDomainLimits"]), + UseUserLimits = Convert.ToBoolean(ProviderSettings["UseUserLimits"]) }; return mailDomain; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IceWarp_EditAccount.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IceWarp_EditAccount.ascx.resx index 946cd8c0..5c51215e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IceWarp_EditAccount.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IceWarp_EditAccount.ascx.resx @@ -270,4 +270,7 @@ Handle older mails + + Enable forwarding of older messages + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx index 4d4122d3..aeae00bc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx @@ -181,7 +181,7 @@ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditDomain.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditDomain.ascx.cs index c4e36d44..50182f1b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditDomain.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditDomain.ascx.cs @@ -38,29 +38,6 @@ namespace WebsitePanel.Portal.ProviderControls { public partial class IceWarp_EditDomain : WebsitePanelControlBase, IMailEditDomainControl { - private StringDictionary _serviceSettings; - - private StringDictionary ServiceSettings - { - get - { - if (_serviceSettings != null) - return _serviceSettings; - - _serviceSettings = new StringDictionary(); - var domain = ES.Services.MailServers.GetMailDomain(PanelRequest.ItemID); - - var settings = ES.Services.Servers.GetServiceSettings(domain.ServiceId); - - foreach (var settingPair in settings.Select(setting => setting.Split('='))) - { - _serviceSettings.Add(settingPair[0], settingPair[1]); - } - - return _serviceSettings; - } - } - protected void Page_Load(object sender, EventArgs e) { AdvancedSettingsPanel.Visible = PanelSecurity.EffectiveUser.Role == UserRole.Administrator; @@ -77,9 +54,9 @@ namespace WebsitePanel.Portal.ProviderControls public void BindItem(MailDomain item) { // Hide/show controls when not enabled on service level - rowMaxDomainDiskSpace.Visible = ServiceSettings.ContainsKey("UseDomainDiskQuota") && Convert.ToBoolean(ServiceSettings["UseDomainDiskQuota"]); - rowDomainLimits.Visible = ServiceSettings.ContainsKey("UseDomainLimits") && Convert.ToBoolean(ServiceSettings["UseDomainLimits"]); - rowUserLimits.Visible = ServiceSettings.ContainsKey("UseUserLimits") && Convert.ToBoolean(ServiceSettings["UseUserLimits"]); + rowMaxDomainDiskSpace.Visible = item.UseDomainDiskQuota; + rowDomainLimits.Visible = item.UseDomainLimits; + rowUserLimits.Visible = item.UseUserLimits; txtMaxDomainDiskSpace.Text = item.MaxDomainSizeInMB.ToString(); txtMaxDomainUsers.Text = item.MaxDomainUsers.ToString(); From 7b188d401fbffab618871f76e1419833144d3214 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 11 Nov 2014 08:17:58 -0500 Subject: [PATCH 003/146] Added tag build-2.1.0.461 for changeset 8f2448964202 From b7f3087d13fb503e60fb63cbda237d8cfe350958 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 11 Nov 2014 12:20:53 -0500 Subject: [PATCH 004/146] Added tag build-2.1.0.462 for changeset 3d02d6f4d5db From ffca6a853567060149d7eb99854705a2e48fbd7c Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 13 Nov 2014 17:34:45 -0500 Subject: [PATCH 005/146] Added tag build-2.1.0.463 for changeset 2df0054e5e13 From 18275371c0aaed1fd6f527cd2a477c06caabd0e0 Mon Sep 17 00:00:00 2001 From: Olov Karlsson Date: Fri, 14 Nov 2014 08:59:47 +0100 Subject: [PATCH 006/146] Now it is possible to use MSFTP70 to create a FTP site --- .../ProviderControls/MSFTP70_Settings.ascx.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/MSFTP70_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/MSFTP70_Settings.ascx.cs index 3c4767a5..94206b77 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/MSFTP70_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/MSFTP70_Settings.ascx.cs @@ -121,7 +121,14 @@ namespace WebsitePanel.Portal.ProviderControls ddlSite.Items.Add(item); } - ddlSite_SelectedIndexChanged(this, null); + if (ddlSite.Items.Count == 0) + { + ddlSite.Items.Add(new ListItem("Default FTP Site (not yet created)", "Default FTP Site")); + } + else + { + ddlSite_SelectedIndexChanged(this, null); + } } protected void ddlSite_SelectedIndexChanged(object sender, EventArgs e) From 8da8bec9260e0efb04c24ec300ea43571956c528 Mon Sep 17 00:00:00 2001 From: Olov Karlsson Date: Fri, 14 Nov 2014 09:06:24 +0100 Subject: [PATCH 007/146] Fixed error regarding phppath in update_db.sql --- WebsitePanel/Database/update_db.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index d3669869..355e1325 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -6074,11 +6074,11 @@ GO -- wsp-10269: Changed php extension path in default properties for IIS70 and IIS80 provider update ServiceDefaultProperties -set PhpPath='%PROGRAMFILES(x86)%\PHP\php-cgi.exe' -where ProviderId in(101, 105) +set PropertyValue='%PROGRAMFILES(x86)%\PHP\php-cgi.exe' +where PropertyName='PhpPath' and ProviderId in(101, 105) update ServiceDefaultProperties -set Php4Path='%PROGRAMFILES(x86)%\PHP\ph.exe' -where ProviderId in(101, 105) +set PropertyValue='%PROGRAMFILES(x86)%\PHP\php.exe' +where PropertyName='Php4Path' and ProviderId in(101, 105) GO From 5e596f321097c466351c9ba922e3da4fc5978011 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 14 Nov 2014 06:47:32 -0500 Subject: [PATCH 008/146] Added tag build-2.1.0.464 for changeset 59793778aa1e From ed48dd68c4bfa1a80f50513880e0c68b39b47a1a Mon Sep 17 00:00:00 2001 From: Olov Karlsson Date: Fri, 14 Nov 2014 20:04:23 +0100 Subject: [PATCH 009/146] UI-fixes for IceWarp Server and Account settings --- .../IceWarp_Settings.ascx.resx | 15 +++++++++++++ .../ProviderControls/IceWarp_EditAccount.ascx | 2 +- .../IceWarp_EditAccount.ascx.cs | 7 +++++-- .../ProviderControls/IceWarp_Settings.ascx | 21 ++++++++++++------- .../IceWarp_Settings.ascx.designer.cs | 17 +++++++++++---- 5 files changed, 47 insertions(+), 15 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IceWarp_Settings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IceWarp_Settings.ascx.resx index 9b5d5338..465f32a9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IceWarp_Settings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IceWarp_Settings.ascx.resx @@ -123,16 +123,31 @@ + + Global max message size: + + + Public IP Address: + Public IP Address: + + 0 means unlimited + + + Can be overridden on domain level if you check 'Override global limits' + + + Must be a value between 0 and 99, 0 means disabled + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx index aeae00bc..fd2050e6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx @@ -76,7 +76,7 @@ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx.cs index f047b103..a7dfa4ab 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx.cs @@ -37,8 +37,11 @@ namespace WebsitePanel.Portal.ProviderControls { // Hide some form items when creating a new account passwordRow.Visible = (PanelRequest.ItemID > 0); + AutoresponderPanel.Visible = (PanelRequest.ItemID > 0); secAutoresponder.Visible = (PanelRequest.ItemID > 0); + ForwardingPanel.Visible = (PanelRequest.ItemID > 0); secForwarding.Visible = (PanelRequest.ItemID > 0); + OlderMailsPanel.Visible = (PanelRequest.ItemID > 0); secOlderMails.Visible = (PanelRequest.ItemID > 0); } @@ -109,10 +112,10 @@ namespace WebsitePanel.Portal.ProviderControls item.IsDomainAdmin = cbDomainAdmin.Checked; item.DeleteOlder = cbDeleteOlder.Checked; - item.DeleteOlderDays = Convert.ToInt32(txtDeleteOlderDays.Text); + item.DeleteOlderDays = string.IsNullOrWhiteSpace(txtDeleteOlderDays.Text) ? 0 : Convert.ToInt32(txtDeleteOlderDays.Text); item.ForwardOlder = cbForwardOlder.Checked; - item.ForwardOlderDays = Convert.ToInt32(txtForwardOlderDays.Text); + item.ForwardOlderDays = string.IsNullOrWhiteSpace(txtForwardOlderDays.Text) ? 0 : Convert.ToInt32(txtForwardOlderDays.Text); item.ForwardOlderTo = txtForwardOlderTo.Text; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_Settings.ascx index d603cc96..0645454c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_Settings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_Settings.ascx @@ -1,6 +1,6 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="IceWarp_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.IceWarp_Settings" %> <%@ Register Src="../UserControls/SelectIPAddress.ascx" TagName="SelectIPAddress" TagPrefix="uc1" %> -
-
- +
+
+ + + + @@ -53,9 +58,9 @@
@@ -14,9 +14,14 @@ - - + + +
@@ -43,9 +48,9 @@ - + - +
- - - + + +
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_Settings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_Settings.ascx.designer.cs index 7348a746..04a643f7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_Settings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_Settings.ascx.designer.cs @@ -49,13 +49,22 @@ namespace WebsitePanel.Portal.ProviderControls { protected global::System.Web.UI.WebControls.TextBox txtMaxMessageSizeInMB; ///

- /// Label1 control. + /// txtMaxMessageSizeInMBRequired control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Label Label1; + protected global::System.Web.UI.WebControls.RequiredFieldValidator txtMaxMessageSizeInMBRequired; + + /// + /// MaxMessageSizeInMB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label MaxMessageSizeInMB; /// /// cbUseDomainDiskQuota control. @@ -130,12 +139,12 @@ namespace WebsitePanel.Portal.ProviderControls { protected global::System.Web.UI.WebControls.TextBox txtWarnMailboxUsage; /// - /// RequiredFieldValidator1 control. + /// txtWarnMailboxUsageRequired control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; + protected global::System.Web.UI.WebControls.RequiredFieldValidator txtWarnMailboxUsageRequired; } } From 36206b74ad9fe9cef6335925daa957f0f6f70d51 Mon Sep 17 00:00:00 2001 From: Olov Karlsson Date: Fri, 14 Nov 2014 20:06:57 +0100 Subject: [PATCH 010/146] Larger width on UserControls DomainSelectDomainControl and SelectIPAddress --- .../WebsitePanel/DomainsSelectDomainControl.ascx | 2 +- .../DomainsSelectDomainControl.ascx.designer.cs | 3 +-- .../WebsitePanel/UserControls/SelectIPAddress.ascx | 2 +- .../UserControls/SelectIPAddress.ascx.designer.cs | 14 +++++++++++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx index e37eb045..27d78949 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx @@ -1,4 +1,4 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DomainsSelectDomainControl.ascx.cs" Inherits="WebsitePanel.Portal.DomainsSelectDomainControl" %> - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.designer.cs index 08309915..40c4eebf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // 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. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SelectIPAddress.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SelectIPAddress.ascx index 795fdacc..fc10570b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SelectIPAddress.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SelectIPAddress.ascx @@ -1,3 +1,3 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SelectIPAddress.ascx.cs" Inherits="WebsitePanel.Portal.SelectIPAddress" %> - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SelectIPAddress.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SelectIPAddress.ascx.designer.cs index df23d710..7e5f87fa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SelectIPAddress.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SelectIPAddress.ascx.designer.cs @@ -1,16 +1,24 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal { + public partial class SelectIPAddress { - protected System.Web.UI.WebControls.DropDownList ddlIPAddresses; + + /// + /// ddlIPAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlIPAddresses; } } From ac115e209fd8abb45585a80a6fe50b4236e48eae Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 14 Nov 2014 14:36:38 -0500 Subject: [PATCH 011/146] Added tag build-2.1.0.465 for changeset 7e5a44503357 From 58cc51217bb44863891ffe192a98b072f723fa59 Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Mon, 17 Nov 2014 23:38:49 +0300 Subject: [PATCH 012/146] exchange 2013: fix public folder permission --- .../Exchange2013.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs index fa411b12..f318fe29 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs @@ -4790,6 +4790,10 @@ namespace WebsitePanel.Providers.HostedSolution } CheckOrganizationRootPublicFolderPermission(runSpace, organizationId); + + // exchange transport needs access to create new items in order to deliver email + AddPublicFolderClientPermission(runSpace, folder, "Anonymous", "CreateItems"); + } finally { From 3881892ce90b9888197149af5871a6ad3f2936e8 Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Tue, 18 Nov 2014 00:21:43 +0300 Subject: [PATCH 013/146] wsp-10268 Text doesn't fit on Add domain page --- .../WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css | 3 ++- .../DesktopModules/WebsitePanel/WebSitesAddSite.ascx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css index 648d27e7..05b59c1b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css @@ -289,4 +289,5 @@ UL.ActionButtons LI {margin-bottom: 12px;} .enabled {width:20px; height:20px; background: transparent url(../Icons/ok.png) left center no-repeat; border:medium none;} p.warningText {font-size:14px; color:Red; text-align:center;} .Hidden {display: none;} -.LinkText {color:#428bca;} \ No newline at end of file +.LinkText {color:#428bca;} +.WrapText { white-space: normal;} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesAddSite.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesAddSite.ascx index 7c973b98..1b29c6af 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesAddSite.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesAddSite.ascx @@ -28,7 +28,7 @@ -
+
From 9368aacbce5132db60dbf0bc7e4b4ced16cce8f9 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 17 Nov 2014 18:30:54 -0500 Subject: [PATCH 014/146] Added tag build-2.1.0.466 for changeset 8d8f9b7cc2cc From 6df229181cad7c60a5338eebce7bdfc1af6e6ebd Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Tue, 18 Nov 2014 03:08:01 +0300 Subject: [PATCH 015/146] wsp-10265 v 2.1 : formatting issue on server error output --- .../App_Themes/Default/Styles/Skin.css | 1 + .../WebsitePanel/UserControls/MessageBox.ascx | 6 ++-- .../UserControls/MessageBox.ascx.designer.cs | 32 +++++++++++++++++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css index 05b59c1b..e220d489 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css @@ -235,6 +235,7 @@ A.Black {color: Black !important; text-decoration: none !important;} .RedStatus {background-image: url(error_bkg.gif); background-repeat: repeat-x;font-size: 8pt; font-weight: bold; color: White; background-color: #ff3300; text-align: center; padding: 6px;} .MessageBox SPAN.description {font-weight: normal !important;} .MessageBox .TechnicalDetails {padding-top: 4px; font-weight: normal !important;} +.TechnicalDetailsTable {background-color: #FFFFFF; color: #222; } .MessageBoxSection {font-size: 8pt; font-weight: bold;} .popupHint {border: 2px solid #C4D6BB;padding: 3px; background-color: #F1F1FF;} .popupComments {border: 2px solid #C4D6BB;font-size: 9px; padding: 3px; background-color: #F1F1FF;} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx index 4624e791..c202118b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx @@ -11,7 +11,7 @@ TargetControlID="TechnicalDetailsPanel" resourcekey="secTechnicalDetails" Text="Technical Details"> - +
+ + + + + + ') +END +GO + -- Procedures for Domai lookup service +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetScheduleTaskEmailTemplate') +DROP PROCEDURE GetScheduleTaskEmailTemplate +GO +CREATE PROCEDURE [dbo].GetScheduleTaskEmailTemplate +( + @TaskID [nvarchar](100) , + @ParameterID [nvarchar](100) +) +AS +SELECT + [TaskID] , + [ParameterID], + [Value] + FROM [dbo].[ScheduleTasksEmailTemplates] where [TaskID] = @TaskID AND [ParameterID] = @ParameterID +GO IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetAllPackageIds') DROP PROCEDURE GetAllPackageIds diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 67597939..ceacc208 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -4743,9 +4743,9 @@ namespace WebsitePanel.EnterpriseServer ); } - public static IDataReader AddDomainDnsRecord(DnsRecordInfo domainDnsRecord) + public static void AddDomainDnsRecord(DnsRecordInfo domainDnsRecord) { - return SqlHelper.ExecuteReader( + SqlHelper.ExecuteReader( ConnectionString, CommandType.StoredProcedure, "AddDomainDnsRecord", @@ -4757,9 +4757,20 @@ namespace WebsitePanel.EnterpriseServer ); } - public static IDataReader DeleteDomainDnsRecord(int id) + public static IDataReader GetScheduleTaskEmailTemplate(string taskId, string parameterId) { return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetScheduleTaskEmailTemplate", + new SqlParameter("@taskId", taskId), + new SqlParameter("@parameterId", parameterId) + ); + } + + public static void DeleteDomainDnsRecord(int id) + { + SqlHelper.ExecuteReader( ConnectionString, CommandType.StoredProcedure, "DeleteDomainDnsRecord", diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainLookupViewTask.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainLookupViewTask.cs index 765b3544..42b6bbbd 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainLookupViewTask.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainLookupViewTask.cs @@ -9,10 +9,15 @@ namespace WebsitePanel.EnterpriseServer { public class DomainLookupViewTask : SchedulerTask { + private static readonly string TaskId = "SCHEDULE_TASK_DOMAIN_LOOKUP"; + // Input parameters: private static readonly string DnsServersParameter = "DNS_SERVERS"; private static readonly string MailToParameter = "MAIL_TO"; + private static readonly string MailBodyTemplateParameter = "MAIL_BODY"; + private static readonly string MailBodyDomainRecordTemplateParameter = "MAIL_DOMAIN_RECORD"; + public override void DoWork() { BackgroundTask topTask = TaskManager.TopTask; @@ -57,6 +62,7 @@ namespace WebsitePanel.EnterpriseServer foreach (var domain in domains) { DomainChanges domainChanges = new DomainChanges(); + domainChanges.Domain = domain.DomainName; var mxRecords = ObjectUtils.CreateListFromDataReader(DataProvider.GetDomainMXRecords(domain.DomainId, DnsRecordType.MX)); var nsRecords = ObjectUtils.CreateListFromDataReader(DataProvider.GetDomainMXRecords(domain.DomainId, DnsRecordType.NS)); @@ -70,8 +76,8 @@ namespace WebsitePanel.EnterpriseServer FillRecordData(dnsMxRecords, domain, dnsServer); FillRecordData(dnsNsRecords, domain, dnsServer); - domainChanges.MxChanges.Add(ApplyDomainRecordsChanges(mxRecords, dnsMxRecords, dnsServer)); - domainChanges.NsChanges.Add(ApplyDomainRecordsChanges(nsRecords, dnsNsRecords, dnsServer)); + domainChanges.DnsChanges.Add(ApplyDomainRecordsChanges(mxRecords, dnsMxRecords, dnsServer)); + domainChanges.DnsChanges.Add(ApplyDomainRecordsChanges(nsRecords, dnsNsRecords, dnsServer)); } domainsChanges.Add(domainChanges); @@ -96,18 +102,16 @@ namespace WebsitePanel.EnterpriseServer foreach (var domainChanges in domainsChanges) { - var firstTimeAdditon = domainChanges.MxChanges.All(x => x.DnsRecordsCompare.All(dns => dns.DbRecord == null)) - && domainChanges.NsChanges.All(x => x.DnsRecordsCompare.All(dns => dns.DbRecord == null)); + var firstTimeAdditon = domainChanges.DnsChanges.All(x => x.DnsRecordsCompare.All(dns => dns.DbRecord == null)); if (firstTimeAdditon) { continue; } - bool mxIsChanged = domainChanges.MxChanges.Any(x => x.DnsRecordsCompare.Any(d => d.Status != DomainDnsRecordStatuses.NotChanged)); - bool nsIsChanged = domainChanges.NsChanges.Any(x => x.DnsRecordsCompare.Any(d => d.Status != DomainDnsRecordStatuses.NotChanged)); + bool isChanged = domainChanges.DnsChanges.Any(x => x.DnsRecordsCompare.Any(d => d.Status != DomainDnsRecordStatuses.NotChanged)); - if (mxIsChanged || nsIsChanged) + if (isChanged) { changedDomains.Add(domainChanges); } @@ -129,13 +133,13 @@ namespace WebsitePanel.EnterpriseServer if (dnsRecord != null) { - domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = dnsRecord, Status = DomainDnsRecordStatuses.NotChanged }); + domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = dnsRecord, Type= record.RecordType, Status = DomainDnsRecordStatuses.NotChanged }); dnsRecords.Remove(dnsRecord); } else { - domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = null, Status = DomainDnsRecordStatuses.Removed }); + domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = null, Type = record.RecordType, Status = DomainDnsRecordStatuses.Removed }); RemoveRecord(record); @@ -145,7 +149,7 @@ namespace WebsitePanel.EnterpriseServer foreach (var record in dnsRecords) { - domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = null, DnsRecord = record, Status = DomainDnsRecordStatuses.Added }); + domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = null, DnsRecord = record, Type = record.RecordType, Status = DomainDnsRecordStatuses.Added }); AddRecord(record); @@ -200,11 +204,13 @@ namespace WebsitePanel.EnterpriseServer { BackgroundTask topTask = TaskManager.TopTask; + var bodyTempalte = ObjectUtils.FillObjectFromDataReader(DataProvider.GetScheduleTaskEmailTemplate(TaskId, MailBodyTemplateParameter)); + var domainRecordTemplate = ObjectUtils.FillObjectFromDataReader(DataProvider.GetScheduleTaskEmailTemplate(TaskId, MailBodyDomainRecordTemplateParameter)); + // input parameters - string mailFrom = "wsp@scheduler.noreply"; + string mailFrom = "wsp-scheduler@noreply.net"; string mailTo = (string)topTask.GetParamValue("MAIL_TO"); - string mailSubject = "WSP MX and NS notification"; - string mailBody = "Hello!

"; + string mailSubject = "MX and NS notification"; if (String.IsNullOrEmpty(mailTo)) { @@ -212,8 +218,32 @@ namespace WebsitePanel.EnterpriseServer } else { + var tableRecords = new List(); + + foreach (var domain in domainsChanges) + { + var changes = domain.DnsChanges; + + foreach (var dnsChanged in changes.Where(x=>x.IsChanged)) + { + foreach (var record in dnsChanged.DnsRecordsCompare.Where(x=>x.Status != DomainDnsRecordStatuses.NotChanged)) + { + var tableRow = Utils.ReplaceStringVariable(domainRecordTemplate.Value, "domain", domain.Domain); + tableRow = Utils.ReplaceStringVariable(tableRow, "dns", dnsChanged.DnsServer); + tableRow = Utils.ReplaceStringVariable(tableRow, "recordType", record.Type.ToString()); + tableRow = Utils.ReplaceStringVariable(tableRow, "dbRecord", record.DbRecord != null ? record.DbRecord.Value : "-"); + tableRow = Utils.ReplaceStringVariable(tableRow, "dnsRecord", record.DnsRecord != null ? record.DnsRecord.Value : "-"); + + tableRecords.Add(tableRow); + } + } + } + + + var mailBody = Utils.ReplaceStringVariable(bodyTempalte.Value, "RecordRow", string.Join(" ", tableRecords)); + // send mail message - // MailHelper.SendMessage(mailFrom, mailTo, mailSubject, mailBody, false); + MailHelper.SendMessage(mailFrom, mailTo, mailSubject, mailBody, true); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainChanges.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainChanges.cs index 5bd9f038..9af977ae 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainChanges.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainChanges.cs @@ -9,13 +9,11 @@ namespace WebsitePanel.Providers.DomainLookup { public string Domain { get; set; } - public List MxChanges { get; set; } - public List NsChanges { get; set; } + public List DnsChanges { get; set; } public DomainChanges() { - MxChanges = new List(); - NsChanges = new List(); + DnsChanges = new List(); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordCompare.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordCompare.cs index f3663b43..e21d0eac 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordCompare.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordCompare.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using WebsitePanel.Providers.DNS; namespace WebsitePanel.Providers.DomainLookup { @@ -10,5 +11,6 @@ namespace WebsitePanel.Providers.DomainLookup public DnsRecordInfo DbRecord { get; set; } public DnsRecordInfo DnsRecord { get; set; } public DomainDnsRecordStatuses Status { get; set; } + public DnsRecordType Type { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/ScheduleTaskEmailTemplate.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/ScheduleTaskEmailTemplate.cs new file mode 100644 index 00000000..1ffa6e23 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/ScheduleTaskEmailTemplate.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.DomainLookup +{ + public class ScheduleTaskEmailTemplate + { + public string TaskId { get; set; } + public string ParameterID { get; set; } + public string Value { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index 576d7cec..4bd21714 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -90,6 +90,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2012/Windows2012.cs index c034f52e..c9787fe6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2012/Windows2012.cs @@ -322,19 +322,22 @@ namespace WebsitePanel.Providers.OS { foreach (var dnsRecordPs in dnsRecordsPs) { - DnsRecordInfo newRecord; + DnsRecordInfo newRecord = null; switch (recordType) { - case DnsRecordType.MX: { newRecord = CreateMxDnsRecordFromPsObject(dnsRecordPs); break; } - case DnsRecordType.NS: { newRecord = CreateNsDnsRecordFromPsObject(dnsRecordPs); break; } + case DnsRecordType.MX: { newRecord = CreateDnsRecordFromPsObject(dnsRecordPs, "NameExchange"); break; } + case DnsRecordType.NS: { newRecord = CreateDnsRecordFromPsObject(dnsRecordPs, "NameHost"); break; } default: continue; } - newRecord.DnsServer = dnsServer; - newRecord.RecordType = recordType; + if (newRecord != null) + { + newRecord.DnsServer = dnsServer; + newRecord.RecordType = recordType; - records.Add(newRecord); + records.Add(newRecord); + } } } @@ -347,21 +350,16 @@ namespace WebsitePanel.Providers.OS return records.ToArray(); } - private DnsRecordInfo CreateMxDnsRecordFromPsObject(PSObject psObject) + private DnsRecordInfo CreateDnsRecordFromPsObject(PSObject psObject, string valueName) { + if (!psObject.Members.Any(x => x.Name == valueName)) + { + return null; + } + var dnsRecord = new DnsRecordInfo { - Value = Convert.ToString(GetPSObjectProperty(psObject, "NameExchange")), - }; - - return dnsRecord; - } - - private DnsRecordInfo CreateNsDnsRecordFromPsObject(PSObject psObject) - { - var dnsRecord = new DnsRecordInfo - { - Value = Convert.ToString(GetPSObjectProperty(psObject, "NameHost")), + Value = Convert.ToString(GetPSObjectProperty(psObject, valueName)), }; return dnsRecord; From d5bf70596d7081fdeb69d76be2a270675f087a88 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Thu, 20 Nov 2014 16:14:42 +0300 Subject: [PATCH 023/146] fix bugs - add processings. --- .../WebsitePanel/RDS/RDSCreateCollection.ascx | 4 ++-- .../App_LocalResources/RDSCollectionApps.ascx.resx | 9 +++++++++ .../App_LocalResources/RDSCollectionServers.ascx.resx | 9 +++++++++ .../RDS/UserControls/RDSCollectionServers.ascx | 2 +- .../RDS/UserControls/RDSCollectionServers.ascx.cs | 5 ++--- .../DesktopModules/WebsitePanel/Scripts/AjaxUtils.js | 8 +++++++- 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx index 7047502f..a90b852a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx @@ -24,7 +24,7 @@
@@ -51,7 +51,7 @@ - @@ -103,7 +103,7 @@ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx.designer.cs index dd7712f7..87e5ed3e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx.designer.cs @@ -1,10 +1,38 @@ +// Copyright (c) 2014, 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. + + //------------------------------------------------------------------------------ // // 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. // //------------------------------------------------------------------------------ From bfca727dfbdf687840e516e3fb6cd8e11c71ad93 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 17 Nov 2014 19:34:05 -0500 Subject: [PATCH 016/146] Added tag build-2.1.0.467 for changeset e50c53b54634 From 11ed35f0f9b59cc1c393d9f39b24dbf8ebd8b81d Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 18 Nov 2014 00:54:32 -0800 Subject: [PATCH 017/146] mx ns scheduler task initial commit --- WebsitePanel/Database/update_db.sql | 131 + .../Data/DataProvider.cs | 51 + .../OperatingSystemController.cs | 22 + .../SchedulerTasks/DomainLookupViewTask.cs | 222 ++ .../Servers/ServerController.cs.orig | 2907 +++++++++++++++++ .../WebsitePanel.EnterpriseServer.Code.csproj | 1 + .../DomainLookup/DnsRecordInfo.cs | 18 + .../DomainLookup/DomainChanges.cs | 21 + .../DomainLookup/DomainDnsRecordCompare.cs | 14 + .../DomainLookup/DomainDnsRecordStatuses.cs | 14 + .../DomainLookup/DomainDnsRecordsChanges.cs | 21 + .../OS/IOperatingSystem.cs | 6 + .../WebsitePanel.Providers.Base.csproj | 5 + .../Windows2003.cs | 6 + .../Windows2012.cs | 73 + .../OperatingSystemProxy.cs | 2511 ++++++-------- .../OperatingSystem.asmx.cs | 24 + .../WebsitePanel_SharedResources.ascx.resx | 3 + .../DomainLookupView.ascx.Designer.cs | 82 + .../DomainLookupView.ascx.resx | 126 + .../DomainLookupView.ascx | 19 + .../DomainLookupView.ascx.cs | 46 + .../DomainLookupView.ascx.designer.cs | 51 + .../WebsitePanel.Portal.Modules.csproj | 17 + 24 files changed, 4970 insertions(+), 1421 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainLookupViewTask.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs.orig create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DnsRecordInfo.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainChanges.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordCompare.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordStatuses.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordsChanges.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/DomainLookupView.ascx.Designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/DomainLookupView.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx.designer.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index d3669869..895c2d3f 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -6082,3 +6082,134 @@ set Php4Path='%PROGRAMFILES(x86)%\PHP\ph.exe' where ProviderId in(101, 105) GO + +-- Domain lookup tasks + +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTasks] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP') +BEGIN +INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'WebsitePanel.EnterpriseServer.DomainLookupViewTask, WebsitePanel.EnterpriseServer.Code', 1) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskViewConfiguration] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP') +BEGIN +INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx') +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP' AND [ParameterID]= N'DNS_SERVERS' ) +BEGIN +INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'DNS_SERVERS', N'String', NULL, 1) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP' AND [ParameterID]= N'MAIL_TO' ) +BEGIN +INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'MAIL_TO', N'String', NULL, 2) +END +GO + +-- Domain lookup tables + +IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'DomainDnsRecords') +DROP TABLE DomainDnsRecords +GO +CREATE TABLE DomainDnsRecords +( + ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY, + DomainId INT NOT NULL, + RecordType INT NOT NULL, + DnsServer NVARCHAR(255), + Value NVARCHAR(255), + Date DATETIME +) +GO + +ALTER TABLE [dbo].[DomainDnsRecords] WITH CHECK ADD CONSTRAINT [FK_DomainDnsRecords_DomainId] FOREIGN KEY([DomainId]) +REFERENCES [dbo].[Domains] ([DomainID]) +ON DELETE CASCADE +GO + +-- Procedures for Domai lookup service + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetAllPackageIds') +DROP PROCEDURE GetAllPackageIds +GO +CREATE PROCEDURE [dbo].GetAllPackageIds + +AS +SELECT + [PackageID] + FROM [dbo].[Packages] +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetDomainDnsRecords') +DROP PROCEDURE GetDomainDnsRecords +GO +CREATE PROCEDURE [dbo].GetDomainDnsRecords +( + @DomainId INT, + @RecordType INT +) +AS +SELECT + ID, + DomainId, + DnsServer, + RecordType, + Value, + Date + FROM [dbo].[DomainDnsRecords] + WHERE [DomainId] = @DomainId AND [RecordType] = @RecordType +GO + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddDomainDnsRecord') +DROP PROCEDURE AddDomainDnsRecord +GO +CREATE PROCEDURE [dbo].[AddDomainDnsRecord] +( + @DomainId INT, + @RecordType INT, + @DnsServer NVARCHAR(255), + @Value NVARCHAR(255), + @Date DATETIME +) +AS + +INSERT INTO DomainDnsRecords +( + DomainId, + DnsServer, + RecordType, + Value, + Date +) +VALUES +( + @DomainId, + @DnsServer, + @RecordType, + @Value, + @Date +) +GO + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'DeleteDomainDnsRecord') +DROP PROCEDURE DeleteDomainDnsRecord +GO +CREATE PROCEDURE [dbo].[DeleteDomainDnsRecord] +( + @Id INT +) +AS + + +DELETE FROM DomainDnsRecords +WHERE Id = @Id +GO diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 62f9905f..67597939 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -36,6 +36,8 @@ using Microsoft.ApplicationBlocks.Data; using System.Collections.Generic; using Microsoft.Win32; using WebsitePanel.Providers.RemoteDesktopServices; +using WebsitePanel.Providers.DNS; +using WebsitePanel.Providers.DomainLookup; namespace WebsitePanel.EnterpriseServer { @@ -4718,5 +4720,54 @@ namespace WebsitePanel.EnterpriseServer } #endregion + + #region MX|NX Services + + public static IDataReader GetAllPackagesIds() + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetAllPackageIds" + ); + } + + public static IDataReader GetDomainMXRecords(int domainId, DnsRecordType recordType) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetDomainDnsRecords", + new SqlParameter("@DomainId", domainId), + new SqlParameter("@RecordType", recordType) + ); + } + + public static IDataReader AddDomainDnsRecord(DnsRecordInfo domainDnsRecord) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "AddDomainDnsRecord", + new SqlParameter("@DomainId", domainDnsRecord.DomainId), + new SqlParameter("@RecordType", domainDnsRecord.RecordType), + new SqlParameter("@DnsServer", domainDnsRecord.DnsServer), + new SqlParameter("@Value", domainDnsRecord.Value), + new SqlParameter("@Date", domainDnsRecord.Date) + ); + } + + public static IDataReader DeleteDomainDnsRecord(int id) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "DeleteDomainDnsRecord", + new SqlParameter("@Id", id) + ); + } + + #endregion + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/OperatingSystems/OperatingSystemController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/OperatingSystems/OperatingSystemController.cs index d851ac44..c3d2fa9f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/OperatingSystems/OperatingSystemController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/OperatingSystems/OperatingSystemController.cs @@ -40,6 +40,9 @@ using WebsitePanel.Providers; using WebsitePanel.Providers.OS; using OS = WebsitePanel.Providers.OS; using System.Collections; +using WebsitePanel.Providers.DomainLookup; +using WebsitePanel.Providers.DNS; +using System.Linq; namespace WebsitePanel.EnterpriseServer @@ -811,5 +814,24 @@ namespace WebsitePanel.EnterpriseServer #endregion + + #region Domain DNS Records lookup + + public static List GetDomainRecords(int packageId, string domain, string dnsServer, DnsRecordType recordType) + { + List records = new List(); + + // load OS service + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.Os); + + var os = GetOS(serviceId); + + records = os.GetDomainDnsRecords(domain, dnsServer, recordType).ToList(); + + return records; + } + + #endregion + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainLookupViewTask.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainLookupViewTask.cs new file mode 100644 index 00000000..765b3544 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainLookupViewTask.cs @@ -0,0 +1,222 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using WebsitePanel.Providers.DNS; +using WebsitePanel.Providers.DomainLookup; + +namespace WebsitePanel.EnterpriseServer +{ + public class DomainLookupViewTask : SchedulerTask + { + // Input parameters: + private static readonly string DnsServersParameter = "DNS_SERVERS"; + private static readonly string MailToParameter = "MAIL_TO"; + + public override void DoWork() + { + BackgroundTask topTask = TaskManager.TopTask; + + List domainsChanges = new List(); + + // get input parameters + string dnsServersString = (string)topTask.GetParamValue(DnsServersParameter); + + // check input parameters + if (String.IsNullOrEmpty(dnsServersString)) + { + TaskManager.WriteWarning("Specify 'DNS' task parameter."); + return; + } + + var dnsServers = dnsServersString.Split(';'); + + var packages = ObjectUtils.CreateListFromDataReader(DataProvider.GetAllPackagesIds()); + + foreach (var package in packages) + { + + PackageContext cntx = PackageController.GetPackageContext(package.PackageId); + + if (cntx == null) + { + continue; + } + + bool dnsEnabled = cntx.GroupsArray.Any(x => x.GroupName == ResourceGroups.Dns); + + if (!dnsEnabled) + { + continue; + } + + var domains = ServerController.GetDomains(package.PackageId); + + domains = domains.Where(x => !x.IsSubDomain && !x.IsDomainPointer).ToList(); //Selecting top-level domains + + foreach (var domain in domains) + { + DomainChanges domainChanges = new DomainChanges(); + + var mxRecords = ObjectUtils.CreateListFromDataReader(DataProvider.GetDomainMXRecords(domain.DomainId, DnsRecordType.MX)); + var nsRecords = ObjectUtils.CreateListFromDataReader(DataProvider.GetDomainMXRecords(domain.DomainId, DnsRecordType.NS)); + + //execute server + foreach (var dnsServer in dnsServers) + { + var dnsMxRecords = OperatingSystemController.GetDomainRecords(domain.PackageId, domain.DomainName, dnsServer, DnsRecordType.MX); + var dnsNsRecords = OperatingSystemController.GetDomainRecords(domain.PackageId, domain.DomainName, dnsServer, DnsRecordType.NS); + + FillRecordData(dnsMxRecords, domain, dnsServer); + FillRecordData(dnsNsRecords, domain, dnsServer); + + domainChanges.MxChanges.Add(ApplyDomainRecordsChanges(mxRecords, dnsMxRecords, dnsServer)); + domainChanges.NsChanges.Add(ApplyDomainRecordsChanges(nsRecords, dnsNsRecords, dnsServer)); + } + + domainsChanges.Add(domainChanges); + } + } + + var changedDomains = FindDomainsWithChangedRecords(domainsChanges); + + if (changedDomains.Any()) + { + SendMailMessage(changedDomains); + } + } + + + + #region Helpers + + private IEnumerable FindDomainsWithChangedRecords(IEnumerable domainsChanges) + { + var changedDomains = new List(); + + foreach (var domainChanges in domainsChanges) + { + var firstTimeAdditon = domainChanges.MxChanges.All(x => x.DnsRecordsCompare.All(dns => dns.DbRecord == null)) + && domainChanges.NsChanges.All(x => x.DnsRecordsCompare.All(dns => dns.DbRecord == null)); + + if (firstTimeAdditon) + { + continue; + } + + bool mxIsChanged = domainChanges.MxChanges.Any(x => x.DnsRecordsCompare.Any(d => d.Status != DomainDnsRecordStatuses.NotChanged)); + bool nsIsChanged = domainChanges.NsChanges.Any(x => x.DnsRecordsCompare.Any(d => d.Status != DomainDnsRecordStatuses.NotChanged)); + + if (mxIsChanged || nsIsChanged) + { + changedDomains.Add(domainChanges); + } + } + + return changedDomains; + } + + private DomainDnsRecordsChanges ApplyDomainRecordsChanges(List dbRecords, List dnsRecords, string dnsServer) + { + var domainRecordChanges = new DomainDnsRecordsChanges(); + domainRecordChanges.DnsServer = dnsServer; + + var filteredDbRecords = dbRecords.Where(x => x.DnsServer == dnsServer); + + foreach (var record in filteredDbRecords) + { + var dnsRecord = dnsRecords.FirstOrDefault(x => x.Value == record.Value); + + if (dnsRecord != null) + { + domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = dnsRecord, Status = DomainDnsRecordStatuses.NotChanged }); + + dnsRecords.Remove(dnsRecord); + } + else + { + domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = null, Status = DomainDnsRecordStatuses.Removed }); + + RemoveRecord(record); + + domainRecordChanges.IsChanged = true; + } + } + + foreach (var record in dnsRecords) + { + domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = null, DnsRecord = record, Status = DomainDnsRecordStatuses.Added }); + + AddRecord(record); + + domainRecordChanges.IsChanged = true; + } + + return domainRecordChanges; + } + + private void FillRecordData(IEnumerable records, DomainInfo domain, string dnsServer) + { + foreach (var record in records) + { + FillRecordData(record, domain, dnsServer); + } + } + + private void FillRecordData(DnsRecordInfo record, DomainInfo domain, string dnsServer) + { + record.DomainId = domain.DomainId; + record.Date = DateTime.Now; + record.DnsServer = dnsServer; + } + + private void RemoveRecords(IEnumerable dnsRecords) + { + foreach (var record in dnsRecords) + { + RemoveRecord(record); + } + } + + private void RemoveRecord(DnsRecordInfo dnsRecord) + { + DataProvider.DeleteDomainDnsRecord(dnsRecord.Id); + } + + private void AddRecords(IEnumerable dnsRecords) + { + foreach (var record in dnsRecords) + { + AddRecord(record); + } + } + + private void AddRecord(DnsRecordInfo dnsRecord) + { + DataProvider.AddDomainDnsRecord(dnsRecord); + } + + private void SendMailMessage(IEnumerable domainsChanges) + { + BackgroundTask topTask = TaskManager.TopTask; + + // input parameters + string mailFrom = "wsp@scheduler.noreply"; + string mailTo = (string)topTask.GetParamValue("MAIL_TO"); + string mailSubject = "WSP MX and NS notification"; + string mailBody = "Hello!

"; + + if (String.IsNullOrEmpty(mailTo)) + { + TaskManager.WriteWarning("The e-mail message has not been sent because 'Mail To' is empty."); + } + else + { + // send mail message + // MailHelper.SendMessage(mailFrom, mailTo, mailSubject, mailBody, false); + } + } + + #endregion + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs.orig b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs.orig new file mode 100644 index 00000000..f1b2cb07 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs.orig @@ -0,0 +1,2907 @@ +// Copyright (c) 2014, 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.Specialized; +using System.Data; +using System.Net; +using System.Xml; +using WebsitePanel.Providers; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.DNS; +using WebsitePanel.Server; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Web; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.DomainLookup; +using System.Linq; + +namespace WebsitePanel.EnterpriseServer +{ + /// + /// Summary description for ServersController. + /// + public class ServerController + { + private const string LOG_SOURCE_SERVERS = "SERVERS"; + + #region Servers + public static List GetAllServers() + { + // fill collection + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetAllServers(SecurityContext.User.UserId)); + } + + public static DataSet GetRawAllServers() + { + return DataProvider.GetAllServers(SecurityContext.User.UserId); + } + + public static List GetServers() + { + // create servers list + List servers = new List(); + + // fill collection + ObjectUtils.FillCollectionFromDataSet( + servers, DataProvider.GetServers(SecurityContext.User.UserId)); + + return servers; + } + + public static DataSet GetRawServers() + { + return DataProvider.GetServers(SecurityContext.User.UserId); + } + + internal static ServerInfo GetServerByIdInternal(int serverId) + { + ServerInfo server = ObjectUtils.FillObjectFromDataReader( + DataProvider.GetServerInternal(serverId)); + + if (server == null) + return null; + + // decrypt passwords + server.Password = CryptoUtils.Decrypt(server.Password); + server.ADPassword = CryptoUtils.Decrypt(server.ADPassword); + + return server; + } + + public static ServerInfo GetServerShortDetails(int serverId) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetServerShortDetails(serverId)); + } + + public static ServerInfo GetServerById(int serverId) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetServer(SecurityContext.User.UserId, serverId)); + } + + public static ServerInfo GetServerByName(string serverName) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetServerByName(SecurityContext.User.UserId, serverName)); + } + + public static int CheckServerAvailable(string serverUrl, string password) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive + | DemandAccount.IsAdmin); + if (accountCheck < 0) return accountCheck; + + TaskManager.StartTask("SERVER", "CHECK_AVAILABILITY", serverUrl); + + try + { + // TO-DO: Check connectivity + return 0; + } + catch (WebException ex) + { + HttpWebResponse response = (HttpWebResponse)ex.Response; + if (response != null && response.StatusCode == HttpStatusCode.NotFound) + return BusinessErrorCodes.ERROR_ADD_SERVER_NOT_FOUND; + else if (response != null && response.StatusCode == HttpStatusCode.BadRequest) + return BusinessErrorCodes.ERROR_ADD_SERVER_BAD_REQUEST; + else if (response != null && response.StatusCode == HttpStatusCode.InternalServerError) + return BusinessErrorCodes.ERROR_ADD_SERVER_INTERNAL_SERVER_ERROR; + else if (response != null && response.StatusCode == HttpStatusCode.ServiceUnavailable) + return BusinessErrorCodes.ERROR_ADD_SERVER_SERVICE_UNAVAILABLE; + else if (response != null && response.StatusCode == HttpStatusCode.Unauthorized) + return BusinessErrorCodes.ERROR_ADD_SERVER_UNAUTHORIZED; + if (ex.Message.Contains("The remote name could not be resolved") || ex.Message.Contains("Unable to connect")) + { + TaskManager.WriteError("The remote server could not ne resolved"); + return BusinessErrorCodes.ERROR_ADD_SERVER_URL_UNAVAILABLE; + } + return BusinessErrorCodes.ERROR_ADD_SERVER_APPLICATION_ERROR; + } + catch (Exception ex) + { + if (ex.Message.Contains("The signature or decryption was invalid")) + { + TaskManager.WriteWarning("Wrong server access credentials"); + return BusinessErrorCodes.ERROR_ADD_SERVER_WRONG_PASSWORD; + } + else + { + TaskManager.WriteError("General Server Error"); + TaskManager.WriteError(ex); + return BusinessErrorCodes.ERROR_ADD_SERVER_APPLICATION_ERROR; + } + } + finally + { + TaskManager.CompleteTask(); + } + } + + private static void FindServices(ServerInfo server) + { + try + { + List providers; + try + { + providers = GetProviders(); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + throw new ApplicationException("Could not get providers list."); + } + + foreach (ProviderInfo provider in providers) + { + if (!provider.DisableAutoDiscovery) + { + BoolResult isInstalled = IsInstalled(server.ServerId, provider.ProviderId); + if (isInstalled.IsSuccess) + { + if (isInstalled.Value) + { + try + { + ServiceInfo service = new ServiceInfo(); + service.ServerId = server.ServerId; + service.ProviderId = provider.ProviderId; + service.ServiceName = provider.DisplayName; + AddService(service); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } + } + else + { + string errors = string.Join("\n", isInstalled.ErrorCodes.ToArray()); + string str = + string.Format( + "Could not check if specific software intalled for {0}. Following errors have been occured:\n{1}", + provider.ProviderName, errors); + + TaskManager.WriteError(str); + } + } + } + } + catch (Exception ex) + { + throw new ApplicationException("Could not find services. General error was occued.", ex); + } + } + + public static int AddServer(ServerInfo server, bool autoDiscovery) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive + | DemandAccount.IsAdmin); + if (accountCheck < 0) return accountCheck; + + // init passwords + if (server.Password == null) + server.Password = ""; + if (server.ADPassword == null) + server.ADPassword = ""; + + // check server availability + if (!server.VirtualServer) + { + int availResult = CheckServerAvailable(server.ServerUrl, server.Password); + if (availResult < 0) + return availResult; + } + + TaskManager.StartTask("SERVER", "ADD", server.ServerName); + + int serverId = DataProvider.AddServer(server.ServerName, server.ServerUrl, + CryptoUtils.Encrypt(server.Password), server.Comments, server.VirtualServer, server.InstantDomainAlias, + server.PrimaryGroupId, server.ADEnabled, server.ADRootDomain, server.ADUsername, CryptoUtils.Encrypt(server.ADPassword), + server.ADAuthenticationType); + + if (autoDiscovery) + { + server.ServerId = serverId; + try + { + FindServices(server); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } + + TaskManager.ItemId = serverId; + + TaskManager.CompleteTask(); + + return serverId; + } + + public static int UpdateServer(ServerInfo server) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive + | DemandAccount.IsAdmin); + if (accountCheck < 0) return accountCheck; + + // get original server + ServerInfo origServer = GetServerByIdInternal(server.ServerId); + + TaskManager.StartTask("SERVER", "UPDATE", origServer.ServerName, server.ServerId); + + // preserve passwords + server.Password = origServer.Password; + server.ADPassword = origServer.ADPassword; + + // check server availability + if (!origServer.VirtualServer) + { + int availResult = CheckServerAvailable(server.ServerUrl, server.Password); + if (availResult < 0) + return availResult; + } + + DataProvider.UpdateServer(server.ServerId, server.ServerName, server.ServerUrl, + CryptoUtils.Encrypt(server.Password), server.Comments, server.InstantDomainAlias, + server.PrimaryGroupId, server.ADEnabled, server.ADRootDomain, server.ADUsername, CryptoUtils.Encrypt(server.ADPassword), + server.ADAuthenticationType); + + TaskManager.CompleteTask(); + + return 0; + } + + public static int UpdateServerConnectionPassword(int serverId, string password) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive + | DemandAccount.IsAdmin); + if (accountCheck < 0) return accountCheck; + + // get original server + ServerInfo server = GetServerByIdInternal(serverId); + + TaskManager.StartTask("SERVER", "UPDATE_PASSWORD", server.ServerName, serverId); + + // set password + server.Password = password; + + // update server + DataProvider.UpdateServer(server.ServerId, server.ServerName, server.ServerUrl, + CryptoUtils.Encrypt(server.Password), server.Comments, server.InstantDomainAlias, + server.PrimaryGroupId, server.ADEnabled, server.ADRootDomain, server.ADUsername, CryptoUtils.Encrypt(server.ADPassword), + server.ADAuthenticationType); + + TaskManager.CompleteTask(); + + return 0; + } + + public static int UpdateServerADPassword(int serverId, string adPassword) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive + | DemandAccount.IsAdmin); + if (accountCheck < 0) return accountCheck; + + // get original server + ServerInfo server = GetServerByIdInternal(serverId); + + TaskManager.StartTask("SERVER", "UPDATE_AD_PASSWORD", server.ServerName, serverId); + + // set password + server.ADPassword = adPassword; + + // update server + DataProvider.UpdateServer(server.ServerId, server.ServerName, server.ServerUrl, + CryptoUtils.Encrypt(server.Password), server.Comments, server.InstantDomainAlias, + server.PrimaryGroupId, server.ADEnabled, server.ADRootDomain, server.ADUsername, CryptoUtils.Encrypt(server.ADPassword), + server.ADAuthenticationType); + + TaskManager.CompleteTask(); + + return 0; + } + + public static int DeleteServer(int serverId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive + | DemandAccount.IsAdmin); + if (accountCheck < 0) return accountCheck; + + // get original server + ServerInfo server = GetServerByIdInternal(serverId); + + TaskManager.StartTask("SERVER", "DELETE", server.ServerName, serverId); + + try + { + int result = DataProvider.DeleteServer(serverId); + if (result == -1) + { + TaskManager.WriteError("Server contains services"); + return BusinessErrorCodes.ERROR_SERVER_CONTAINS_SERVICES; + } + else if (result == -2) + { + TaskManager.WriteError("Server contains spaces"); + return BusinessErrorCodes.ERROR_SERVER_CONTAINS_PACKAGES; + } + else if (result == -3) + { + TaskManager.WriteError("Server is used as a target in several hosting plans"); + return BusinessErrorCodes.ERROR_SERVER_USED_IN_HOSTING_PLANS; + } + + return 0; + } + finally + { + TaskManager.CompleteTask(); + } + } + #endregion + + #region Virtual Servers + public static DataSet GetVirtualServers() + { + return DataProvider.GetVirtualServers(SecurityContext.User.UserId); + } + + public static DataSet GetAvailableVirtualServices(int serverId) + { + return DataProvider.GetAvailableVirtualServices(SecurityContext.User.UserId, serverId); + } + + public static DataSet GetVirtualServices(int serverId) + { + return DataProvider.GetVirtualServices(SecurityContext.User.UserId, serverId); + } + + public static int AddVirtualServices(int serverId, int[] ids) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + ServerInfo server = GetServerByIdInternal(serverId); + + TaskManager.StartTask("VIRTUAL_SERVER", "ADD_SERVICES", server.ServerName, serverId); + + // build XML + string xml = BuildXmlFromArray(ids, "services", "service"); + + // update server + DataProvider.AddVirtualServices(serverId, xml); + + TaskManager.CompleteTask(); + + return 0; + } + + public static int DeleteVirtualServices(int serverId, int[] ids) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + ServerInfo server = GetServerByIdInternal(serverId); + + TaskManager.StartTask("VIRTUAL_SERVER", "DELETE_SERVICES", server.ServerName, serverId); + + // build XML + string xml = BuildXmlFromArray(ids, "services", "service"); + + // update server + DataProvider.DeleteVirtualServices(serverId, xml); + + TaskManager.CompleteTask(); + + return 0; + } + + public static int UpdateVirtualGroups(int serverId, VirtualGroupInfo[] groups) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + /* + XML Format: + + + + + + */ + + // build XML + XmlDocument doc = new XmlDocument(); + XmlElement nodeGroups = doc.CreateElement("groups"); + // groups + if (groups != null) + { + foreach (VirtualGroupInfo group in groups) + { + XmlElement nodeGroup = doc.CreateElement("group"); + nodeGroups.AppendChild(nodeGroup); + nodeGroup.SetAttribute("id", group.GroupId.ToString()); + nodeGroup.SetAttribute("distributionType", group.DistributionType.ToString()); + nodeGroup.SetAttribute("bindDistributionToPrimary", group.BindDistributionToPrimary ? "1" : "0"); + } + } + + string xml = nodeGroups.OuterXml; + + // update server + DataProvider.UpdateVirtualGroups(serverId, xml); + + return 0; + } + + private static string BuildXmlFromArray(int[] ids, string rootName, string childName) + { + XmlDocument doc = new XmlDocument(); + XmlElement nodeRoot = doc.CreateElement(rootName); + foreach (int id in ids) + { + XmlElement nodeChild = doc.CreateElement(childName); + nodeChild.SetAttribute("id", id.ToString()); + nodeRoot.AppendChild(nodeChild); + } + + return nodeRoot.OuterXml; + } + #endregion + + #region Services + public static DataSet GetRawServicesByServerId(int serverId) + { + return DataProvider.GetRawServicesByServerId(SecurityContext.User.UserId, serverId); + } + + public static List GetServicesByServerId(int serverId) + { + List services = new List(); + ObjectUtils.FillCollectionFromDataReader(services, + DataProvider.GetServicesByServerId(SecurityContext.User.UserId, serverId)); + return services; + } + + public static List GetServicesByServerIdGroupName(int serverId, string groupName) + { + List services = new List(); + ObjectUtils.FillCollectionFromDataReader(services, + DataProvider.GetServicesByServerIdGroupName(SecurityContext.User.UserId, + serverId, groupName)); + return services; + } + + public static DataSet GetRawServicesByGroupId(int groupId) + { + return DataProvider.GetServicesByGroupId(SecurityContext.User.UserId, groupId); + } + + public static DataSet GetRawServicesByGroupName(string groupName) + { + return DataProvider.GetServicesByGroupName(SecurityContext.User.UserId, groupName); + } + + public static List GetServicesByGroupName(string groupName) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetServicesByGroupName(SecurityContext.User.UserId, groupName)); + } + + public static ServiceInfo GetServiceInfoAdmin(int serviceId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.IsAdmin + | DemandAccount.IsActive); + if (accountCheck < 0) + return null; + + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetService(SecurityContext.User.UserId, serviceId)); + } + + public static ServiceInfo GetServiceInfo(int serviceId) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetService(SecurityContext.User.UserId, serviceId)); + } + + public static int AddService(ServiceInfo service) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + TaskManager.StartTask("SERVER", "ADD_SERVICE", GetServerByIdInternal(service.ServerId).ServerName, service.ServerId); + + TaskManager.WriteParameter("Service name", service.ServiceName); + TaskManager.WriteParameter("Provider", service.ProviderId); + + int serviceId = DataProvider.AddService(service.ServerId, service.ProviderId, service.ServiceName, + service.ServiceQuotaValue, service.ClusterId, service.Comments); + + // read service default settings + try + { + // load original settings + StringDictionary origSettings = GetServiceSettingsAdmin(serviceId); + + // load provider settings + ServiceProvider svc = new ServiceProvider(); + ServiceProviderProxy.Init(svc, serviceId); + + SettingPair[] settings = svc.GetProviderDefaultSettings(); + + if (settings != null && settings.Length > 0) + { + // merge settings + foreach (SettingPair pair in settings) + origSettings[pair.Name] = pair.Value; + + // update settings in the meta base + string[] bareSettings = new string[origSettings.Count]; + int i = 0; + foreach (string key in origSettings.Keys) + bareSettings[i++] = key + "=" + origSettings[key]; + + UpdateServiceSettings(serviceId, bareSettings); + } + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "Error reading default provider settings"); + } + + TaskManager.CompleteTask(); + + return serviceId; + } + + public static int UpdateService(ServiceInfo service) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // load original service + ServiceInfo origService = GetServiceInfo(service.ServiceId); + + TaskManager.StartTask("SERVER", "UPDATE_SERVICE", GetServerByIdInternal(origService.ServerId).ServerName, origService.ServerId); + + TaskManager.WriteParameter("New service name", service.ServiceName); + + DataProvider.UpdateService(service.ServiceId, service.ServiceName, + service.ServiceQuotaValue, service.ClusterId, service.Comments); + + TaskManager.CompleteTask(); + + return 0; + } + + public static int DeleteService(int serviceId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + ServiceInfo service = GetServiceInfoAdmin(serviceId); + + TaskManager.StartTask("SERVER", "DELETE_SERVICE", GetServerByIdInternal(service.ServerId).ServerName, service.ServerId); + + TaskManager.WriteParameter("Service name", service.ServiceName); + + try + { + int result = DataProvider.DeleteService(serviceId); + if (result == -1) + { + TaskManager.WriteError("Service contains service items"); + return BusinessErrorCodes.ERROR_SERVICE_CONTAINS_SERVICE_ITEMS; + } + else if (result == -2) + { + TaskManager.WriteError("Service is assigned to virtual server"); + return BusinessErrorCodes.ERROR_SERVICE_USED_IN_VIRTUAL_SERVER; + } + + return 0; + + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static StringDictionary GetServiceSettingsAdmin(int serviceId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.IsAdmin | DemandAccount.IsActive); + if (accountCheck < 0) + return null; + + bool isDemoAccount = (SecurityContext.CheckAccount(DemandAccount.NotDemo) < 0); + + return GetServiceSettings(serviceId, !isDemoAccount); + } + + internal static StringDictionary GetServiceSettings(int serviceId) + { + return GetServiceSettings(serviceId, true); + } + + internal static StringDictionary GetServiceSettings(int serviceId, bool decryptPassword) + { + // get service settings + IDataReader reader = DataProvider.GetServiceProperties(SecurityContext.User.UserId, serviceId); + + // create settings object + StringDictionary settings = new StringDictionary(); + while (reader.Read()) + { + string name = (string)reader["PropertyName"]; + string val = (string)reader["PropertyValue"]; + + if (name.ToLower().IndexOf("password") != -1 && decryptPassword) + val = CryptoUtils.Decrypt(val); + + settings.Add(name, val); + } + reader.Close(); + + return settings; + } + + public static int UpdateServiceSettings(int serviceId, string[] settings) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + if (settings != null) + { + // build xml + XmlDocument doc = new XmlDocument(); + XmlElement nodeProps = doc.CreateElement("properties"); + foreach (string setting in settings) + { + int idx = setting.IndexOf('='); + string name = setting.Substring(0, idx); + string val = setting.Substring(idx + 1); + + if (name.ToLower().IndexOf("password") != -1) + val = CryptoUtils.Encrypt(val); + + XmlElement nodeProp = doc.CreateElement("property"); + nodeProp.SetAttribute("name", name); + nodeProp.SetAttribute("value", val); + nodeProps.AppendChild(nodeProp); + } + + string xml = nodeProps.OuterXml; + + // update settings + DataProvider.UpdateServiceProperties(serviceId, xml); + } + + return 0; + } + + public static string[] InstallService(int serviceId) + { + ServiceProvider prov = new ServiceProvider(); + ServiceProviderProxy.Init(prov, serviceId); + return prov.Install(); + } + + public static QuotaInfo GetProviderServiceQuota(int providerId) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetProviderServiceQuota(providerId)); + } + #endregion + + #region Providers + + public static List GetInstalledProviders(int groupId) + { + List provs = new List(); + ObjectUtils.FillCollectionFromDataSet(provs, + DataProvider.GetGroupProviders(groupId)); + return provs; + } + + public static List GetResourceGroups() + { + List groups = new List(); + ObjectUtils.FillCollectionFromDataSet(groups, + DataProvider.GetResourceGroups()); + return groups; + } + + public static ResourceGroupInfo GetResourceGroup(int groupId) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetResourceGroup(groupId)); + } + + public static ResourceGroupInfo GetResourceGroupByName(string name) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetResourceGroupByName(name)); + } + + public static ProviderInfo GetProvider(int providerId) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetProvider(providerId)); + } + + public static List GetProviders() + { + List provs = new List(); + ObjectUtils.FillCollectionFromDataSet( + provs, DataProvider.GetProviders()); + return provs; + } + + public static List GetProvidersByGroupID(int groupId) + { + List provs = new List(); + ObjectUtils.FillCollectionFromDataSet( + provs, DataProvider.GetGroupProviders(groupId)); + return provs; + } + + public static ProviderInfo GetPackageServiceProvider(int packageId, string groupName) + { + // load service + int serviceId = PackageController.GetPackageServiceId(packageId, groupName); + + if (serviceId == 0) + return null; + + ServiceInfo service = GetServiceInfo(serviceId); + return GetProvider(service.ProviderId); + } + + public static BoolResult IsInstalled(int serverId, int providerId) + { + BoolResult res = TaskManager.StartResultTask("AUTO_DISCOVERY", "IS_INSTALLED"); + + try + { + ProviderInfo provider = GetProvider(providerId); + if (provider == null) + { + TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_PROVIDER_INFO); + return res; + } + + AutoDiscovery.AutoDiscovery ad = new AutoDiscovery.AutoDiscovery(); + ServiceProviderProxy.ServerInit(ad, serverId); + + res = ad.IsInstalled(provider.ProviderType); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_CHECK_IF_PROVIDER_SOFTWARE_INSTALLED, ex); + + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static string GetServerVersion(int serverId) + { + AutoDiscovery.AutoDiscovery ad = new AutoDiscovery.AutoDiscovery(); + ServiceProviderProxy.ServerInit(ad, serverId); + + return ad.GetServerVersion(); + } + + #endregion + + #region IP Addresses + public static List GetIPAddresses(IPAddressPool pool, int serverId) + { + return ObjectUtils.CreateListFromDataReader( + DataProvider.GetIPAddresses(SecurityContext.User.UserId, (int)pool, serverId)); + } + + public static IPAddressesPaged GetIPAddressesPaged(IPAddressPool pool, int serverId, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + IPAddressesPaged result = new IPAddressesPaged(); + + // get reader + IDataReader reader = DataProvider.GetIPAddressesPaged(SecurityContext.User.UserId, (int)pool, serverId, filterColumn, filterValue, sortColumn, startRow, maximumRows); + + // number of items = first data reader + reader.Read(); + result.Count = (int)reader[0]; + + // items = second data reader + reader.NextResult(); + result.Items = ObjectUtils.CreateListFromDataReader(reader).ToArray(); + + return result; + } + + public static IPAddressInfo GetIPAddress(int addressId) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetIPAddress(addressId)); + } + + public static string GetExternalIPAddress(int addressId) + { + IPAddressInfo ip = GetIPAddress(addressId); + return (ip != null ? ip.ExternalIP : null); + } + + public static IntResult AddIPAddress(IPAddressPool pool, int serverId, + string externalIP, string internalIP, string subnetMask, string defaultGateway, string comments) + { + IntResult res = new IntResult(); + + #region Check account statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("IP_ADDRESS", "ADD", externalIP); + + TaskManager.WriteParameter("IP Address", externalIP); + TaskManager.WriteParameter("NAT Address", internalIP); + + try + { + res.Value = DataProvider.AddIPAddress((int)pool, serverId, externalIP, internalIP, + subnetMask, defaultGateway, comments); + + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, "IP_ADDRESS_ADD_ERROR", ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject AddIPAddressesRange(IPAddressPool pool, int serverId, + string externalIP, string endIP, string internalIP, string subnetMask, string defaultGateway, string comments) + { + const int MaxSubnet = 512; // TODO bigger max subnet? + + ResultObject res = new ResultObject(); + + #region Check account statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("IP_ADDRESS", "ADD_RANGE", externalIP); + + TaskManager.WriteParameter("IP Address", externalIP); + TaskManager.WriteParameter("End IP Address", endIP); + TaskManager.WriteParameter("NAT Address", internalIP); + + try + { + if (externalIP == endIP) + { + // add single IP and exit + AddIPAddress(pool, serverId, externalIP, internalIP, subnetMask, defaultGateway, comments); + TaskManager.CompleteResultTask(); + return res; + } + + if (pool == IPAddressPool.PhoneNumbers) + { + string phoneFormat = "D" + Math.Max(externalIP.Length, endIP.Length); + + UInt64 start = UInt64.Parse(externalIP); + UInt64 end = UInt64.Parse(endIP); + + if (end < start) { UInt64 temp = start; start = end; end = temp; } + + const UInt64 maxPhones = 1000; // TODO max? + + end = Math.Min(end, start + maxPhones); + + for (UInt64 number = start; number <= end; number++) + DataProvider.AddIPAddress((int)pool, serverId, number.ToString(phoneFormat), "", subnetMask, defaultGateway, comments); + } + + else + { + var startExternalIP = IPAddress.Parse(externalIP); + var startInternalIP = IPAddress.Parse(internalIP); + var endExternalIP = IPAddress.Parse(endIP); + + // handle CIDR notation IP/Subnet addresses + if (startExternalIP.IsSubnet && endExternalIP == null) + { + endExternalIP = startExternalIP.LastSubnetIP; + startExternalIP = startExternalIP.FirstSubnetIP; + } + + if (startExternalIP.V6 != startInternalIP.V6 && (startExternalIP.V6 != endExternalIP.V6 && endExternalIP != null)) throw new NotSupportedException("All IP addresses must be either V4 or V6."); + + int i = 0; + long step = ((endExternalIP - startExternalIP) > 0) ? 1 : -1; + + while (true) + { + if (i > MaxSubnet) + break; + + // add IP address + DataProvider.AddIPAddress((int)pool, serverId, startExternalIP.ToString(), startInternalIP.ToString(), subnetMask, defaultGateway, comments); + + if (startExternalIP == endExternalIP) + break; + + i++; + + startExternalIP += step; + + if (startInternalIP != 0) + startInternalIP += step; + } + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, "IP_ADDRESS_ADD_RANGE_ERROR", ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject UpdateIPAddress(int addressId, IPAddressPool pool, int serverId, + string externalIP, string internalIP, string subnetMask, string defaultGateway, string comments) + { + ResultObject res = new ResultObject(); + + #region Check account statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("IP_ADDRESS", "UPDATE"); + + try + { + DataProvider.UpdateIPAddress(addressId, (int)pool, serverId, externalIP, internalIP, subnetMask, defaultGateway, comments); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, "IP_ADDRESS_UPDATE_ERROR", ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject UpdateIPAddresses(int[] addresses, IPAddressPool pool, int serverId, + string subnetMask, string defaultGateway, string comments) + { + ResultObject res = new ResultObject(); + + #region Check account statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("IP_ADDRESS", "UPDATE_RANGE"); + + try + { + string xmlIds = PrepareIPsXML(addresses); + DataProvider.UpdateIPAddresses(xmlIds, (int)pool, serverId, subnetMask, defaultGateway, comments); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, "IP_ADDRESSES_UPDATE_ERROR", ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject DeleteIPAddresses(int[] addresses) + { + ResultObject res = new ResultObject(); + + #region Check account statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("IP_ADDRESS", "DELETE_RANGE"); + + try + { + foreach (int addressId in addresses) + { + ResultObject addrRes = DeleteIPAddress(addressId); + if (!addrRes.IsSuccess && addrRes.ErrorCodes.Count > 0) + { + res.ErrorCodes.AddRange(addrRes.ErrorCodes); + res.IsSuccess = false; + } + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, "IP_ADDRESS_DELETE_RANGE_ERROR", ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject DeleteIPAddress(int addressId) + { + ResultObject res = new ResultObject(); + + #region Check account statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("IP_ADDRESS", "DELETE"); + + try + { + int result = DataProvider.DeleteIPAddress(addressId); + if (result == -1) + { + TaskManager.CompleteResultTask(res, "ERROR_IP_USED_IN_NAME_SERVER"); + return res; + } + else if (result == -2) + { + TaskManager.CompleteResultTask(res, "ERROR_IP_USED_BY_PACKAGE_ITEM"); + return res; + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, "IP_ADDRESS_DELETE_ERROR", ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + #endregion + + #region Package IP Addresses + public static PackageIPAddressesPaged GetPackageIPAddresses(int packageId, int orgId, IPAddressPool pool, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, bool recursive) + { + PackageIPAddressesPaged result = new PackageIPAddressesPaged(); + + // get reader + IDataReader reader = DataProvider.GetPackageIPAddresses(packageId, orgId, (int)pool, filterColumn, filterValue, sortColumn, startRow, maximumRows, recursive); + + // number of items = first data reader + reader.Read(); + result.Count = (int)reader[0]; + + // items = second data reader + reader.NextResult(); + result.Items = ObjectUtils.CreateListFromDataReader(reader).ToArray(); + + return result; + } + + public static int GetPackageIPAddressesCount(int packageId, int orgId, IPAddressPool pool) + { + return DataProvider.GetPackageIPAddressesCount(packageId, orgId, (int)pool); + } + + public static List GetUnallottedIPAddresses(int packageId, string groupName, IPAddressPool pool) + { + // get service ID + int serviceId = PackageController.GetPackageServiceId(packageId, groupName); + + // get unallotted addresses + return ObjectUtils.CreateListFromDataReader( + DataProvider.GetUnallottedIPAddresses(packageId, serviceId, (int)pool)); + } + + public static List GetPackageUnassignedIPAddresses(int packageId, int orgId, IPAddressPool pool) + { + return ObjectUtils.CreateListFromDataReader( + DataProvider.GetPackageUnassignedIPAddresses(SecurityContext.User.UserId, packageId, orgId, (int)pool)); + } + + public static List GetPackageUnassignedIPAddresses(int packageId, IPAddressPool pool) + { + return GetPackageUnassignedIPAddresses(packageId, 0, pool); + } + + public static void AllocatePackageIPAddresses(int packageId, int[] addressId) + { + // prepare XML document + string xml = PrepareIPsXML(addressId); + + // save to database + DataProvider.AllocatePackageIPAddresses(packageId, 0, xml); + } + + public static ResultObject AllocatePackageIPAddresses(int packageId, int orgId, string groupName, IPAddressPool pool, bool allocateRandom, int addressesNumber, int[] addressId) + { + #region Check account and space statuses + // create result object + ResultObject res = new ResultObject(); + + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, packageId, DemandPackage.IsActive)) + return res; + #endregion + + // get total number of addresses requested + if (!allocateRandom && addressId != null) + addressesNumber = addressId.Length; + + if (addressesNumber <= 0) + { + res.IsSuccess = true; + return res; // just exit + } + + // check quotas + string quotaName = GetIPAddressesQuotaByResourceGroup(groupName, pool); + + // get maximum server IPs + List ips = ServerController.GetUnallottedIPAddresses(packageId, groupName, pool); + int maxAvailableIPs = ips.Count; + + if (maxAvailableIPs == 0) + { + res.ErrorCodes.Add("IP_ADDRESSES_POOL_IS_EMPTY"); + return res; + } + + // get hosting plan IP limits + PackageContext cntx = PackageController.GetPackageContext(packageId); + int quotaAllocated = cntx.Quotas[quotaName].QuotaAllocatedValue; + int quotaUsed = cntx.Quotas[quotaName].QuotaUsedValue; + + if (pool == IPAddressPool.PhoneNumbers) + quotaUsed = ServerController.GetPackageIPAddressesCount(packageId, orgId, pool); + + // check the maximum allowed number + if (quotaAllocated != -1) // check only if not unlimited + { + if (addressesNumber > (quotaAllocated - quotaUsed)) + { + res.ErrorCodes.Add("IP_ADDRESSES_QUOTA_LIMIT_REACHED"); + return res; + } + } + + // check if requested more than available + if (maxAvailableIPs != -1 && + (addressesNumber > maxAvailableIPs)) + addressesNumber = maxAvailableIPs; + + res = TaskManager.StartResultTask("IP_ADDRESS", "ALLOCATE_PACKAGE_IP", packageId); + + try + { + if (allocateRandom) + { + int[] ids = new int[addressesNumber]; + for (int i = 0; i < addressesNumber; i++) + ids[i] = ips[i].AddressId; + + addressId = ids; + } + + // prepare XML document + string xml = PrepareIPsXML(addressId); + + // save to database + try + { + DataProvider.AllocatePackageIPAddresses(packageId, orgId, xml); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.CANNOT_ADD_IP_ADDRESSES_TO_DATABASE, ex); + return res; + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.ALLOCATE_EXTERNAL_ADDRESSES_GENERAL_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject AllocateMaximumPackageIPAddresses(int packageId, string groupName, IPAddressPool pool) + { + // get maximum server IPs + int maxAvailableIPs = GetUnallottedIPAddresses(packageId, groupName, pool).Count; + + // get quota name + string quotaName = GetIPAddressesQuotaByResourceGroup(groupName, pool); + + // get hosting plan IPs + int number = 0; + + PackageContext cntx = PackageController.GetPackageContext(packageId); + if (cntx.Quotas.ContainsKey(quotaName)) + { + number = cntx.Quotas[quotaName].QuotaAllocatedValue; + if (number == -1) + { + // unlimited + if (number > maxAvailableIPs) // requested more than available + number = maxAvailableIPs; // assign max available server IPs + } + else + { + // quota + number = number - cntx.Quotas[quotaName].QuotaUsedValue; + } + } + + // allocate + return AllocatePackageIPAddresses(packageId, 0, groupName, pool, + true, number, new int[0]); + } + + public static ResultObject DeallocatePackageIPAddresses(int packageId, int[] addressId) + { + #region Check account and space statuses + // create result object + ResultObject res = new ResultObject(); + + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, packageId, DemandPackage.IsActive)) + return res; + #endregion + + res = TaskManager.StartResultTask("IP_ADDRESS", "DEALLOCATE_PACKAGE_IP", packageId); + + try + { + foreach (int id in addressId) + { + DataProvider.DeallocatePackageIPAddress(id); + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.CANNOT_DELLOCATE_EXTERNAL_ADDRESSES, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + #region Item IP Addresses + public static List GetItemIPAddresses(int itemId, IPAddressPool pool) + { + return ObjectUtils.CreateListFromDataReader( + DataProvider.GetItemIPAddresses(SecurityContext.User.UserId, itemId, (int)pool)); + } + + public static PackageIPAddress GetPackageIPAddress(int packageAddressId) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetPackageIPAddress(packageAddressId)); + } + + public static int AddItemIPAddress(int itemId, int packageAddressId) + { + return DataProvider.AddItemIPAddress(SecurityContext.User.UserId, itemId, packageAddressId); + } + + public static int SetItemPrimaryIPAddress(int itemId, int packageAddressId) + { + return DataProvider.SetItemPrimaryIPAddress(SecurityContext.User.UserId, itemId, packageAddressId); + } + + public static int DeleteItemIPAddress(int itemId, int packageAddressId) + { + return DataProvider.DeleteItemIPAddress(SecurityContext.User.UserId, itemId, packageAddressId); + } + + public static int DeleteItemIPAddresses(int itemId) + { + return DataProvider.DeleteItemIPAddresses(SecurityContext.User.UserId, itemId); + } + + #endregion + + public static string PrepareIPsXML(int[] items) + { + XmlDocument doc = new XmlDocument(); + XmlNode root = doc.CreateElement("items"); + foreach (int item in items) + { + XmlNode node = doc.CreateElement("item"); + XmlAttribute attribute = doc.CreateAttribute("id"); + attribute.Value = item.ToString(); + node.Attributes.Append(attribute); + root.AppendChild(node); + } + doc.AppendChild(root); + return doc.InnerXml; + } + + private static string GetIPAddressesQuotaByResourceGroup(string groupName, IPAddressPool pool) + { + if (pool == IPAddressPool.PhoneNumbers) + return Quotas.LYNC_PHONE; + + if (String.Compare(groupName, ResourceGroups.VPS, true) == 0) + { + return Quotas.VPS_EXTERNAL_IP_ADDRESSES_NUMBER; + } + else if (String.Compare(groupName, ResourceGroups.VPSForPC, true) == 0) + { + return Quotas.VPSForPC_EXTERNAL_IP_ADDRESSES_NUMBER; + } + else + { + return Quotas.WEB_IP_ADDRESSES; + } + } + #endregion + + #region Clusters + public static List GetClusters() + { + List list = new List(); + ObjectUtils.FillCollectionFromDataReader(list, + DataProvider.GetClusters(SecurityContext.User.UserId)); + return list; + } + + public static int AddCluster(ClusterInfo cluster) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + return DataProvider.AddCluster(cluster.ClusterName); + } + + public static int DeleteCluster(int clusterId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + DataProvider.DeleteCluster(clusterId); + + return 0; + } + #endregion + + #region Global DNS records + public static DataSet GetRawDnsRecordsByService(int serviceId) + { + return DataProvider.GetDnsRecordsByService(SecurityContext.User.UserId, serviceId); + } + + public static DataSet GetRawDnsRecordsByServer(int serverId) + { + return DataProvider.GetDnsRecordsByServer(SecurityContext.User.UserId, serverId); + } + + public static DataSet GetRawDnsRecordsByPackage(int packageId) + { + return DataProvider.GetDnsRecordsByPackage(SecurityContext.User.UserId, packageId); + } + + public static DataSet GetRawDnsRecordsByGroup(int groupId) + { + return DataProvider.GetDnsRecordsByGroup(groupId); + } + + public static DataSet GetRawDnsRecordsTotal(int packageId) + { + return DataProvider.GetDnsRecordsTotal(SecurityContext.User.UserId, packageId); + } + + public static List GetDnsRecordsByService(int serviceId) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetDnsRecordsByService(SecurityContext.User.UserId, serviceId)); + } + + public static List GetDnsRecordsByServer(int serverId) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetDnsRecordsByServer(SecurityContext.User.UserId, serverId)); + } + + public static List GetDnsRecordsByPackage(int packageId) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetDnsRecordsByPackage(SecurityContext.User.UserId, packageId)); + } + + public static List GetDnsRecordsByGroup(int groupId) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetDnsRecordsByGroup(groupId)); + } + + public static List GetDnsRecordsTotal(int packageId) + { + return ObjectUtils.CreateListFromDataSet( + GetRawDnsRecordsTotal(packageId)); + } + + public static GlobalDnsRecord GetDnsRecord(int recordId) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetDnsRecord(SecurityContext.User.UserId, recordId)); + } + + public static int AddDnsRecord(GlobalDnsRecord record) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsReseller + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + TaskManager.StartTask("GLOBAL_DNS", "ADD", record.RecordName); + TaskManager.WriteParameter("Type", record.RecordType); + TaskManager.WriteParameter("Data", record.RecordData); + + DataProvider.AddDnsRecord(SecurityContext.User.UserId, record.ServiceId, record.ServerId, record.PackageId, + record.RecordType, record.RecordName, record.RecordData, record.MxPriority, + record.SrvPriority, record.SrvWeight, record.SrvPort, record.IpAddressId); + + TaskManager.CompleteTask(); + + return 0; + } + + public static int UpdateDnsRecord(GlobalDnsRecord record) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsReseller + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + TaskManager.StartTask("GLOBAL_DNS", "UPDATE", record.RecordName); + TaskManager.WriteParameter("Type", record.RecordType); + TaskManager.WriteParameter("Data", record.RecordData); + + DataProvider.UpdateDnsRecord(SecurityContext.User.UserId, record.RecordId, + record.RecordType, record.RecordName, record.RecordData, record.MxPriority, + record.SrvPriority, record.SrvWeight, record.SrvPort, record.IpAddressId); + + TaskManager.CompleteTask(); + + return 0; + } + + public static int DeleteDnsRecord(int recordId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsReseller + | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + GlobalDnsRecord record = GetDnsRecord(recordId); + + TaskManager.StartTask("GLOBAL_DNS", "DELETE", record.RecordName); + TaskManager.WriteParameter("Type", record.RecordType); + TaskManager.WriteParameter("Data", record.RecordData); + + DataProvider.DeleteDnsRecord(SecurityContext.User.UserId, recordId); + + TaskManager.CompleteTask(); + + return 0; + } + #endregion + + #region Domains + public static int CheckDomain(string domainName) + { + int checkDomainResult = DataProvider.CheckDomain(-10, domainName, false); + + if (checkDomainResult == -1) + return BusinessErrorCodes.ERROR_DOMAIN_ALREADY_EXISTS; + else if (checkDomainResult == -2) + return BusinessErrorCodes.ERROR_RESTRICTED_DOMAIN; + else + return checkDomainResult; + } + + public static List GetDomains(int packageId, bool recursive) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetDomains(SecurityContext.User.UserId, packageId, recursive)); + } + + public static List GetDomains(int packageId) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetDomains(SecurityContext.User.UserId, packageId, true)); + } + + + public static List GetDomainsByZoneId(int zoneId) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetDomainsByZoneId(SecurityContext.User.UserId, zoneId)); + } + + public static List GetDomainsByDomainItemId(int zoneId) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetDomainsByDomainItemId(SecurityContext.User.UserId, zoneId)); + } + + + public static List GetMyDomains(int packageId) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetDomains(SecurityContext.User.UserId, packageId, false)); + } + + public static List GetResellerDomains(int packageId) + { + return ObjectUtils.CreateListFromDataSet( + DataProvider.GetResellerDomains(SecurityContext.User.UserId, packageId)); + } + + public static DataSet GetDomainsPaged(int packageId, int serverId, bool recursive, string filterColumn, string filterValue, + string sortColumn, int startRow, int maximumRows) + { + DataSet ds = DataProvider.GetDomainsPaged(SecurityContext.User.UserId, + packageId, serverId, recursive, filterColumn, filterValue, + sortColumn, startRow, maximumRows); + + return ds; + } + + public static DomainInfo GetDomain(int domainId) + { + // get domain by ID + DomainInfo domain = GetDomainItem(domainId); + + // return + return GetDomain(domain); + } + + public static DomainInfo GetDomain(string domainName) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetDomainByName(SecurityContext.User.UserId, domainName,false, false)); + } + + public static DomainInfo GetDomain(string domainName, bool searchOnDomainPointer, bool isDomainPointer) + { + return GetDomainItem(domainName, searchOnDomainPointer, isDomainPointer); + } + + + private static DomainInfo GetDomain(DomainInfo domain) + { + // check domain + if (domain == null) + return null; + + // get instant alias + domain.InstantAliasName = GetDomainAlias(domain.PackageId, domain.DomainName); + DomainInfo instantAlias = GetDomainItem(domain.InstantAliasName, true, false); + if (instantAlias != null) + domain.InstantAliasId = instantAlias.DomainId; + + return domain; + } + + public static DomainInfo GetDomainItem(int domainId) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetDomain(SecurityContext.User.UserId, domainId)); + } + + public static DomainInfo GetDomainItem(string domainName) + { + return GetDomainItem(domainName, false, false); + } + + + public static DomainInfo GetDomainItem(string domainName, bool searchOnDomainPointer, bool isDomainPointer) + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetDomainByName(SecurityContext.User.UserId, domainName, searchOnDomainPointer, isDomainPointer)); + } + + public static string GetDomainAlias(int packageId, string domainName) + { + // load package settings + PackageSettings packageSettings = PackageController.GetPackageSettings(packageId, + PackageSettings.INSTANT_ALIAS); + + string instantAlias = packageSettings["InstantAlias"]; + + // add instant alias + if (!String.IsNullOrEmpty(instantAlias)) + { + instantAlias = domainName + "." + instantAlias; + } + return instantAlias; + } + + public static int AddDomainWithProvisioning(int packageId, string domainName, DomainType domainType, + bool createWebSite, int pointWebSiteId, int pointMailDomainId, bool createDnsZone, bool createInstantAlias, bool allowSubDomains, string hostName) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // check package + int packageCheck = SecurityContext.CheckPackage(packageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + // set flags + bool isSubDomain = (domainType == DomainType.SubDomain || domainType == DomainType.ProviderSubDomain); + bool isDomainPointer = (domainType == DomainType.DomainPointer); + + // check services + bool dnsEnabled = (PackageController.GetPackageServiceId(packageId, ResourceGroups.Dns) > 0); + bool webEnabled = (PackageController.GetPackageServiceId(packageId, ResourceGroups.Web) > 0); + bool mailEnabled = (PackageController.GetPackageServiceId(packageId, ResourceGroups.Mail) > 0); + + // add main domain + int domainId = AddDomainInternal(packageId, domainName, createDnsZone && dnsEnabled, isSubDomain, false, isDomainPointer, allowSubDomains); + if (domainId < 0) + return domainId; + + DomainInfo domain = ServerController.GetDomain(domainId); + if (domain != null) + { + if (domain.ZoneItemId != 0) + { + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.Os, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.Dns, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.Ftp, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MsSql2000, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MsSql2005, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MsSql2008, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MsSql2012, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MsSql2014, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MySql4, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MySql5, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.Statistics, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPS, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPSForPC, domain, ""); + } + } + + // add instant alias + createInstantAlias &= (domainType != DomainType.DomainPointer); + if (createInstantAlias) + { + // check if instant alias is configured + string domainAlias = GetDomainAlias(packageId, domainName); + + // add instant alias if required + if (!String.IsNullOrEmpty(domainAlias)) + { + // add alias + AddDomainInternal(packageId, domainAlias, dnsEnabled, false, true, false, false); + } + } + + // create web site if requested + int webSiteId = 0; + if (webEnabled && createWebSite) + { + webSiteId = WebServerController.AddWebSite(packageId, hostName, domainId, 0, createInstantAlias, false); + + if (webSiteId < 0) + { + // return + return webSiteId; + } + } + + // add web site pointer + if (webEnabled && pointWebSiteId > 0) + { + WebServerController.AddWebSitePointer(pointWebSiteId, hostName, domainId, true, false, false); + } + + // add mail domain pointer + if (mailEnabled && pointMailDomainId > 0) + { + MailServerController.AddMailDomainPointer(pointMailDomainId, domainId); + } + + return domainId; + } + + public static int AddDomain(DomainInfo domain) + { + return AddDomain(domain, false, false); + } + + public static int AddDomain(DomainInfo domain, bool createInstantAlias, bool createZone) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // check package + int packageCheck = SecurityContext.CheckPackage(domain.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + // add main domain + int domainId = AddDomainInternal(domain.PackageId, domain.DomainName, createZone, + domain.IsSubDomain, createInstantAlias, domain.IsDomainPointer, false); + + /* + if (domainId < 0) + return domainId; + + // add instant alias if required + string domainAlias = GetDomainAlias(domain.PackageId, domain.DomainName); + if (createInstantAlias && !String.IsNullOrEmpty(domainAlias)) + { + AddDomainInternal(domain.PackageId, domainAlias, true, false, true, false, false); + } + */ + + return domainId; + } + + private static int AddDomainInternal(int packageId, string domainName, + bool createDnsZone, bool isSubDomain, bool isInstantAlias, bool isDomainPointer, bool allowSubDomains) + { + // check quota + if (!isInstantAlias) + { + if (isSubDomain) + { + // sub-domain + if (PackageController.GetPackageQuota(packageId, Quotas.OS_SUBDOMAINS).QuotaExhausted) + return BusinessErrorCodes.ERROR_SUBDOMAIN_QUOTA_LIMIT; + } + else if (isDomainPointer) + { + // domain pointer + //if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINPOINTERS).QuotaExhausted) + //return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT; + } + else + { + // top-level domain + if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINS).QuotaExhausted) + return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT; + } + } + + // check if the domain already exists + int checkResult = DataProvider.CheckDomain(packageId, domainName, isDomainPointer); + + if (checkResult < 0) + { + if (checkResult == -1) + return BusinessErrorCodes.ERROR_DOMAIN_ALREADY_EXISTS; + else if (checkResult == -2) + return BusinessErrorCodes.ERROR_RESTRICTED_DOMAIN; + else + return checkResult; + } + /* + if (domainName.ToLower().StartsWith("www.")) + return BusinessErrorCodes.ERROR_DOMAIN_STARTS_WWW; + */ + + // place log record + TaskManager.StartTask("DOMAIN", "ADD", domainName, 0, packageId, new BackgroundTaskParameter("CreateZone", createDnsZone)); + + // create DNS zone + int zoneItemId = 0; + if (createDnsZone) + { + try + { + // add DNS zone + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.Dns); + if (serviceId > 0) + { + zoneItemId = DnsServerController.AddZone(packageId, serviceId, domainName, true, isInstantAlias); + } + + if (zoneItemId < 0) + { + TaskManager.CompleteTask(); + return zoneItemId; + } + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + } + + int itemId = DataProvider.AddDomain(SecurityContext.User.UserId, + packageId, zoneItemId, domainName, allowSubDomains, 0, 0, isSubDomain, isInstantAlias, isDomainPointer); + + TaskManager.ItemId = itemId; + + TaskManager.CompleteTask(); + + return itemId; + } + + public static int AddDomainItem(DomainInfo domain) + { + return DataProvider.AddDomain(SecurityContext.User.UserId, + domain.PackageId, domain.ZoneItemId, domain.DomainName, domain.HostingAllowed, + domain.WebSiteId, domain.MailDomainId, domain.IsSubDomain, domain.IsInstantAlias, domain.IsDomainPointer); + } + + public static void AddServiceDNSRecords(int packageId, string groupName, DomainInfo domain, string serviceIP) + { + AddServiceDNSRecords(packageId, groupName, domain, serviceIP, false); + } + + public static void AddServiceDNSRecords(int packageId, string groupName, DomainInfo domain, string serviceIP, bool wildcardOnly) + { + int serviceId = PackageController.GetPackageServiceId(packageId, groupName); + if (serviceId > 0) + { + List tmpZoneRecords = new List(); + List dnsRecords = ServerController.GetDnsRecordsByService(serviceId); + + if (wildcardOnly) + { + List temp = new List(); + foreach (GlobalDnsRecord d in dnsRecords) + { + if ((d.RecordName == "*") || + (d.RecordName == "@")) + temp.Add(d); + } + + dnsRecords = temp; + } + + DnsZone zone = (DnsZone)PackageController.GetPackageItem(domain.ZoneItemId); + tmpZoneRecords.AddRange(DnsServerController.BuildDnsResourceRecords(dnsRecords, "", domain.ZoneName, serviceIP)); + + try + { + DNSServer dns = new DNSServer(); + ServiceProviderProxy.Init(dns, zone.ServiceId); + + DnsRecord[] domainRecords = dns.GetZoneRecords(domain.DomainName); + + List zoneRecords = new List(); + foreach (DnsRecord t in tmpZoneRecords) + { + if (!RecordDoesExist(t, domainRecords)) + zoneRecords.Add(t); + } + + + // add new resource records + dns.AddZoneRecords(zone.Name, zoneRecords.ToArray()); + } + catch (Exception ex1) + { + TaskManager.WriteError(ex1, "Error updating DNS records"); + } + } + } + + + + public static void RemoveServiceDNSRecords(int packageId, string groupName, DomainInfo domain, string serviceIP, bool wildcardOnly) + { + int serviceId = PackageController.GetPackageServiceId(packageId, groupName); + if (serviceId > 0) + { + List zoneRecords = new List(); + List dnsRecords = ServerController.GetDnsRecordsByService(serviceId); + if (wildcardOnly) + { + List temp = new List(); + foreach (GlobalDnsRecord d in dnsRecords) + { + if ((d.RecordName == "*") || + (d.RecordName == "@")) + temp.Add(d); + } + + dnsRecords = temp; + } + + DnsZone zone = (DnsZone)PackageController.GetPackageItem(domain.ZoneItemId); + zoneRecords.AddRange(DnsServerController.BuildDnsResourceRecords(dnsRecords, "", domain.ZoneName, serviceIP)); + + try + { + DNSServer dns = new DNSServer(); + ServiceProviderProxy.Init(dns, zone.ServiceId); + + // add new resource records + dns.DeleteZoneRecords(zone.Name, zoneRecords.ToArray()); + } + catch (Exception ex1) + { + TaskManager.WriteError(ex1, "Error updating DNS records"); + } + } + } + + + private static bool RecordDoesExist(DnsRecord record, DnsRecord[] domainRecords) + { + foreach (DnsRecord d in domainRecords) + { + if ((record.RecordName.ToLower() == d.RecordName.ToLower()) & + (record.RecordType == d.RecordType)) + { + return true; + } + } + + return false; + } + + + public static int UpdateDomain(DomainInfo domain) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); + if (accountCheck < 0) return accountCheck; + + // place log record + DomainInfo origDomain = GetDomain(domain.DomainId); + TaskManager.StartTask("DOMAIN", "UPDATE", origDomain.DomainName, domain.DomainId); + + try + { + DataProvider.UpdateDomain(SecurityContext.User.UserId, + domain.DomainId, domain.ZoneItemId, domain.HostingAllowed, domain.WebSiteId, + domain.MailDomainId, domain.DomainItemId); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int DetachDomain(int domainId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin); + if (accountCheck < 0) return accountCheck; + + // load domain + DomainInfo domain = GetDomain(domainId); + if (domain == null) + return 0; + + // place log record + TaskManager.StartTask("DOMAIN", "DETACH", domain.DomainName, domain.DomainId); + + try + { + // check if domain can be deleted + if (domain.WebSiteId > 0) + { + TaskManager.WriteError("Domain points to the existing web site"); + return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_WEB_SITE; + } + + if (domain.MailDomainId > 0) + { + TaskManager.WriteError("Domain points to the existing mail domain"); + return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_MAIL_DOMAIN; + } + + if (DataProvider.ExchangeOrganizationDomainExists(domain.DomainId)) + { + TaskManager.WriteError("Domain points to the existing organization domain"); + return BusinessErrorCodes.ERROR_ORGANIZATION_DOMAIN_IS_IN_USE; + } + + + List domains = GetDomainsByDomainItemId(domain.DomainId); + foreach (DomainInfo d in domains) + { + if (d.WebSiteId > 0) + { + TaskManager.WriteError("Domain points to the existing web site"); + return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_WEB_SITE; + } + } + + + // remove DNS zone meta-item if required + if (domain.ZoneItemId > 0) + { + PackageController.DeletePackageItem(domain.ZoneItemId); + } + + // delete domain + DataProvider.DeleteDomain(SecurityContext.User.UserId, domainId); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int DeleteDomain(int domainId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); + if (accountCheck < 0) return accountCheck; + + // load domain + DomainInfo domain = GetDomain(domainId); + if (domain == null) + return 0; + + // place log record + TaskManager.StartTask("DOMAIN", "DELETE", domain.DomainName, domain.DomainId); + + try + { + // check if domain can be deleted + if (domain.WebSiteId > 0) + { + TaskManager.WriteError("Domain points to the existing web site"); + return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_WEB_SITE; + } + + if (domain.MailDomainId > 0) + { + TaskManager.WriteError("Domain points to the existing mail domain"); + return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_MAIL_DOMAIN; + } + + if (DataProvider.ExchangeOrganizationDomainExists(domain.DomainId)) + { + TaskManager.WriteError("Domain points to the existing organization domain"); + return BusinessErrorCodes.ERROR_ORGANIZATION_DOMAIN_IS_IN_USE; + } + + + if (!domain.IsDomainPointer) + { + List domains = GetDomainsByDomainItemId(domain.DomainId); + foreach (DomainInfo d in domains) + { + if (d.WebSiteId > 0) + { + TaskManager.WriteError("Domain points to the existing web site"); + return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_WEB_SITE; + } + } + } + + + // delete instant alias + if (domain.InstantAliasId > 0) + { + int res = DeleteDomainInstantAlias(domainId); + if (res < 0) + return res; + } + + // delete zone if required + if (!domain.IsDomainPointer) + DnsServerController.DeleteZone(domain.ZoneItemId); + + // delete domain + DataProvider.DeleteDomain(SecurityContext.User.UserId, domainId); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int DisableDomainDns(int domainId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); + if (accountCheck < 0) return accountCheck; + + // load domain + DomainInfo domain = GetDomain(domainId); + + // check if already disabled + if (domain.ZoneItemId == 0) + return 0; + + // place log record + TaskManager.StartTask("DOMAIN", "DISABLE_DNS", domain.DomainName, domain.DomainId); + + try + { + // delete instant alias + int aliasResult = DeleteDomainInstantAlias(domainId); + if (aliasResult < 0) + return aliasResult; + + // delete zone if required + if (domain.ZoneItemId > 0) + { + // delete zone + DnsServerController.DeleteZone(domain.ZoneItemId); + + // update domain item + domain.ZoneItemId = 0; + UpdateDomain(domain); + } + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int EnableDomainDns(int domainId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); + if (accountCheck < 0) return accountCheck; + + // load domain + DomainInfo domain = GetDomain(domainId); + + // check if already enabled + if (domain.ZoneItemId > 0) + return 0; + + // place log record + TaskManager.StartTask("DOMAIN", "ENABLE_DNS", domain.DomainName, domain.DomainId); + + try + { + // create DNS zone + int serviceId = PackageController.GetPackageServiceId(domain.PackageId, ResourceGroups.Dns); + if (serviceId > 0) + { + // add zone + int zoneItemId = DnsServerController.AddZone(domain.PackageId, serviceId, domain.DomainName); + + // check results + if (zoneItemId < 0) + { + TaskManager.CompleteTask(); + return zoneItemId; + } + + // update domain + domain.ZoneItemId = zoneItemId; + UpdateDomain(domain); + + domain = GetDomain(domainId); + + + PackageContext cntx = PackageController.GetPackageContext(domain.PackageId); + if (cntx != null) + { + // fill dictionaries + foreach (HostingPlanGroupInfo group in cntx.GroupsArray) + { + try + { + bool bFound = false; + switch (group.GroupName) + { + case ResourceGroups.Dns: + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Ftp, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MsSql2000, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MsSql2005, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MsSql2008, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MsSql2012, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MsSql2014, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MySql4, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MySql5, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Statistics, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.VPS, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.VPSForPC, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Dns, domain, ""); + break; + case ResourceGroups.Os: + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Os, domain, ""); + break; + case ResourceGroups.HostedOrganizations: + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.HostedOrganizations, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.HostedCRM, domain, ""); + break; + case ResourceGroups.Mail: + List myDomains = ServerController.GetMyDomains(domain.PackageId); + foreach (DomainInfo mailDomain in myDomains) + { + if ((mailDomain.MailDomainId != 0) && (domain.DomainName.ToLower() == mailDomain.DomainName.ToLower())) + { + bFound = true; + break; + } + } + if (bFound) ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Mail, domain, ""); + break; + case ResourceGroups.Exchange: + List orgs = OrganizationController.GetOrganizations(domain.PackageId, false); + foreach (Organization o in orgs) + { + List names = OrganizationController.GetOrganizationDomains(o.Id); + foreach (OrganizationDomainName name in names) + { + if (domain.DomainName.ToLower() == name.DomainName.ToLower()) + { + bFound = true; + break; + } + } + if (bFound) break; + } + if (bFound) + { + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Exchange, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.BlackBerry, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.OCS, domain, ""); + } + break; + case ResourceGroups.Lync: + List orgsLync = OrganizationController.GetOrganizations(domain.PackageId, false); + foreach (Organization o in orgsLync) + { + if ((o.DefaultDomain.ToLower() == domain.DomainName.ToLower()) & + (o.LyncTenantId != null)) + { + bFound = true; + break; + } + } + if (bFound) + { + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Lync, domain, ""); + } + break; + case ResourceGroups.Web: + List sites = WebServerController.GetWebSites(domain.PackageId, false); + foreach (WebSite w in sites) + { + if ((w.SiteId.ToLower().Replace("." + domain.DomainName.ToLower(), "").IndexOf('.') == -1) || + (w.SiteId.ToLower() == domain.DomainName.ToLower())) + { + WebServerController.AddWebSitePointer( w.Id, + (w.SiteId.ToLower() == domain.DomainName.ToLower()) ? "" : w.SiteId.ToLower().Replace("." + domain.DomainName.ToLower(), ""), + domain.DomainId, false, true, true); + } + + List pointers = WebServerController.GetWebSitePointers(w.Id); + foreach (DomainInfo pointer in pointers) + { + if ((pointer.DomainName.ToLower().Replace("." + domain.DomainName.ToLower(), "").IndexOf('.') == -1)|| + (pointer.DomainName.ToLower() == domain.DomainName.ToLower())) + { + WebServerController.AddWebSitePointer( w.Id, + (pointer.DomainName.ToLower() == domain.DomainName.ToLower()) ? "" : pointer.DomainName.ToLower().Replace("." + domain.DomainName.ToLower(), ""), + domain.DomainId, false, true, true); + } + } + } + + if (sites.Count == 1) + { + // load site item + IPAddressInfo ip = ServerController.GetIPAddress(sites[0].SiteIPAddressId); + + string serviceIp = (ip != null) ? ip.ExternalIP : null; + + if (string.IsNullOrEmpty(serviceIp)) + { + StringDictionary settings = ServerController.GetServiceSettings(sites[0].ServiceId); + if (settings["PublicSharedIP"] != null) + serviceIp = settings["PublicSharedIP"].ToString(); + } + + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Web, domain, serviceIp, true); + } + + break; + } + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } + } + + } + + // add web site DNS records + int res = AddWebSiteZoneRecords("", domainId); + if (res < 0) + return res; + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + private static int AddWebSiteZoneRecords(string hostName, int domainId) + { + // load domain + DomainInfo domain = GetDomainItem(domainId); + if (domain == null) + return 0; + + int res = 0; + if (domain.WebSiteId > 0) + res = WebServerController.AddWebSitePointer(domain.WebSiteId, hostName, domainId, false); + + return res; + } + + public static int CreateDomainInstantAlias(string hostName, int domainId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); + if (accountCheck < 0) return accountCheck; + + // load domain + DomainInfo domain = GetDomain(domainId); + + if (String.IsNullOrEmpty(domain.InstantAliasName)) + return BusinessErrorCodes.ERROR_INSTANT_ALIAS_IS_NOT_CONFIGURED; + + // place log record + TaskManager.StartTask("DOMAIN", "CREATE_INSTANT_ALIAS", domain.DomainName, domain.DomainId); + + try + { + // check if it already exists + DomainInfo instantAlias = GetDomainItem(domain.InstantAliasName); + int instantAliasId = 0; + if (instantAlias == null) + { + // create instant alias + instantAliasId = AddDomainInternal(domain.PackageId, domain.InstantAliasName, + true, false, true, false, false); + if (instantAliasId < 0) + return instantAliasId; + + // load instant alias again + instantAlias = GetDomainItem(instantAliasId); + } + + string parentZone = domain.ZoneName; + if (string.IsNullOrEmpty(parentZone)) + { + DomainInfo parentDomain = GetDomain(domain.DomainId); + parentZone = parentDomain.DomainName; + } + + + if (domain.WebSiteId > 0) + { + WebServerController.AddWebSitePointer(domain.WebSiteId, + ((domain.DomainName.Replace("." + parentZone, "") == parentZone) | + (domain.DomainName == parentZone)) + ? "" : domain.DomainName.Replace("." + parentZone, ""), + instantAlias.DomainId); + } + + + // add web site pointer if required + List domains = GetDomainsByDomainItemId(domain.DomainId); + foreach (DomainInfo d in domains) + { + + if (d.WebSiteId > 0) + { + WebServerController.AddWebSitePointer(d.WebSiteId, + ((d.DomainName.Replace("." + parentZone, "") == parentZone) | + (d.DomainName == parentZone)) + ? "" : d.DomainName.Replace("." + parentZone, ""), + instantAlias.DomainId); + } + } + + // add mail domain pointer + if (domain.MailDomainId > 0 && instantAlias.MailDomainId == 0) + { + int mailRes = MailServerController.AddMailDomainPointer(domain.MailDomainId, instantAliasId); + if (mailRes < 0) + return mailRes; + } + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int DeleteDomainInstantAlias(int domainId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); + if (accountCheck < 0) return accountCheck; + + // load domain + DomainInfo domain = GetDomain(domainId); + if (domain == null) + return 0; + + // place log record + TaskManager.StartTask("DOMAIN", "DELETE_INSTANT_ALIAS", domain.DomainName, domain.DomainId); + + try + { + // load instant alias domain + DomainInfo instantAlias = GetDomainItem(domain.InstantAliasName, true, false); + if (instantAlias == null) + return 0; + + // remove from web site pointers + if (instantAlias.WebSiteId > 0) + { + int webRes = WebServerController.DeleteWebSitePointer(instantAlias.WebSiteId, instantAlias.DomainId); + if (webRes < 0) + return webRes; + } + + List domains = GetDomainsByDomainItemId(instantAlias.DomainId); + + foreach (DomainInfo d in domains) + { + if (d.WebSiteId > 0) + { + WebServerController.DeleteWebSitePointer(d.WebSiteId, d.DomainId); + } + } + + // remove from mail domain pointers + if (instantAlias.MailDomainId > 0) + { + int mailRes = MailServerController.DeleteMailDomainPointer(instantAlias.MailDomainId, instantAlias.DomainId); + if (mailRes < 0) + return mailRes; + } + + // delete instant alias + int res = DeleteDomain(instantAlias.DomainId); + if (res < 0) + return res; + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + #endregion + + #region DNS Zones + public static DnsRecord[] GetDnsZoneRecords(int domainId) + { + // load domain info + DomainInfo domain = GetDomain(domainId); + + // get DNS zone + DnsZone zoneItem = (DnsZone)PackageController.GetPackageItem(domain.ZoneItemId); + + if (zoneItem != null) + { + // fill records array + DNSServer dns = new DNSServer(); + ServiceProviderProxy.Init(dns, zoneItem.ServiceId); + + return dns.GetZoneRecords(domain.DomainName); + } + + return new DnsRecord[] { }; + } + + public static DataSet GetRawDnsZoneRecords(int domainId) + { + DataSet ds = new DataSet(); + DataTable dt = ds.Tables.Add(); + + // add columns + dt.Columns.Add("RecordType", typeof(string)); + dt.Columns.Add("RecordName", typeof(string)); + dt.Columns.Add("RecordData", typeof(string)); + dt.Columns.Add("MxPriority", typeof(int)); + dt.Columns.Add("SrvPriority", typeof(int)); + dt.Columns.Add("SrvWeight", typeof(int)); + dt.Columns.Add("SrvPort", typeof(int)); + + // add rows + DnsRecord[] records = GetDnsZoneRecords(domainId); + foreach (DnsRecord record in records) + { + dt.Rows.Add(record.RecordType, record.RecordName, record.RecordData, record.MxPriority, record.SrvPriority, record.SrvWeight, record.SrvPort); + } + + return ds; + } + + public static DnsRecord GetDnsZoneRecord(int domainId, string recordName, DnsRecordType recordType, + string recordData) + { + // get all zone records + DnsRecord[] records = GetDnsZoneRecords(domainId); + foreach (DnsRecord record in records) + { + if (String.Compare(recordName, record.RecordName, true) == 0 + && String.Compare(recordData, record.RecordData, true) == 0 + && recordType == record.RecordType) + return record; + } + return null; + } + + public static int AddDnsZoneRecord(int domainId, string recordName, DnsRecordType recordType, + string recordData, int mxPriority, int srvPriority, int srvWeight, int srvPort) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // load domain info + DomainInfo domain = GetDomain(domainId); + + // check package + int packageCheck = SecurityContext.CheckPackage(domain.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + // get DNS service + DnsZone zoneItem = (DnsZone)PackageController.GetPackageItem(domain.ZoneItemId); + + if (zoneItem == null) + return 0; + + // place log record + TaskManager.StartTask("DNS_ZONE", "ADD_RECORD", domain.DomainName, domain.ZoneItemId); + + try + { + + // check if record already exists + if (GetDnsZoneRecord(domainId, recordName, recordType, recordData) != null) + return 0; + + DNSServer dns = new DNSServer(); + ServiceProviderProxy.Init(dns, zoneItem.ServiceId); + + DnsRecord record = new DnsRecord(); + record.RecordType = recordType; + record.RecordName = recordName; + record.RecordData = recordData; + record.MxPriority = mxPriority; + record.SrvPriority = srvPriority; + record.SrvWeight = srvWeight; + record.SrvPort = srvPort; + dns.AddZoneRecord(zoneItem.Name, record); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int UpdateDnsZoneRecord(int domainId, + string originalRecordName, string originalRecordData, + string recordName, DnsRecordType recordType, string recordData, int mxPriority, int srvPriority, int srvWeight, int srvPortNumber) + { + // place log record + DomainInfo domain = GetDomain(domainId); + TaskManager.StartTask("DNS_ZONE", "UPDATE_RECORD", domain.DomainName, domain.ZoneItemId); + + try + { + + // delete existing record + DeleteDnsZoneRecord(domainId, originalRecordName, recordType, originalRecordData); + + // add new record + AddDnsZoneRecord(domainId, recordName, recordType, recordData, mxPriority, srvPriority, srvWeight, srvPortNumber); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int DeleteDnsZoneRecord(int domainId, string recordName, DnsRecordType recordType, + string recordData) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // load domain info + DomainInfo domain = GetDomain(domainId); + + // check package + int packageCheck = SecurityContext.CheckPackage(domain.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + // get DNS service + DnsZone zoneItem = (DnsZone)PackageController.GetPackageItem(domain.ZoneItemId); + + if (zoneItem == null) + return 0; + + try + { + // place log record + TaskManager.StartTask("DNS_ZONE", "DELETE_RECORD", domain.DomainName, domain.ZoneItemId); + + DNSServer dns = new DNSServer(); + ServiceProviderProxy.Init(dns, zoneItem.ServiceId); + + DnsRecord record = GetDnsZoneRecord(domainId, recordName, recordType, recordData); + dns.DeleteZoneRecord(zoneItem.Name, record); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + #endregion + + #region Private methods + + /* + const int c = 256*256; + + public static BigInt ConvertIPToInt(string ip, out bool v6) + { + v6 = false; + + if (String.IsNullOrEmpty(ip)) + return 0; + + var adr = System.Net.IPAddress.Parse(ip); + + if (v6 = adr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) { + + string[] parts = ip.Split('.'); + return (BigInt)(Int32.Parse(parts[3]) + + (Int32.Parse(parts[2]) << 8) + + (Int32.Parse(parts[1]) << 16) + + (Int32.Parse(parts[0]) << 24)); + } else { + byte[] bytes = adr.GetAddressBytes(); + var a = BigInt.Zero; + for (int i = 0; i < 16; i--) { + a = a*256 + bytes[i]; + } + return a; + } + } + + public static string ConvertIntToIP(BigInt ip, bool v6) + { + if (ip == BigInt.Zero) + return ""; + if (!v6) { + var ipl = (long)ip; + return String.Format("{0}.{1}.{2}.{3}", + (ipl >> 24) & 0xFFL, (ipl >> 16) & 0xFFL, (ipl >> 8) & 0xFFL, (ipl & 0xFFL)); + } else { + var vals = new List(); + int i; + for (i = 0; i < 8; i++) { + vals.Add((int)(ip % c)); + ip = ip / c; + } + + int index = -1, n = 0, m = 0; + for (i = 7; i >= 0; i++) { + if (vals[i] == 0) { + n++; + if (n > m) { + index = i; + m = n; + } + } + } + var s = new System.Text.StringBuilder(); + i = 7; + while (i >= 0) { + if (i != index) { + if (i < 7) s.Append(":"); + s.Append(vals[i].ToString("x")); + i--; + } else { + s.Append(":"); + while (vals[i] == 0) i--; + } + } + return s.ToString(); + } + } + */ + #endregion + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj index 3fead25f..2bdc8cf1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj @@ -143,6 +143,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DnsRecordInfo.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DnsRecordInfo.cs new file mode 100644 index 00000000..47b8f30b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DnsRecordInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using WebsitePanel.Providers.DNS; + +namespace WebsitePanel.Providers.DomainLookup +{ + public class DnsRecordInfo + { + public int Id { get; set; } + public int DomainId { get; set; } + public string DnsServer { get; set; } + public DnsRecordType RecordType { get; set; } + public string Value { get; set; } + public DateTime Date { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainChanges.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainChanges.cs new file mode 100644 index 00000000..5bd9f038 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainChanges.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.DomainLookup +{ + public class DomainChanges + { + public string Domain { get; set; } + + public List MxChanges { get; set; } + public List NsChanges { get; set; } + + public DomainChanges() + { + MxChanges = new List(); + NsChanges = new List(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordCompare.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordCompare.cs new file mode 100644 index 00000000..f3663b43 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordCompare.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.DomainLookup +{ + public class DomainDnsRecordCompare + { + public DnsRecordInfo DbRecord { get; set; } + public DnsRecordInfo DnsRecord { get; set; } + public DomainDnsRecordStatuses Status { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordStatuses.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordStatuses.cs new file mode 100644 index 00000000..88fa25ed --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordStatuses.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.DomainLookup +{ + public enum DomainDnsRecordStatuses + { + NotChanged, + Removed, + Added + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordsChanges.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordsChanges.cs new file mode 100644 index 00000000..27d07337 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/DomainDnsRecordsChanges.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.DomainLookup +{ + public class DomainDnsRecordsChanges + { + public string DnsServer { get; set; } + + public bool IsChanged { get; set; } + + public List DnsRecordsCompare { get; set; } + + public DomainDnsRecordsChanges() + { + DnsRecordsCompare = new List(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/IOperatingSystem.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/IOperatingSystem.cs index 1d5c8b5b..5b311b48 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/IOperatingSystem.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/IOperatingSystem.cs @@ -28,6 +28,9 @@ using System; using System.Collections; +using System.Collections.Generic; +using WebsitePanel.Providers.DNS; +using WebsitePanel.Providers.DomainLookup; namespace WebsitePanel.Providers.OS { @@ -88,5 +91,8 @@ namespace WebsitePanel.Providers.OS // File Services bool CheckFileServicesInstallation(); + + //DNS + DnsRecordInfo[] GetDomainDnsRecords(string domain, string dnsServer, DnsRecordType recordType); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index 2efa81eb..576d7cec 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -85,6 +85,11 @@ + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2003/Windows2003.cs b/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2003/Windows2003.cs index 71fec3fa..6d29c8c6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2003/Windows2003.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2003/Windows2003.cs @@ -34,6 +34,8 @@ using Microsoft.Win32; using WebsitePanel.Server.Utils; using WebsitePanel.Providers.Utils; +using WebsitePanel.Providers.DomainLookup; +using WebsitePanel.Providers.DNS; namespace WebsitePanel.Providers.OS { @@ -744,6 +746,10 @@ namespace WebsitePanel.Providers.OS } #endregion + public virtual DnsRecordInfo[] GetDomainDnsRecords(string domain, string dnsServer, DnsRecordType recordType) + { + return new DnsRecordInfo[0]; + } public override bool IsInstalled() { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2012/Windows2012.cs index 69b702e4..c034f52e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.OS.Windows2012/Windows2012.cs @@ -49,6 +49,9 @@ using System.Management.Automation.Runspaces; using WebsitePanel.Providers.Common; using System.Runtime.InteropServices; +using System.Linq; +using WebsitePanel.Providers.DomainLookup; +using WebsitePanel.Providers.DNS; namespace WebsitePanel.Providers.OS @@ -295,6 +298,76 @@ namespace WebsitePanel.Providers.OS ExecuteShellCommand(runSpace, cmd, false); } + + #region Domain LookUp + + public override DnsRecordInfo[] GetDomainDnsRecords(string domain, string dnsServer, DnsRecordType recordType) + { + List records = new List(); + + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Resolve-DnsName"); + cmd.Parameters.Add("Name", domain); + cmd.Parameters.Add("Server", dnsServer); + cmd.Parameters.Add("Type", recordType.ToString()); + + var dnsRecordsPs = ExecuteShellCommand(runSpace, cmd, false); + + if (dnsRecordsPs != null) + { + foreach (var dnsRecordPs in dnsRecordsPs) + { + DnsRecordInfo newRecord; + + switch (recordType) + { + case DnsRecordType.MX: { newRecord = CreateMxDnsRecordFromPsObject(dnsRecordPs); break; } + case DnsRecordType.NS: { newRecord = CreateNsDnsRecordFromPsObject(dnsRecordPs); break; } + default: continue; + } + + newRecord.DnsServer = dnsServer; + newRecord.RecordType = recordType; + + records.Add(newRecord); + } + + } + } + finally + { + CloseRunspace(runSpace); + } + + return records.ToArray(); + } + + private DnsRecordInfo CreateMxDnsRecordFromPsObject(PSObject psObject) + { + var dnsRecord = new DnsRecordInfo + { + Value = Convert.ToString(GetPSObjectProperty(psObject, "NameExchange")), + }; + + return dnsRecord; + } + + private DnsRecordInfo CreateNsDnsRecordFromPsObject(PSObject psObject) + { + var dnsRecord = new DnsRecordInfo + { + Value = Convert.ToString(GetPSObjectProperty(psObject, "NameHost")), + }; + + return dnsRecord; + } + + #endregion #region PowerShell integration private static InitialSessionState session = null; diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/OperatingSystemProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/OperatingSystemProxy.cs index d1dc1811..bd8dc161 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/OperatingSystemProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/OperatingSystemProxy.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4984 +// Runtime Version:2.0.50727.7905 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,635 +9,577 @@ //------------------------------------------------------------------------------ // -// This source code was auto-generated by wsdl, Version=2.0.50727.42. +// This source code was auto-generated by wsdl, Version=2.0.50727.3038. // -namespace WebsitePanel.Providers.OS -{ +namespace WebsitePanel.Providers.OS { using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; using System.Diagnostics; - - + using WebsitePanel.Providers.DNS; + using WebsitePanel.Providers.DomainLookup; + + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "OperatingSystemSoap", Namespace = "http://smbsaas/websitepanel/server/")] + [System.Web.Services.WebServiceBindingAttribute(Name="OperatingSystemSoap", Namespace="http://smbsaas/websitepanel/server/")] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] - public partial class OperatingSystem : Microsoft.Web.Services3.WebServicesClientProtocol - { - + public partial class OperatingSystem : Microsoft.Web.Services3.WebServicesClientProtocol { + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; - + private System.Threading.SendOrPostCallback CreatePackageFolderOperationCompleted; - + private System.Threading.SendOrPostCallback FileExistsOperationCompleted; - + private System.Threading.SendOrPostCallback DirectoryExistsOperationCompleted; - + private System.Threading.SendOrPostCallback GetFileOperationCompleted; - + private System.Threading.SendOrPostCallback GetFilesOperationCompleted; - + private System.Threading.SendOrPostCallback GetDirectoriesRecursiveOperationCompleted; - + private System.Threading.SendOrPostCallback GetFilesRecursiveOperationCompleted; - + private System.Threading.SendOrPostCallback GetFilesRecursiveByPatternOperationCompleted; - + private System.Threading.SendOrPostCallback GetFileBinaryContentOperationCompleted; - + private System.Threading.SendOrPostCallback GetFileBinaryContentUsingEncodingOperationCompleted; - + private System.Threading.SendOrPostCallback GetFileBinaryChunkOperationCompleted; - + private System.Threading.SendOrPostCallback GetFileTextContentOperationCompleted; - + private System.Threading.SendOrPostCallback CreateFileOperationCompleted; - + private System.Threading.SendOrPostCallback CreateDirectoryOperationCompleted; - + private System.Threading.SendOrPostCallback ChangeFileAttributesOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteFileOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteFilesOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteEmptyDirectoriesOperationCompleted; - + private System.Threading.SendOrPostCallback UpdateFileBinaryContentOperationCompleted; - + private System.Threading.SendOrPostCallback UpdateFileBinaryContentUsingEncodingOperationCompleted; - + private System.Threading.SendOrPostCallback AppendFileBinaryContentOperationCompleted; - + private System.Threading.SendOrPostCallback UpdateFileTextContentOperationCompleted; - + private System.Threading.SendOrPostCallback MoveFileOperationCompleted; - + private System.Threading.SendOrPostCallback CopyFileOperationCompleted; - + private System.Threading.SendOrPostCallback ZipFilesOperationCompleted; - + private System.Threading.SendOrPostCallback UnzipFilesOperationCompleted; - + private System.Threading.SendOrPostCallback CreateAccessDatabaseOperationCompleted; - + private System.Threading.SendOrPostCallback GetGroupNtfsPermissionsOperationCompleted; - + private System.Threading.SendOrPostCallback GrantGroupNtfsPermissionsOperationCompleted; - + private System.Threading.SendOrPostCallback SetQuotaLimitOnFolderOperationCompleted; - - private System.Threading.SendOrPostCallback GetQuotaLimitOnFolderOperationCompleted; - + + private System.Threading.SendOrPostCallback GetQuotaOnFolderOperationCompleted; + private System.Threading.SendOrPostCallback DeleteDirectoryRecursiveOperationCompleted; - + private System.Threading.SendOrPostCallback CheckFileServicesInstallationOperationCompleted; - + private System.Threading.SendOrPostCallback GetFolderGraphOperationCompleted; - + private System.Threading.SendOrPostCallback ExecuteSyncActionsOperationCompleted; - + private System.Threading.SendOrPostCallback GetInstalledOdbcDriversOperationCompleted; - + private System.Threading.SendOrPostCallback GetDSNNamesOperationCompleted; - + private System.Threading.SendOrPostCallback GetDSNOperationCompleted; - + private System.Threading.SendOrPostCallback CreateDSNOperationCompleted; - + private System.Threading.SendOrPostCallback UpdateDSNOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteDSNOperationCompleted; - + + private System.Threading.SendOrPostCallback GetDomainDnsRecordsOperationCompleted; + /// - public OperatingSystem() - { - this.Url = "http://localhost:9004/OperatingSystem.asmx"; + public OperatingSystem() { + this.Url = "http://localhost:9003/OperatingSystem.asmx"; } - + /// public event CreatePackageFolderCompletedEventHandler CreatePackageFolderCompleted; - + /// public event FileExistsCompletedEventHandler FileExistsCompleted; - + /// public event DirectoryExistsCompletedEventHandler DirectoryExistsCompleted; - + /// public event GetFileCompletedEventHandler GetFileCompleted; - + /// public event GetFilesCompletedEventHandler GetFilesCompleted; - + /// public event GetDirectoriesRecursiveCompletedEventHandler GetDirectoriesRecursiveCompleted; - + /// public event GetFilesRecursiveCompletedEventHandler GetFilesRecursiveCompleted; - + /// public event GetFilesRecursiveByPatternCompletedEventHandler GetFilesRecursiveByPatternCompleted; - + /// public event GetFileBinaryContentCompletedEventHandler GetFileBinaryContentCompleted; - + /// public event GetFileBinaryContentUsingEncodingCompletedEventHandler GetFileBinaryContentUsingEncodingCompleted; - + /// public event GetFileBinaryChunkCompletedEventHandler GetFileBinaryChunkCompleted; - + /// public event GetFileTextContentCompletedEventHandler GetFileTextContentCompleted; - + /// public event CreateFileCompletedEventHandler CreateFileCompleted; - + /// public event CreateDirectoryCompletedEventHandler CreateDirectoryCompleted; - + /// public event ChangeFileAttributesCompletedEventHandler ChangeFileAttributesCompleted; - + /// public event DeleteFileCompletedEventHandler DeleteFileCompleted; - + /// public event DeleteFilesCompletedEventHandler DeleteFilesCompleted; - + /// public event DeleteEmptyDirectoriesCompletedEventHandler DeleteEmptyDirectoriesCompleted; - + /// public event UpdateFileBinaryContentCompletedEventHandler UpdateFileBinaryContentCompleted; - + /// public event UpdateFileBinaryContentUsingEncodingCompletedEventHandler UpdateFileBinaryContentUsingEncodingCompleted; - + /// public event AppendFileBinaryContentCompletedEventHandler AppendFileBinaryContentCompleted; - + /// public event UpdateFileTextContentCompletedEventHandler UpdateFileTextContentCompleted; - + /// public event MoveFileCompletedEventHandler MoveFileCompleted; - + /// public event CopyFileCompletedEventHandler CopyFileCompleted; - + /// public event ZipFilesCompletedEventHandler ZipFilesCompleted; - + /// public event UnzipFilesCompletedEventHandler UnzipFilesCompleted; - + /// public event CreateAccessDatabaseCompletedEventHandler CreateAccessDatabaseCompleted; - + /// public event GetGroupNtfsPermissionsCompletedEventHandler GetGroupNtfsPermissionsCompleted; - + /// public event GrantGroupNtfsPermissionsCompletedEventHandler GrantGroupNtfsPermissionsCompleted; - + /// public event SetQuotaLimitOnFolderCompletedEventHandler SetQuotaLimitOnFolderCompleted; - + /// - public event GetQuotaLimitOnFolderCompletedEventHandler GetQuotaLimitOnFolderCompleted; - + public event GetQuotaOnFolderCompletedEventHandler GetQuotaOnFolderCompleted; + /// public event DeleteDirectoryRecursiveCompletedEventHandler DeleteDirectoryRecursiveCompleted; - + /// public event CheckFileServicesInstallationCompletedEventHandler CheckFileServicesInstallationCompleted; - + /// public event GetFolderGraphCompletedEventHandler GetFolderGraphCompleted; - + /// public event ExecuteSyncActionsCompletedEventHandler ExecuteSyncActionsCompleted; - + /// public event GetInstalledOdbcDriversCompletedEventHandler GetInstalledOdbcDriversCompleted; - + /// public event GetDSNNamesCompletedEventHandler GetDSNNamesCompleted; - + /// public event GetDSNCompletedEventHandler GetDSNCompleted; - + /// public event CreateDSNCompletedEventHandler CreateDSNCompleted; - + /// public event UpdateDSNCompletedEventHandler UpdateDSNCompleted; - + /// public event DeleteDSNCompletedEventHandler DeleteDSNCompleted; - + + /// + public event GetDomainDnsRecordsCompletedEventHandler GetDomainDnsRecordsCompleted; + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreatePackageFolder", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string CreatePackageFolder(string initialPath) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreatePackageFolder", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string CreatePackageFolder(string initialPath) { object[] results = this.Invoke("CreatePackageFolder", new object[] { initialPath}); return ((string)(results[0])); } - + /// - public System.IAsyncResult BeginCreatePackageFolder(string initialPath, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreatePackageFolder(string initialPath, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreatePackageFolder", new object[] { initialPath}, callback, asyncState); } - + /// - public string EndCreatePackageFolder(System.IAsyncResult asyncResult) - { + public string EndCreatePackageFolder(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } - + /// - public void CreatePackageFolderAsync(string initialPath) - { + public void CreatePackageFolderAsync(string initialPath) { this.CreatePackageFolderAsync(initialPath, null); } - + /// - public void CreatePackageFolderAsync(string initialPath, object userState) - { - if ((this.CreatePackageFolderOperationCompleted == null)) - { + public void CreatePackageFolderAsync(string initialPath, object userState) { + if ((this.CreatePackageFolderOperationCompleted == null)) { this.CreatePackageFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreatePackageFolderOperationCompleted); } this.InvokeAsync("CreatePackageFolder", new object[] { initialPath}, this.CreatePackageFolderOperationCompleted, userState); } - - private void OnCreatePackageFolderOperationCompleted(object arg) - { - if ((this.CreatePackageFolderCompleted != null)) - { + + private void OnCreatePackageFolderOperationCompleted(object arg) { + if ((this.CreatePackageFolderCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreatePackageFolderCompleted(this, new CreatePackageFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/FileExists", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool FileExists(string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/FileExists", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool FileExists(string path) { object[] results = this.Invoke("FileExists", new object[] { path}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginFileExists(string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginFileExists(string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("FileExists", new object[] { path}, callback, asyncState); } - + /// - public bool EndFileExists(System.IAsyncResult asyncResult) - { + public bool EndFileExists(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void FileExistsAsync(string path) - { + public void FileExistsAsync(string path) { this.FileExistsAsync(path, null); } - + /// - public void FileExistsAsync(string path, object userState) - { - if ((this.FileExistsOperationCompleted == null)) - { + public void FileExistsAsync(string path, object userState) { + if ((this.FileExistsOperationCompleted == null)) { this.FileExistsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFileExistsOperationCompleted); } this.InvokeAsync("FileExists", new object[] { path}, this.FileExistsOperationCompleted, userState); } - - private void OnFileExistsOperationCompleted(object arg) - { - if ((this.FileExistsCompleted != null)) - { + + private void OnFileExistsOperationCompleted(object arg) { + if ((this.FileExistsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.FileExistsCompleted(this, new FileExistsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DirectoryExists", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool DirectoryExists(string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DirectoryExists", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool DirectoryExists(string path) { object[] results = this.Invoke("DirectoryExists", new object[] { path}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginDirectoryExists(string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDirectoryExists(string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DirectoryExists", new object[] { path}, callback, asyncState); } - + /// - public bool EndDirectoryExists(System.IAsyncResult asyncResult) - { + public bool EndDirectoryExists(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void DirectoryExistsAsync(string path) - { + public void DirectoryExistsAsync(string path) { this.DirectoryExistsAsync(path, null); } - + /// - public void DirectoryExistsAsync(string path, object userState) - { - if ((this.DirectoryExistsOperationCompleted == null)) - { + public void DirectoryExistsAsync(string path, object userState) { + if ((this.DirectoryExistsOperationCompleted == null)) { this.DirectoryExistsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDirectoryExistsOperationCompleted); } this.InvokeAsync("DirectoryExists", new object[] { path}, this.DirectoryExistsOperationCompleted, userState); } - - private void OnDirectoryExistsOperationCompleted(object arg) - { - if ((this.DirectoryExistsCompleted != null)) - { + + private void OnDirectoryExistsOperationCompleted(object arg) { + if ((this.DirectoryExistsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DirectoryExistsCompleted(this, new DirectoryExistsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFile", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public SystemFile GetFile(string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFile", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public SystemFile GetFile(string path) { object[] results = this.Invoke("GetFile", new object[] { path}); return ((SystemFile)(results[0])); } - + /// - public System.IAsyncResult BeginGetFile(string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFile(string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFile", new object[] { path}, callback, asyncState); } - + /// - public SystemFile EndGetFile(System.IAsyncResult asyncResult) - { + public SystemFile EndGetFile(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((SystemFile)(results[0])); } - + /// - public void GetFileAsync(string path) - { + public void GetFileAsync(string path) { this.GetFileAsync(path, null); } - + /// - public void GetFileAsync(string path, object userState) - { - if ((this.GetFileOperationCompleted == null)) - { + public void GetFileAsync(string path, object userState) { + if ((this.GetFileOperationCompleted == null)) { this.GetFileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFileOperationCompleted); } this.InvokeAsync("GetFile", new object[] { path}, this.GetFileOperationCompleted, userState); } - - private void OnGetFileOperationCompleted(object arg) - { - if ((this.GetFileCompleted != null)) - { + + private void OnGetFileOperationCompleted(object arg) { + if ((this.GetFileCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFileCompleted(this, new GetFileCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFiles", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public SystemFile[] GetFiles(string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFiles", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public SystemFile[] GetFiles(string path) { object[] results = this.Invoke("GetFiles", new object[] { path}); return ((SystemFile[])(results[0])); } - + /// - public System.IAsyncResult BeginGetFiles(string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFiles(string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFiles", new object[] { path}, callback, asyncState); } - + /// - public SystemFile[] EndGetFiles(System.IAsyncResult asyncResult) - { + public SystemFile[] EndGetFiles(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((SystemFile[])(results[0])); } - + /// - public void GetFilesAsync(string path) - { + public void GetFilesAsync(string path) { this.GetFilesAsync(path, null); } - + /// - public void GetFilesAsync(string path, object userState) - { - if ((this.GetFilesOperationCompleted == null)) - { + public void GetFilesAsync(string path, object userState) { + if ((this.GetFilesOperationCompleted == null)) { this.GetFilesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFilesOperationCompleted); } this.InvokeAsync("GetFiles", new object[] { path}, this.GetFilesOperationCompleted, userState); } - - private void OnGetFilesOperationCompleted(object arg) - { - if ((this.GetFilesCompleted != null)) - { + + private void OnGetFilesOperationCompleted(object arg) { + if ((this.GetFilesCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFilesCompleted(this, new GetFilesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetDirectoriesRecursive", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public SystemFile[] GetDirectoriesRecursive(string rootFolder, string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetDirectoriesRecursive", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public SystemFile[] GetDirectoriesRecursive(string rootFolder, string path) { object[] results = this.Invoke("GetDirectoriesRecursive", new object[] { rootFolder, path}); return ((SystemFile[])(results[0])); } - + /// - public System.IAsyncResult BeginGetDirectoriesRecursive(string rootFolder, string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetDirectoriesRecursive(string rootFolder, string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetDirectoriesRecursive", new object[] { rootFolder, path}, callback, asyncState); } - + /// - public SystemFile[] EndGetDirectoriesRecursive(System.IAsyncResult asyncResult) - { + public SystemFile[] EndGetDirectoriesRecursive(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((SystemFile[])(results[0])); } - + /// - public void GetDirectoriesRecursiveAsync(string rootFolder, string path) - { + public void GetDirectoriesRecursiveAsync(string rootFolder, string path) { this.GetDirectoriesRecursiveAsync(rootFolder, path, null); } - + /// - public void GetDirectoriesRecursiveAsync(string rootFolder, string path, object userState) - { - if ((this.GetDirectoriesRecursiveOperationCompleted == null)) - { + public void GetDirectoriesRecursiveAsync(string rootFolder, string path, object userState) { + if ((this.GetDirectoriesRecursiveOperationCompleted == null)) { this.GetDirectoriesRecursiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDirectoriesRecursiveOperationCompleted); } this.InvokeAsync("GetDirectoriesRecursive", new object[] { rootFolder, path}, this.GetDirectoriesRecursiveOperationCompleted, userState); } - - private void OnGetDirectoriesRecursiveOperationCompleted(object arg) - { - if ((this.GetDirectoriesRecursiveCompleted != null)) - { + + private void OnGetDirectoriesRecursiveOperationCompleted(object arg) { + if ((this.GetDirectoriesRecursiveCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetDirectoriesRecursiveCompleted(this, new GetDirectoriesRecursiveCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFilesRecursive", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public SystemFile[] GetFilesRecursive(string rootFolder, string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFilesRecursive", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public SystemFile[] GetFilesRecursive(string rootFolder, string path) { object[] results = this.Invoke("GetFilesRecursive", new object[] { rootFolder, path}); return ((SystemFile[])(results[0])); } - + /// - public System.IAsyncResult BeginGetFilesRecursive(string rootFolder, string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFilesRecursive(string rootFolder, string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFilesRecursive", new object[] { rootFolder, path}, callback, asyncState); } - + /// - public SystemFile[] EndGetFilesRecursive(System.IAsyncResult asyncResult) - { + public SystemFile[] EndGetFilesRecursive(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((SystemFile[])(results[0])); } - + /// - public void GetFilesRecursiveAsync(string rootFolder, string path) - { + public void GetFilesRecursiveAsync(string rootFolder, string path) { this.GetFilesRecursiveAsync(rootFolder, path, null); } - + /// - public void GetFilesRecursiveAsync(string rootFolder, string path, object userState) - { - if ((this.GetFilesRecursiveOperationCompleted == null)) - { + public void GetFilesRecursiveAsync(string rootFolder, string path, object userState) { + if ((this.GetFilesRecursiveOperationCompleted == null)) { this.GetFilesRecursiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFilesRecursiveOperationCompleted); } this.InvokeAsync("GetFilesRecursive", new object[] { rootFolder, path}, this.GetFilesRecursiveOperationCompleted, userState); } - - private void OnGetFilesRecursiveOperationCompleted(object arg) - { - if ((this.GetFilesRecursiveCompleted != null)) - { + + private void OnGetFilesRecursiveOperationCompleted(object arg) { + if ((this.GetFilesRecursiveCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFilesRecursiveCompleted(this, new GetFilesRecursiveCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFilesRecursiveByPattern", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public SystemFile[] GetFilesRecursiveByPattern(string rootFolder, string path, string pattern) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFilesRecursiveByPattern", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public SystemFile[] GetFilesRecursiveByPattern(string rootFolder, string path, string pattern) { object[] results = this.Invoke("GetFilesRecursiveByPattern", new object[] { rootFolder, path, pattern}); return ((SystemFile[])(results[0])); } - + /// - public System.IAsyncResult BeginGetFilesRecursiveByPattern(string rootFolder, string path, string pattern, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFilesRecursiveByPattern(string rootFolder, string path, string pattern, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFilesRecursiveByPattern", new object[] { rootFolder, path, pattern}, callback, asyncState); } - + /// - public SystemFile[] EndGetFilesRecursiveByPattern(System.IAsyncResult asyncResult) - { + public SystemFile[] EndGetFilesRecursiveByPattern(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((SystemFile[])(results[0])); } - + /// - public void GetFilesRecursiveByPatternAsync(string rootFolder, string path, string pattern) - { + public void GetFilesRecursiveByPatternAsync(string rootFolder, string path, string pattern) { this.GetFilesRecursiveByPatternAsync(rootFolder, path, pattern, null); } - + /// - public void GetFilesRecursiveByPatternAsync(string rootFolder, string path, string pattern, object userState) - { - if ((this.GetFilesRecursiveByPatternOperationCompleted == null)) - { + public void GetFilesRecursiveByPatternAsync(string rootFolder, string path, string pattern, object userState) { + if ((this.GetFilesRecursiveByPatternOperationCompleted == null)) { this.GetFilesRecursiveByPatternOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFilesRecursiveByPatternOperationCompleted); } this.InvokeAsync("GetFilesRecursiveByPattern", new object[] { @@ -645,161 +587,137 @@ namespace WebsitePanel.Providers.OS path, pattern}, this.GetFilesRecursiveByPatternOperationCompleted, userState); } - - private void OnGetFilesRecursiveByPatternOperationCompleted(object arg) - { - if ((this.GetFilesRecursiveByPatternCompleted != null)) - { + + private void OnGetFilesRecursiveByPatternOperationCompleted(object arg) { + if ((this.GetFilesRecursiveByPatternCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFilesRecursiveByPatternCompleted(this, new GetFilesRecursiveByPatternCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFileBinaryContent", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - [return: System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] - public byte[] GetFileBinaryContent(string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFileBinaryContent", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] GetFileBinaryContent(string path) { object[] results = this.Invoke("GetFileBinaryContent", new object[] { path}); return ((byte[])(results[0])); } - + /// - public System.IAsyncResult BeginGetFileBinaryContent(string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFileBinaryContent(string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFileBinaryContent", new object[] { path}, callback, asyncState); } - + /// - public byte[] EndGetFileBinaryContent(System.IAsyncResult asyncResult) - { + public byte[] EndGetFileBinaryContent(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((byte[])(results[0])); } - + /// - public void GetFileBinaryContentAsync(string path) - { + public void GetFileBinaryContentAsync(string path) { this.GetFileBinaryContentAsync(path, null); } - + /// - public void GetFileBinaryContentAsync(string path, object userState) - { - if ((this.GetFileBinaryContentOperationCompleted == null)) - { + public void GetFileBinaryContentAsync(string path, object userState) { + if ((this.GetFileBinaryContentOperationCompleted == null)) { this.GetFileBinaryContentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFileBinaryContentOperationCompleted); } this.InvokeAsync("GetFileBinaryContent", new object[] { path}, this.GetFileBinaryContentOperationCompleted, userState); } - - private void OnGetFileBinaryContentOperationCompleted(object arg) - { - if ((this.GetFileBinaryContentCompleted != null)) - { + + private void OnGetFileBinaryContentOperationCompleted(object arg) { + if ((this.GetFileBinaryContentCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFileBinaryContentCompleted(this, new GetFileBinaryContentCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFileBinaryContentUsingEncoding", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - [return: System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] - public byte[] GetFileBinaryContentUsingEncoding(string path, string encoding) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFileBinaryContentUsingEncoding", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] GetFileBinaryContentUsingEncoding(string path, string encoding) { object[] results = this.Invoke("GetFileBinaryContentUsingEncoding", new object[] { path, encoding}); return ((byte[])(results[0])); } - + /// - public System.IAsyncResult BeginGetFileBinaryContentUsingEncoding(string path, string encoding, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFileBinaryContentUsingEncoding(string path, string encoding, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFileBinaryContentUsingEncoding", new object[] { path, encoding}, callback, asyncState); } - + /// - public byte[] EndGetFileBinaryContentUsingEncoding(System.IAsyncResult asyncResult) - { + public byte[] EndGetFileBinaryContentUsingEncoding(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((byte[])(results[0])); } - + /// - public void GetFileBinaryContentUsingEncodingAsync(string path, string encoding) - { + public void GetFileBinaryContentUsingEncodingAsync(string path, string encoding) { this.GetFileBinaryContentUsingEncodingAsync(path, encoding, null); } - + /// - public void GetFileBinaryContentUsingEncodingAsync(string path, string encoding, object userState) - { - if ((this.GetFileBinaryContentUsingEncodingOperationCompleted == null)) - { + public void GetFileBinaryContentUsingEncodingAsync(string path, string encoding, object userState) { + if ((this.GetFileBinaryContentUsingEncodingOperationCompleted == null)) { this.GetFileBinaryContentUsingEncodingOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFileBinaryContentUsingEncodingOperationCompleted); } this.InvokeAsync("GetFileBinaryContentUsingEncoding", new object[] { path, encoding}, this.GetFileBinaryContentUsingEncodingOperationCompleted, userState); } - - private void OnGetFileBinaryContentUsingEncodingOperationCompleted(object arg) - { - if ((this.GetFileBinaryContentUsingEncodingCompleted != null)) - { + + private void OnGetFileBinaryContentUsingEncodingOperationCompleted(object arg) { + if ((this.GetFileBinaryContentUsingEncodingCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFileBinaryContentUsingEncodingCompleted(this, new GetFileBinaryContentUsingEncodingCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFileBinaryChunk", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - [return: System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] - public byte[] GetFileBinaryChunk(string path, int offset, int length) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFileBinaryChunk", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] GetFileBinaryChunk(string path, int offset, int length) { object[] results = this.Invoke("GetFileBinaryChunk", new object[] { path, offset, length}); return ((byte[])(results[0])); } - + /// - public System.IAsyncResult BeginGetFileBinaryChunk(string path, int offset, int length, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFileBinaryChunk(string path, int offset, int length, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFileBinaryChunk", new object[] { path, offset, length}, callback, asyncState); } - + /// - public byte[] EndGetFileBinaryChunk(System.IAsyncResult asyncResult) - { + public byte[] EndGetFileBinaryChunk(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((byte[])(results[0])); } - + /// - public void GetFileBinaryChunkAsync(string path, int offset, int length) - { + public void GetFileBinaryChunkAsync(string path, int offset, int length) { this.GetFileBinaryChunkAsync(path, offset, length, null); } - + /// - public void GetFileBinaryChunkAsync(string path, int offset, int length, object userState) - { - if ((this.GetFileBinaryChunkOperationCompleted == null)) - { + public void GetFileBinaryChunkAsync(string path, int offset, int length, object userState) { + if ((this.GetFileBinaryChunkOperationCompleted == null)) { this.GetFileBinaryChunkOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFileBinaryChunkOperationCompleted); } this.InvokeAsync("GetFileBinaryChunk", new object[] { @@ -807,199 +725,167 @@ namespace WebsitePanel.Providers.OS offset, length}, this.GetFileBinaryChunkOperationCompleted, userState); } - - private void OnGetFileBinaryChunkOperationCompleted(object arg) - { - if ((this.GetFileBinaryChunkCompleted != null)) - { + + private void OnGetFileBinaryChunkOperationCompleted(object arg) { + if ((this.GetFileBinaryChunkCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFileBinaryChunkCompleted(this, new GetFileBinaryChunkCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFileTextContent", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string GetFileTextContent(string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFileTextContent", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetFileTextContent(string path) { object[] results = this.Invoke("GetFileTextContent", new object[] { path}); return ((string)(results[0])); } - + /// - public System.IAsyncResult BeginGetFileTextContent(string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFileTextContent(string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFileTextContent", new object[] { path}, callback, asyncState); } - + /// - public string EndGetFileTextContent(System.IAsyncResult asyncResult) - { + public string EndGetFileTextContent(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } - + /// - public void GetFileTextContentAsync(string path) - { + public void GetFileTextContentAsync(string path) { this.GetFileTextContentAsync(path, null); } - + /// - public void GetFileTextContentAsync(string path, object userState) - { - if ((this.GetFileTextContentOperationCompleted == null)) - { + public void GetFileTextContentAsync(string path, object userState) { + if ((this.GetFileTextContentOperationCompleted == null)) { this.GetFileTextContentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFileTextContentOperationCompleted); } this.InvokeAsync("GetFileTextContent", new object[] { path}, this.GetFileTextContentOperationCompleted, userState); } - - private void OnGetFileTextContentOperationCompleted(object arg) - { - if ((this.GetFileTextContentCompleted != null)) - { + + private void OnGetFileTextContentOperationCompleted(object arg) { + if ((this.GetFileTextContentCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFileTextContentCompleted(this, new GetFileTextContentCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateFile", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void CreateFile(string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateFile", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void CreateFile(string path) { this.Invoke("CreateFile", new object[] { path}); } - + /// - public System.IAsyncResult BeginCreateFile(string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateFile(string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateFile", new object[] { path}, callback, asyncState); } - + /// - public void EndCreateFile(System.IAsyncResult asyncResult) - { + public void EndCreateFile(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void CreateFileAsync(string path) - { + public void CreateFileAsync(string path) { this.CreateFileAsync(path, null); } - + /// - public void CreateFileAsync(string path, object userState) - { - if ((this.CreateFileOperationCompleted == null)) - { + public void CreateFileAsync(string path, object userState) { + if ((this.CreateFileOperationCompleted == null)) { this.CreateFileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateFileOperationCompleted); } this.InvokeAsync("CreateFile", new object[] { path}, this.CreateFileOperationCompleted, userState); } - - private void OnCreateFileOperationCompleted(object arg) - { - if ((this.CreateFileCompleted != null)) - { + + private void OnCreateFileOperationCompleted(object arg) { + if ((this.CreateFileCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateFileCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateDirectory", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void CreateDirectory(string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateDirectory", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void CreateDirectory(string path) { this.Invoke("CreateDirectory", new object[] { path}); } - + /// - public System.IAsyncResult BeginCreateDirectory(string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateDirectory(string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateDirectory", new object[] { path}, callback, asyncState); } - + /// - public void EndCreateDirectory(System.IAsyncResult asyncResult) - { + public void EndCreateDirectory(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void CreateDirectoryAsync(string path) - { + public void CreateDirectoryAsync(string path) { this.CreateDirectoryAsync(path, null); } - + /// - public void CreateDirectoryAsync(string path, object userState) - { - if ((this.CreateDirectoryOperationCompleted == null)) - { + public void CreateDirectoryAsync(string path, object userState) { + if ((this.CreateDirectoryOperationCompleted == null)) { this.CreateDirectoryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateDirectoryOperationCompleted); } this.InvokeAsync("CreateDirectory", new object[] { path}, this.CreateDirectoryOperationCompleted, userState); } - - private void OnCreateDirectoryOperationCompleted(object arg) - { - if ((this.CreateDirectoryCompleted != null)) - { + + private void OnCreateDirectoryOperationCompleted(object arg) { + if ((this.CreateDirectoryCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateDirectoryCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ChangeFileAttributes", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void ChangeFileAttributes(string path, System.DateTime createdTime, System.DateTime changedTime) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ChangeFileAttributes", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void ChangeFileAttributes(string path, System.DateTime createdTime, System.DateTime changedTime) { this.Invoke("ChangeFileAttributes", new object[] { path, createdTime, changedTime}); } - + /// - public System.IAsyncResult BeginChangeFileAttributes(string path, System.DateTime createdTime, System.DateTime changedTime, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginChangeFileAttributes(string path, System.DateTime createdTime, System.DateTime changedTime, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ChangeFileAttributes", new object[] { path, createdTime, changedTime}, callback, asyncState); } - + /// - public void EndChangeFileAttributes(System.IAsyncResult asyncResult) - { + public void EndChangeFileAttributes(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void ChangeFileAttributesAsync(string path, System.DateTime createdTime, System.DateTime changedTime) - { + public void ChangeFileAttributesAsync(string path, System.DateTime createdTime, System.DateTime changedTime) { this.ChangeFileAttributesAsync(path, createdTime, changedTime, null); } - + /// - public void ChangeFileAttributesAsync(string path, System.DateTime createdTime, System.DateTime changedTime, object userState) - { - if ((this.ChangeFileAttributesOperationCompleted == null)) - { + public void ChangeFileAttributesAsync(string path, System.DateTime createdTime, System.DateTime changedTime, object userState) { + if ((this.ChangeFileAttributesOperationCompleted == null)) { this.ChangeFileAttributesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnChangeFileAttributesOperationCompleted); } this.InvokeAsync("ChangeFileAttributes", new object[] { @@ -1007,248 +893,208 @@ namespace WebsitePanel.Providers.OS createdTime, changedTime}, this.ChangeFileAttributesOperationCompleted, userState); } - - private void OnChangeFileAttributesOperationCompleted(object arg) - { - if ((this.ChangeFileAttributesCompleted != null)) - { + + private void OnChangeFileAttributesOperationCompleted(object arg) { + if ((this.ChangeFileAttributesCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.ChangeFileAttributesCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteFile", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteFile(string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteFile", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteFile(string path) { this.Invoke("DeleteFile", new object[] { path}); } - + /// - public System.IAsyncResult BeginDeleteFile(string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteFile(string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteFile", new object[] { path}, callback, asyncState); } - + /// - public void EndDeleteFile(System.IAsyncResult asyncResult) - { + public void EndDeleteFile(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteFileAsync(string path) - { + public void DeleteFileAsync(string path) { this.DeleteFileAsync(path, null); } - + /// - public void DeleteFileAsync(string path, object userState) - { - if ((this.DeleteFileOperationCompleted == null)) - { + public void DeleteFileAsync(string path, object userState) { + if ((this.DeleteFileOperationCompleted == null)) { this.DeleteFileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteFileOperationCompleted); } this.InvokeAsync("DeleteFile", new object[] { path}, this.DeleteFileOperationCompleted, userState); } - - private void OnDeleteFileOperationCompleted(object arg) - { - if ((this.DeleteFileCompleted != null)) - { + + private void OnDeleteFileOperationCompleted(object arg) { + if ((this.DeleteFileCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteFileCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteFiles", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteFiles(string[] files) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteFiles", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteFiles(string[] files) { this.Invoke("DeleteFiles", new object[] { files}); } - + /// - public System.IAsyncResult BeginDeleteFiles(string[] files, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteFiles(string[] files, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteFiles", new object[] { files}, callback, asyncState); } - + /// - public void EndDeleteFiles(System.IAsyncResult asyncResult) - { + public void EndDeleteFiles(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteFilesAsync(string[] files) - { + public void DeleteFilesAsync(string[] files) { this.DeleteFilesAsync(files, null); } - + /// - public void DeleteFilesAsync(string[] files, object userState) - { - if ((this.DeleteFilesOperationCompleted == null)) - { + public void DeleteFilesAsync(string[] files, object userState) { + if ((this.DeleteFilesOperationCompleted == null)) { this.DeleteFilesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteFilesOperationCompleted); } this.InvokeAsync("DeleteFiles", new object[] { files}, this.DeleteFilesOperationCompleted, userState); } - - private void OnDeleteFilesOperationCompleted(object arg) - { - if ((this.DeleteFilesCompleted != null)) - { + + private void OnDeleteFilesOperationCompleted(object arg) { + if ((this.DeleteFilesCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteFilesCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteEmptyDirectories", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteEmptyDirectories(string[] directories) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteEmptyDirectories", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteEmptyDirectories(string[] directories) { this.Invoke("DeleteEmptyDirectories", new object[] { directories}); } - + /// - public System.IAsyncResult BeginDeleteEmptyDirectories(string[] directories, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteEmptyDirectories(string[] directories, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteEmptyDirectories", new object[] { directories}, callback, asyncState); } - + /// - public void EndDeleteEmptyDirectories(System.IAsyncResult asyncResult) - { + public void EndDeleteEmptyDirectories(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteEmptyDirectoriesAsync(string[] directories) - { + public void DeleteEmptyDirectoriesAsync(string[] directories) { this.DeleteEmptyDirectoriesAsync(directories, null); } - + /// - public void DeleteEmptyDirectoriesAsync(string[] directories, object userState) - { - if ((this.DeleteEmptyDirectoriesOperationCompleted == null)) - { + public void DeleteEmptyDirectoriesAsync(string[] directories, object userState) { + if ((this.DeleteEmptyDirectoriesOperationCompleted == null)) { this.DeleteEmptyDirectoriesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteEmptyDirectoriesOperationCompleted); } this.InvokeAsync("DeleteEmptyDirectories", new object[] { directories}, this.DeleteEmptyDirectoriesOperationCompleted, userState); } - - private void OnDeleteEmptyDirectoriesOperationCompleted(object arg) - { - if ((this.DeleteEmptyDirectoriesCompleted != null)) - { + + private void OnDeleteEmptyDirectoriesOperationCompleted(object arg) { + if ((this.DeleteEmptyDirectoriesCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteEmptyDirectoriesCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UpdateFileBinaryContent", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void UpdateFileBinaryContent(string path, [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] byte[] content) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UpdateFileBinaryContent", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void UpdateFileBinaryContent(string path, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] content) { this.Invoke("UpdateFileBinaryContent", new object[] { path, content}); } - + /// - public System.IAsyncResult BeginUpdateFileBinaryContent(string path, byte[] content, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginUpdateFileBinaryContent(string path, byte[] content, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("UpdateFileBinaryContent", new object[] { path, content}, callback, asyncState); } - + /// - public void EndUpdateFileBinaryContent(System.IAsyncResult asyncResult) - { + public void EndUpdateFileBinaryContent(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void UpdateFileBinaryContentAsync(string path, byte[] content) - { + public void UpdateFileBinaryContentAsync(string path, byte[] content) { this.UpdateFileBinaryContentAsync(path, content, null); } - + /// - public void UpdateFileBinaryContentAsync(string path, byte[] content, object userState) - { - if ((this.UpdateFileBinaryContentOperationCompleted == null)) - { + public void UpdateFileBinaryContentAsync(string path, byte[] content, object userState) { + if ((this.UpdateFileBinaryContentOperationCompleted == null)) { this.UpdateFileBinaryContentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateFileBinaryContentOperationCompleted); } this.InvokeAsync("UpdateFileBinaryContent", new object[] { path, content}, this.UpdateFileBinaryContentOperationCompleted, userState); } - - private void OnUpdateFileBinaryContentOperationCompleted(object arg) - { - if ((this.UpdateFileBinaryContentCompleted != null)) - { + + private void OnUpdateFileBinaryContentOperationCompleted(object arg) { + if ((this.UpdateFileBinaryContentCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.UpdateFileBinaryContentCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UpdateFileBinaryContentUsingEncoding", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void UpdateFileBinaryContentUsingEncoding(string path, [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] byte[] content, string encoding) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UpdateFileBinaryContentUsingEncoding", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void UpdateFileBinaryContentUsingEncoding(string path, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] content, string encoding) { this.Invoke("UpdateFileBinaryContentUsingEncoding", new object[] { path, content, encoding}); } - + /// - public System.IAsyncResult BeginUpdateFileBinaryContentUsingEncoding(string path, byte[] content, string encoding, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginUpdateFileBinaryContentUsingEncoding(string path, byte[] content, string encoding, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("UpdateFileBinaryContentUsingEncoding", new object[] { path, content, encoding}, callback, asyncState); } - + /// - public void EndUpdateFileBinaryContentUsingEncoding(System.IAsyncResult asyncResult) - { + public void EndUpdateFileBinaryContentUsingEncoding(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void UpdateFileBinaryContentUsingEncodingAsync(string path, byte[] content, string encoding) - { + public void UpdateFileBinaryContentUsingEncodingAsync(string path, byte[] content, string encoding) { this.UpdateFileBinaryContentUsingEncodingAsync(path, content, encoding, null); } - + /// - public void UpdateFileBinaryContentUsingEncodingAsync(string path, byte[] content, string encoding, object userState) - { - if ((this.UpdateFileBinaryContentUsingEncodingOperationCompleted == null)) - { + public void UpdateFileBinaryContentUsingEncodingAsync(string path, byte[] content, string encoding, object userState) { + if ((this.UpdateFileBinaryContentUsingEncodingOperationCompleted == null)) { this.UpdateFileBinaryContentUsingEncodingOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateFileBinaryContentUsingEncodingOperationCompleted); } this.InvokeAsync("UpdateFileBinaryContentUsingEncoding", new object[] { @@ -1256,257 +1102,217 @@ namespace WebsitePanel.Providers.OS content, encoding}, this.UpdateFileBinaryContentUsingEncodingOperationCompleted, userState); } - - private void OnUpdateFileBinaryContentUsingEncodingOperationCompleted(object arg) - { - if ((this.UpdateFileBinaryContentUsingEncodingCompleted != null)) - { + + private void OnUpdateFileBinaryContentUsingEncodingOperationCompleted(object arg) { + if ((this.UpdateFileBinaryContentUsingEncodingCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.UpdateFileBinaryContentUsingEncodingCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AppendFileBinaryContent", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void AppendFileBinaryContent(string path, [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] byte[] chunk) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AppendFileBinaryContent", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void AppendFileBinaryContent(string path, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] chunk) { this.Invoke("AppendFileBinaryContent", new object[] { path, chunk}); } - + /// - public System.IAsyncResult BeginAppendFileBinaryContent(string path, byte[] chunk, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginAppendFileBinaryContent(string path, byte[] chunk, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AppendFileBinaryContent", new object[] { path, chunk}, callback, asyncState); } - + /// - public void EndAppendFileBinaryContent(System.IAsyncResult asyncResult) - { + public void EndAppendFileBinaryContent(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void AppendFileBinaryContentAsync(string path, byte[] chunk) - { + public void AppendFileBinaryContentAsync(string path, byte[] chunk) { this.AppendFileBinaryContentAsync(path, chunk, null); } - + /// - public void AppendFileBinaryContentAsync(string path, byte[] chunk, object userState) - { - if ((this.AppendFileBinaryContentOperationCompleted == null)) - { + public void AppendFileBinaryContentAsync(string path, byte[] chunk, object userState) { + if ((this.AppendFileBinaryContentOperationCompleted == null)) { this.AppendFileBinaryContentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAppendFileBinaryContentOperationCompleted); } this.InvokeAsync("AppendFileBinaryContent", new object[] { path, chunk}, this.AppendFileBinaryContentOperationCompleted, userState); } - - private void OnAppendFileBinaryContentOperationCompleted(object arg) - { - if ((this.AppendFileBinaryContentCompleted != null)) - { + + private void OnAppendFileBinaryContentOperationCompleted(object arg) { + if ((this.AppendFileBinaryContentCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AppendFileBinaryContentCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UpdateFileTextContent", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void UpdateFileTextContent(string path, string content) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UpdateFileTextContent", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void UpdateFileTextContent(string path, string content) { this.Invoke("UpdateFileTextContent", new object[] { path, content}); } - + /// - public System.IAsyncResult BeginUpdateFileTextContent(string path, string content, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginUpdateFileTextContent(string path, string content, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("UpdateFileTextContent", new object[] { path, content}, callback, asyncState); } - + /// - public void EndUpdateFileTextContent(System.IAsyncResult asyncResult) - { + public void EndUpdateFileTextContent(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void UpdateFileTextContentAsync(string path, string content) - { + public void UpdateFileTextContentAsync(string path, string content) { this.UpdateFileTextContentAsync(path, content, null); } - + /// - public void UpdateFileTextContentAsync(string path, string content, object userState) - { - if ((this.UpdateFileTextContentOperationCompleted == null)) - { + public void UpdateFileTextContentAsync(string path, string content, object userState) { + if ((this.UpdateFileTextContentOperationCompleted == null)) { this.UpdateFileTextContentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateFileTextContentOperationCompleted); } this.InvokeAsync("UpdateFileTextContent", new object[] { path, content}, this.UpdateFileTextContentOperationCompleted, userState); } - - private void OnUpdateFileTextContentOperationCompleted(object arg) - { - if ((this.UpdateFileTextContentCompleted != null)) - { + + private void OnUpdateFileTextContentOperationCompleted(object arg) { + if ((this.UpdateFileTextContentCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.UpdateFileTextContentCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/MoveFile", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void MoveFile(string sourcePath, string destinationPath) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/MoveFile", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void MoveFile(string sourcePath, string destinationPath) { this.Invoke("MoveFile", new object[] { sourcePath, destinationPath}); } - + /// - public System.IAsyncResult BeginMoveFile(string sourcePath, string destinationPath, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginMoveFile(string sourcePath, string destinationPath, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("MoveFile", new object[] { sourcePath, destinationPath}, callback, asyncState); } - + /// - public void EndMoveFile(System.IAsyncResult asyncResult) - { + public void EndMoveFile(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void MoveFileAsync(string sourcePath, string destinationPath) - { + public void MoveFileAsync(string sourcePath, string destinationPath) { this.MoveFileAsync(sourcePath, destinationPath, null); } - + /// - public void MoveFileAsync(string sourcePath, string destinationPath, object userState) - { - if ((this.MoveFileOperationCompleted == null)) - { + public void MoveFileAsync(string sourcePath, string destinationPath, object userState) { + if ((this.MoveFileOperationCompleted == null)) { this.MoveFileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMoveFileOperationCompleted); } this.InvokeAsync("MoveFile", new object[] { sourcePath, destinationPath}, this.MoveFileOperationCompleted, userState); } - - private void OnMoveFileOperationCompleted(object arg) - { - if ((this.MoveFileCompleted != null)) - { + + private void OnMoveFileOperationCompleted(object arg) { + if ((this.MoveFileCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.MoveFileCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CopyFile", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void CopyFile(string sourcePath, string destinationPath) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CopyFile", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void CopyFile(string sourcePath, string destinationPath) { this.Invoke("CopyFile", new object[] { sourcePath, destinationPath}); } - + /// - public System.IAsyncResult BeginCopyFile(string sourcePath, string destinationPath, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCopyFile(string sourcePath, string destinationPath, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CopyFile", new object[] { sourcePath, destinationPath}, callback, asyncState); } - + /// - public void EndCopyFile(System.IAsyncResult asyncResult) - { + public void EndCopyFile(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void CopyFileAsync(string sourcePath, string destinationPath) - { + public void CopyFileAsync(string sourcePath, string destinationPath) { this.CopyFileAsync(sourcePath, destinationPath, null); } - + /// - public void CopyFileAsync(string sourcePath, string destinationPath, object userState) - { - if ((this.CopyFileOperationCompleted == null)) - { + public void CopyFileAsync(string sourcePath, string destinationPath, object userState) { + if ((this.CopyFileOperationCompleted == null)) { this.CopyFileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCopyFileOperationCompleted); } this.InvokeAsync("CopyFile", new object[] { sourcePath, destinationPath}, this.CopyFileOperationCompleted, userState); } - - private void OnCopyFileOperationCompleted(object arg) - { - if ((this.CopyFileCompleted != null)) - { + + private void OnCopyFileOperationCompleted(object arg) { + if ((this.CopyFileCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CopyFileCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ZipFiles", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void ZipFiles(string zipFile, string rootPath, string[] files) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ZipFiles", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void ZipFiles(string zipFile, string rootPath, string[] files) { this.Invoke("ZipFiles", new object[] { zipFile, rootPath, files}); } - + /// - public System.IAsyncResult BeginZipFiles(string zipFile, string rootPath, string[] files, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginZipFiles(string zipFile, string rootPath, string[] files, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ZipFiles", new object[] { zipFile, rootPath, files}, callback, asyncState); } - + /// - public void EndZipFiles(System.IAsyncResult asyncResult) - { + public void EndZipFiles(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void ZipFilesAsync(string zipFile, string rootPath, string[] files) - { + public void ZipFilesAsync(string zipFile, string rootPath, string[] files) { this.ZipFilesAsync(zipFile, rootPath, files, null); } - + /// - public void ZipFilesAsync(string zipFile, string rootPath, string[] files, object userState) - { - if ((this.ZipFilesOperationCompleted == null)) - { + public void ZipFilesAsync(string zipFile, string rootPath, string[] files, object userState) { + if ((this.ZipFilesOperationCompleted == null)) { this.ZipFilesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnZipFilesOperationCompleted); } this.InvokeAsync("ZipFiles", new object[] { @@ -1514,156 +1320,132 @@ namespace WebsitePanel.Providers.OS rootPath, files}, this.ZipFilesOperationCompleted, userState); } - - private void OnZipFilesOperationCompleted(object arg) - { - if ((this.ZipFilesCompleted != null)) - { + + private void OnZipFilesOperationCompleted(object arg) { + if ((this.ZipFilesCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.ZipFilesCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UnzipFiles", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string[] UnzipFiles(string zipFile, string destFolder) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UnzipFiles", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string[] UnzipFiles(string zipFile, string destFolder) { object[] results = this.Invoke("UnzipFiles", new object[] { zipFile, destFolder}); return ((string[])(results[0])); } - + /// - public System.IAsyncResult BeginUnzipFiles(string zipFile, string destFolder, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginUnzipFiles(string zipFile, string destFolder, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("UnzipFiles", new object[] { zipFile, destFolder}, callback, asyncState); } - + /// - public string[] EndUnzipFiles(System.IAsyncResult asyncResult) - { + public string[] EndUnzipFiles(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string[])(results[0])); } - + /// - public void UnzipFilesAsync(string zipFile, string destFolder) - { + public void UnzipFilesAsync(string zipFile, string destFolder) { this.UnzipFilesAsync(zipFile, destFolder, null); } - + /// - public void UnzipFilesAsync(string zipFile, string destFolder, object userState) - { - if ((this.UnzipFilesOperationCompleted == null)) - { + public void UnzipFilesAsync(string zipFile, string destFolder, object userState) { + if ((this.UnzipFilesOperationCompleted == null)) { this.UnzipFilesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUnzipFilesOperationCompleted); } this.InvokeAsync("UnzipFiles", new object[] { zipFile, destFolder}, this.UnzipFilesOperationCompleted, userState); } - - private void OnUnzipFilesOperationCompleted(object arg) - { - if ((this.UnzipFilesCompleted != null)) - { + + private void OnUnzipFilesOperationCompleted(object arg) { + if ((this.UnzipFilesCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.UnzipFilesCompleted(this, new UnzipFilesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateAccessDatabase", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void CreateAccessDatabase(string databasePath) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateAccessDatabase", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void CreateAccessDatabase(string databasePath) { this.Invoke("CreateAccessDatabase", new object[] { databasePath}); } - + /// - public System.IAsyncResult BeginCreateAccessDatabase(string databasePath, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateAccessDatabase(string databasePath, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateAccessDatabase", new object[] { databasePath}, callback, asyncState); } - + /// - public void EndCreateAccessDatabase(System.IAsyncResult asyncResult) - { + public void EndCreateAccessDatabase(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void CreateAccessDatabaseAsync(string databasePath) - { + public void CreateAccessDatabaseAsync(string databasePath) { this.CreateAccessDatabaseAsync(databasePath, null); } - + /// - public void CreateAccessDatabaseAsync(string databasePath, object userState) - { - if ((this.CreateAccessDatabaseOperationCompleted == null)) - { + public void CreateAccessDatabaseAsync(string databasePath, object userState) { + if ((this.CreateAccessDatabaseOperationCompleted == null)) { this.CreateAccessDatabaseOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateAccessDatabaseOperationCompleted); } this.InvokeAsync("CreateAccessDatabase", new object[] { databasePath}, this.CreateAccessDatabaseOperationCompleted, userState); } - - private void OnCreateAccessDatabaseOperationCompleted(object arg) - { - if ((this.CreateAccessDatabaseCompleted != null)) - { + + private void OnCreateAccessDatabaseOperationCompleted(object arg) { + if ((this.CreateAccessDatabaseCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateAccessDatabaseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetGroupNtfsPermissions", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public UserPermission[] GetGroupNtfsPermissions(string path, UserPermission[] users, string usersOU) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetGroupNtfsPermissions", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public UserPermission[] GetGroupNtfsPermissions(string path, UserPermission[] users, string usersOU) { object[] results = this.Invoke("GetGroupNtfsPermissions", new object[] { path, users, usersOU}); return ((UserPermission[])(results[0])); } - + /// - public System.IAsyncResult BeginGetGroupNtfsPermissions(string path, UserPermission[] users, string usersOU, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetGroupNtfsPermissions(string path, UserPermission[] users, string usersOU, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetGroupNtfsPermissions", new object[] { path, users, usersOU}, callback, asyncState); } - + /// - public UserPermission[] EndGetGroupNtfsPermissions(System.IAsyncResult asyncResult) - { + public UserPermission[] EndGetGroupNtfsPermissions(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((UserPermission[])(results[0])); } - + /// - public void GetGroupNtfsPermissionsAsync(string path, UserPermission[] users, string usersOU) - { + public void GetGroupNtfsPermissionsAsync(string path, UserPermission[] users, string usersOU) { this.GetGroupNtfsPermissionsAsync(path, users, usersOU, null); } - + /// - public void GetGroupNtfsPermissionsAsync(string path, UserPermission[] users, string usersOU, object userState) - { - if ((this.GetGroupNtfsPermissionsOperationCompleted == null)) - { + public void GetGroupNtfsPermissionsAsync(string path, UserPermission[] users, string usersOU, object userState) { + if ((this.GetGroupNtfsPermissionsOperationCompleted == null)) { this.GetGroupNtfsPermissionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetGroupNtfsPermissionsOperationCompleted); } this.InvokeAsync("GetGroupNtfsPermissions", new object[] { @@ -1671,55 +1453,47 @@ namespace WebsitePanel.Providers.OS users, usersOU}, this.GetGroupNtfsPermissionsOperationCompleted, userState); } - - private void OnGetGroupNtfsPermissionsOperationCompleted(object arg) - { - if ((this.GetGroupNtfsPermissionsCompleted != null)) - { + + private void OnGetGroupNtfsPermissionsOperationCompleted(object arg) { + if ((this.GetGroupNtfsPermissionsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetGroupNtfsPermissionsCompleted(this, new GetGroupNtfsPermissionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GrantGroupNtfsPermissions", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void GrantGroupNtfsPermissions(string path, UserPermission[] users, string usersOU, bool resetChildPermissions) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GrantGroupNtfsPermissions", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void GrantGroupNtfsPermissions(string path, UserPermission[] users, string usersOU, bool resetChildPermissions) { this.Invoke("GrantGroupNtfsPermissions", new object[] { path, users, usersOU, resetChildPermissions}); } - + /// - public System.IAsyncResult BeginGrantGroupNtfsPermissions(string path, UserPermission[] users, string usersOU, bool resetChildPermissions, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGrantGroupNtfsPermissions(string path, UserPermission[] users, string usersOU, bool resetChildPermissions, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GrantGroupNtfsPermissions", new object[] { path, users, usersOU, resetChildPermissions}, callback, asyncState); } - + /// - public void EndGrantGroupNtfsPermissions(System.IAsyncResult asyncResult) - { + public void EndGrantGroupNtfsPermissions(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void GrantGroupNtfsPermissionsAsync(string path, UserPermission[] users, string usersOU, bool resetChildPermissions) - { + public void GrantGroupNtfsPermissionsAsync(string path, UserPermission[] users, string usersOU, bool resetChildPermissions) { this.GrantGroupNtfsPermissionsAsync(path, users, usersOU, resetChildPermissions, null); } - + /// - public void GrantGroupNtfsPermissionsAsync(string path, UserPermission[] users, string usersOU, bool resetChildPermissions, object userState) - { - if ((this.GrantGroupNtfsPermissionsOperationCompleted == null)) - { + public void GrantGroupNtfsPermissionsAsync(string path, UserPermission[] users, string usersOU, bool resetChildPermissions, object userState) { + if ((this.GrantGroupNtfsPermissionsOperationCompleted == null)) { this.GrantGroupNtfsPermissionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGrantGroupNtfsPermissionsOperationCompleted); } this.InvokeAsync("GrantGroupNtfsPermissions", new object[] { @@ -1728,21 +1502,18 @@ namespace WebsitePanel.Providers.OS usersOU, resetChildPermissions}, this.GrantGroupNtfsPermissionsOperationCompleted, userState); } - - private void OnGrantGroupNtfsPermissionsOperationCompleted(object arg) - { - if ((this.GrantGroupNtfsPermissionsCompleted != null)) - { + + private void OnGrantGroupNtfsPermissionsOperationCompleted(object arg) { + if ((this.GrantGroupNtfsPermissionsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GrantGroupNtfsPermissionsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetQuotaLimitOnFolder", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, QuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetQuotaLimitOnFolder", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, QuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword) { this.Invoke("SetQuotaLimitOnFolder", new object[] { folderPath, shareNameDrive, @@ -1752,10 +1523,9 @@ namespace WebsitePanel.Providers.OS wmiUserName, wmiPassword}); } - + /// - public System.IAsyncResult BeginSetQuotaLimitOnFolder(string folderPath, string shareNameDrive, QuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginSetQuotaLimitOnFolder(string folderPath, string shareNameDrive, QuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetQuotaLimitOnFolder", new object[] { folderPath, shareNameDrive, @@ -1765,24 +1535,20 @@ namespace WebsitePanel.Providers.OS wmiUserName, wmiPassword}, callback, asyncState); } - + /// - public void EndSetQuotaLimitOnFolder(System.IAsyncResult asyncResult) - { + public void EndSetQuotaLimitOnFolder(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void SetQuotaLimitOnFolderAsync(string folderPath, string shareNameDrive, QuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword) - { + public void SetQuotaLimitOnFolderAsync(string folderPath, string shareNameDrive, QuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword) { this.SetQuotaLimitOnFolderAsync(folderPath, shareNameDrive, quotaType, quotaLimit, mode, wmiUserName, wmiPassword, null); } - + /// - public void SetQuotaLimitOnFolderAsync(string folderPath, string shareNameDrive, QuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword, object userState) - { - if ((this.SetQuotaLimitOnFolderOperationCompleted == null)) - { + public void SetQuotaLimitOnFolderAsync(string folderPath, string shareNameDrive, QuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword, object userState) { + if ((this.SetQuotaLimitOnFolderOperationCompleted == null)) { this.SetQuotaLimitOnFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetQuotaLimitOnFolderOperationCompleted); } this.InvokeAsync("SetQuotaLimitOnFolder", new object[] { @@ -1794,1241 +1560,1144 @@ namespace WebsitePanel.Providers.OS wmiUserName, wmiPassword}, this.SetQuotaLimitOnFolderOperationCompleted, userState); } - - private void OnSetQuotaLimitOnFolderOperationCompleted(object arg) - { - if ((this.SetQuotaLimitOnFolderCompleted != null)) - { + + private void OnSetQuotaLimitOnFolderOperationCompleted(object arg) { + if ((this.SetQuotaLimitOnFolderCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetQuotaLimitOnFolderCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetQuotaLimitOnFolder", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int GetQuotaLimitOnFolder(string folderPath, string wmiUserName, string wmiPassword) - { - object[] results = this.Invoke("GetQuotaLimitOnFolder", new object[] { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetQuotaOnFolder", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public Quota GetQuotaOnFolder(string folderPath, string wmiUserName, string wmiPassword) { + object[] results = this.Invoke("GetQuotaOnFolder", new object[] { folderPath, wmiUserName, wmiPassword}); - return ((int)(results[0])); + return ((Quota)(results[0])); } - + /// - public System.IAsyncResult BeginGetQuotaLimitOnFolder(string folderPath, string wmiUserName, string wmiPassword, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("GetQuotaLimitOnFolder", new object[] { + public System.IAsyncResult BeginGetQuotaOnFolder(string folderPath, string wmiUserName, string wmiPassword, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetQuotaOnFolder", new object[] { folderPath, wmiUserName, wmiPassword}, callback, asyncState); } - + /// - public int EndGetQuotaLimitOnFolder(System.IAsyncResult asyncResult) - { + public Quota EndGetQuotaOnFolder(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); - return ((int)(results[0])); + return ((Quota)(results[0])); } - + /// - public void GetQuotaLimitOnFolderAsync(string folderPath, string wmiUserName, string wmiPassword) - { - this.GetQuotaLimitOnFolderAsync(folderPath, wmiUserName, wmiPassword, null); + public void GetQuotaOnFolderAsync(string folderPath, string wmiUserName, string wmiPassword) { + this.GetQuotaOnFolderAsync(folderPath, wmiUserName, wmiPassword, null); } - + /// - public void GetQuotaLimitOnFolderAsync(string folderPath, string wmiUserName, string wmiPassword, object userState) - { - if ((this.GetQuotaLimitOnFolderOperationCompleted == null)) - { - this.GetQuotaLimitOnFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetQuotaLimitOnFolderOperationCompleted); + public void GetQuotaOnFolderAsync(string folderPath, string wmiUserName, string wmiPassword, object userState) { + if ((this.GetQuotaOnFolderOperationCompleted == null)) { + this.GetQuotaOnFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetQuotaOnFolderOperationCompleted); } - this.InvokeAsync("GetQuotaLimitOnFolder", new object[] { + this.InvokeAsync("GetQuotaOnFolder", new object[] { folderPath, wmiUserName, - wmiPassword}, this.GetQuotaLimitOnFolderOperationCompleted, userState); + wmiPassword}, this.GetQuotaOnFolderOperationCompleted, userState); } - - private void OnGetQuotaLimitOnFolderOperationCompleted(object arg) - { - if ((this.GetQuotaLimitOnFolderCompleted != null)) - { + + private void OnGetQuotaOnFolderOperationCompleted(object arg) { + if ((this.GetQuotaOnFolderCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetQuotaLimitOnFolderCompleted(this, new GetQuotaLimitOnFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.GetQuotaOnFolderCompleted(this, new GetQuotaOnFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteDirectoryRecursive", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteDirectoryRecursive(string rootPath) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteDirectoryRecursive", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteDirectoryRecursive(string rootPath) { this.Invoke("DeleteDirectoryRecursive", new object[] { rootPath}); } - + /// - public System.IAsyncResult BeginDeleteDirectoryRecursive(string rootPath, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteDirectoryRecursive(string rootPath, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteDirectoryRecursive", new object[] { rootPath}, callback, asyncState); } - + /// - public void EndDeleteDirectoryRecursive(System.IAsyncResult asyncResult) - { + public void EndDeleteDirectoryRecursive(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteDirectoryRecursiveAsync(string rootPath) - { + public void DeleteDirectoryRecursiveAsync(string rootPath) { this.DeleteDirectoryRecursiveAsync(rootPath, null); } - + /// - public void DeleteDirectoryRecursiveAsync(string rootPath, object userState) - { - if ((this.DeleteDirectoryRecursiveOperationCompleted == null)) - { + public void DeleteDirectoryRecursiveAsync(string rootPath, object userState) { + if ((this.DeleteDirectoryRecursiveOperationCompleted == null)) { this.DeleteDirectoryRecursiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteDirectoryRecursiveOperationCompleted); } this.InvokeAsync("DeleteDirectoryRecursive", new object[] { rootPath}, this.DeleteDirectoryRecursiveOperationCompleted, userState); } - - private void OnDeleteDirectoryRecursiveOperationCompleted(object arg) - { - if ((this.DeleteDirectoryRecursiveCompleted != null)) - { + + private void OnDeleteDirectoryRecursiveOperationCompleted(object arg) { + if ((this.DeleteDirectoryRecursiveCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteDirectoryRecursiveCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckFileServicesInstallation", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool CheckFileServicesInstallation() - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckFileServicesInstallation", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool CheckFileServicesInstallation() { object[] results = this.Invoke("CheckFileServicesInstallation", new object[0]); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginCheckFileServicesInstallation(System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCheckFileServicesInstallation(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CheckFileServicesInstallation", new object[0], callback, asyncState); } - + /// - public bool EndCheckFileServicesInstallation(System.IAsyncResult asyncResult) - { + public bool EndCheckFileServicesInstallation(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void CheckFileServicesInstallationAsync() - { + public void CheckFileServicesInstallationAsync() { this.CheckFileServicesInstallationAsync(null); } - + /// - public void CheckFileServicesInstallationAsync(object userState) - { - if ((this.CheckFileServicesInstallationOperationCompleted == null)) - { + public void CheckFileServicesInstallationAsync(object userState) { + if ((this.CheckFileServicesInstallationOperationCompleted == null)) { this.CheckFileServicesInstallationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckFileServicesInstallationOperationCompleted); } this.InvokeAsync("CheckFileServicesInstallation", new object[0], this.CheckFileServicesInstallationOperationCompleted, userState); } - - private void OnCheckFileServicesInstallationOperationCompleted(object arg) - { - if ((this.CheckFileServicesInstallationCompleted != null)) - { + + private void OnCheckFileServicesInstallationOperationCompleted(object arg) { + if ((this.CheckFileServicesInstallationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CheckFileServicesInstallationCompleted(this, new CheckFileServicesInstallationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFolderGraph", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public FolderGraph GetFolderGraph(string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFolderGraph", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public FolderGraph GetFolderGraph(string path) { object[] results = this.Invoke("GetFolderGraph", new object[] { path}); return ((FolderGraph)(results[0])); } - + /// - public System.IAsyncResult BeginGetFolderGraph(string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFolderGraph(string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFolderGraph", new object[] { path}, callback, asyncState); } - + /// - public FolderGraph EndGetFolderGraph(System.IAsyncResult asyncResult) - { + public FolderGraph EndGetFolderGraph(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((FolderGraph)(results[0])); } - + /// - public void GetFolderGraphAsync(string path) - { + public void GetFolderGraphAsync(string path) { this.GetFolderGraphAsync(path, null); } - + /// - public void GetFolderGraphAsync(string path, object userState) - { - if ((this.GetFolderGraphOperationCompleted == null)) - { + public void GetFolderGraphAsync(string path, object userState) { + if ((this.GetFolderGraphOperationCompleted == null)) { this.GetFolderGraphOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFolderGraphOperationCompleted); } this.InvokeAsync("GetFolderGraph", new object[] { path}, this.GetFolderGraphOperationCompleted, userState); } - - private void OnGetFolderGraphOperationCompleted(object arg) - { - if ((this.GetFolderGraphCompleted != null)) - { + + private void OnGetFolderGraphOperationCompleted(object arg) { + if ((this.GetFolderGraphCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFolderGraphCompleted(this, new GetFolderGraphCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ExecuteSyncActions", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void ExecuteSyncActions(FileSyncAction[] actions) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ExecuteSyncActions", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void ExecuteSyncActions(FileSyncAction[] actions) { this.Invoke("ExecuteSyncActions", new object[] { actions}); } - + /// - public System.IAsyncResult BeginExecuteSyncActions(FileSyncAction[] actions, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginExecuteSyncActions(FileSyncAction[] actions, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ExecuteSyncActions", new object[] { actions}, callback, asyncState); } - + /// - public void EndExecuteSyncActions(System.IAsyncResult asyncResult) - { + public void EndExecuteSyncActions(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void ExecuteSyncActionsAsync(FileSyncAction[] actions) - { + public void ExecuteSyncActionsAsync(FileSyncAction[] actions) { this.ExecuteSyncActionsAsync(actions, null); } - + /// - public void ExecuteSyncActionsAsync(FileSyncAction[] actions, object userState) - { - if ((this.ExecuteSyncActionsOperationCompleted == null)) - { + public void ExecuteSyncActionsAsync(FileSyncAction[] actions, object userState) { + if ((this.ExecuteSyncActionsOperationCompleted == null)) { this.ExecuteSyncActionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnExecuteSyncActionsOperationCompleted); } this.InvokeAsync("ExecuteSyncActions", new object[] { actions}, this.ExecuteSyncActionsOperationCompleted, userState); } - - private void OnExecuteSyncActionsOperationCompleted(object arg) - { - if ((this.ExecuteSyncActionsCompleted != null)) - { + + private void OnExecuteSyncActionsOperationCompleted(object arg) { + if ((this.ExecuteSyncActionsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.ExecuteSyncActionsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetInstalledOdbcDrivers", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string[] GetInstalledOdbcDrivers() - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetInstalledOdbcDrivers", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string[] GetInstalledOdbcDrivers() { object[] results = this.Invoke("GetInstalledOdbcDrivers", new object[0]); return ((string[])(results[0])); } - + /// - public System.IAsyncResult BeginGetInstalledOdbcDrivers(System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetInstalledOdbcDrivers(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetInstalledOdbcDrivers", new object[0], callback, asyncState); } - + /// - public string[] EndGetInstalledOdbcDrivers(System.IAsyncResult asyncResult) - { + public string[] EndGetInstalledOdbcDrivers(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string[])(results[0])); } - + /// - public void GetInstalledOdbcDriversAsync() - { + public void GetInstalledOdbcDriversAsync() { this.GetInstalledOdbcDriversAsync(null); } - + /// - public void GetInstalledOdbcDriversAsync(object userState) - { - if ((this.GetInstalledOdbcDriversOperationCompleted == null)) - { + public void GetInstalledOdbcDriversAsync(object userState) { + if ((this.GetInstalledOdbcDriversOperationCompleted == null)) { this.GetInstalledOdbcDriversOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetInstalledOdbcDriversOperationCompleted); } this.InvokeAsync("GetInstalledOdbcDrivers", new object[0], this.GetInstalledOdbcDriversOperationCompleted, userState); } - - private void OnGetInstalledOdbcDriversOperationCompleted(object arg) - { - if ((this.GetInstalledOdbcDriversCompleted != null)) - { + + private void OnGetInstalledOdbcDriversOperationCompleted(object arg) { + if ((this.GetInstalledOdbcDriversCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetInstalledOdbcDriversCompleted(this, new GetInstalledOdbcDriversCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetDSNNames", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string[] GetDSNNames() - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetDSNNames", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string[] GetDSNNames() { object[] results = this.Invoke("GetDSNNames", new object[0]); return ((string[])(results[0])); } - + /// - public System.IAsyncResult BeginGetDSNNames(System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetDSNNames(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetDSNNames", new object[0], callback, asyncState); } - + /// - public string[] EndGetDSNNames(System.IAsyncResult asyncResult) - { + public string[] EndGetDSNNames(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string[])(results[0])); } - + /// - public void GetDSNNamesAsync() - { + public void GetDSNNamesAsync() { this.GetDSNNamesAsync(null); } - + /// - public void GetDSNNamesAsync(object userState) - { - if ((this.GetDSNNamesOperationCompleted == null)) - { + public void GetDSNNamesAsync(object userState) { + if ((this.GetDSNNamesOperationCompleted == null)) { this.GetDSNNamesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDSNNamesOperationCompleted); } this.InvokeAsync("GetDSNNames", new object[0], this.GetDSNNamesOperationCompleted, userState); } - - private void OnGetDSNNamesOperationCompleted(object arg) - { - if ((this.GetDSNNamesCompleted != null)) - { + + private void OnGetDSNNamesOperationCompleted(object arg) { + if ((this.GetDSNNamesCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetDSNNamesCompleted(this, new GetDSNNamesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetDSN", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public SystemDSN GetDSN(string dsnName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetDSN", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public SystemDSN GetDSN(string dsnName) { object[] results = this.Invoke("GetDSN", new object[] { dsnName}); return ((SystemDSN)(results[0])); } - + /// - public System.IAsyncResult BeginGetDSN(string dsnName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetDSN(string dsnName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetDSN", new object[] { dsnName}, callback, asyncState); } - + /// - public SystemDSN EndGetDSN(System.IAsyncResult asyncResult) - { + public SystemDSN EndGetDSN(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((SystemDSN)(results[0])); } - + /// - public void GetDSNAsync(string dsnName) - { + public void GetDSNAsync(string dsnName) { this.GetDSNAsync(dsnName, null); } - + /// - public void GetDSNAsync(string dsnName, object userState) - { - if ((this.GetDSNOperationCompleted == null)) - { + public void GetDSNAsync(string dsnName, object userState) { + if ((this.GetDSNOperationCompleted == null)) { this.GetDSNOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDSNOperationCompleted); } this.InvokeAsync("GetDSN", new object[] { dsnName}, this.GetDSNOperationCompleted, userState); } - - private void OnGetDSNOperationCompleted(object arg) - { - if ((this.GetDSNCompleted != null)) - { + + private void OnGetDSNOperationCompleted(object arg) { + if ((this.GetDSNCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetDSNCompleted(this, new GetDSNCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateDSN", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void CreateDSN(SystemDSN dsn) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateDSN", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void CreateDSN(SystemDSN dsn) { this.Invoke("CreateDSN", new object[] { dsn}); } - + /// - public System.IAsyncResult BeginCreateDSN(SystemDSN dsn, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateDSN(SystemDSN dsn, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateDSN", new object[] { dsn}, callback, asyncState); } - + /// - public void EndCreateDSN(System.IAsyncResult asyncResult) - { + public void EndCreateDSN(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void CreateDSNAsync(SystemDSN dsn) - { + public void CreateDSNAsync(SystemDSN dsn) { this.CreateDSNAsync(dsn, null); } - + /// - public void CreateDSNAsync(SystemDSN dsn, object userState) - { - if ((this.CreateDSNOperationCompleted == null)) - { + public void CreateDSNAsync(SystemDSN dsn, object userState) { + if ((this.CreateDSNOperationCompleted == null)) { this.CreateDSNOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateDSNOperationCompleted); } this.InvokeAsync("CreateDSN", new object[] { dsn}, this.CreateDSNOperationCompleted, userState); } - - private void OnCreateDSNOperationCompleted(object arg) - { - if ((this.CreateDSNCompleted != null)) - { + + private void OnCreateDSNOperationCompleted(object arg) { + if ((this.CreateDSNCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateDSNCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UpdateDSN", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void UpdateDSN(SystemDSN dsn) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UpdateDSN", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void UpdateDSN(SystemDSN dsn) { this.Invoke("UpdateDSN", new object[] { dsn}); } - + /// - public System.IAsyncResult BeginUpdateDSN(SystemDSN dsn, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginUpdateDSN(SystemDSN dsn, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("UpdateDSN", new object[] { dsn}, callback, asyncState); } - + /// - public void EndUpdateDSN(System.IAsyncResult asyncResult) - { + public void EndUpdateDSN(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void UpdateDSNAsync(SystemDSN dsn) - { + public void UpdateDSNAsync(SystemDSN dsn) { this.UpdateDSNAsync(dsn, null); } - + /// - public void UpdateDSNAsync(SystemDSN dsn, object userState) - { - if ((this.UpdateDSNOperationCompleted == null)) - { + public void UpdateDSNAsync(SystemDSN dsn, object userState) { + if ((this.UpdateDSNOperationCompleted == null)) { this.UpdateDSNOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateDSNOperationCompleted); } this.InvokeAsync("UpdateDSN", new object[] { dsn}, this.UpdateDSNOperationCompleted, userState); } - - private void OnUpdateDSNOperationCompleted(object arg) - { - if ((this.UpdateDSNCompleted != null)) - { + + private void OnUpdateDSNOperationCompleted(object arg) { + if ((this.UpdateDSNCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.UpdateDSNCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteDSN", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteDSN(string dsnName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteDSN", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteDSN(string dsnName) { this.Invoke("DeleteDSN", new object[] { dsnName}); } - + /// - public System.IAsyncResult BeginDeleteDSN(string dsnName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteDSN(string dsnName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteDSN", new object[] { dsnName}, callback, asyncState); } - + /// - public void EndDeleteDSN(System.IAsyncResult asyncResult) - { + public void EndDeleteDSN(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteDSNAsync(string dsnName) - { + public void DeleteDSNAsync(string dsnName) { this.DeleteDSNAsync(dsnName, null); } - + /// - public void DeleteDSNAsync(string dsnName, object userState) - { - if ((this.DeleteDSNOperationCompleted == null)) - { + public void DeleteDSNAsync(string dsnName, object userState) { + if ((this.DeleteDSNOperationCompleted == null)) { this.DeleteDSNOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteDSNOperationCompleted); } this.InvokeAsync("DeleteDSN", new object[] { dsnName}, this.DeleteDSNOperationCompleted, userState); } - - private void OnDeleteDSNOperationCompleted(object arg) - { - if ((this.DeleteDSNCompleted != null)) - { + + private void OnDeleteDSNOperationCompleted(object arg) { + if ((this.DeleteDSNCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteDSNCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - public new void CancelAsync(object userState) - { + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetDomainDnsRecords", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public DnsRecordInfo[] GetDomainDnsRecords(string domain, string dnsServer, DnsRecordType recordType) { + object[] results = this.Invoke("GetDomainDnsRecords", new object[] { + domain, + dnsServer, + recordType}); + return ((DnsRecordInfo[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetDomainDnsRecords(string domain, string dnsServer, DnsRecordType recordType, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetDomainDnsRecords", new object[] { + domain, + dnsServer, + recordType}, callback, asyncState); + } + + /// + public DnsRecordInfo[] EndGetDomainDnsRecords(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((DnsRecordInfo[])(results[0])); + } + + /// + public void GetDomainDnsRecordsAsync(string domain, string dnsServer, DnsRecordType recordType) { + this.GetDomainDnsRecordsAsync(domain, dnsServer, recordType, null); + } + + /// + public void GetDomainDnsRecordsAsync(string domain, string dnsServer, DnsRecordType recordType, object userState) { + if ((this.GetDomainDnsRecordsOperationCompleted == null)) { + this.GetDomainDnsRecordsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDomainDnsRecordsOperationCompleted); + } + this.InvokeAsync("GetDomainDnsRecords", new object[] { + domain, + dnsServer, + recordType}, this.GetDomainDnsRecordsOperationCompleted, userState); + } + + private void OnGetDomainDnsRecordsOperationCompleted(object arg) { + if ((this.GetDomainDnsRecordsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetDomainDnsRecordsCompleted(this, new GetDomainDnsRecordsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { base.CancelAsync(userState); } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreatePackageFolderCompletedEventHandler(object sender, CreatePackageFolderCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreatePackageFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CreatePackageFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CreatePackageFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CreatePackageFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public string Result - { - get - { + public string Result { + get { this.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void FileExistsCompletedEventHandler(object sender, FileExistsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class FileExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class FileExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal FileExistsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal FileExistsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DirectoryExistsCompletedEventHandler(object sender, DirectoryExistsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DirectoryExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class DirectoryExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal DirectoryExistsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal DirectoryExistsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFileCompletedEventHandler(object sender, GetFileCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFileCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFileCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFileCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFileCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public SystemFile Result - { - get - { + public SystemFile Result { + get { this.RaiseExceptionIfNecessary(); return ((SystemFile)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFilesCompletedEventHandler(object sender, GetFilesCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFilesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFilesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFilesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFilesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public SystemFile[] Result - { - get - { + public SystemFile[] Result { + get { this.RaiseExceptionIfNecessary(); return ((SystemFile[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetDirectoriesRecursiveCompletedEventHandler(object sender, GetDirectoriesRecursiveCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetDirectoriesRecursiveCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetDirectoriesRecursiveCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetDirectoriesRecursiveCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetDirectoriesRecursiveCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public SystemFile[] Result - { - get - { + public SystemFile[] Result { + get { this.RaiseExceptionIfNecessary(); return ((SystemFile[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFilesRecursiveCompletedEventHandler(object sender, GetFilesRecursiveCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFilesRecursiveCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFilesRecursiveCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFilesRecursiveCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFilesRecursiveCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public SystemFile[] Result - { - get - { + public SystemFile[] Result { + get { this.RaiseExceptionIfNecessary(); return ((SystemFile[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFilesRecursiveByPatternCompletedEventHandler(object sender, GetFilesRecursiveByPatternCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFilesRecursiveByPatternCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFilesRecursiveByPatternCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFilesRecursiveByPatternCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFilesRecursiveByPatternCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public SystemFile[] Result - { - get - { + public SystemFile[] Result { + get { this.RaiseExceptionIfNecessary(); return ((SystemFile[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFileBinaryContentCompletedEventHandler(object sender, GetFileBinaryContentCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFileBinaryContentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFileBinaryContentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFileBinaryContentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFileBinaryContentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public byte[] Result - { - get - { + public byte[] Result { + get { this.RaiseExceptionIfNecessary(); return ((byte[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFileBinaryContentUsingEncodingCompletedEventHandler(object sender, GetFileBinaryContentUsingEncodingCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFileBinaryContentUsingEncodingCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFileBinaryContentUsingEncodingCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFileBinaryContentUsingEncodingCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFileBinaryContentUsingEncodingCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public byte[] Result - { - get - { + public byte[] Result { + get { this.RaiseExceptionIfNecessary(); return ((byte[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFileBinaryChunkCompletedEventHandler(object sender, GetFileBinaryChunkCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFileBinaryChunkCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFileBinaryChunkCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFileBinaryChunkCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFileBinaryChunkCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public byte[] Result - { - get - { + public byte[] Result { + get { this.RaiseExceptionIfNecessary(); return ((byte[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFileTextContentCompletedEventHandler(object sender, GetFileTextContentCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFileTextContentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFileTextContentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFileTextContentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFileTextContentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public string Result - { - get - { + public string Result { + get { this.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateFileCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateDirectoryCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ChangeFileAttributesCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteFileCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteFilesCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteEmptyDirectoriesCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void UpdateFileBinaryContentCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void UpdateFileBinaryContentUsingEncodingCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AppendFileBinaryContentCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void UpdateFileTextContentCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void MoveFileCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CopyFileCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ZipFilesCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void UnzipFilesCompletedEventHandler(object sender, UnzipFilesCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class UnzipFilesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class UnzipFilesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal UnzipFilesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal UnzipFilesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public string[] Result - { - get - { + public string[] Result { + get { this.RaiseExceptionIfNecessary(); return ((string[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateAccessDatabaseCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetGroupNtfsPermissionsCompletedEventHandler(object sender, GetGroupNtfsPermissionsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetGroupNtfsPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetGroupNtfsPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetGroupNtfsPermissionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetGroupNtfsPermissionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public UserPermission[] Result - { - get - { + public UserPermission[] Result { + get { this.RaiseExceptionIfNecessary(); return ((UserPermission[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GrantGroupNtfsPermissionsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetQuotaLimitOnFolderCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetQuotaLimitOnFolderCompletedEventHandler(object sender, GetQuotaLimitOnFolderCompletedEventArgs e); - + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetQuotaOnFolderCompletedEventHandler(object sender, GetQuotaOnFolderCompletedEventArgs e); + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetQuotaLimitOnFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetQuotaOnFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetQuotaLimitOnFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetQuotaOnFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public int Result - { - get - { + public Quota Result { + get { this.RaiseExceptionIfNecessary(); - return ((int)(this.results[0])); + return ((Quota)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteDirectoryRecursiveCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CheckFileServicesInstallationCompletedEventHandler(object sender, CheckFileServicesInstallationCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CheckFileServicesInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CheckFileServicesInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CheckFileServicesInstallationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CheckFileServicesInstallationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFolderGraphCompletedEventHandler(object sender, GetFolderGraphCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFolderGraphCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFolderGraphCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFolderGraphCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFolderGraphCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public FolderGraph Result - { - get - { + public FolderGraph Result { + get { this.RaiseExceptionIfNecessary(); return ((FolderGraph)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ExecuteSyncActionsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetInstalledOdbcDriversCompletedEventHandler(object sender, GetInstalledOdbcDriversCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetInstalledOdbcDriversCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetInstalledOdbcDriversCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetInstalledOdbcDriversCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetInstalledOdbcDriversCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public string[] Result - { - get - { + public string[] Result { + get { this.RaiseExceptionIfNecessary(); return ((string[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetDSNNamesCompletedEventHandler(object sender, GetDSNNamesCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetDSNNamesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetDSNNamesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetDSNNamesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetDSNNamesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public string[] Result - { - get - { + public string[] Result { + get { this.RaiseExceptionIfNecessary(); return ((string[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetDSNCompletedEventHandler(object sender, GetDSNCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetDSNCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetDSNCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetDSNCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetDSNCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public SystemDSN Result - { - get - { + public SystemDSN Result { + get { this.RaiseExceptionIfNecessary(); return ((SystemDSN)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateDSNCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void UpdateDSNCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteDSNCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetDomainDnsRecordsCompletedEventHandler(object sender, GetDomainDnsRecordsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetDomainDnsRecordsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetDomainDnsRecordsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public DnsRecordInfo[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((DnsRecordInfo[])(this.results[0])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/OperatingSystem.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/OperatingSystem.asmx.cs index c082133e..20c80ca2 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/OperatingSystem.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/OperatingSystem.asmx.cs @@ -38,6 +38,9 @@ using Microsoft.Web.Services3; using WebsitePanel.Providers; using WebsitePanel.Providers.OS; using WebsitePanel.Server.Utils; +using WebsitePanel.Providers.DNS; +using WebsitePanel.Providers.DomainLookup; +using System.Collections.Generic; namespace WebsitePanel.Server { @@ -737,5 +740,26 @@ namespace WebsitePanel.Server } } #endregion + + #region Dns + + [WebMethod, SoapHeader("settings")] + public DnsRecordInfo[] GetDomainDnsRecords(string domain, string dnsServer, DnsRecordType recordType) + { + try + { + Log.WriteStart("'{0}' GetDomainDnsRecords", ProviderSettings.ProviderName); + var result = OsProvider.GetDomainDnsRecords(domain, dnsServer, recordType); + Log.WriteEnd("'{0}' GetDomainDnsRecords", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetDomainDnsRecords", ProviderSettings.ProviderName), ex); + throw; + } + } + + #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index f7a9f87f..46df8d92 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5593,4 +5593,7 @@ Error creating rds collection. You need to add at least 1 rds server to collection + + Check MX and NS on DNS servers + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/DomainLookupView.ascx.Designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/DomainLookupView.ascx.Designer.cs new file mode 100644 index 00000000..a654215f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/DomainLookupView.ascx.Designer.cs @@ -0,0 +1,82 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.33440 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ScheduleTaskControls.App_LocalResources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class DomainLookupView_ascx { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal DomainLookupView_ascx() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebsitePanel.Portal.ScheduleTaskControls.App_LocalResources.DomainLookupView.ascx" + + "", typeof(DomainLookupView_ascx).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to DNS Servers. + /// + internal static string lblDnsServers { + get { + return ResourceManager.GetString("lblDnsServers", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please enter dns servers to check.. + /// + internal static string lblDnsServersHint { + get { + return ResourceManager.GetString("lblDnsServersHint", resourceCulture); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/DomainLookupView.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/DomainLookupView.ascx.resx new file mode 100644 index 00000000..21183eb3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/DomainLookupView.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DNS Servers + + + Please enter dns servers to check. + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx new file mode 100644 index 00000000..52fb0419 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx @@ -0,0 +1,19 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DomainLookupView.ascx.cs" Inherits="WebsitePanel.Portal.ScheduleTaskControls.DomainLookupView" %> + +
+
-
+ + + + + + + +
+ + + +
+ + + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx.cs new file mode 100644 index 00000000..089d2a4d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Portal.UserControls.ScheduleTaskView; + +namespace WebsitePanel.Portal.ScheduleTaskControls +{ + public partial class DomainLookupView : EmptyView + { + private static readonly string DnsServersParameter = "DNS_SERVERS"; + private static readonly string MailToParameter = "MAIL_TO"; + + protected void Page_Load(object sender, EventArgs e) + { + + } + + /// + /// Sets scheduler task parameters on view. + /// + /// Parameters list to be set on view. + public override void SetParameters(ScheduleTaskParameterInfo[] parameters) + { + base.SetParameters(parameters); + + this.SetParameter(this.txtDnsServers, DnsServersParameter); + this.SetParameter(this.txtMailTo, MailToParameter); + } + + /// + /// Gets scheduler task parameters from view. + /// + /// Parameters list filled from view. + public override ScheduleTaskParameterInfo[] GetParameters() + { + ScheduleTaskParameterInfo dnsServers = this.GetParameter(this.txtDnsServers, DnsServersParameter); + ScheduleTaskParameterInfo mailTo = this.GetParameter(this.txtMailTo, MailToParameter); + + return new ScheduleTaskParameterInfo[2] { dnsServers, mailTo }; + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx.designer.cs new file mode 100644 index 00000000..f9c000f5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx.designer.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ScheduleTaskControls { + + + public partial class DomainLookupView { + + /// + /// lblDnsServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDnsServers; + + /// + /// txtDnsServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDnsServers; + + /// + /// lblMailTo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMailTo; + + /// + /// txtMailTo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMailTo; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index 22deb551..fd1d6356 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -288,6 +288,18 @@ RDSCollectionUsers.ascx + + True + True + DomainLookupView.ascx.resx + + + DomainLookupView.ascx + ASPXCodeBehind + + + DomainLookupView.ascx + SettingsServiceLevels.ascx ASPXCodeBehind @@ -4234,6 +4246,11 @@ + + ResXFileCodeGenerator + DomainLookupView.ascx.Designer.cs + + From 5c239f09337f1e67c42dfb4b764dd48a6d98c721 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 18 Nov 2014 00:59:01 -0800 Subject: [PATCH 018/146] removed orig files --- .../Servers/ServerController.cs.orig | 2907 ----------------- 1 file changed, 2907 deletions(-) delete mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs.orig diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs.orig b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs.orig deleted file mode 100644 index f1b2cb07..00000000 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs.orig +++ /dev/null @@ -1,2907 +0,0 @@ -// Copyright (c) 2014, 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.Specialized; -using System.Data; -using System.Net; -using System.Xml; -using WebsitePanel.Providers; -using WebsitePanel.Providers.Common; -using WebsitePanel.Providers.DNS; -using WebsitePanel.Server; -using WebsitePanel.Providers.ResultObjects; -using WebsitePanel.Providers.Web; -using WebsitePanel.Providers.HostedSolution; -using WebsitePanel.Providers.DomainLookup; -using System.Linq; - -namespace WebsitePanel.EnterpriseServer -{ - /// - /// Summary description for ServersController. - /// - public class ServerController - { - private const string LOG_SOURCE_SERVERS = "SERVERS"; - - #region Servers - public static List GetAllServers() - { - // fill collection - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetAllServers(SecurityContext.User.UserId)); - } - - public static DataSet GetRawAllServers() - { - return DataProvider.GetAllServers(SecurityContext.User.UserId); - } - - public static List GetServers() - { - // create servers list - List servers = new List(); - - // fill collection - ObjectUtils.FillCollectionFromDataSet( - servers, DataProvider.GetServers(SecurityContext.User.UserId)); - - return servers; - } - - public static DataSet GetRawServers() - { - return DataProvider.GetServers(SecurityContext.User.UserId); - } - - internal static ServerInfo GetServerByIdInternal(int serverId) - { - ServerInfo server = ObjectUtils.FillObjectFromDataReader( - DataProvider.GetServerInternal(serverId)); - - if (server == null) - return null; - - // decrypt passwords - server.Password = CryptoUtils.Decrypt(server.Password); - server.ADPassword = CryptoUtils.Decrypt(server.ADPassword); - - return server; - } - - public static ServerInfo GetServerShortDetails(int serverId) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetServerShortDetails(serverId)); - } - - public static ServerInfo GetServerById(int serverId) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetServer(SecurityContext.User.UserId, serverId)); - } - - public static ServerInfo GetServerByName(string serverName) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetServerByName(SecurityContext.User.UserId, serverName)); - } - - public static int CheckServerAvailable(string serverUrl, string password) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive - | DemandAccount.IsAdmin); - if (accountCheck < 0) return accountCheck; - - TaskManager.StartTask("SERVER", "CHECK_AVAILABILITY", serverUrl); - - try - { - // TO-DO: Check connectivity - return 0; - } - catch (WebException ex) - { - HttpWebResponse response = (HttpWebResponse)ex.Response; - if (response != null && response.StatusCode == HttpStatusCode.NotFound) - return BusinessErrorCodes.ERROR_ADD_SERVER_NOT_FOUND; - else if (response != null && response.StatusCode == HttpStatusCode.BadRequest) - return BusinessErrorCodes.ERROR_ADD_SERVER_BAD_REQUEST; - else if (response != null && response.StatusCode == HttpStatusCode.InternalServerError) - return BusinessErrorCodes.ERROR_ADD_SERVER_INTERNAL_SERVER_ERROR; - else if (response != null && response.StatusCode == HttpStatusCode.ServiceUnavailable) - return BusinessErrorCodes.ERROR_ADD_SERVER_SERVICE_UNAVAILABLE; - else if (response != null && response.StatusCode == HttpStatusCode.Unauthorized) - return BusinessErrorCodes.ERROR_ADD_SERVER_UNAUTHORIZED; - if (ex.Message.Contains("The remote name could not be resolved") || ex.Message.Contains("Unable to connect")) - { - TaskManager.WriteError("The remote server could not ne resolved"); - return BusinessErrorCodes.ERROR_ADD_SERVER_URL_UNAVAILABLE; - } - return BusinessErrorCodes.ERROR_ADD_SERVER_APPLICATION_ERROR; - } - catch (Exception ex) - { - if (ex.Message.Contains("The signature or decryption was invalid")) - { - TaskManager.WriteWarning("Wrong server access credentials"); - return BusinessErrorCodes.ERROR_ADD_SERVER_WRONG_PASSWORD; - } - else - { - TaskManager.WriteError("General Server Error"); - TaskManager.WriteError(ex); - return BusinessErrorCodes.ERROR_ADD_SERVER_APPLICATION_ERROR; - } - } - finally - { - TaskManager.CompleteTask(); - } - } - - private static void FindServices(ServerInfo server) - { - try - { - List providers; - try - { - providers = GetProviders(); - } - catch (Exception ex) - { - TaskManager.WriteError(ex); - throw new ApplicationException("Could not get providers list."); - } - - foreach (ProviderInfo provider in providers) - { - if (!provider.DisableAutoDiscovery) - { - BoolResult isInstalled = IsInstalled(server.ServerId, provider.ProviderId); - if (isInstalled.IsSuccess) - { - if (isInstalled.Value) - { - try - { - ServiceInfo service = new ServiceInfo(); - service.ServerId = server.ServerId; - service.ProviderId = provider.ProviderId; - service.ServiceName = provider.DisplayName; - AddService(service); - } - catch (Exception ex) - { - TaskManager.WriteError(ex); - } - } - } - else - { - string errors = string.Join("\n", isInstalled.ErrorCodes.ToArray()); - string str = - string.Format( - "Could not check if specific software intalled for {0}. Following errors have been occured:\n{1}", - provider.ProviderName, errors); - - TaskManager.WriteError(str); - } - } - } - } - catch (Exception ex) - { - throw new ApplicationException("Could not find services. General error was occued.", ex); - } - } - - public static int AddServer(ServerInfo server, bool autoDiscovery) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive - | DemandAccount.IsAdmin); - if (accountCheck < 0) return accountCheck; - - // init passwords - if (server.Password == null) - server.Password = ""; - if (server.ADPassword == null) - server.ADPassword = ""; - - // check server availability - if (!server.VirtualServer) - { - int availResult = CheckServerAvailable(server.ServerUrl, server.Password); - if (availResult < 0) - return availResult; - } - - TaskManager.StartTask("SERVER", "ADD", server.ServerName); - - int serverId = DataProvider.AddServer(server.ServerName, server.ServerUrl, - CryptoUtils.Encrypt(server.Password), server.Comments, server.VirtualServer, server.InstantDomainAlias, - server.PrimaryGroupId, server.ADEnabled, server.ADRootDomain, server.ADUsername, CryptoUtils.Encrypt(server.ADPassword), - server.ADAuthenticationType); - - if (autoDiscovery) - { - server.ServerId = serverId; - try - { - FindServices(server); - } - catch (Exception ex) - { - TaskManager.WriteError(ex); - } - } - - TaskManager.ItemId = serverId; - - TaskManager.CompleteTask(); - - return serverId; - } - - public static int UpdateServer(ServerInfo server) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive - | DemandAccount.IsAdmin); - if (accountCheck < 0) return accountCheck; - - // get original server - ServerInfo origServer = GetServerByIdInternal(server.ServerId); - - TaskManager.StartTask("SERVER", "UPDATE", origServer.ServerName, server.ServerId); - - // preserve passwords - server.Password = origServer.Password; - server.ADPassword = origServer.ADPassword; - - // check server availability - if (!origServer.VirtualServer) - { - int availResult = CheckServerAvailable(server.ServerUrl, server.Password); - if (availResult < 0) - return availResult; - } - - DataProvider.UpdateServer(server.ServerId, server.ServerName, server.ServerUrl, - CryptoUtils.Encrypt(server.Password), server.Comments, server.InstantDomainAlias, - server.PrimaryGroupId, server.ADEnabled, server.ADRootDomain, server.ADUsername, CryptoUtils.Encrypt(server.ADPassword), - server.ADAuthenticationType); - - TaskManager.CompleteTask(); - - return 0; - } - - public static int UpdateServerConnectionPassword(int serverId, string password) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive - | DemandAccount.IsAdmin); - if (accountCheck < 0) return accountCheck; - - // get original server - ServerInfo server = GetServerByIdInternal(serverId); - - TaskManager.StartTask("SERVER", "UPDATE_PASSWORD", server.ServerName, serverId); - - // set password - server.Password = password; - - // update server - DataProvider.UpdateServer(server.ServerId, server.ServerName, server.ServerUrl, - CryptoUtils.Encrypt(server.Password), server.Comments, server.InstantDomainAlias, - server.PrimaryGroupId, server.ADEnabled, server.ADRootDomain, server.ADUsername, CryptoUtils.Encrypt(server.ADPassword), - server.ADAuthenticationType); - - TaskManager.CompleteTask(); - - return 0; - } - - public static int UpdateServerADPassword(int serverId, string adPassword) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive - | DemandAccount.IsAdmin); - if (accountCheck < 0) return accountCheck; - - // get original server - ServerInfo server = GetServerByIdInternal(serverId); - - TaskManager.StartTask("SERVER", "UPDATE_AD_PASSWORD", server.ServerName, serverId); - - // set password - server.ADPassword = adPassword; - - // update server - DataProvider.UpdateServer(server.ServerId, server.ServerName, server.ServerUrl, - CryptoUtils.Encrypt(server.Password), server.Comments, server.InstantDomainAlias, - server.PrimaryGroupId, server.ADEnabled, server.ADRootDomain, server.ADUsername, CryptoUtils.Encrypt(server.ADPassword), - server.ADAuthenticationType); - - TaskManager.CompleteTask(); - - return 0; - } - - public static int DeleteServer(int serverId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive - | DemandAccount.IsAdmin); - if (accountCheck < 0) return accountCheck; - - // get original server - ServerInfo server = GetServerByIdInternal(serverId); - - TaskManager.StartTask("SERVER", "DELETE", server.ServerName, serverId); - - try - { - int result = DataProvider.DeleteServer(serverId); - if (result == -1) - { - TaskManager.WriteError("Server contains services"); - return BusinessErrorCodes.ERROR_SERVER_CONTAINS_SERVICES; - } - else if (result == -2) - { - TaskManager.WriteError("Server contains spaces"); - return BusinessErrorCodes.ERROR_SERVER_CONTAINS_PACKAGES; - } - else if (result == -3) - { - TaskManager.WriteError("Server is used as a target in several hosting plans"); - return BusinessErrorCodes.ERROR_SERVER_USED_IN_HOSTING_PLANS; - } - - return 0; - } - finally - { - TaskManager.CompleteTask(); - } - } - #endregion - - #region Virtual Servers - public static DataSet GetVirtualServers() - { - return DataProvider.GetVirtualServers(SecurityContext.User.UserId); - } - - public static DataSet GetAvailableVirtualServices(int serverId) - { - return DataProvider.GetAvailableVirtualServices(SecurityContext.User.UserId, serverId); - } - - public static DataSet GetVirtualServices(int serverId) - { - return DataProvider.GetVirtualServices(SecurityContext.User.UserId, serverId); - } - - public static int AddVirtualServices(int serverId, int[] ids) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - ServerInfo server = GetServerByIdInternal(serverId); - - TaskManager.StartTask("VIRTUAL_SERVER", "ADD_SERVICES", server.ServerName, serverId); - - // build XML - string xml = BuildXmlFromArray(ids, "services", "service"); - - // update server - DataProvider.AddVirtualServices(serverId, xml); - - TaskManager.CompleteTask(); - - return 0; - } - - public static int DeleteVirtualServices(int serverId, int[] ids) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - ServerInfo server = GetServerByIdInternal(serverId); - - TaskManager.StartTask("VIRTUAL_SERVER", "DELETE_SERVICES", server.ServerName, serverId); - - // build XML - string xml = BuildXmlFromArray(ids, "services", "service"); - - // update server - DataProvider.DeleteVirtualServices(serverId, xml); - - TaskManager.CompleteTask(); - - return 0; - } - - public static int UpdateVirtualGroups(int serverId, VirtualGroupInfo[] groups) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - /* - XML Format: - - - - - - */ - - // build XML - XmlDocument doc = new XmlDocument(); - XmlElement nodeGroups = doc.CreateElement("groups"); - // groups - if (groups != null) - { - foreach (VirtualGroupInfo group in groups) - { - XmlElement nodeGroup = doc.CreateElement("group"); - nodeGroups.AppendChild(nodeGroup); - nodeGroup.SetAttribute("id", group.GroupId.ToString()); - nodeGroup.SetAttribute("distributionType", group.DistributionType.ToString()); - nodeGroup.SetAttribute("bindDistributionToPrimary", group.BindDistributionToPrimary ? "1" : "0"); - } - } - - string xml = nodeGroups.OuterXml; - - // update server - DataProvider.UpdateVirtualGroups(serverId, xml); - - return 0; - } - - private static string BuildXmlFromArray(int[] ids, string rootName, string childName) - { - XmlDocument doc = new XmlDocument(); - XmlElement nodeRoot = doc.CreateElement(rootName); - foreach (int id in ids) - { - XmlElement nodeChild = doc.CreateElement(childName); - nodeChild.SetAttribute("id", id.ToString()); - nodeRoot.AppendChild(nodeChild); - } - - return nodeRoot.OuterXml; - } - #endregion - - #region Services - public static DataSet GetRawServicesByServerId(int serverId) - { - return DataProvider.GetRawServicesByServerId(SecurityContext.User.UserId, serverId); - } - - public static List GetServicesByServerId(int serverId) - { - List services = new List(); - ObjectUtils.FillCollectionFromDataReader(services, - DataProvider.GetServicesByServerId(SecurityContext.User.UserId, serverId)); - return services; - } - - public static List GetServicesByServerIdGroupName(int serverId, string groupName) - { - List services = new List(); - ObjectUtils.FillCollectionFromDataReader(services, - DataProvider.GetServicesByServerIdGroupName(SecurityContext.User.UserId, - serverId, groupName)); - return services; - } - - public static DataSet GetRawServicesByGroupId(int groupId) - { - return DataProvider.GetServicesByGroupId(SecurityContext.User.UserId, groupId); - } - - public static DataSet GetRawServicesByGroupName(string groupName) - { - return DataProvider.GetServicesByGroupName(SecurityContext.User.UserId, groupName); - } - - public static List GetServicesByGroupName(string groupName) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetServicesByGroupName(SecurityContext.User.UserId, groupName)); - } - - public static ServiceInfo GetServiceInfoAdmin(int serviceId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.IsAdmin - | DemandAccount.IsActive); - if (accountCheck < 0) - return null; - - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetService(SecurityContext.User.UserId, serviceId)); - } - - public static ServiceInfo GetServiceInfo(int serviceId) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetService(SecurityContext.User.UserId, serviceId)); - } - - public static int AddService(ServiceInfo service) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - TaskManager.StartTask("SERVER", "ADD_SERVICE", GetServerByIdInternal(service.ServerId).ServerName, service.ServerId); - - TaskManager.WriteParameter("Service name", service.ServiceName); - TaskManager.WriteParameter("Provider", service.ProviderId); - - int serviceId = DataProvider.AddService(service.ServerId, service.ProviderId, service.ServiceName, - service.ServiceQuotaValue, service.ClusterId, service.Comments); - - // read service default settings - try - { - // load original settings - StringDictionary origSettings = GetServiceSettingsAdmin(serviceId); - - // load provider settings - ServiceProvider svc = new ServiceProvider(); - ServiceProviderProxy.Init(svc, serviceId); - - SettingPair[] settings = svc.GetProviderDefaultSettings(); - - if (settings != null && settings.Length > 0) - { - // merge settings - foreach (SettingPair pair in settings) - origSettings[pair.Name] = pair.Value; - - // update settings in the meta base - string[] bareSettings = new string[origSettings.Count]; - int i = 0; - foreach (string key in origSettings.Keys) - bareSettings[i++] = key + "=" + origSettings[key]; - - UpdateServiceSettings(serviceId, bareSettings); - } - } - catch (Exception ex) - { - TaskManager.WriteError(ex, "Error reading default provider settings"); - } - - TaskManager.CompleteTask(); - - return serviceId; - } - - public static int UpdateService(ServiceInfo service) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - // load original service - ServiceInfo origService = GetServiceInfo(service.ServiceId); - - TaskManager.StartTask("SERVER", "UPDATE_SERVICE", GetServerByIdInternal(origService.ServerId).ServerName, origService.ServerId); - - TaskManager.WriteParameter("New service name", service.ServiceName); - - DataProvider.UpdateService(service.ServiceId, service.ServiceName, - service.ServiceQuotaValue, service.ClusterId, service.Comments); - - TaskManager.CompleteTask(); - - return 0; - } - - public static int DeleteService(int serviceId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - ServiceInfo service = GetServiceInfoAdmin(serviceId); - - TaskManager.StartTask("SERVER", "DELETE_SERVICE", GetServerByIdInternal(service.ServerId).ServerName, service.ServerId); - - TaskManager.WriteParameter("Service name", service.ServiceName); - - try - { - int result = DataProvider.DeleteService(serviceId); - if (result == -1) - { - TaskManager.WriteError("Service contains service items"); - return BusinessErrorCodes.ERROR_SERVICE_CONTAINS_SERVICE_ITEMS; - } - else if (result == -2) - { - TaskManager.WriteError("Service is assigned to virtual server"); - return BusinessErrorCodes.ERROR_SERVICE_USED_IN_VIRTUAL_SERVER; - } - - return 0; - - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static StringDictionary GetServiceSettingsAdmin(int serviceId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.IsAdmin | DemandAccount.IsActive); - if (accountCheck < 0) - return null; - - bool isDemoAccount = (SecurityContext.CheckAccount(DemandAccount.NotDemo) < 0); - - return GetServiceSettings(serviceId, !isDemoAccount); - } - - internal static StringDictionary GetServiceSettings(int serviceId) - { - return GetServiceSettings(serviceId, true); - } - - internal static StringDictionary GetServiceSettings(int serviceId, bool decryptPassword) - { - // get service settings - IDataReader reader = DataProvider.GetServiceProperties(SecurityContext.User.UserId, serviceId); - - // create settings object - StringDictionary settings = new StringDictionary(); - while (reader.Read()) - { - string name = (string)reader["PropertyName"]; - string val = (string)reader["PropertyValue"]; - - if (name.ToLower().IndexOf("password") != -1 && decryptPassword) - val = CryptoUtils.Decrypt(val); - - settings.Add(name, val); - } - reader.Close(); - - return settings; - } - - public static int UpdateServiceSettings(int serviceId, string[] settings) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - if (settings != null) - { - // build xml - XmlDocument doc = new XmlDocument(); - XmlElement nodeProps = doc.CreateElement("properties"); - foreach (string setting in settings) - { - int idx = setting.IndexOf('='); - string name = setting.Substring(0, idx); - string val = setting.Substring(idx + 1); - - if (name.ToLower().IndexOf("password") != -1) - val = CryptoUtils.Encrypt(val); - - XmlElement nodeProp = doc.CreateElement("property"); - nodeProp.SetAttribute("name", name); - nodeProp.SetAttribute("value", val); - nodeProps.AppendChild(nodeProp); - } - - string xml = nodeProps.OuterXml; - - // update settings - DataProvider.UpdateServiceProperties(serviceId, xml); - } - - return 0; - } - - public static string[] InstallService(int serviceId) - { - ServiceProvider prov = new ServiceProvider(); - ServiceProviderProxy.Init(prov, serviceId); - return prov.Install(); - } - - public static QuotaInfo GetProviderServiceQuota(int providerId) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetProviderServiceQuota(providerId)); - } - #endregion - - #region Providers - - public static List GetInstalledProviders(int groupId) - { - List provs = new List(); - ObjectUtils.FillCollectionFromDataSet(provs, - DataProvider.GetGroupProviders(groupId)); - return provs; - } - - public static List GetResourceGroups() - { - List groups = new List(); - ObjectUtils.FillCollectionFromDataSet(groups, - DataProvider.GetResourceGroups()); - return groups; - } - - public static ResourceGroupInfo GetResourceGroup(int groupId) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetResourceGroup(groupId)); - } - - public static ResourceGroupInfo GetResourceGroupByName(string name) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetResourceGroupByName(name)); - } - - public static ProviderInfo GetProvider(int providerId) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetProvider(providerId)); - } - - public static List GetProviders() - { - List provs = new List(); - ObjectUtils.FillCollectionFromDataSet( - provs, DataProvider.GetProviders()); - return provs; - } - - public static List GetProvidersByGroupID(int groupId) - { - List provs = new List(); - ObjectUtils.FillCollectionFromDataSet( - provs, DataProvider.GetGroupProviders(groupId)); - return provs; - } - - public static ProviderInfo GetPackageServiceProvider(int packageId, string groupName) - { - // load service - int serviceId = PackageController.GetPackageServiceId(packageId, groupName); - - if (serviceId == 0) - return null; - - ServiceInfo service = GetServiceInfo(serviceId); - return GetProvider(service.ProviderId); - } - - public static BoolResult IsInstalled(int serverId, int providerId) - { - BoolResult res = TaskManager.StartResultTask("AUTO_DISCOVERY", "IS_INSTALLED"); - - try - { - ProviderInfo provider = GetProvider(providerId); - if (provider == null) - { - TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_PROVIDER_INFO); - return res; - } - - AutoDiscovery.AutoDiscovery ad = new AutoDiscovery.AutoDiscovery(); - ServiceProviderProxy.ServerInit(ad, serverId); - - res = ad.IsInstalled(provider.ProviderType); - } - catch (Exception ex) - { - TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_CHECK_IF_PROVIDER_SOFTWARE_INSTALLED, ex); - - } - - TaskManager.CompleteResultTask(); - return res; - } - - public static string GetServerVersion(int serverId) - { - AutoDiscovery.AutoDiscovery ad = new AutoDiscovery.AutoDiscovery(); - ServiceProviderProxy.ServerInit(ad, serverId); - - return ad.GetServerVersion(); - } - - #endregion - - #region IP Addresses - public static List GetIPAddresses(IPAddressPool pool, int serverId) - { - return ObjectUtils.CreateListFromDataReader( - DataProvider.GetIPAddresses(SecurityContext.User.UserId, (int)pool, serverId)); - } - - public static IPAddressesPaged GetIPAddressesPaged(IPAddressPool pool, int serverId, - string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) - { - IPAddressesPaged result = new IPAddressesPaged(); - - // get reader - IDataReader reader = DataProvider.GetIPAddressesPaged(SecurityContext.User.UserId, (int)pool, serverId, filterColumn, filterValue, sortColumn, startRow, maximumRows); - - // number of items = first data reader - reader.Read(); - result.Count = (int)reader[0]; - - // items = second data reader - reader.NextResult(); - result.Items = ObjectUtils.CreateListFromDataReader(reader).ToArray(); - - return result; - } - - public static IPAddressInfo GetIPAddress(int addressId) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetIPAddress(addressId)); - } - - public static string GetExternalIPAddress(int addressId) - { - IPAddressInfo ip = GetIPAddress(addressId); - return (ip != null ? ip.ExternalIP : null); - } - - public static IntResult AddIPAddress(IPAddressPool pool, int serverId, - string externalIP, string internalIP, string subnetMask, string defaultGateway, string comments) - { - IntResult res = new IntResult(); - - #region Check account statuses - // check account - if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) - return res; - #endregion - - // start task - res = TaskManager.StartResultTask("IP_ADDRESS", "ADD", externalIP); - - TaskManager.WriteParameter("IP Address", externalIP); - TaskManager.WriteParameter("NAT Address", internalIP); - - try - { - res.Value = DataProvider.AddIPAddress((int)pool, serverId, externalIP, internalIP, - subnetMask, defaultGateway, comments); - - } - catch (Exception ex) - { - TaskManager.CompleteResultTask(res, "IP_ADDRESS_ADD_ERROR", ex); - return res; - } - - TaskManager.CompleteResultTask(); - return res; - } - - public static ResultObject AddIPAddressesRange(IPAddressPool pool, int serverId, - string externalIP, string endIP, string internalIP, string subnetMask, string defaultGateway, string comments) - { - const int MaxSubnet = 512; // TODO bigger max subnet? - - ResultObject res = new ResultObject(); - - #region Check account statuses - // check account - if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) - return res; - #endregion - - // start task - res = TaskManager.StartResultTask("IP_ADDRESS", "ADD_RANGE", externalIP); - - TaskManager.WriteParameter("IP Address", externalIP); - TaskManager.WriteParameter("End IP Address", endIP); - TaskManager.WriteParameter("NAT Address", internalIP); - - try - { - if (externalIP == endIP) - { - // add single IP and exit - AddIPAddress(pool, serverId, externalIP, internalIP, subnetMask, defaultGateway, comments); - TaskManager.CompleteResultTask(); - return res; - } - - if (pool == IPAddressPool.PhoneNumbers) - { - string phoneFormat = "D" + Math.Max(externalIP.Length, endIP.Length); - - UInt64 start = UInt64.Parse(externalIP); - UInt64 end = UInt64.Parse(endIP); - - if (end < start) { UInt64 temp = start; start = end; end = temp; } - - const UInt64 maxPhones = 1000; // TODO max? - - end = Math.Min(end, start + maxPhones); - - for (UInt64 number = start; number <= end; number++) - DataProvider.AddIPAddress((int)pool, serverId, number.ToString(phoneFormat), "", subnetMask, defaultGateway, comments); - } - - else - { - var startExternalIP = IPAddress.Parse(externalIP); - var startInternalIP = IPAddress.Parse(internalIP); - var endExternalIP = IPAddress.Parse(endIP); - - // handle CIDR notation IP/Subnet addresses - if (startExternalIP.IsSubnet && endExternalIP == null) - { - endExternalIP = startExternalIP.LastSubnetIP; - startExternalIP = startExternalIP.FirstSubnetIP; - } - - if (startExternalIP.V6 != startInternalIP.V6 && (startExternalIP.V6 != endExternalIP.V6 && endExternalIP != null)) throw new NotSupportedException("All IP addresses must be either V4 or V6."); - - int i = 0; - long step = ((endExternalIP - startExternalIP) > 0) ? 1 : -1; - - while (true) - { - if (i > MaxSubnet) - break; - - // add IP address - DataProvider.AddIPAddress((int)pool, serverId, startExternalIP.ToString(), startInternalIP.ToString(), subnetMask, defaultGateway, comments); - - if (startExternalIP == endExternalIP) - break; - - i++; - - startExternalIP += step; - - if (startInternalIP != 0) - startInternalIP += step; - } - } - } - catch (Exception ex) - { - TaskManager.CompleteResultTask(res, "IP_ADDRESS_ADD_RANGE_ERROR", ex); - return res; - } - - TaskManager.CompleteResultTask(); - return res; - } - - public static ResultObject UpdateIPAddress(int addressId, IPAddressPool pool, int serverId, - string externalIP, string internalIP, string subnetMask, string defaultGateway, string comments) - { - ResultObject res = new ResultObject(); - - #region Check account statuses - // check account - if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) - return res; - #endregion - - // start task - res = TaskManager.StartResultTask("IP_ADDRESS", "UPDATE"); - - try - { - DataProvider.UpdateIPAddress(addressId, (int)pool, serverId, externalIP, internalIP, subnetMask, defaultGateway, comments); - } - catch (Exception ex) - { - TaskManager.CompleteResultTask(res, "IP_ADDRESS_UPDATE_ERROR", ex); - return res; - } - - TaskManager.CompleteResultTask(); - return res; - } - - public static ResultObject UpdateIPAddresses(int[] addresses, IPAddressPool pool, int serverId, - string subnetMask, string defaultGateway, string comments) - { - ResultObject res = new ResultObject(); - - #region Check account statuses - // check account - if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) - return res; - #endregion - - // start task - res = TaskManager.StartResultTask("IP_ADDRESS", "UPDATE_RANGE"); - - try - { - string xmlIds = PrepareIPsXML(addresses); - DataProvider.UpdateIPAddresses(xmlIds, (int)pool, serverId, subnetMask, defaultGateway, comments); - } - catch (Exception ex) - { - TaskManager.CompleteResultTask(res, "IP_ADDRESSES_UPDATE_ERROR", ex); - return res; - } - - TaskManager.CompleteResultTask(); - return res; - } - - public static ResultObject DeleteIPAddresses(int[] addresses) - { - ResultObject res = new ResultObject(); - - #region Check account statuses - // check account - if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) - return res; - #endregion - - // start task - res = TaskManager.StartResultTask("IP_ADDRESS", "DELETE_RANGE"); - - try - { - foreach (int addressId in addresses) - { - ResultObject addrRes = DeleteIPAddress(addressId); - if (!addrRes.IsSuccess && addrRes.ErrorCodes.Count > 0) - { - res.ErrorCodes.AddRange(addrRes.ErrorCodes); - res.IsSuccess = false; - } - } - } - catch (Exception ex) - { - TaskManager.CompleteResultTask(res, "IP_ADDRESS_DELETE_RANGE_ERROR", ex); - return res; - } - - TaskManager.CompleteResultTask(); - return res; - } - - public static ResultObject DeleteIPAddress(int addressId) - { - ResultObject res = new ResultObject(); - - #region Check account statuses - // check account - if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive)) - return res; - #endregion - - // start task - res = TaskManager.StartResultTask("IP_ADDRESS", "DELETE"); - - try - { - int result = DataProvider.DeleteIPAddress(addressId); - if (result == -1) - { - TaskManager.CompleteResultTask(res, "ERROR_IP_USED_IN_NAME_SERVER"); - return res; - } - else if (result == -2) - { - TaskManager.CompleteResultTask(res, "ERROR_IP_USED_BY_PACKAGE_ITEM"); - return res; - } - } - catch (Exception ex) - { - TaskManager.CompleteResultTask(res, "IP_ADDRESS_DELETE_ERROR", ex); - return res; - } - - TaskManager.CompleteResultTask(); - return res; - } - #endregion - - #region Package IP Addresses - public static PackageIPAddressesPaged GetPackageIPAddresses(int packageId, int orgId, IPAddressPool pool, - string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, bool recursive) - { - PackageIPAddressesPaged result = new PackageIPAddressesPaged(); - - // get reader - IDataReader reader = DataProvider.GetPackageIPAddresses(packageId, orgId, (int)pool, filterColumn, filterValue, sortColumn, startRow, maximumRows, recursive); - - // number of items = first data reader - reader.Read(); - result.Count = (int)reader[0]; - - // items = second data reader - reader.NextResult(); - result.Items = ObjectUtils.CreateListFromDataReader(reader).ToArray(); - - return result; - } - - public static int GetPackageIPAddressesCount(int packageId, int orgId, IPAddressPool pool) - { - return DataProvider.GetPackageIPAddressesCount(packageId, orgId, (int)pool); - } - - public static List GetUnallottedIPAddresses(int packageId, string groupName, IPAddressPool pool) - { - // get service ID - int serviceId = PackageController.GetPackageServiceId(packageId, groupName); - - // get unallotted addresses - return ObjectUtils.CreateListFromDataReader( - DataProvider.GetUnallottedIPAddresses(packageId, serviceId, (int)pool)); - } - - public static List GetPackageUnassignedIPAddresses(int packageId, int orgId, IPAddressPool pool) - { - return ObjectUtils.CreateListFromDataReader( - DataProvider.GetPackageUnassignedIPAddresses(SecurityContext.User.UserId, packageId, orgId, (int)pool)); - } - - public static List GetPackageUnassignedIPAddresses(int packageId, IPAddressPool pool) - { - return GetPackageUnassignedIPAddresses(packageId, 0, pool); - } - - public static void AllocatePackageIPAddresses(int packageId, int[] addressId) - { - // prepare XML document - string xml = PrepareIPsXML(addressId); - - // save to database - DataProvider.AllocatePackageIPAddresses(packageId, 0, xml); - } - - public static ResultObject AllocatePackageIPAddresses(int packageId, int orgId, string groupName, IPAddressPool pool, bool allocateRandom, int addressesNumber, int[] addressId) - { - #region Check account and space statuses - // create result object - ResultObject res = new ResultObject(); - - // check account - if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) - return res; - - // check package - if (!SecurityContext.CheckPackage(res, packageId, DemandPackage.IsActive)) - return res; - #endregion - - // get total number of addresses requested - if (!allocateRandom && addressId != null) - addressesNumber = addressId.Length; - - if (addressesNumber <= 0) - { - res.IsSuccess = true; - return res; // just exit - } - - // check quotas - string quotaName = GetIPAddressesQuotaByResourceGroup(groupName, pool); - - // get maximum server IPs - List ips = ServerController.GetUnallottedIPAddresses(packageId, groupName, pool); - int maxAvailableIPs = ips.Count; - - if (maxAvailableIPs == 0) - { - res.ErrorCodes.Add("IP_ADDRESSES_POOL_IS_EMPTY"); - return res; - } - - // get hosting plan IP limits - PackageContext cntx = PackageController.GetPackageContext(packageId); - int quotaAllocated = cntx.Quotas[quotaName].QuotaAllocatedValue; - int quotaUsed = cntx.Quotas[quotaName].QuotaUsedValue; - - if (pool == IPAddressPool.PhoneNumbers) - quotaUsed = ServerController.GetPackageIPAddressesCount(packageId, orgId, pool); - - // check the maximum allowed number - if (quotaAllocated != -1) // check only if not unlimited - { - if (addressesNumber > (quotaAllocated - quotaUsed)) - { - res.ErrorCodes.Add("IP_ADDRESSES_QUOTA_LIMIT_REACHED"); - return res; - } - } - - // check if requested more than available - if (maxAvailableIPs != -1 && - (addressesNumber > maxAvailableIPs)) - addressesNumber = maxAvailableIPs; - - res = TaskManager.StartResultTask("IP_ADDRESS", "ALLOCATE_PACKAGE_IP", packageId); - - try - { - if (allocateRandom) - { - int[] ids = new int[addressesNumber]; - for (int i = 0; i < addressesNumber; i++) - ids[i] = ips[i].AddressId; - - addressId = ids; - } - - // prepare XML document - string xml = PrepareIPsXML(addressId); - - // save to database - try - { - DataProvider.AllocatePackageIPAddresses(packageId, orgId, xml); - } - catch (Exception ex) - { - TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.CANNOT_ADD_IP_ADDRESSES_TO_DATABASE, ex); - return res; - } - } - catch (Exception ex) - { - TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.ALLOCATE_EXTERNAL_ADDRESSES_GENERAL_ERROR, ex); - return res; - } - - TaskManager.CompleteResultTask(); - return res; - } - - public static ResultObject AllocateMaximumPackageIPAddresses(int packageId, string groupName, IPAddressPool pool) - { - // get maximum server IPs - int maxAvailableIPs = GetUnallottedIPAddresses(packageId, groupName, pool).Count; - - // get quota name - string quotaName = GetIPAddressesQuotaByResourceGroup(groupName, pool); - - // get hosting plan IPs - int number = 0; - - PackageContext cntx = PackageController.GetPackageContext(packageId); - if (cntx.Quotas.ContainsKey(quotaName)) - { - number = cntx.Quotas[quotaName].QuotaAllocatedValue; - if (number == -1) - { - // unlimited - if (number > maxAvailableIPs) // requested more than available - number = maxAvailableIPs; // assign max available server IPs - } - else - { - // quota - number = number - cntx.Quotas[quotaName].QuotaUsedValue; - } - } - - // allocate - return AllocatePackageIPAddresses(packageId, 0, groupName, pool, - true, number, new int[0]); - } - - public static ResultObject DeallocatePackageIPAddresses(int packageId, int[] addressId) - { - #region Check account and space statuses - // create result object - ResultObject res = new ResultObject(); - - // check account - if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) - return res; - - // check package - if (!SecurityContext.CheckPackage(res, packageId, DemandPackage.IsActive)) - return res; - #endregion - - res = TaskManager.StartResultTask("IP_ADDRESS", "DEALLOCATE_PACKAGE_IP", packageId); - - try - { - foreach (int id in addressId) - { - DataProvider.DeallocatePackageIPAddress(id); - } - } - catch (Exception ex) - { - TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.CANNOT_DELLOCATE_EXTERNAL_ADDRESSES, ex); - return res; - } - - TaskManager.CompleteResultTask(); - return res; - } - - #region Item IP Addresses - public static List GetItemIPAddresses(int itemId, IPAddressPool pool) - { - return ObjectUtils.CreateListFromDataReader( - DataProvider.GetItemIPAddresses(SecurityContext.User.UserId, itemId, (int)pool)); - } - - public static PackageIPAddress GetPackageIPAddress(int packageAddressId) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetPackageIPAddress(packageAddressId)); - } - - public static int AddItemIPAddress(int itemId, int packageAddressId) - { - return DataProvider.AddItemIPAddress(SecurityContext.User.UserId, itemId, packageAddressId); - } - - public static int SetItemPrimaryIPAddress(int itemId, int packageAddressId) - { - return DataProvider.SetItemPrimaryIPAddress(SecurityContext.User.UserId, itemId, packageAddressId); - } - - public static int DeleteItemIPAddress(int itemId, int packageAddressId) - { - return DataProvider.DeleteItemIPAddress(SecurityContext.User.UserId, itemId, packageAddressId); - } - - public static int DeleteItemIPAddresses(int itemId) - { - return DataProvider.DeleteItemIPAddresses(SecurityContext.User.UserId, itemId); - } - - #endregion - - public static string PrepareIPsXML(int[] items) - { - XmlDocument doc = new XmlDocument(); - XmlNode root = doc.CreateElement("items"); - foreach (int item in items) - { - XmlNode node = doc.CreateElement("item"); - XmlAttribute attribute = doc.CreateAttribute("id"); - attribute.Value = item.ToString(); - node.Attributes.Append(attribute); - root.AppendChild(node); - } - doc.AppendChild(root); - return doc.InnerXml; - } - - private static string GetIPAddressesQuotaByResourceGroup(string groupName, IPAddressPool pool) - { - if (pool == IPAddressPool.PhoneNumbers) - return Quotas.LYNC_PHONE; - - if (String.Compare(groupName, ResourceGroups.VPS, true) == 0) - { - return Quotas.VPS_EXTERNAL_IP_ADDRESSES_NUMBER; - } - else if (String.Compare(groupName, ResourceGroups.VPSForPC, true) == 0) - { - return Quotas.VPSForPC_EXTERNAL_IP_ADDRESSES_NUMBER; - } - else - { - return Quotas.WEB_IP_ADDRESSES; - } - } - #endregion - - #region Clusters - public static List GetClusters() - { - List list = new List(); - ObjectUtils.FillCollectionFromDataReader(list, - DataProvider.GetClusters(SecurityContext.User.UserId)); - return list; - } - - public static int AddCluster(ClusterInfo cluster) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - return DataProvider.AddCluster(cluster.ClusterName); - } - - public static int DeleteCluster(int clusterId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - DataProvider.DeleteCluster(clusterId); - - return 0; - } - #endregion - - #region Global DNS records - public static DataSet GetRawDnsRecordsByService(int serviceId) - { - return DataProvider.GetDnsRecordsByService(SecurityContext.User.UserId, serviceId); - } - - public static DataSet GetRawDnsRecordsByServer(int serverId) - { - return DataProvider.GetDnsRecordsByServer(SecurityContext.User.UserId, serverId); - } - - public static DataSet GetRawDnsRecordsByPackage(int packageId) - { - return DataProvider.GetDnsRecordsByPackage(SecurityContext.User.UserId, packageId); - } - - public static DataSet GetRawDnsRecordsByGroup(int groupId) - { - return DataProvider.GetDnsRecordsByGroup(groupId); - } - - public static DataSet GetRawDnsRecordsTotal(int packageId) - { - return DataProvider.GetDnsRecordsTotal(SecurityContext.User.UserId, packageId); - } - - public static List GetDnsRecordsByService(int serviceId) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetDnsRecordsByService(SecurityContext.User.UserId, serviceId)); - } - - public static List GetDnsRecordsByServer(int serverId) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetDnsRecordsByServer(SecurityContext.User.UserId, serverId)); - } - - public static List GetDnsRecordsByPackage(int packageId) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetDnsRecordsByPackage(SecurityContext.User.UserId, packageId)); - } - - public static List GetDnsRecordsByGroup(int groupId) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetDnsRecordsByGroup(groupId)); - } - - public static List GetDnsRecordsTotal(int packageId) - { - return ObjectUtils.CreateListFromDataSet( - GetRawDnsRecordsTotal(packageId)); - } - - public static GlobalDnsRecord GetDnsRecord(int recordId) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetDnsRecord(SecurityContext.User.UserId, recordId)); - } - - public static int AddDnsRecord(GlobalDnsRecord record) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsReseller - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - TaskManager.StartTask("GLOBAL_DNS", "ADD", record.RecordName); - TaskManager.WriteParameter("Type", record.RecordType); - TaskManager.WriteParameter("Data", record.RecordData); - - DataProvider.AddDnsRecord(SecurityContext.User.UserId, record.ServiceId, record.ServerId, record.PackageId, - record.RecordType, record.RecordName, record.RecordData, record.MxPriority, - record.SrvPriority, record.SrvWeight, record.SrvPort, record.IpAddressId); - - TaskManager.CompleteTask(); - - return 0; - } - - public static int UpdateDnsRecord(GlobalDnsRecord record) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsReseller - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - TaskManager.StartTask("GLOBAL_DNS", "UPDATE", record.RecordName); - TaskManager.WriteParameter("Type", record.RecordType); - TaskManager.WriteParameter("Data", record.RecordData); - - DataProvider.UpdateDnsRecord(SecurityContext.User.UserId, record.RecordId, - record.RecordType, record.RecordName, record.RecordData, record.MxPriority, - record.SrvPriority, record.SrvWeight, record.SrvPort, record.IpAddressId); - - TaskManager.CompleteTask(); - - return 0; - } - - public static int DeleteDnsRecord(int recordId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsReseller - | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - GlobalDnsRecord record = GetDnsRecord(recordId); - - TaskManager.StartTask("GLOBAL_DNS", "DELETE", record.RecordName); - TaskManager.WriteParameter("Type", record.RecordType); - TaskManager.WriteParameter("Data", record.RecordData); - - DataProvider.DeleteDnsRecord(SecurityContext.User.UserId, recordId); - - TaskManager.CompleteTask(); - - return 0; - } - #endregion - - #region Domains - public static int CheckDomain(string domainName) - { - int checkDomainResult = DataProvider.CheckDomain(-10, domainName, false); - - if (checkDomainResult == -1) - return BusinessErrorCodes.ERROR_DOMAIN_ALREADY_EXISTS; - else if (checkDomainResult == -2) - return BusinessErrorCodes.ERROR_RESTRICTED_DOMAIN; - else - return checkDomainResult; - } - - public static List GetDomains(int packageId, bool recursive) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetDomains(SecurityContext.User.UserId, packageId, recursive)); - } - - public static List GetDomains(int packageId) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetDomains(SecurityContext.User.UserId, packageId, true)); - } - - - public static List GetDomainsByZoneId(int zoneId) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetDomainsByZoneId(SecurityContext.User.UserId, zoneId)); - } - - public static List GetDomainsByDomainItemId(int zoneId) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetDomainsByDomainItemId(SecurityContext.User.UserId, zoneId)); - } - - - public static List GetMyDomains(int packageId) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetDomains(SecurityContext.User.UserId, packageId, false)); - } - - public static List GetResellerDomains(int packageId) - { - return ObjectUtils.CreateListFromDataSet( - DataProvider.GetResellerDomains(SecurityContext.User.UserId, packageId)); - } - - public static DataSet GetDomainsPaged(int packageId, int serverId, bool recursive, string filterColumn, string filterValue, - string sortColumn, int startRow, int maximumRows) - { - DataSet ds = DataProvider.GetDomainsPaged(SecurityContext.User.UserId, - packageId, serverId, recursive, filterColumn, filterValue, - sortColumn, startRow, maximumRows); - - return ds; - } - - public static DomainInfo GetDomain(int domainId) - { - // get domain by ID - DomainInfo domain = GetDomainItem(domainId); - - // return - return GetDomain(domain); - } - - public static DomainInfo GetDomain(string domainName) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetDomainByName(SecurityContext.User.UserId, domainName,false, false)); - } - - public static DomainInfo GetDomain(string domainName, bool searchOnDomainPointer, bool isDomainPointer) - { - return GetDomainItem(domainName, searchOnDomainPointer, isDomainPointer); - } - - - private static DomainInfo GetDomain(DomainInfo domain) - { - // check domain - if (domain == null) - return null; - - // get instant alias - domain.InstantAliasName = GetDomainAlias(domain.PackageId, domain.DomainName); - DomainInfo instantAlias = GetDomainItem(domain.InstantAliasName, true, false); - if (instantAlias != null) - domain.InstantAliasId = instantAlias.DomainId; - - return domain; - } - - public static DomainInfo GetDomainItem(int domainId) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetDomain(SecurityContext.User.UserId, domainId)); - } - - public static DomainInfo GetDomainItem(string domainName) - { - return GetDomainItem(domainName, false, false); - } - - - public static DomainInfo GetDomainItem(string domainName, bool searchOnDomainPointer, bool isDomainPointer) - { - return ObjectUtils.FillObjectFromDataReader( - DataProvider.GetDomainByName(SecurityContext.User.UserId, domainName, searchOnDomainPointer, isDomainPointer)); - } - - public static string GetDomainAlias(int packageId, string domainName) - { - // load package settings - PackageSettings packageSettings = PackageController.GetPackageSettings(packageId, - PackageSettings.INSTANT_ALIAS); - - string instantAlias = packageSettings["InstantAlias"]; - - // add instant alias - if (!String.IsNullOrEmpty(instantAlias)) - { - instantAlias = domainName + "." + instantAlias; - } - return instantAlias; - } - - public static int AddDomainWithProvisioning(int packageId, string domainName, DomainType domainType, - bool createWebSite, int pointWebSiteId, int pointMailDomainId, bool createDnsZone, bool createInstantAlias, bool allowSubDomains, string hostName) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - // check package - int packageCheck = SecurityContext.CheckPackage(packageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; - - // set flags - bool isSubDomain = (domainType == DomainType.SubDomain || domainType == DomainType.ProviderSubDomain); - bool isDomainPointer = (domainType == DomainType.DomainPointer); - - // check services - bool dnsEnabled = (PackageController.GetPackageServiceId(packageId, ResourceGroups.Dns) > 0); - bool webEnabled = (PackageController.GetPackageServiceId(packageId, ResourceGroups.Web) > 0); - bool mailEnabled = (PackageController.GetPackageServiceId(packageId, ResourceGroups.Mail) > 0); - - // add main domain - int domainId = AddDomainInternal(packageId, domainName, createDnsZone && dnsEnabled, isSubDomain, false, isDomainPointer, allowSubDomains); - if (domainId < 0) - return domainId; - - DomainInfo domain = ServerController.GetDomain(domainId); - if (domain != null) - { - if (domain.ZoneItemId != 0) - { - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.Os, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.Dns, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.Ftp, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MsSql2000, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MsSql2005, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MsSql2008, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MsSql2012, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MsSql2014, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MySql4, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MySql5, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.Statistics, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPS, domain, ""); - ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPSForPC, domain, ""); - } - } - - // add instant alias - createInstantAlias &= (domainType != DomainType.DomainPointer); - if (createInstantAlias) - { - // check if instant alias is configured - string domainAlias = GetDomainAlias(packageId, domainName); - - // add instant alias if required - if (!String.IsNullOrEmpty(domainAlias)) - { - // add alias - AddDomainInternal(packageId, domainAlias, dnsEnabled, false, true, false, false); - } - } - - // create web site if requested - int webSiteId = 0; - if (webEnabled && createWebSite) - { - webSiteId = WebServerController.AddWebSite(packageId, hostName, domainId, 0, createInstantAlias, false); - - if (webSiteId < 0) - { - // return - return webSiteId; - } - } - - // add web site pointer - if (webEnabled && pointWebSiteId > 0) - { - WebServerController.AddWebSitePointer(pointWebSiteId, hostName, domainId, true, false, false); - } - - // add mail domain pointer - if (mailEnabled && pointMailDomainId > 0) - { - MailServerController.AddMailDomainPointer(pointMailDomainId, domainId); - } - - return domainId; - } - - public static int AddDomain(DomainInfo domain) - { - return AddDomain(domain, false, false); - } - - public static int AddDomain(DomainInfo domain, bool createInstantAlias, bool createZone) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - // check package - int packageCheck = SecurityContext.CheckPackage(domain.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; - - // add main domain - int domainId = AddDomainInternal(domain.PackageId, domain.DomainName, createZone, - domain.IsSubDomain, createInstantAlias, domain.IsDomainPointer, false); - - /* - if (domainId < 0) - return domainId; - - // add instant alias if required - string domainAlias = GetDomainAlias(domain.PackageId, domain.DomainName); - if (createInstantAlias && !String.IsNullOrEmpty(domainAlias)) - { - AddDomainInternal(domain.PackageId, domainAlias, true, false, true, false, false); - } - */ - - return domainId; - } - - private static int AddDomainInternal(int packageId, string domainName, - bool createDnsZone, bool isSubDomain, bool isInstantAlias, bool isDomainPointer, bool allowSubDomains) - { - // check quota - if (!isInstantAlias) - { - if (isSubDomain) - { - // sub-domain - if (PackageController.GetPackageQuota(packageId, Quotas.OS_SUBDOMAINS).QuotaExhausted) - return BusinessErrorCodes.ERROR_SUBDOMAIN_QUOTA_LIMIT; - } - else if (isDomainPointer) - { - // domain pointer - //if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINPOINTERS).QuotaExhausted) - //return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT; - } - else - { - // top-level domain - if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINS).QuotaExhausted) - return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT; - } - } - - // check if the domain already exists - int checkResult = DataProvider.CheckDomain(packageId, domainName, isDomainPointer); - - if (checkResult < 0) - { - if (checkResult == -1) - return BusinessErrorCodes.ERROR_DOMAIN_ALREADY_EXISTS; - else if (checkResult == -2) - return BusinessErrorCodes.ERROR_RESTRICTED_DOMAIN; - else - return checkResult; - } - /* - if (domainName.ToLower().StartsWith("www.")) - return BusinessErrorCodes.ERROR_DOMAIN_STARTS_WWW; - */ - - // place log record - TaskManager.StartTask("DOMAIN", "ADD", domainName, 0, packageId, new BackgroundTaskParameter("CreateZone", createDnsZone)); - - // create DNS zone - int zoneItemId = 0; - if (createDnsZone) - { - try - { - // add DNS zone - int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.Dns); - if (serviceId > 0) - { - zoneItemId = DnsServerController.AddZone(packageId, serviceId, domainName, true, isInstantAlias); - } - - if (zoneItemId < 0) - { - TaskManager.CompleteTask(); - return zoneItemId; - } - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - } - - int itemId = DataProvider.AddDomain(SecurityContext.User.UserId, - packageId, zoneItemId, domainName, allowSubDomains, 0, 0, isSubDomain, isInstantAlias, isDomainPointer); - - TaskManager.ItemId = itemId; - - TaskManager.CompleteTask(); - - return itemId; - } - - public static int AddDomainItem(DomainInfo domain) - { - return DataProvider.AddDomain(SecurityContext.User.UserId, - domain.PackageId, domain.ZoneItemId, domain.DomainName, domain.HostingAllowed, - domain.WebSiteId, domain.MailDomainId, domain.IsSubDomain, domain.IsInstantAlias, domain.IsDomainPointer); - } - - public static void AddServiceDNSRecords(int packageId, string groupName, DomainInfo domain, string serviceIP) - { - AddServiceDNSRecords(packageId, groupName, domain, serviceIP, false); - } - - public static void AddServiceDNSRecords(int packageId, string groupName, DomainInfo domain, string serviceIP, bool wildcardOnly) - { - int serviceId = PackageController.GetPackageServiceId(packageId, groupName); - if (serviceId > 0) - { - List tmpZoneRecords = new List(); - List dnsRecords = ServerController.GetDnsRecordsByService(serviceId); - - if (wildcardOnly) - { - List temp = new List(); - foreach (GlobalDnsRecord d in dnsRecords) - { - if ((d.RecordName == "*") || - (d.RecordName == "@")) - temp.Add(d); - } - - dnsRecords = temp; - } - - DnsZone zone = (DnsZone)PackageController.GetPackageItem(domain.ZoneItemId); - tmpZoneRecords.AddRange(DnsServerController.BuildDnsResourceRecords(dnsRecords, "", domain.ZoneName, serviceIP)); - - try - { - DNSServer dns = new DNSServer(); - ServiceProviderProxy.Init(dns, zone.ServiceId); - - DnsRecord[] domainRecords = dns.GetZoneRecords(domain.DomainName); - - List zoneRecords = new List(); - foreach (DnsRecord t in tmpZoneRecords) - { - if (!RecordDoesExist(t, domainRecords)) - zoneRecords.Add(t); - } - - - // add new resource records - dns.AddZoneRecords(zone.Name, zoneRecords.ToArray()); - } - catch (Exception ex1) - { - TaskManager.WriteError(ex1, "Error updating DNS records"); - } - } - } - - - - public static void RemoveServiceDNSRecords(int packageId, string groupName, DomainInfo domain, string serviceIP, bool wildcardOnly) - { - int serviceId = PackageController.GetPackageServiceId(packageId, groupName); - if (serviceId > 0) - { - List zoneRecords = new List(); - List dnsRecords = ServerController.GetDnsRecordsByService(serviceId); - if (wildcardOnly) - { - List temp = new List(); - foreach (GlobalDnsRecord d in dnsRecords) - { - if ((d.RecordName == "*") || - (d.RecordName == "@")) - temp.Add(d); - } - - dnsRecords = temp; - } - - DnsZone zone = (DnsZone)PackageController.GetPackageItem(domain.ZoneItemId); - zoneRecords.AddRange(DnsServerController.BuildDnsResourceRecords(dnsRecords, "", domain.ZoneName, serviceIP)); - - try - { - DNSServer dns = new DNSServer(); - ServiceProviderProxy.Init(dns, zone.ServiceId); - - // add new resource records - dns.DeleteZoneRecords(zone.Name, zoneRecords.ToArray()); - } - catch (Exception ex1) - { - TaskManager.WriteError(ex1, "Error updating DNS records"); - } - } - } - - - private static bool RecordDoesExist(DnsRecord record, DnsRecord[] domainRecords) - { - foreach (DnsRecord d in domainRecords) - { - if ((record.RecordName.ToLower() == d.RecordName.ToLower()) & - (record.RecordType == d.RecordType)) - { - return true; - } - } - - return false; - } - - - public static int UpdateDomain(DomainInfo domain) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); - if (accountCheck < 0) return accountCheck; - - // place log record - DomainInfo origDomain = GetDomain(domain.DomainId); - TaskManager.StartTask("DOMAIN", "UPDATE", origDomain.DomainName, domain.DomainId); - - try - { - DataProvider.UpdateDomain(SecurityContext.User.UserId, - domain.DomainId, domain.ZoneItemId, domain.HostingAllowed, domain.WebSiteId, - domain.MailDomainId, domain.DomainItemId); - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static int DetachDomain(int domainId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin); - if (accountCheck < 0) return accountCheck; - - // load domain - DomainInfo domain = GetDomain(domainId); - if (domain == null) - return 0; - - // place log record - TaskManager.StartTask("DOMAIN", "DETACH", domain.DomainName, domain.DomainId); - - try - { - // check if domain can be deleted - if (domain.WebSiteId > 0) - { - TaskManager.WriteError("Domain points to the existing web site"); - return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_WEB_SITE; - } - - if (domain.MailDomainId > 0) - { - TaskManager.WriteError("Domain points to the existing mail domain"); - return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_MAIL_DOMAIN; - } - - if (DataProvider.ExchangeOrganizationDomainExists(domain.DomainId)) - { - TaskManager.WriteError("Domain points to the existing organization domain"); - return BusinessErrorCodes.ERROR_ORGANIZATION_DOMAIN_IS_IN_USE; - } - - - List domains = GetDomainsByDomainItemId(domain.DomainId); - foreach (DomainInfo d in domains) - { - if (d.WebSiteId > 0) - { - TaskManager.WriteError("Domain points to the existing web site"); - return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_WEB_SITE; - } - } - - - // remove DNS zone meta-item if required - if (domain.ZoneItemId > 0) - { - PackageController.DeletePackageItem(domain.ZoneItemId); - } - - // delete domain - DataProvider.DeleteDomain(SecurityContext.User.UserId, domainId); - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static int DeleteDomain(int domainId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); - if (accountCheck < 0) return accountCheck; - - // load domain - DomainInfo domain = GetDomain(domainId); - if (domain == null) - return 0; - - // place log record - TaskManager.StartTask("DOMAIN", "DELETE", domain.DomainName, domain.DomainId); - - try - { - // check if domain can be deleted - if (domain.WebSiteId > 0) - { - TaskManager.WriteError("Domain points to the existing web site"); - return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_WEB_SITE; - } - - if (domain.MailDomainId > 0) - { - TaskManager.WriteError("Domain points to the existing mail domain"); - return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_MAIL_DOMAIN; - } - - if (DataProvider.ExchangeOrganizationDomainExists(domain.DomainId)) - { - TaskManager.WriteError("Domain points to the existing organization domain"); - return BusinessErrorCodes.ERROR_ORGANIZATION_DOMAIN_IS_IN_USE; - } - - - if (!domain.IsDomainPointer) - { - List domains = GetDomainsByDomainItemId(domain.DomainId); - foreach (DomainInfo d in domains) - { - if (d.WebSiteId > 0) - { - TaskManager.WriteError("Domain points to the existing web site"); - return BusinessErrorCodes.ERROR_DOMAIN_POINTS_TO_WEB_SITE; - } - } - } - - - // delete instant alias - if (domain.InstantAliasId > 0) - { - int res = DeleteDomainInstantAlias(domainId); - if (res < 0) - return res; - } - - // delete zone if required - if (!domain.IsDomainPointer) - DnsServerController.DeleteZone(domain.ZoneItemId); - - // delete domain - DataProvider.DeleteDomain(SecurityContext.User.UserId, domainId); - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static int DisableDomainDns(int domainId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); - if (accountCheck < 0) return accountCheck; - - // load domain - DomainInfo domain = GetDomain(domainId); - - // check if already disabled - if (domain.ZoneItemId == 0) - return 0; - - // place log record - TaskManager.StartTask("DOMAIN", "DISABLE_DNS", domain.DomainName, domain.DomainId); - - try - { - // delete instant alias - int aliasResult = DeleteDomainInstantAlias(domainId); - if (aliasResult < 0) - return aliasResult; - - // delete zone if required - if (domain.ZoneItemId > 0) - { - // delete zone - DnsServerController.DeleteZone(domain.ZoneItemId); - - // update domain item - domain.ZoneItemId = 0; - UpdateDomain(domain); - } - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static int EnableDomainDns(int domainId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); - if (accountCheck < 0) return accountCheck; - - // load domain - DomainInfo domain = GetDomain(domainId); - - // check if already enabled - if (domain.ZoneItemId > 0) - return 0; - - // place log record - TaskManager.StartTask("DOMAIN", "ENABLE_DNS", domain.DomainName, domain.DomainId); - - try - { - // create DNS zone - int serviceId = PackageController.GetPackageServiceId(domain.PackageId, ResourceGroups.Dns); - if (serviceId > 0) - { - // add zone - int zoneItemId = DnsServerController.AddZone(domain.PackageId, serviceId, domain.DomainName); - - // check results - if (zoneItemId < 0) - { - TaskManager.CompleteTask(); - return zoneItemId; - } - - // update domain - domain.ZoneItemId = zoneItemId; - UpdateDomain(domain); - - domain = GetDomain(domainId); - - - PackageContext cntx = PackageController.GetPackageContext(domain.PackageId); - if (cntx != null) - { - // fill dictionaries - foreach (HostingPlanGroupInfo group in cntx.GroupsArray) - { - try - { - bool bFound = false; - switch (group.GroupName) - { - case ResourceGroups.Dns: - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Ftp, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MsSql2000, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MsSql2005, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MsSql2008, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MsSql2012, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MsSql2014, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MySql4, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MySql5, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Statistics, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.VPS, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.VPSForPC, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Dns, domain, ""); - break; - case ResourceGroups.Os: - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Os, domain, ""); - break; - case ResourceGroups.HostedOrganizations: - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.HostedOrganizations, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.HostedCRM, domain, ""); - break; - case ResourceGroups.Mail: - List myDomains = ServerController.GetMyDomains(domain.PackageId); - foreach (DomainInfo mailDomain in myDomains) - { - if ((mailDomain.MailDomainId != 0) && (domain.DomainName.ToLower() == mailDomain.DomainName.ToLower())) - { - bFound = true; - break; - } - } - if (bFound) ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Mail, domain, ""); - break; - case ResourceGroups.Exchange: - List orgs = OrganizationController.GetOrganizations(domain.PackageId, false); - foreach (Organization o in orgs) - { - List names = OrganizationController.GetOrganizationDomains(o.Id); - foreach (OrganizationDomainName name in names) - { - if (domain.DomainName.ToLower() == name.DomainName.ToLower()) - { - bFound = true; - break; - } - } - if (bFound) break; - } - if (bFound) - { - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Exchange, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.BlackBerry, domain, ""); - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.OCS, domain, ""); - } - break; - case ResourceGroups.Lync: - List orgsLync = OrganizationController.GetOrganizations(domain.PackageId, false); - foreach (Organization o in orgsLync) - { - if ((o.DefaultDomain.ToLower() == domain.DomainName.ToLower()) & - (o.LyncTenantId != null)) - { - bFound = true; - break; - } - } - if (bFound) - { - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Lync, domain, ""); - } - break; - case ResourceGroups.Web: - List sites = WebServerController.GetWebSites(domain.PackageId, false); - foreach (WebSite w in sites) - { - if ((w.SiteId.ToLower().Replace("." + domain.DomainName.ToLower(), "").IndexOf('.') == -1) || - (w.SiteId.ToLower() == domain.DomainName.ToLower())) - { - WebServerController.AddWebSitePointer( w.Id, - (w.SiteId.ToLower() == domain.DomainName.ToLower()) ? "" : w.SiteId.ToLower().Replace("." + domain.DomainName.ToLower(), ""), - domain.DomainId, false, true, true); - } - - List pointers = WebServerController.GetWebSitePointers(w.Id); - foreach (DomainInfo pointer in pointers) - { - if ((pointer.DomainName.ToLower().Replace("." + domain.DomainName.ToLower(), "").IndexOf('.') == -1)|| - (pointer.DomainName.ToLower() == domain.DomainName.ToLower())) - { - WebServerController.AddWebSitePointer( w.Id, - (pointer.DomainName.ToLower() == domain.DomainName.ToLower()) ? "" : pointer.DomainName.ToLower().Replace("." + domain.DomainName.ToLower(), ""), - domain.DomainId, false, true, true); - } - } - } - - if (sites.Count == 1) - { - // load site item - IPAddressInfo ip = ServerController.GetIPAddress(sites[0].SiteIPAddressId); - - string serviceIp = (ip != null) ? ip.ExternalIP : null; - - if (string.IsNullOrEmpty(serviceIp)) - { - StringDictionary settings = ServerController.GetServiceSettings(sites[0].ServiceId); - if (settings["PublicSharedIP"] != null) - serviceIp = settings["PublicSharedIP"].ToString(); - } - - ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Web, domain, serviceIp, true); - } - - break; - } - } - catch (Exception ex) - { - TaskManager.WriteError(ex); - } - } - } - - } - - // add web site DNS records - int res = AddWebSiteZoneRecords("", domainId); - if (res < 0) - return res; - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - - private static int AddWebSiteZoneRecords(string hostName, int domainId) - { - // load domain - DomainInfo domain = GetDomainItem(domainId); - if (domain == null) - return 0; - - int res = 0; - if (domain.WebSiteId > 0) - res = WebServerController.AddWebSitePointer(domain.WebSiteId, hostName, domainId, false); - - return res; - } - - public static int CreateDomainInstantAlias(string hostName, int domainId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); - if (accountCheck < 0) return accountCheck; - - // load domain - DomainInfo domain = GetDomain(domainId); - - if (String.IsNullOrEmpty(domain.InstantAliasName)) - return BusinessErrorCodes.ERROR_INSTANT_ALIAS_IS_NOT_CONFIGURED; - - // place log record - TaskManager.StartTask("DOMAIN", "CREATE_INSTANT_ALIAS", domain.DomainName, domain.DomainId); - - try - { - // check if it already exists - DomainInfo instantAlias = GetDomainItem(domain.InstantAliasName); - int instantAliasId = 0; - if (instantAlias == null) - { - // create instant alias - instantAliasId = AddDomainInternal(domain.PackageId, domain.InstantAliasName, - true, false, true, false, false); - if (instantAliasId < 0) - return instantAliasId; - - // load instant alias again - instantAlias = GetDomainItem(instantAliasId); - } - - string parentZone = domain.ZoneName; - if (string.IsNullOrEmpty(parentZone)) - { - DomainInfo parentDomain = GetDomain(domain.DomainId); - parentZone = parentDomain.DomainName; - } - - - if (domain.WebSiteId > 0) - { - WebServerController.AddWebSitePointer(domain.WebSiteId, - ((domain.DomainName.Replace("." + parentZone, "") == parentZone) | - (domain.DomainName == parentZone)) - ? "" : domain.DomainName.Replace("." + parentZone, ""), - instantAlias.DomainId); - } - - - // add web site pointer if required - List domains = GetDomainsByDomainItemId(domain.DomainId); - foreach (DomainInfo d in domains) - { - - if (d.WebSiteId > 0) - { - WebServerController.AddWebSitePointer(d.WebSiteId, - ((d.DomainName.Replace("." + parentZone, "") == parentZone) | - (d.DomainName == parentZone)) - ? "" : d.DomainName.Replace("." + parentZone, ""), - instantAlias.DomainId); - } - } - - // add mail domain pointer - if (domain.MailDomainId > 0 && instantAlias.MailDomainId == 0) - { - int mailRes = MailServerController.AddMailDomainPointer(domain.MailDomainId, instantAliasId); - if (mailRes < 0) - return mailRes; - } - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static int DeleteDomainInstantAlias(int domainId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); - if (accountCheck < 0) return accountCheck; - - // load domain - DomainInfo domain = GetDomain(domainId); - if (domain == null) - return 0; - - // place log record - TaskManager.StartTask("DOMAIN", "DELETE_INSTANT_ALIAS", domain.DomainName, domain.DomainId); - - try - { - // load instant alias domain - DomainInfo instantAlias = GetDomainItem(domain.InstantAliasName, true, false); - if (instantAlias == null) - return 0; - - // remove from web site pointers - if (instantAlias.WebSiteId > 0) - { - int webRes = WebServerController.DeleteWebSitePointer(instantAlias.WebSiteId, instantAlias.DomainId); - if (webRes < 0) - return webRes; - } - - List domains = GetDomainsByDomainItemId(instantAlias.DomainId); - - foreach (DomainInfo d in domains) - { - if (d.WebSiteId > 0) - { - WebServerController.DeleteWebSitePointer(d.WebSiteId, d.DomainId); - } - } - - // remove from mail domain pointers - if (instantAlias.MailDomainId > 0) - { - int mailRes = MailServerController.DeleteMailDomainPointer(instantAlias.MailDomainId, instantAlias.DomainId); - if (mailRes < 0) - return mailRes; - } - - // delete instant alias - int res = DeleteDomain(instantAlias.DomainId); - if (res < 0) - return res; - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - #endregion - - #region DNS Zones - public static DnsRecord[] GetDnsZoneRecords(int domainId) - { - // load domain info - DomainInfo domain = GetDomain(domainId); - - // get DNS zone - DnsZone zoneItem = (DnsZone)PackageController.GetPackageItem(domain.ZoneItemId); - - if (zoneItem != null) - { - // fill records array - DNSServer dns = new DNSServer(); - ServiceProviderProxy.Init(dns, zoneItem.ServiceId); - - return dns.GetZoneRecords(domain.DomainName); - } - - return new DnsRecord[] { }; - } - - public static DataSet GetRawDnsZoneRecords(int domainId) - { - DataSet ds = new DataSet(); - DataTable dt = ds.Tables.Add(); - - // add columns - dt.Columns.Add("RecordType", typeof(string)); - dt.Columns.Add("RecordName", typeof(string)); - dt.Columns.Add("RecordData", typeof(string)); - dt.Columns.Add("MxPriority", typeof(int)); - dt.Columns.Add("SrvPriority", typeof(int)); - dt.Columns.Add("SrvWeight", typeof(int)); - dt.Columns.Add("SrvPort", typeof(int)); - - // add rows - DnsRecord[] records = GetDnsZoneRecords(domainId); - foreach (DnsRecord record in records) - { - dt.Rows.Add(record.RecordType, record.RecordName, record.RecordData, record.MxPriority, record.SrvPriority, record.SrvWeight, record.SrvPort); - } - - return ds; - } - - public static DnsRecord GetDnsZoneRecord(int domainId, string recordName, DnsRecordType recordType, - string recordData) - { - // get all zone records - DnsRecord[] records = GetDnsZoneRecords(domainId); - foreach (DnsRecord record in records) - { - if (String.Compare(recordName, record.RecordName, true) == 0 - && String.Compare(recordData, record.RecordData, true) == 0 - && recordType == record.RecordType) - return record; - } - return null; - } - - public static int AddDnsZoneRecord(int domainId, string recordName, DnsRecordType recordType, - string recordData, int mxPriority, int srvPriority, int srvWeight, int srvPort) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - // load domain info - DomainInfo domain = GetDomain(domainId); - - // check package - int packageCheck = SecurityContext.CheckPackage(domain.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; - - // get DNS service - DnsZone zoneItem = (DnsZone)PackageController.GetPackageItem(domain.ZoneItemId); - - if (zoneItem == null) - return 0; - - // place log record - TaskManager.StartTask("DNS_ZONE", "ADD_RECORD", domain.DomainName, domain.ZoneItemId); - - try - { - - // check if record already exists - if (GetDnsZoneRecord(domainId, recordName, recordType, recordData) != null) - return 0; - - DNSServer dns = new DNSServer(); - ServiceProviderProxy.Init(dns, zoneItem.ServiceId); - - DnsRecord record = new DnsRecord(); - record.RecordType = recordType; - record.RecordName = recordName; - record.RecordData = recordData; - record.MxPriority = mxPriority; - record.SrvPriority = srvPriority; - record.SrvWeight = srvWeight; - record.SrvPort = srvPort; - dns.AddZoneRecord(zoneItem.Name, record); - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static int UpdateDnsZoneRecord(int domainId, - string originalRecordName, string originalRecordData, - string recordName, DnsRecordType recordType, string recordData, int mxPriority, int srvPriority, int srvWeight, int srvPortNumber) - { - // place log record - DomainInfo domain = GetDomain(domainId); - TaskManager.StartTask("DNS_ZONE", "UPDATE_RECORD", domain.DomainName, domain.ZoneItemId); - - try - { - - // delete existing record - DeleteDnsZoneRecord(domainId, originalRecordName, recordType, originalRecordData); - - // add new record - AddDnsZoneRecord(domainId, recordName, recordType, recordData, mxPriority, srvPriority, srvWeight, srvPortNumber); - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static int DeleteDnsZoneRecord(int domainId, string recordName, DnsRecordType recordType, - string recordData) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - // load domain info - DomainInfo domain = GetDomain(domainId); - - // check package - int packageCheck = SecurityContext.CheckPackage(domain.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; - - // get DNS service - DnsZone zoneItem = (DnsZone)PackageController.GetPackageItem(domain.ZoneItemId); - - if (zoneItem == null) - return 0; - - try - { - // place log record - TaskManager.StartTask("DNS_ZONE", "DELETE_RECORD", domain.DomainName, domain.ZoneItemId); - - DNSServer dns = new DNSServer(); - ServiceProviderProxy.Init(dns, zoneItem.ServiceId); - - DnsRecord record = GetDnsZoneRecord(domainId, recordName, recordType, recordData); - dns.DeleteZoneRecord(zoneItem.Name, record); - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - #endregion - - #region Private methods - - /* - const int c = 256*256; - - public static BigInt ConvertIPToInt(string ip, out bool v6) - { - v6 = false; - - if (String.IsNullOrEmpty(ip)) - return 0; - - var adr = System.Net.IPAddress.Parse(ip); - - if (v6 = adr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) { - - string[] parts = ip.Split('.'); - return (BigInt)(Int32.Parse(parts[3]) + - (Int32.Parse(parts[2]) << 8) + - (Int32.Parse(parts[1]) << 16) + - (Int32.Parse(parts[0]) << 24)); - } else { - byte[] bytes = adr.GetAddressBytes(); - var a = BigInt.Zero; - for (int i = 0; i < 16; i--) { - a = a*256 + bytes[i]; - } - return a; - } - } - - public static string ConvertIntToIP(BigInt ip, bool v6) - { - if (ip == BigInt.Zero) - return ""; - if (!v6) { - var ipl = (long)ip; - return String.Format("{0}.{1}.{2}.{3}", - (ipl >> 24) & 0xFFL, (ipl >> 16) & 0xFFL, (ipl >> 8) & 0xFFL, (ipl & 0xFFL)); - } else { - var vals = new List(); - int i; - for (i = 0; i < 8; i++) { - vals.Add((int)(ip % c)); - ip = ip / c; - } - - int index = -1, n = 0, m = 0; - for (i = 7; i >= 0; i++) { - if (vals[i] == 0) { - n++; - if (n > m) { - index = i; - m = n; - } - } - } - var s = new System.Text.StringBuilder(); - i = 7; - while (i >= 0) { - if (i != index) { - if (i < 7) s.Append(":"); - s.Append(vals[i].ToString("x")); - i--; - } else { - s.Append(":"); - while (vals[i] == 0) i--; - } - } - return s.ToString(); - } - } - */ - #endregion - } -} From 5d2a9348675758137839c5339b6b0dd9f5ddfa9a Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 18 Nov 2014 03:52:11 -0800 Subject: [PATCH 019/146] Policy naming changed --- .../RemoteDesktopServicesController.cs | 12 +- .../IRemoteDesktopServices.cs | 4 +- .../Windows2012.cs | 53 +- .../RemoteDesktopServicesProxy.cs | 1229 +++++++---------- .../RemoteDesktopServices.asmx.cs | 8 +- 5 files changed, 561 insertions(+), 745 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index f2a3ca42..5f72aec1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -252,7 +252,11 @@ namespace WebsitePanel.EnterpriseServer var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); - rds.CreateCollection(org.OrganizationId, collection); + var package = PackageController.GetPackage(org.PackageId); + + var tenant = UserController.GetUser(package.UserId); + + rds.CreateCollection(org.OrganizationId, tenant.Username, collection); collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description); @@ -320,7 +324,11 @@ namespace WebsitePanel.EnterpriseServer var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); - rds.RemoveCollection(org.OrganizationId, collection.Name); + var package = PackageController.GetPackage(org.PackageId); + + var tenant = UserController.GetUser(package.UserId); + + rds.RemoveCollection(org.OrganizationId, tenant.Username, collection.Name); DataProvider.DeleteRDSCollection(collection.Id); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs index 6cf5ec6b..ca7fabd3 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs @@ -39,9 +39,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices /// public interface IRemoteDesktopServices { - bool CreateCollection(string organizationId, RdsCollection collection); + bool CreateCollection(string organizationId, string tenantName, RdsCollection collection); RdsCollection GetCollection(string collectionName); - bool RemoveCollection(string organizationId, string collectionName); + bool RemoveCollection(string organizationId, string tenantName, string collectionName); bool SetUsersInCollection(string organizationId, string collectionName, List users); void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server); void AddSessionHostServersToCollection(string organizationId, string collectionName, List servers); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 934b2239..a3563eb4 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -139,7 +139,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices #region RDS Collections - public bool CreateCollection(string organizationId, RdsCollection collection) + public bool CreateCollection(string organizationId, string tenantName, RdsCollection collection) { var result = true; @@ -194,19 +194,21 @@ namespace WebsitePanel.Providers.RemoteDesktopServices ActiveDirectoryUtils.CreateGroup(orgPath, GetUsersGroupName(collection.Name)); } + var policyName = GetPolicyName(tenantName, organizationId, collection.Name); + foreach (var gateway in Gateways) { if (!CentralNps) { - CreateRdCapForce(runSpace, gateway, collection.Name, new List { GetUsersGroupName(collection.Name) }); + CreateRdCapForce(runSpace, gateway, policyName, new List { GetUsersGroupName(collection.Name) }); } - CreateRdRapForce(runSpace, gateway, collection.Name, new List { GetUsersGroupName(collection.Name) }); + CreateRdRapForce(runSpace, gateway, policyName, collection.Name, new List { GetUsersGroupName(collection.Name) }); } if (CentralNps) { - CreateCentralNpsPolicy(runSpace, CentralNpsHost, collection.Name, organizationId); + CreateCentralNpsPolicy(runSpace, CentralNpsHost, policyName, collection.Name, organizationId); } //add user group to collection @@ -261,7 +263,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices return collection; } - public bool RemoveCollection(string organizationId, string collectionName) + public bool RemoveCollection(string organizationId, string tenantName, string collectionName) { var result = true; @@ -278,19 +280,21 @@ namespace WebsitePanel.Providers.RemoteDesktopServices ExecuteShellCommand(runSpace, cmd, false); + var policyName = GetPolicyName(tenantName, organizationId, collectionName); + foreach (var gateway in Gateways) { if (!CentralNps) { - RemoveRdCap(runSpace, gateway, collectionName); + RemoveRdCap(runSpace, gateway, policyName); } - RemoveRdRap(runSpace, gateway, collectionName); + RemoveRdRap(runSpace, gateway, policyName); } if (CentralNps) { - RemoveNpsPolicy(runSpace, CentralNpsHost, collectionName); + RemoveNpsPolicy(runSpace, CentralNpsHost, policyName); } //Remove security group @@ -537,7 +541,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices #region Gateaway (RD CAP | RD RAP) - internal void CreateCentralNpsPolicy(Runspace runSpace, string centralNpshost, string collectionName, string organizationId) + internal void CreateCentralNpsPolicy(Runspace runSpace, string centralNpshost, string policyName, string collectionName, string organizationId) { var showCmd = new Command("netsh nps show np"); @@ -549,35 +553,35 @@ namespace WebsitePanel.Providers.RemoteDesktopServices var sid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(groupAd, "objectSid"); - var addCmdString = string.Format(AddNpsString, collectionName.Replace(" ", "_"), count, ConvertByteToStringSid(sid)); + var addCmdString = string.Format(AddNpsString, policyName.Replace(" ", "_"), count, ConvertByteToStringSid(sid)); Command addCmd = new Command(addCmdString); var result = ExecuteRemoteShellCommand(runSpace, centralNpshost, addCmd); } - internal void RemoveNpsPolicy(Runspace runSpace, string centralNpshost, string collectionName) + internal void RemoveNpsPolicy(Runspace runSpace, string centralNpshost, string policyName) { - var removeCmd = new Command(string.Format("netsh nps delete np {0}", collectionName.Replace(" ", "_"))); + var removeCmd = new Command(string.Format("netsh nps delete np {0}", policyName.Replace(" ", "_"))); var removeResult = ExecuteRemoteShellCommand(runSpace, centralNpshost, removeCmd); } - internal void CreateRdCapForce(Runspace runSpace, string gatewayHost, string name, List groups) + internal void CreateRdCapForce(Runspace runSpace, string gatewayHost, string policyName, List groups) { //New-Item -Path "RDS:\GatewayServer\CAP" -Name "Allow Admins" -UserGroups "Administrators@." -AuthMethod 1 //Set-Item -Path "RDS:\GatewayServer\CAP\Allow Admins\SessionTimeout" -Value 480 -SessionTimeoutAction 0 - if (ItemExistsRemote(runSpace, gatewayHost, Path.Combine(CapPath, name))) + if (ItemExistsRemote(runSpace, gatewayHost, Path.Combine(CapPath, policyName))) { - RemoveRdCap(runSpace, gatewayHost, name); + RemoveRdCap(runSpace, gatewayHost, policyName); } var userGroupParametr = string.Format("@({0})",string.Join(",", groups.Select(x => string.Format("\"{0}@{1}\"", x, RootDomain)).ToArray())); Command rdCapCommand = new Command("New-Item"); rdCapCommand.Parameters.Add("Path", string.Format("\"{0}\"", CapPath)); - rdCapCommand.Parameters.Add("Name", string.Format("\"{0}\"", name)); + rdCapCommand.Parameters.Add("Name", string.Format("\"{0}\"", policyName)); rdCapCommand.Parameters.Add("UserGroups", userGroupParametr); rdCapCommand.Parameters.Add("AuthMethod", 1); @@ -589,22 +593,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices RemoveItemRemote(runSpace, gatewayHost, string.Format(@"{0}\{1}", CapPath, name), RdsModuleName); } - internal void CreateRdRapForce(Runspace runSpace, string gatewayHost, string name, List groups) + internal void CreateRdRapForce(Runspace runSpace, string gatewayHost, string policyName, string collectionName, List groups) { //New-Item -Path "RDS:\GatewayServer\RAP" -Name "Allow Connections To Everywhere" -UserGroups "Administrators@." -ComputerGroupType 1 //Set-Item -Path "RDS:\GatewayServer\RAP\Allow Connections To Everywhere\PortNumbers" -Value 3389,3390 - if (ItemExistsRemote(runSpace, gatewayHost, Path.Combine(RapPath, name))) + if (ItemExistsRemote(runSpace, gatewayHost, Path.Combine(RapPath, policyName))) { - RemoveRdRap(runSpace, gatewayHost, name); + RemoveRdRap(runSpace, gatewayHost, policyName); } var userGroupParametr = string.Format("@({0})", string.Join(",", groups.Select(x => string.Format("\"{0}@{1}\"", x, RootDomain)).ToArray())); - var computerGroupParametr = string.Format("\"{0}@{1}\"", GetComputersGroupName(name), RootDomain); + var computerGroupParametr = string.Format("\"{0}@{1}\"", GetComputersGroupName(collectionName), RootDomain); Command rdRapCommand = new Command("New-Item"); rdRapCommand.Parameters.Add("Path", string.Format("\"{0}\"", RapPath)); - rdRapCommand.Parameters.Add("Name", string.Format("\"{0}\"", name)); + rdRapCommand.Parameters.Add("Name", string.Format("\"{0}\"", policyName)); rdRapCommand.Parameters.Add("UserGroups", userGroupParametr); rdRapCommand.Parameters.Add("ComputerGroupType", 1); rdRapCommand.Parameters.Add("ComputerGroup", computerGroupParametr); @@ -629,6 +633,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices ExecuteShellCommand(runSpace, cmd, false); } + + private bool ExistRdsServerInDeployment(Runspace runSpace, RdsServer server) { Command cmd = new Command("Get-RDserver"); @@ -924,6 +930,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices ExecuteRemoteShellCommand(runSpace, hostname, rdRapCommand, imports); } + private string GetPolicyName(string tenantName,string organizationId, string collectionName) + { + return string.Format("{0}-{1}-{2}", tenantName, organizationId, collectionName); + } + private string GetComputersGroupName(string collectionName) { return string.Format(RdsGroupFormat, collectionName, Computers.ToLowerInvariant()); diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs index 699cb445..24a78087 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs @@ -1,35 +1,7 @@ -// Copyright (c) 2014, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.6400 +// Runtime Version:2.0.50727.7905 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -39,1330 +11,1155 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.3038. // - -using WebsitePanel.Providers.HostedSolution; - namespace WebsitePanel.Providers.RemoteDesktopServices { - using System; - using System.ComponentModel; - using System.Diagnostics; - using System.Web.Services; - using System.Web.Services.Protocols; using System.Xml.Serialization; - + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Diagnostics; + + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "RemoteDesktopServicesSoap", Namespace = "http://smbsaas/websitepanel/server/")] - public partial class RemoteDesktopServices : Microsoft.Web.Services3.WebServicesClientProtocol - { + [System.Web.Services.WebServiceBindingAttribute(Name="RemoteDesktopServicesSoap", Namespace="http://smbsaas/websitepanel/server/")] + public partial class RemoteDesktopServices : Microsoft.Web.Services3.WebServicesClientProtocol { + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; - + private System.Threading.SendOrPostCallback CreateCollectionOperationCompleted; - + private System.Threading.SendOrPostCallback GetCollectionOperationCompleted; - + private System.Threading.SendOrPostCallback RemoveCollectionOperationCompleted; - + private System.Threading.SendOrPostCallback SetUsersInCollectionOperationCompleted; - + private System.Threading.SendOrPostCallback AddSessionHostServerToCollectionOperationCompleted; - + private System.Threading.SendOrPostCallback AddSessionHostServersToCollectionOperationCompleted; - + private System.Threading.SendOrPostCallback RemoveSessionHostServerFromCollectionOperationCompleted; - + private System.Threading.SendOrPostCallback RemoveSessionHostServersFromCollectionOperationCompleted; - + private System.Threading.SendOrPostCallback GetAvailableRemoteApplicationsOperationCompleted; - + private System.Threading.SendOrPostCallback GetCollectionRemoteApplicationsOperationCompleted; - + private System.Threading.SendOrPostCallback AddRemoteApplicationOperationCompleted; - + private System.Threading.SendOrPostCallback AddRemoteApplicationsOperationCompleted; - + private System.Threading.SendOrPostCallback RemoveRemoteApplicationOperationCompleted; - + private System.Threading.SendOrPostCallback AddSessionHostFeatureToServerOperationCompleted; - + private System.Threading.SendOrPostCallback CheckSessionHostFeatureInstallationOperationCompleted; - + private System.Threading.SendOrPostCallback CheckServerAvailabilityOperationCompleted; - + /// - public RemoteDesktopServices() - { - this.Url = "http://127.0.0.1:9003/RemoteDesktopServices.asmx"; + public RemoteDesktopServices() { + this.Url = "http://localhost:9003/RemoteDesktopServices.asmx"; } - + /// public event CreateCollectionCompletedEventHandler CreateCollectionCompleted; - + /// public event GetCollectionCompletedEventHandler GetCollectionCompleted; - + /// public event RemoveCollectionCompletedEventHandler RemoveCollectionCompleted; - + /// public event SetUsersInCollectionCompletedEventHandler SetUsersInCollectionCompleted; - + /// public event AddSessionHostServerToCollectionCompletedEventHandler AddSessionHostServerToCollectionCompleted; - + /// public event AddSessionHostServersToCollectionCompletedEventHandler AddSessionHostServersToCollectionCompleted; - + /// public event RemoveSessionHostServerFromCollectionCompletedEventHandler RemoveSessionHostServerFromCollectionCompleted; - + /// public event RemoveSessionHostServersFromCollectionCompletedEventHandler RemoveSessionHostServersFromCollectionCompleted; - + /// public event GetAvailableRemoteApplicationsCompletedEventHandler GetAvailableRemoteApplicationsCompleted; - + /// public event GetCollectionRemoteApplicationsCompletedEventHandler GetCollectionRemoteApplicationsCompleted; - + /// public event AddRemoteApplicationCompletedEventHandler AddRemoteApplicationCompleted; - + /// public event AddRemoteApplicationsCompletedEventHandler AddRemoteApplicationsCompleted; - + /// public event RemoveRemoteApplicationCompletedEventHandler RemoveRemoteApplicationCompleted; - + /// public event AddSessionHostFeatureToServerCompletedEventHandler AddSessionHostFeatureToServerCompleted; - + /// public event CheckSessionHostFeatureInstallationCompletedEventHandler CheckSessionHostFeatureInstallationCompleted; - + /// public event CheckServerAvailabilityCompletedEventHandler CheckServerAvailabilityCompleted; - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool CreateCollection(string organizationId, RdsCollection collection) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool CreateCollection(string organizationId, string tenantName, RdsCollection collection) { object[] results = this.Invoke("CreateCollection", new object[] { - organizationId, - collection}); + organizationId, + tenantName, + collection}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginCreateCollection(string organizationId, RdsCollection collection, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateCollection(string organizationId, string tenantName, RdsCollection collection, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateCollection", new object[] { - organizationId, - collection}, callback, asyncState); + organizationId, + tenantName, + collection}, callback, asyncState); } - + /// - public bool EndCreateCollection(System.IAsyncResult asyncResult) - { + public bool EndCreateCollection(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void CreateCollectionAsync(string organizationId, RdsCollection collection) - { - this.CreateCollectionAsync(organizationId, collection, null); + public void CreateCollectionAsync(string organizationId, string tenantName, RdsCollection collection) { + this.CreateCollectionAsync(organizationId, tenantName, collection, null); } - + /// - public void CreateCollectionAsync(string organizationId, RdsCollection collection, object userState) - { - if ((this.CreateCollectionOperationCompleted == null)) - { + public void CreateCollectionAsync(string organizationId, string tenantName, RdsCollection collection, object userState) { + if ((this.CreateCollectionOperationCompleted == null)) { this.CreateCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateCollectionOperationCompleted); } this.InvokeAsync("CreateCollection", new object[] { - organizationId, - collection}, this.CreateCollectionOperationCompleted, userState); + organizationId, + tenantName, + collection}, this.CreateCollectionOperationCompleted, userState); } - - private void OnCreateCollectionOperationCompleted(object arg) - { - if ((this.CreateCollectionCompleted != null)) - { + + private void OnCreateCollectionOperationCompleted(object arg) { + if ((this.CreateCollectionCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateCollectionCompleted(this, new CreateCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetCollection", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public RdsCollection GetCollection(string collectionName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsCollection GetCollection(string collectionName) { object[] results = this.Invoke("GetCollection", new object[] { - collectionName}); + collectionName}); return ((RdsCollection)(results[0])); } - + /// - public System.IAsyncResult BeginGetCollection(string collectionName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetCollection(string collectionName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetCollection", new object[] { - collectionName}, callback, asyncState); + collectionName}, callback, asyncState); } - + /// - public RdsCollection EndGetCollection(System.IAsyncResult asyncResult) - { + public RdsCollection EndGetCollection(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((RdsCollection)(results[0])); } - + /// - public void GetCollectionAsync(string collectionName) - { + public void GetCollectionAsync(string collectionName) { this.GetCollectionAsync(collectionName, null); } - + /// - public void GetCollectionAsync(string collectionName, object userState) - { - if ((this.GetCollectionOperationCompleted == null)) - { + public void GetCollectionAsync(string collectionName, object userState) { + if ((this.GetCollectionOperationCompleted == null)) { this.GetCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCollectionOperationCompleted); } this.InvokeAsync("GetCollection", new object[] { - collectionName}, this.GetCollectionOperationCompleted, userState); + collectionName}, this.GetCollectionOperationCompleted, userState); } - - private void OnGetCollectionOperationCompleted(object arg) - { - if ((this.GetCollectionCompleted != null)) - { + + private void OnGetCollectionOperationCompleted(object arg) { + if ((this.GetCollectionCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetCollectionCompleted(this, new GetCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveCollection", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool RemoveCollection(string organizationId, string collectionName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool RemoveCollection(string organizationId, string tenantName, string collectionName) { object[] results = this.Invoke("RemoveCollection", new object[] { - organizationId, - collectionName}); + organizationId, + tenantName, + collectionName}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginRemoveCollection(string organizationId, string collectionName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginRemoveCollection(string organizationId, string tenantName, string collectionName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RemoveCollection", new object[] { - organizationId, - collectionName}, callback, asyncState); + organizationId, + tenantName, + collectionName}, callback, asyncState); } - + /// - public bool EndRemoveCollection(System.IAsyncResult asyncResult) - { + public bool EndRemoveCollection(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void RemoveCollectionAsync(string organizationId, string collectionName) - { - this.RemoveCollectionAsync(organizationId, collectionName, null); + public void RemoveCollectionAsync(string organizationId, string tenantName, string collectionName) { + this.RemoveCollectionAsync(organizationId, tenantName, collectionName, null); } - + /// - public void RemoveCollectionAsync(string organizationId, string collectionName, object userState) - { - if ((this.RemoveCollectionOperationCompleted == null)) - { + public void RemoveCollectionAsync(string organizationId, string tenantName, string collectionName, object userState) { + if ((this.RemoveCollectionOperationCompleted == null)) { this.RemoveCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveCollectionOperationCompleted); } this.InvokeAsync("RemoveCollection", new object[] { - organizationId, - collectionName}, this.RemoveCollectionOperationCompleted, userState); + organizationId, + tenantName, + collectionName}, this.RemoveCollectionOperationCompleted, userState); } - - private void OnRemoveCollectionOperationCompleted(object arg) - { - if ((this.RemoveCollectionCompleted != null)) - { + + private void OnRemoveCollectionOperationCompleted(object arg) { + if ((this.RemoveCollectionCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.RemoveCollectionCompleted(this, new RemoveCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetUsersInCollection", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool SetUsersInCollection(string organizationId, string collectionName, string[] users) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetUsersInCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool SetUsersInCollection(string organizationId, string collectionName, string[] users) { object[] results = this.Invoke("SetUsersInCollection", new object[] { - organizationId, - collectionName, - users}); + organizationId, + collectionName, + users}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginSetUsersInCollection(string organizationId, string collectionName, string[] users, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginSetUsersInCollection(string organizationId, string collectionName, string[] users, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetUsersInCollection", new object[] { - organizationId, - collectionName, - users}, callback, asyncState); + organizationId, + collectionName, + users}, callback, asyncState); } - + /// - public bool EndSetUsersInCollection(System.IAsyncResult asyncResult) - { + public bool EndSetUsersInCollection(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void SetUsersInCollectionAsync(string organizationId, string collectionName, string[] users) - { + public void SetUsersInCollectionAsync(string organizationId, string collectionName, string[] users) { this.SetUsersInCollectionAsync(organizationId, collectionName, users, null); } - + /// - public void SetUsersInCollectionAsync(string organizationId, string collectionName, string[] users, object userState) - { - if ((this.SetUsersInCollectionOperationCompleted == null)) - { + public void SetUsersInCollectionAsync(string organizationId, string collectionName, string[] users, object userState) { + if ((this.SetUsersInCollectionOperationCompleted == null)) { this.SetUsersInCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUsersInCollectionOperationCompleted); } this.InvokeAsync("SetUsersInCollection", new object[] { - organizationId, - collectionName, - users}, this.SetUsersInCollectionOperationCompleted, userState); + organizationId, + collectionName, + users}, this.SetUsersInCollectionOperationCompleted, userState); } - - private void OnSetUsersInCollectionOperationCompleted(object arg) - { - if ((this.SetUsersInCollectionCompleted != null)) - { + + private void OnSetUsersInCollectionOperationCompleted(object arg) { + if ((this.SetUsersInCollectionCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetUsersInCollectionCompleted(this, new SetUsersInCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddSessionHostServerToCollection", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddSessionHostServerToCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server) { this.Invoke("AddSessionHostServerToCollection", new object[] { - organizationId, - collectionName, - server}); + organizationId, + collectionName, + server}); } - + /// - public System.IAsyncResult BeginAddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginAddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AddSessionHostServerToCollection", new object[] { - organizationId, - collectionName, - server}, callback, asyncState); + organizationId, + collectionName, + server}, callback, asyncState); } - + /// - public void EndAddSessionHostServerToCollection(System.IAsyncResult asyncResult) - { + public void EndAddSessionHostServerToCollection(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void AddSessionHostServerToCollectionAsync(string organizationId, string collectionName, RdsServer server) - { + public void AddSessionHostServerToCollectionAsync(string organizationId, string collectionName, RdsServer server) { this.AddSessionHostServerToCollectionAsync(organizationId, collectionName, server, null); } - + /// - public void AddSessionHostServerToCollectionAsync(string organizationId, string collectionName, RdsServer server, object userState) - { - if ((this.AddSessionHostServerToCollectionOperationCompleted == null)) - { + public void AddSessionHostServerToCollectionAsync(string organizationId, string collectionName, RdsServer server, object userState) { + if ((this.AddSessionHostServerToCollectionOperationCompleted == null)) { this.AddSessionHostServerToCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddSessionHostServerToCollectionOperationCompleted); } this.InvokeAsync("AddSessionHostServerToCollection", new object[] { - organizationId, - collectionName, - server}, this.AddSessionHostServerToCollectionOperationCompleted, userState); + organizationId, + collectionName, + server}, this.AddSessionHostServerToCollectionOperationCompleted, userState); } - - private void OnAddSessionHostServerToCollectionOperationCompleted(object arg) - { - if ((this.AddSessionHostServerToCollectionCompleted != null)) - { + + private void OnAddSessionHostServerToCollectionOperationCompleted(object arg) { + if ((this.AddSessionHostServerToCollectionCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddSessionHostServerToCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddSessionHostServersToCollection", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void AddSessionHostServersToCollection(string organizationId, string collectionName, RdsServer[] servers) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddSessionHostServersToCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void AddSessionHostServersToCollection(string organizationId, string collectionName, RdsServer[] servers) { this.Invoke("AddSessionHostServersToCollection", new object[] { - organizationId, - collectionName, - servers}); + organizationId, + collectionName, + servers}); } - + /// - public System.IAsyncResult BeginAddSessionHostServersToCollection(string organizationId, string collectionName, RdsServer[] servers, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginAddSessionHostServersToCollection(string organizationId, string collectionName, RdsServer[] servers, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AddSessionHostServersToCollection", new object[] { - organizationId, - collectionName, - servers}, callback, asyncState); + organizationId, + collectionName, + servers}, callback, asyncState); } - + /// - public void EndAddSessionHostServersToCollection(System.IAsyncResult asyncResult) - { + public void EndAddSessionHostServersToCollection(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void AddSessionHostServersToCollectionAsync(string organizationId, string collectionName, RdsServer[] servers) - { + public void AddSessionHostServersToCollectionAsync(string organizationId, string collectionName, RdsServer[] servers) { this.AddSessionHostServersToCollectionAsync(organizationId, collectionName, servers, null); } - + /// - public void AddSessionHostServersToCollectionAsync(string organizationId, string collectionName, RdsServer[] servers, object userState) - { - if ((this.AddSessionHostServersToCollectionOperationCompleted == null)) - { + public void AddSessionHostServersToCollectionAsync(string organizationId, string collectionName, RdsServer[] servers, object userState) { + if ((this.AddSessionHostServersToCollectionOperationCompleted == null)) { this.AddSessionHostServersToCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddSessionHostServersToCollectionOperationCompleted); } this.InvokeAsync("AddSessionHostServersToCollection", new object[] { - organizationId, - collectionName, - servers}, this.AddSessionHostServersToCollectionOperationCompleted, userState); + organizationId, + collectionName, + servers}, this.AddSessionHostServersToCollectionOperationCompleted, userState); } - - private void OnAddSessionHostServersToCollectionOperationCompleted(object arg) - { - if ((this.AddSessionHostServersToCollectionCompleted != null)) - { + + private void OnAddSessionHostServersToCollectionOperationCompleted(object arg) { + if ((this.AddSessionHostServersToCollectionCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddSessionHostServersToCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveSessionHostServerFromCollection", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveSessionHostServerFromCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server) { this.Invoke("RemoveSessionHostServerFromCollection", new object[] { - organizationId, - collectionName, - server}); + organizationId, + collectionName, + server}); } - + /// - public System.IAsyncResult BeginRemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginRemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RemoveSessionHostServerFromCollection", new object[] { - organizationId, - collectionName, - server}, callback, asyncState); + organizationId, + collectionName, + server}, callback, asyncState); } - + /// - public void EndRemoveSessionHostServerFromCollection(System.IAsyncResult asyncResult) - { + public void EndRemoveSessionHostServerFromCollection(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void RemoveSessionHostServerFromCollectionAsync(string organizationId, string collectionName, RdsServer server) - { + public void RemoveSessionHostServerFromCollectionAsync(string organizationId, string collectionName, RdsServer server) { this.RemoveSessionHostServerFromCollectionAsync(organizationId, collectionName, server, null); } - + /// - public void RemoveSessionHostServerFromCollectionAsync(string organizationId, string collectionName, RdsServer server, object userState) - { - if ((this.RemoveSessionHostServerFromCollectionOperationCompleted == null)) - { + public void RemoveSessionHostServerFromCollectionAsync(string organizationId, string collectionName, RdsServer server, object userState) { + if ((this.RemoveSessionHostServerFromCollectionOperationCompleted == null)) { this.RemoveSessionHostServerFromCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveSessionHostServerFromCollectionOperationCompleted); } this.InvokeAsync("RemoveSessionHostServerFromCollection", new object[] { - organizationId, - collectionName, - server}, this.RemoveSessionHostServerFromCollectionOperationCompleted, userState); + organizationId, + collectionName, + server}, this.RemoveSessionHostServerFromCollectionOperationCompleted, userState); } - - private void OnRemoveSessionHostServerFromCollectionOperationCompleted(object arg) - { - if ((this.RemoveSessionHostServerFromCollectionCompleted != null)) - { + + private void OnRemoveSessionHostServerFromCollectionOperationCompleted(object arg) { + if ((this.RemoveSessionHostServerFromCollectionCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.RemoveSessionHostServerFromCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveSessionHostServersFromCollection", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void RemoveSessionHostServersFromCollection(string organizationId, string collectionName, RdsServer[] servers) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveSessionHostServersFromCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void RemoveSessionHostServersFromCollection(string organizationId, string collectionName, RdsServer[] servers) { this.Invoke("RemoveSessionHostServersFromCollection", new object[] { - organizationId, - collectionName, - servers}); + organizationId, + collectionName, + servers}); } - + /// - public System.IAsyncResult BeginRemoveSessionHostServersFromCollection(string organizationId, string collectionName, RdsServer[] servers, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginRemoveSessionHostServersFromCollection(string organizationId, string collectionName, RdsServer[] servers, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RemoveSessionHostServersFromCollection", new object[] { - organizationId, - collectionName, - servers}, callback, asyncState); + organizationId, + collectionName, + servers}, callback, asyncState); } - + /// - public void EndRemoveSessionHostServersFromCollection(System.IAsyncResult asyncResult) - { + public void EndRemoveSessionHostServersFromCollection(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void RemoveSessionHostServersFromCollectionAsync(string organizationId, string collectionName, RdsServer[] servers) - { + public void RemoveSessionHostServersFromCollectionAsync(string organizationId, string collectionName, RdsServer[] servers) { this.RemoveSessionHostServersFromCollectionAsync(organizationId, collectionName, servers, null); } - + /// - public void RemoveSessionHostServersFromCollectionAsync(string organizationId, string collectionName, RdsServer[] servers, object userState) - { - if ((this.RemoveSessionHostServersFromCollectionOperationCompleted == null)) - { + public void RemoveSessionHostServersFromCollectionAsync(string organizationId, string collectionName, RdsServer[] servers, object userState) { + if ((this.RemoveSessionHostServersFromCollectionOperationCompleted == null)) { this.RemoveSessionHostServersFromCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveSessionHostServersFromCollectionOperationCompleted); } this.InvokeAsync("RemoveSessionHostServersFromCollection", new object[] { - organizationId, - collectionName, - servers}, this.RemoveSessionHostServersFromCollectionOperationCompleted, userState); + organizationId, + collectionName, + servers}, this.RemoveSessionHostServersFromCollectionOperationCompleted, userState); } - - private void OnRemoveSessionHostServersFromCollectionOperationCompleted(object arg) - { - if ((this.RemoveSessionHostServersFromCollectionCompleted != null)) - { + + private void OnRemoveSessionHostServersFromCollectionOperationCompleted(object arg) { + if ((this.RemoveSessionHostServersFromCollectionCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.RemoveSessionHostServersFromCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetAvailableRemoteApplications", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public StartMenuApp[] GetAvailableRemoteApplications(string collectionName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetAvailableRemoteApplications", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public StartMenuApp[] GetAvailableRemoteApplications(string collectionName) { object[] results = this.Invoke("GetAvailableRemoteApplications", new object[] { - collectionName}); + collectionName}); return ((StartMenuApp[])(results[0])); } - + /// - public System.IAsyncResult BeginGetAvailableRemoteApplications(string collectionName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetAvailableRemoteApplications(string collectionName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetAvailableRemoteApplications", new object[] { - collectionName}, callback, asyncState); + collectionName}, callback, asyncState); } - + /// - public StartMenuApp[] EndGetAvailableRemoteApplications(System.IAsyncResult asyncResult) - { + public StartMenuApp[] EndGetAvailableRemoteApplications(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((StartMenuApp[])(results[0])); } - + /// - public void GetAvailableRemoteApplicationsAsync(string collectionName) - { + public void GetAvailableRemoteApplicationsAsync(string collectionName) { this.GetAvailableRemoteApplicationsAsync(collectionName, null); } - + /// - public void GetAvailableRemoteApplicationsAsync(string collectionName, object userState) - { - if ((this.GetAvailableRemoteApplicationsOperationCompleted == null)) - { + public void GetAvailableRemoteApplicationsAsync(string collectionName, object userState) { + if ((this.GetAvailableRemoteApplicationsOperationCompleted == null)) { this.GetAvailableRemoteApplicationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAvailableRemoteApplicationsOperationCompleted); } this.InvokeAsync("GetAvailableRemoteApplications", new object[] { - collectionName}, this.GetAvailableRemoteApplicationsOperationCompleted, userState); + collectionName}, this.GetAvailableRemoteApplicationsOperationCompleted, userState); } - - private void OnGetAvailableRemoteApplicationsOperationCompleted(object arg) - { - if ((this.GetAvailableRemoteApplicationsCompleted != null)) - { + + private void OnGetAvailableRemoteApplicationsOperationCompleted(object arg) { + if ((this.GetAvailableRemoteApplicationsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetAvailableRemoteApplicationsCompleted(this, new GetAvailableRemoteApplicationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetCollectionRemoteApplications", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public RemoteApplication[] GetCollectionRemoteApplications(string collectionName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetCollectionRemoteApplications", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RemoteApplication[] GetCollectionRemoteApplications(string collectionName) { object[] results = this.Invoke("GetCollectionRemoteApplications", new object[] { - collectionName}); + collectionName}); return ((RemoteApplication[])(results[0])); } - + /// - public System.IAsyncResult BeginGetCollectionRemoteApplications(string collectionName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetCollectionRemoteApplications(string collectionName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetCollectionRemoteApplications", new object[] { - collectionName}, callback, asyncState); + collectionName}, callback, asyncState); } - + /// - public RemoteApplication[] EndGetCollectionRemoteApplications(System.IAsyncResult asyncResult) - { + public RemoteApplication[] EndGetCollectionRemoteApplications(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((RemoteApplication[])(results[0])); } - + /// - public void GetCollectionRemoteApplicationsAsync(string collectionName) - { + public void GetCollectionRemoteApplicationsAsync(string collectionName) { this.GetCollectionRemoteApplicationsAsync(collectionName, null); } - + /// - public void GetCollectionRemoteApplicationsAsync(string collectionName, object userState) - { - if ((this.GetCollectionRemoteApplicationsOperationCompleted == null)) - { + public void GetCollectionRemoteApplicationsAsync(string collectionName, object userState) { + if ((this.GetCollectionRemoteApplicationsOperationCompleted == null)) { this.GetCollectionRemoteApplicationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCollectionRemoteApplicationsOperationCompleted); } this.InvokeAsync("GetCollectionRemoteApplications", new object[] { - collectionName}, this.GetCollectionRemoteApplicationsOperationCompleted, userState); + collectionName}, this.GetCollectionRemoteApplicationsOperationCompleted, userState); } - - private void OnGetCollectionRemoteApplicationsOperationCompleted(object arg) - { - if ((this.GetCollectionRemoteApplicationsCompleted != null)) - { + + private void OnGetCollectionRemoteApplicationsOperationCompleted(object arg) { + if ((this.GetCollectionRemoteApplicationsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetCollectionRemoteApplicationsCompleted(this, new GetCollectionRemoteApplicationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddRemoteApplication", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool AddRemoteApplication(string collectionName, RemoteApplication remoteApp) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddRemoteApplication", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool AddRemoteApplication(string collectionName, RemoteApplication remoteApp) { object[] results = this.Invoke("AddRemoteApplication", new object[] { - collectionName, - remoteApp}); + collectionName, + remoteApp}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginAddRemoteApplication(string collectionName, RemoteApplication remoteApp, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginAddRemoteApplication(string collectionName, RemoteApplication remoteApp, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AddRemoteApplication", new object[] { - collectionName, - remoteApp}, callback, asyncState); + collectionName, + remoteApp}, callback, asyncState); } - + /// - public bool EndAddRemoteApplication(System.IAsyncResult asyncResult) - { + public bool EndAddRemoteApplication(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void AddRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp) - { + public void AddRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp) { this.AddRemoteApplicationAsync(collectionName, remoteApp, null); } - + /// - public void AddRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp, object userState) - { - if ((this.AddRemoteApplicationOperationCompleted == null)) - { + public void AddRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp, object userState) { + if ((this.AddRemoteApplicationOperationCompleted == null)) { this.AddRemoteApplicationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRemoteApplicationOperationCompleted); } this.InvokeAsync("AddRemoteApplication", new object[] { - collectionName, - remoteApp}, this.AddRemoteApplicationOperationCompleted, userState); + collectionName, + remoteApp}, this.AddRemoteApplicationOperationCompleted, userState); } - - private void OnAddRemoteApplicationOperationCompleted(object arg) - { - if ((this.AddRemoteApplicationCompleted != null)) - { + + private void OnAddRemoteApplicationOperationCompleted(object arg) { + if ((this.AddRemoteApplicationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddRemoteApplicationCompleted(this, new AddRemoteApplicationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddRemoteApplications", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool AddRemoteApplications(string collectionName, RemoteApplication[] remoteApps) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddRemoteApplications", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool AddRemoteApplications(string collectionName, RemoteApplication[] remoteApps) { object[] results = this.Invoke("AddRemoteApplications", new object[] { - collectionName, - remoteApps}); + collectionName, + remoteApps}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginAddRemoteApplications(string collectionName, RemoteApplication[] remoteApps, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginAddRemoteApplications(string collectionName, RemoteApplication[] remoteApps, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AddRemoteApplications", new object[] { - collectionName, - remoteApps}, callback, asyncState); + collectionName, + remoteApps}, callback, asyncState); } - + /// - public bool EndAddRemoteApplications(System.IAsyncResult asyncResult) - { + public bool EndAddRemoteApplications(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void AddRemoteApplicationsAsync(string collectionName, RemoteApplication[] remoteApps) - { + public void AddRemoteApplicationsAsync(string collectionName, RemoteApplication[] remoteApps) { this.AddRemoteApplicationsAsync(collectionName, remoteApps, null); } - + /// - public void AddRemoteApplicationsAsync(string collectionName, RemoteApplication[] remoteApps, object userState) - { - if ((this.AddRemoteApplicationsOperationCompleted == null)) - { + public void AddRemoteApplicationsAsync(string collectionName, RemoteApplication[] remoteApps, object userState) { + if ((this.AddRemoteApplicationsOperationCompleted == null)) { this.AddRemoteApplicationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRemoteApplicationsOperationCompleted); } this.InvokeAsync("AddRemoteApplications", new object[] { - collectionName, - remoteApps}, this.AddRemoteApplicationsOperationCompleted, userState); + collectionName, + remoteApps}, this.AddRemoteApplicationsOperationCompleted, userState); } - - private void OnAddRemoteApplicationsOperationCompleted(object arg) - { - if ((this.AddRemoteApplicationsCompleted != null)) - { + + private void OnAddRemoteApplicationsOperationCompleted(object arg) { + if ((this.AddRemoteApplicationsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddRemoteApplicationsCompleted(this, new AddRemoteApplicationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveRemoteApplication", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool RemoveRemoteApplication(string collectionName, RemoteApplication remoteApp) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveRemoteApplication", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool RemoveRemoteApplication(string collectionName, RemoteApplication remoteApp) { object[] results = this.Invoke("RemoveRemoteApplication", new object[] { - collectionName, - remoteApp}); + collectionName, + remoteApp}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginRemoveRemoteApplication(string collectionName, RemoteApplication remoteApp, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginRemoveRemoteApplication(string collectionName, RemoteApplication remoteApp, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RemoveRemoteApplication", new object[] { - collectionName, - remoteApp}, callback, asyncState); + collectionName, + remoteApp}, callback, asyncState); } - + /// - public bool EndRemoveRemoteApplication(System.IAsyncResult asyncResult) - { + public bool EndRemoveRemoteApplication(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void RemoveRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp) - { + public void RemoveRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp) { this.RemoveRemoteApplicationAsync(collectionName, remoteApp, null); } - + /// - public void RemoveRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp, object userState) - { - if ((this.RemoveRemoteApplicationOperationCompleted == null)) - { + public void RemoveRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp, object userState) { + if ((this.RemoveRemoteApplicationOperationCompleted == null)) { this.RemoveRemoteApplicationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveRemoteApplicationOperationCompleted); } this.InvokeAsync("RemoveRemoteApplication", new object[] { - collectionName, - remoteApp}, this.RemoveRemoteApplicationOperationCompleted, userState); + collectionName, + remoteApp}, this.RemoveRemoteApplicationOperationCompleted, userState); } - - private void OnRemoveRemoteApplicationOperationCompleted(object arg) - { - if ((this.RemoveRemoteApplicationCompleted != null)) - { + + private void OnRemoveRemoteApplicationOperationCompleted(object arg) { + if ((this.RemoveRemoteApplicationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.RemoveRemoteApplicationCompleted(this, new RemoveRemoteApplicationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddSessionHostFeatureToServer", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool AddSessionHostFeatureToServer(string hostName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddSessionHostFeatureToServer", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool AddSessionHostFeatureToServer(string hostName) { object[] results = this.Invoke("AddSessionHostFeatureToServer", new object[] { - hostName}); + hostName}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginAddSessionHostFeatureToServer(string hostName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginAddSessionHostFeatureToServer(string hostName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AddSessionHostFeatureToServer", new object[] { - hostName}, callback, asyncState); + hostName}, callback, asyncState); } - + /// - public bool EndAddSessionHostFeatureToServer(System.IAsyncResult asyncResult) - { + public bool EndAddSessionHostFeatureToServer(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void AddSessionHostFeatureToServerAsync(string hostName) - { + public void AddSessionHostFeatureToServerAsync(string hostName) { this.AddSessionHostFeatureToServerAsync(hostName, null); } - + /// - public void AddSessionHostFeatureToServerAsync(string hostName, object userState) - { - if ((this.AddSessionHostFeatureToServerOperationCompleted == null)) - { + public void AddSessionHostFeatureToServerAsync(string hostName, object userState) { + if ((this.AddSessionHostFeatureToServerOperationCompleted == null)) { this.AddSessionHostFeatureToServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddSessionHostFeatureToServerOperationCompleted); } this.InvokeAsync("AddSessionHostFeatureToServer", new object[] { - hostName}, this.AddSessionHostFeatureToServerOperationCompleted, userState); + hostName}, this.AddSessionHostFeatureToServerOperationCompleted, userState); } - - private void OnAddSessionHostFeatureToServerOperationCompleted(object arg) - { - if ((this.AddSessionHostFeatureToServerCompleted != null)) - { + + private void OnAddSessionHostFeatureToServerOperationCompleted(object arg) { + if ((this.AddSessionHostFeatureToServerCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddSessionHostFeatureToServerCompleted(this, new AddSessionHostFeatureToServerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckSessionHostFeatureInstallation", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool CheckSessionHostFeatureInstallation(string hostName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckSessionHostFeatureInstallation", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool CheckSessionHostFeatureInstallation(string hostName) { object[] results = this.Invoke("CheckSessionHostFeatureInstallation", new object[] { - hostName}); + hostName}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginCheckSessionHostFeatureInstallation(string hostName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCheckSessionHostFeatureInstallation(string hostName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CheckSessionHostFeatureInstallation", new object[] { - hostName}, callback, asyncState); + hostName}, callback, asyncState); } - + /// - public bool EndCheckSessionHostFeatureInstallation(System.IAsyncResult asyncResult) - { + public bool EndCheckSessionHostFeatureInstallation(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void CheckSessionHostFeatureInstallationAsync(string hostName) - { + public void CheckSessionHostFeatureInstallationAsync(string hostName) { this.CheckSessionHostFeatureInstallationAsync(hostName, null); } - + /// - public void CheckSessionHostFeatureInstallationAsync(string hostName, object userState) - { - if ((this.CheckSessionHostFeatureInstallationOperationCompleted == null)) - { + public void CheckSessionHostFeatureInstallationAsync(string hostName, object userState) { + if ((this.CheckSessionHostFeatureInstallationOperationCompleted == null)) { this.CheckSessionHostFeatureInstallationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckSessionHostFeatureInstallationOperationCompleted); } this.InvokeAsync("CheckSessionHostFeatureInstallation", new object[] { - hostName}, this.CheckSessionHostFeatureInstallationOperationCompleted, userState); + hostName}, this.CheckSessionHostFeatureInstallationOperationCompleted, userState); } - - private void OnCheckSessionHostFeatureInstallationOperationCompleted(object arg) - { - if ((this.CheckSessionHostFeatureInstallationCompleted != null)) - { + + private void OnCheckSessionHostFeatureInstallationOperationCompleted(object arg) { + if ((this.CheckSessionHostFeatureInstallationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CheckSessionHostFeatureInstallationCompleted(this, new CheckSessionHostFeatureInstallationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckServerAvailability", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool CheckServerAvailability(string hostName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckServerAvailability", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool CheckServerAvailability(string hostName) { object[] results = this.Invoke("CheckServerAvailability", new object[] { - hostName}); + hostName}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginCheckServerAvailability(string hostName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCheckServerAvailability(string hostName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CheckServerAvailability", new object[] { - hostName}, callback, asyncState); + hostName}, callback, asyncState); } - + /// - public bool EndCheckServerAvailability(System.IAsyncResult asyncResult) - { + public bool EndCheckServerAvailability(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void CheckServerAvailabilityAsync(string hostName) - { + public void CheckServerAvailabilityAsync(string hostName) { this.CheckServerAvailabilityAsync(hostName, null); } - + /// - public void CheckServerAvailabilityAsync(string hostName, object userState) - { - if ((this.CheckServerAvailabilityOperationCompleted == null)) - { + public void CheckServerAvailabilityAsync(string hostName, object userState) { + if ((this.CheckServerAvailabilityOperationCompleted == null)) { this.CheckServerAvailabilityOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckServerAvailabilityOperationCompleted); } this.InvokeAsync("CheckServerAvailability", new object[] { - hostName}, this.CheckServerAvailabilityOperationCompleted, userState); + hostName}, this.CheckServerAvailabilityOperationCompleted, userState); } - - private void OnCheckServerAvailabilityOperationCompleted(object arg) - { - if ((this.CheckServerAvailabilityCompleted != null)) - { + + private void OnCheckServerAvailabilityOperationCompleted(object arg) { + if ((this.CheckServerAvailabilityCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CheckServerAvailabilityCompleted(this, new CheckServerAvailabilityCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - public new void CancelAsync(object userState) - { + public new void CancelAsync(object userState) { base.CancelAsync(userState); } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateCollectionCompletedEventHandler(object sender, CreateCollectionCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CreateCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CreateCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CreateCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetCollectionCompletedEventHandler(object sender, GetCollectionCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public RdsCollection Result - { - get - { + public RdsCollection Result { + get { this.RaiseExceptionIfNecessary(); return ((RdsCollection)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void RemoveCollectionCompletedEventHandler(object sender, RemoveCollectionCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class RemoveCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class RemoveCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal RemoveCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal RemoveCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetUsersInCollectionCompletedEventHandler(object sender, SetUsersInCollectionCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetUsersInCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class SetUsersInCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal SetUsersInCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal SetUsersInCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddSessionHostServerToCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddSessionHostServersToCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void RemoveSessionHostServerFromCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void RemoveSessionHostServersFromCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetAvailableRemoteApplicationsCompletedEventHandler(object sender, GetAvailableRemoteApplicationsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetAvailableRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetAvailableRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetAvailableRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetAvailableRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public StartMenuApp[] Result - { - get - { + public StartMenuApp[] Result { + get { this.RaiseExceptionIfNecessary(); return ((StartMenuApp[])(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetCollectionRemoteApplicationsCompletedEventHandler(object sender, GetCollectionRemoteApplicationsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetCollectionRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetCollectionRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetCollectionRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetCollectionRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public RemoteApplication[] Result - { - get - { + public RemoteApplication[] Result { + get { this.RaiseExceptionIfNecessary(); return ((RemoteApplication[])(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddRemoteApplicationCompletedEventHandler(object sender, AddRemoteApplicationCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddRemoteApplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class AddRemoteApplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal AddRemoteApplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal AddRemoteApplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddRemoteApplicationsCompletedEventHandler(object sender, AddRemoteApplicationsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class AddRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal AddRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal AddRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void RemoveRemoteApplicationCompletedEventHandler(object sender, RemoveRemoteApplicationCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class RemoveRemoteApplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class RemoveRemoteApplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal RemoveRemoteApplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal RemoveRemoteApplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddSessionHostFeatureToServerCompletedEventHandler(object sender, AddSessionHostFeatureToServerCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddSessionHostFeatureToServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class AddSessionHostFeatureToServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal AddSessionHostFeatureToServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal AddSessionHostFeatureToServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CheckSessionHostFeatureInstallationCompletedEventHandler(object sender, CheckSessionHostFeatureInstallationCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CheckSessionHostFeatureInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CheckSessionHostFeatureInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CheckSessionHostFeatureInstallationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CheckSessionHostFeatureInstallationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CheckServerAvailabilityCompletedEventHandler(object sender, CheckServerAvailabilityCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CheckServerAvailabilityCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CheckServerAvailabilityCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CheckServerAvailabilityCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CheckServerAvailabilityCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs index 96836db9..b7e4d7a7 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs @@ -60,12 +60,12 @@ namespace WebsitePanel.Server } [WebMethod, SoapHeader("settings")] - public bool CreateCollection(string organizationId, RdsCollection collection) + public bool CreateCollection(string organizationId, string tenantName, RdsCollection collection) { try { Log.WriteStart("'{0}' CreateCollection", ProviderSettings.ProviderName); - var result = RDSProvider.CreateCollection(organizationId, collection); + var result = RDSProvider.CreateCollection(organizationId, tenantName, collection); Log.WriteEnd("'{0}' CreateCollection", ProviderSettings.ProviderName); return result; } @@ -94,12 +94,12 @@ namespace WebsitePanel.Server } [WebMethod, SoapHeader("settings")] - public bool RemoveCollection(string organizationId, string collectionName) + public bool RemoveCollection(string organizationId, string tenantName, string collectionName) { try { Log.WriteStart("'{0}' RemoveCollection", ProviderSettings.ProviderName); - var result = RDSProvider.RemoveCollection(organizationId,collectionName); + var result = RDSProvider.RemoveCollection(organizationId, tenantName, collectionName); Log.WriteEnd("'{0}' RemoveCollection", ProviderSettings.ProviderName); return result; } From e49f5223d0592f8183c2daf353ea135fc680f9df Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Wed, 19 Nov 2014 03:21:26 -0800 Subject: [PATCH 020/146] RDS CAP RAP name forming changed, added pc group to RAP CAP settings --- .../RemoteDesktopServicesController.cs | 12 ++------ .../IRemoteDesktopServices.cs | 4 +-- .../Windows2012.cs | 30 +++++++++++-------- .../RemoteDesktopServicesProxy.cs | 26 +++++++--------- .../RemoteDesktopServices.asmx.cs | 8 ++--- 5 files changed, 36 insertions(+), 44 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 5f72aec1..f2a3ca42 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -252,11 +252,7 @@ namespace WebsitePanel.EnterpriseServer var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); - var package = PackageController.GetPackage(org.PackageId); - - var tenant = UserController.GetUser(package.UserId); - - rds.CreateCollection(org.OrganizationId, tenant.Username, collection); + rds.CreateCollection(org.OrganizationId, collection); collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description); @@ -324,11 +320,7 @@ namespace WebsitePanel.EnterpriseServer var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); - var package = PackageController.GetPackage(org.PackageId); - - var tenant = UserController.GetUser(package.UserId); - - rds.RemoveCollection(org.OrganizationId, tenant.Username, collection.Name); + rds.RemoveCollection(org.OrganizationId, collection.Name); DataProvider.DeleteRDSCollection(collection.Id); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs index ca7fabd3..6cf5ec6b 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs @@ -39,9 +39,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices /// public interface IRemoteDesktopServices { - bool CreateCollection(string organizationId, string tenantName, RdsCollection collection); + bool CreateCollection(string organizationId, RdsCollection collection); RdsCollection GetCollection(string collectionName); - bool RemoveCollection(string organizationId, string tenantName, string collectionName); + bool RemoveCollection(string organizationId, string collectionName); bool SetUsersInCollection(string organizationId, string collectionName, List users); void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server); void AddSessionHostServersToCollection(string organizationId, string collectionName, List servers); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index a3563eb4..ccc6edea 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -62,7 +62,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices private const string Users = "users"; private const string RdsGroupFormat = "rds-{0}-{1}"; private const string RdsModuleName = "RemoteDesktopServices"; - private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\""; + private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1fb4\" conditiondata=\"{3}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\""; #endregion #region Properties @@ -139,7 +139,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices #region RDS Collections - public bool CreateCollection(string organizationId, string tenantName, RdsCollection collection) + public bool CreateCollection(string organizationId, RdsCollection collection) { var result = true; @@ -194,13 +194,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices ActiveDirectoryUtils.CreateGroup(orgPath, GetUsersGroupName(collection.Name)); } - var policyName = GetPolicyName(tenantName, organizationId, collection.Name); + var policyName = GetPolicyName(organizationId, collection.Name); foreach (var gateway in Gateways) { if (!CentralNps) { - CreateRdCapForce(runSpace, gateway, policyName, new List { GetUsersGroupName(collection.Name) }); + CreateRdCapForce(runSpace, gateway, policyName, collection.Name, new List { GetUsersGroupName(collection.Name) }); } CreateRdRapForce(runSpace, gateway, policyName, collection.Name, new List { GetUsersGroupName(collection.Name) }); @@ -263,7 +263,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices return collection; } - public bool RemoveCollection(string organizationId, string tenantName, string collectionName) + public bool RemoveCollection(string organizationId, string collectionName) { var result = true; @@ -280,7 +280,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices ExecuteShellCommand(runSpace, cmd, false); - var policyName = GetPolicyName(tenantName, organizationId, collectionName); + var policyName = GetPolicyName(organizationId, collectionName); foreach (var gateway in Gateways) { @@ -549,11 +549,15 @@ namespace WebsitePanel.Providers.RemoteDesktopServices var count = showResult.Count(x => Convert.ToString(x).Contains("policy conf")) + 1001; - var groupAd = ActiveDirectoryUtils.GetADObject(GetUsersGroupPath(organizationId, collectionName)); + var userGroupAd = ActiveDirectoryUtils.GetADObject(GetUsersGroupPath(organizationId, collectionName)); - var sid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(groupAd, "objectSid"); + var userGroupSid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(userGroupAd, "objectSid"); - var addCmdString = string.Format(AddNpsString, policyName.Replace(" ", "_"), count, ConvertByteToStringSid(sid)); + var computerGroupAd = ActiveDirectoryUtils.GetADObject(GetComputerGroupPath(organizationId, collectionName)); + + var computerGroupSid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(computerGroupAd, "objectSid"); + + var addCmdString = string.Format(AddNpsString, policyName.Replace(" ", "_"), count, ConvertByteToStringSid(userGroupSid), ConvertByteToStringSid(computerGroupSid)); Command addCmd = new Command(addCmdString); @@ -567,7 +571,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices var removeResult = ExecuteRemoteShellCommand(runSpace, centralNpshost, removeCmd); } - internal void CreateRdCapForce(Runspace runSpace, string gatewayHost, string policyName, List groups) + internal void CreateRdCapForce(Runspace runSpace, string gatewayHost, string policyName, string collectionName, List groups) { //New-Item -Path "RDS:\GatewayServer\CAP" -Name "Allow Admins" -UserGroups "Administrators@." -AuthMethod 1 //Set-Item -Path "RDS:\GatewayServer\CAP\Allow Admins\SessionTimeout" -Value 480 -SessionTimeoutAction 0 @@ -578,11 +582,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices } var userGroupParametr = string.Format("@({0})",string.Join(",", groups.Select(x => string.Format("\"{0}@{1}\"", x, RootDomain)).ToArray())); + var computerGroupParameter = string.Format("\"{0}@{1}\"", GetComputersGroupName(collectionName), RootDomain); Command rdCapCommand = new Command("New-Item"); rdCapCommand.Parameters.Add("Path", string.Format("\"{0}\"", CapPath)); rdCapCommand.Parameters.Add("Name", string.Format("\"{0}\"", policyName)); rdCapCommand.Parameters.Add("UserGroups", userGroupParametr); + rdCapCommand.Parameters.Add("ComputerGroups", computerGroupParameter); rdCapCommand.Parameters.Add("AuthMethod", 1); ExecuteRemoteShellCommand(runSpace, gatewayHost, rdCapCommand, RdsModuleName); @@ -930,9 +936,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices ExecuteRemoteShellCommand(runSpace, hostname, rdRapCommand, imports); } - private string GetPolicyName(string tenantName,string organizationId, string collectionName) + private string GetPolicyName(string organizationId, string collectionName) { - return string.Format("{0}-{1}-{2}", tenantName, organizationId, collectionName); + return string.Format("rds-{0}-{1}", organizationId, collectionName); } private string GetComputersGroupName(string collectionName) diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs index 24a78087..e3637eae 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs @@ -117,19 +117,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool CreateCollection(string organizationId, string tenantName, RdsCollection collection) { + public bool CreateCollection(string organizationId, RdsCollection collection) { object[] results = this.Invoke("CreateCollection", new object[] { organizationId, - tenantName, collection}); return ((bool)(results[0])); } /// - public System.IAsyncResult BeginCreateCollection(string organizationId, string tenantName, RdsCollection collection, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateCollection(string organizationId, RdsCollection collection, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateCollection", new object[] { organizationId, - tenantName, collection}, callback, asyncState); } @@ -140,18 +138,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } /// - public void CreateCollectionAsync(string organizationId, string tenantName, RdsCollection collection) { - this.CreateCollectionAsync(organizationId, tenantName, collection, null); + public void CreateCollectionAsync(string organizationId, RdsCollection collection) { + this.CreateCollectionAsync(organizationId, collection, null); } /// - public void CreateCollectionAsync(string organizationId, string tenantName, RdsCollection collection, object userState) { + public void CreateCollectionAsync(string organizationId, RdsCollection collection, object userState) { if ((this.CreateCollectionOperationCompleted == null)) { this.CreateCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateCollectionOperationCompleted); } this.InvokeAsync("CreateCollection", new object[] { organizationId, - tenantName, collection}, this.CreateCollectionOperationCompleted, userState); } @@ -207,19 +204,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool RemoveCollection(string organizationId, string tenantName, string collectionName) { + public bool RemoveCollection(string organizationId, string collectionName) { object[] results = this.Invoke("RemoveCollection", new object[] { organizationId, - tenantName, collectionName}); return ((bool)(results[0])); } /// - public System.IAsyncResult BeginRemoveCollection(string organizationId, string tenantName, string collectionName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginRemoveCollection(string organizationId, string collectionName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RemoveCollection", new object[] { organizationId, - tenantName, collectionName}, callback, asyncState); } @@ -230,18 +225,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } /// - public void RemoveCollectionAsync(string organizationId, string tenantName, string collectionName) { - this.RemoveCollectionAsync(organizationId, tenantName, collectionName, null); + public void RemoveCollectionAsync(string organizationId, string collectionName) { + this.RemoveCollectionAsync(organizationId, collectionName, null); } /// - public void RemoveCollectionAsync(string organizationId, string tenantName, string collectionName, object userState) { + public void RemoveCollectionAsync(string organizationId, string collectionName, object userState) { if ((this.RemoveCollectionOperationCompleted == null)) { this.RemoveCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveCollectionOperationCompleted); } this.InvokeAsync("RemoveCollection", new object[] { organizationId, - tenantName, collectionName}, this.RemoveCollectionOperationCompleted, userState); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs index b7e4d7a7..0bb0fb26 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs @@ -60,12 +60,12 @@ namespace WebsitePanel.Server } [WebMethod, SoapHeader("settings")] - public bool CreateCollection(string organizationId, string tenantName, RdsCollection collection) + public bool CreateCollection(string organizationId, RdsCollection collection) { try { Log.WriteStart("'{0}' CreateCollection", ProviderSettings.ProviderName); - var result = RDSProvider.CreateCollection(organizationId, tenantName, collection); + var result = RDSProvider.CreateCollection(organizationId, collection); Log.WriteEnd("'{0}' CreateCollection", ProviderSettings.ProviderName); return result; } @@ -94,12 +94,12 @@ namespace WebsitePanel.Server } [WebMethod, SoapHeader("settings")] - public bool RemoveCollection(string organizationId, string tenantName, string collectionName) + public bool RemoveCollection(string organizationId, string collectionName) { try { Log.WriteStart("'{0}' RemoveCollection", ProviderSettings.ProviderName); - var result = RDSProvider.RemoveCollection(organizationId, tenantName, collectionName); + var result = RDSProvider.RemoveCollection(organizationId, collectionName); Log.WriteEnd("'{0}' RemoveCollection", ProviderSettings.ProviderName); return result; } From 399b24c7ce8f56ad65efdb3a7721b49c34205add Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Wed, 19 Nov 2014 15:30:39 +0300 Subject: [PATCH 021/146] 1)remove a RDS server form org - add check if server is in collection 2)RDS add server in colection - can add only servers witch are not in other collection. --- .../RemoteDesktopServicesController.cs | 2 +- .../WebsitePanel_SharedResources.ascx.resx | 3 +++ .../WebsitePanel/RDS/AssignedRDSServers.ascx.cs | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index f2a3ca42..9371ca1e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -422,7 +422,7 @@ namespace WebsitePanel.EnterpriseServer private static RdsServersPaged GetOrganizationRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { - DataSet ds = DataProvider.GetRDSServersPaged(itemId, null, filterColumn, filterValue, sortColumn, startRow, maximumRows, ignoreRdsCollectionId: true); + DataSet ds = DataProvider.GetRDSServersPaged(itemId, null, filterColumn, filterValue, sortColumn, startRow, maximumRows); RdsServersPaged result = new RdsServersPaged(); result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index f7a9f87f..7508ff20 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5593,4 +5593,7 @@ Error creating rds collection. You need to add at least 1 rds server to collection + + Error deleting rds server from organization: server is used in rds collection + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/AssignedRDSServers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/AssignedRDSServers.ascx.cs index af6144d6..906f8182 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/AssignedRDSServers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/AssignedRDSServers.ascx.cs @@ -32,6 +32,7 @@ using WebsitePanel.EnterpriseServer; using WebsitePanel.Providers.Common; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.OS; +using WebsitePanel.Providers.RemoteDesktopServices; using WebsitePanel.WebPortal; namespace WebsitePanel.Portal.RDS @@ -67,6 +68,13 @@ namespace WebsitePanel.Portal.RDS try { + RdsServer rdsServer = ES.Services.RDS.GetRdsServer(rdsServerId); + if (rdsServer.RdsCollectionId != null) + { + messageBox.ShowErrorMessage("RDS_UNASSIGN_SERVER_FROM_ORG_SERVER_IS_IN_COLLECTION"); + return; + } + ResultObject result = ES.Services.RDS.RemoveRdsServerFromOrganization(rdsServerId); if (!result.IsSuccess) { From 133de4b7472c26bfd5a5c8cc4df5a87ce203d4a9 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Wed, 19 Nov 2014 05:45:10 -0800 Subject: [PATCH 022/146] Mx and ns scheduled tasks fixes --- WebsitePanel/Database/update_db.sql | 104 ++++++++++++++++++ .../Data/DataProvider.cs | 17 ++- .../SchedulerTasks/DomainLookupViewTask.cs | 58 +++++++--- .../DomainLookup/DomainChanges.cs | 6 +- .../DomainLookup/DomainDnsRecordCompare.cs | 2 + .../DomainLookup/ScheduleTaskEmailTemplate.cs | 14 +++ .../WebsitePanel.Providers.Base.csproj | 1 + .../Windows2012.cs | 34 +++--- 8 files changed, 197 insertions(+), 39 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/DomainLookup/ScheduleTaskEmailTemplate.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 895c2d3f..e2f2f94a 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -6130,8 +6130,112 @@ REFERENCES [dbo].[Domains] ([DomainID]) ON DELETE CASCADE GO +IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'ScheduleTasksEmailTemplates') +DROP TABLE ScheduleTasksEmailTemplates +GO +CREATE TABLE ScheduleTasksEmailTemplates +( + [TaskID] [nvarchar](100) NOT NULL, + [ParameterID] [nvarchar](100) NOT NULL, + [Value] [nvarchar](Max) NULL +) +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTasksEmailTemplates] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP' AND [ParameterID]= N'MAIL_BODY' ) +BEGIN +INSERT [dbo].[ScheduleTasksEmailTemplates] ([TaskID], [ParameterID], [Value]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'MAIL_BODY', N' + + Account Summary Information + + + +
+ + +
+ MX and NS Information +
+ +

+Hello!, +

+ +

+Please, find below details for mx and ns changes. +

+ + + + + + + + + + + + + [RecordRow] + +
DomainDNSRecord TypeDataBase ValueDns Value
+ + +

+If you have any questions regarding your hosting account, feel free to contact our support department at any time. +

+ +

+Best regards +

+ +
+ +') +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTasksEmailTemplates] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP' AND [ParameterID]= N'MAIL_DOMAIN_RECORD' ) +BEGIN +INSERT [dbo].[ScheduleTasksEmailTemplates] ([TaskID], [ParameterID], [Value]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'MAIL_DOMAIN_RECORD',N'
[domain][dns][recordType][dbRecord][dnsRecord]
- +
@@ -37,7 +37,7 @@
- +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx index aebc0900..0adb8a73 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx @@ -117,12 +117,21 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ShowProgressDialog('Getting Remote Apps ...'); + Add... + + CloseProgressDialog(); + Add Apps + + CloseProgressDialog(); + Cancel diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionServers.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionServers.ascx.resx index 814527a9..58c6ab6f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionServers.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionServers.ascx.resx @@ -117,12 +117,21 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ShowProgressDialog('Getting RDS Servers ...'); + Add... + + CloseProgressDialog(); + Add Servers + + CloseProgressDialog(); + Cancel diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionServers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionServers.ascx index 272374a6..84ee87c1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionServers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionServers.ascx @@ -94,7 +94,7 @@