diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs index 8cf5ab0d..fe8a4b6e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs @@ -54,6 +54,7 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { using WebsitePanel.Providers.ResultObjects; + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] @@ -85,6 +86,8 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { private System.Threading.SendOrPostCallback AddOrganizationDomainOperationCompleted; + private System.Threading.SendOrPostCallback ChangeOrganizationDomainTypeOperationCompleted; + private System.Threading.SendOrPostCallback GetOrganizationDomainsOperationCompleted; private System.Threading.SendOrPostCallback DeleteOrganizationDomainOperationCompleted; @@ -145,6 +148,9 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { /// public event AddOrganizationDomainCompletedEventHandler AddOrganizationDomainCompleted; + /// + public event ChangeOrganizationDomainTypeCompletedEventHandler ChangeOrganizationDomainTypeCompleted; + /// public event GetOrganizationDomainsCompletedEventHandler GetOrganizationDomainsCompleted; @@ -180,20 +186,22 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int CreateOrganization(int packageId, string organizationID, string organizationName) { + public int CreateOrganization(int packageId, string organizationID, string organizationName, string domainName) { object[] results = this.Invoke("CreateOrganization", new object[] { packageId, organizationID, - organizationName}); + organizationName, + domainName}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginCreateOrganization(int packageId, string organizationID, string organizationName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateOrganization(int packageId, string organizationID, string organizationName, string domainName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateOrganization", new object[] { packageId, organizationID, - organizationName}, callback, asyncState); + organizationName, + domainName}, callback, asyncState); } /// @@ -203,19 +211,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName) { - this.CreateOrganizationAsync(packageId, organizationID, organizationName, null); + public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, string domainName) { + this.CreateOrganizationAsync(packageId, organizationID, organizationName, domainName, null); } /// - public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, object userState) { + public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, string domainName, object userState) { if ((this.CreateOrganizationOperationCompleted == null)) { this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); } this.InvokeAsync("CreateOrganization", new object[] { packageId, organizationID, - organizationName}, this.CreateOrganizationOperationCompleted, userState); + organizationName, + domainName}, this.CreateOrganizationOperationCompleted, userState); } private void OnCreateOrganizationOperationCompleted(object arg) { @@ -686,6 +695,53 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ChangeOrganizationDomainType", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int ChangeOrganizationDomainType(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType) { + object[] results = this.Invoke("ChangeOrganizationDomainType", new object[] { + itemId, + domainId, + newDomainType}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginChangeOrganizationDomainType(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ChangeOrganizationDomainType", new object[] { + itemId, + domainId, + newDomainType}, callback, asyncState); + } + + /// + public int EndChangeOrganizationDomainType(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void ChangeOrganizationDomainTypeAsync(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType) { + this.ChangeOrganizationDomainTypeAsync(itemId, domainId, newDomainType, null); + } + + /// + public void ChangeOrganizationDomainTypeAsync(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType, object userState) { + if ((this.ChangeOrganizationDomainTypeOperationCompleted == null)) { + this.ChangeOrganizationDomainTypeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnChangeOrganizationDomainTypeOperationCompleted); + } + this.InvokeAsync("ChangeOrganizationDomainType", new object[] { + itemId, + domainId, + newDomainType}, this.ChangeOrganizationDomainTypeOperationCompleted, userState); + } + + private void OnChangeOrganizationDomainTypeOperationCompleted(object arg) { + if ((this.ChangeOrganizationDomainTypeCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ChangeOrganizationDomainTypeCompleted(this, new ChangeOrganizationDomainTypeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationDomains", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public OrganizationDomainName[] GetOrganizationDomains(int itemId) { @@ -735,17 +791,6 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { domainId}); return ((int)(results[0])); } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ChangeOrganizationDomainType", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int ChangeOrganizationDomainType(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType) - { - object[] results = this.Invoke("ChangeOrganizationDomainType", new object[] { - itemId, - domainId, - newDomainType}); - return ((int)(results[0])); - } /// public System.IAsyncResult BeginDeleteOrganizationDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) { @@ -1721,6 +1766,32 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void ChangeOrganizationDomainTypeCompletedEventHandler(object sender, ChangeOrganizationDomainTypeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ChangeOrganizationDomainTypeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ChangeOrganizationDomainTypeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationDomainsCompletedEventHandler(object sender, GetOrganizationDomainsCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 13057b80..e86c6d8d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -281,7 +281,7 @@ namespace WebsitePanel.EnterpriseServer TaskManager.WriteError(ex); } } - public static int CreateOrganization(int packageId, string organizationId, string organizationName) + public static int CreateOrganization(int packageId, string organizationId, string organizationName, string domainName) { int itemId; int errorCode; @@ -291,6 +291,7 @@ namespace WebsitePanel.EnterpriseServer // place log record TaskManager.StartTask("ORGANIZATION", "CREATE_ORG", organizationName); TaskManager.TaskParameters["Organization ID"] = organizationId; + TaskManager.TaskParameters["DomainName"] = domainName; try { @@ -311,7 +312,12 @@ namespace WebsitePanel.EnterpriseServer return BusinessErrorCodes.ERROR_ORG_ID_EXISTS; //create temporary domain name; - string domainName = CreateTemporyDomainName(serviceId, organizationId); + if (string.IsNullOrEmpty(domainName)) + { + string tmpDomainName = CreateTemporyDomainName(serviceId, organizationId); + + if (!string.IsNullOrEmpty(tmpDomainName)) domainName = tmpDomainName; + } if (string.IsNullOrEmpty(domainName)) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 7419631a..6c7d9d64 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -9,7 +9,7 @@ --> - + @@ -17,7 +17,8 @@ --> - + + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs index f81ad8cf..38acbebf 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs @@ -46,9 +46,9 @@ namespace WebsitePanel.EnterpriseServer #region Organizations [WebMethod] - public int CreateOrganization(int packageId, string organizationID, string organizationName) + public int CreateOrganization(int packageId, string organizationID, string organizationName, string domainName) { - return OrganizationController.CreateOrganization(packageId, organizationID, organizationName); + return OrganizationController.CreateOrganization(packageId, organizationID, organizationName, domainName); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs index 21887292..26c14e00 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs @@ -199,7 +199,8 @@ namespace WebsitePanel.Providers.HostedSolution //create conferencing policy cmd = new Command("New-CsConferencingPolicy"); cmd.Parameters.Add("Identity", organizationId); - cmd.Parameters.Add("MaxMeetingSize", maxConferenceSize); + + cmd.Parameters.Add("MaxMeetingSize", ((maxConferenceSize == -1) | (maxConferenceSize > 250)) ? 250 : maxConferenceSize); cmd.Parameters.Add("AllowIPVideo", enableConferencingVideo); ExecuteShellCommand(runSpace, cmd, false); transaction.RegisterNewConferencingPolicy(organizationId); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateOrganization.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateOrganization.ascx.resx index 4b45044c..0f6fe988 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateOrganization.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateOrganization.ascx.resx @@ -156,4 +156,7 @@ * + + Domain Name: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.cs index cbdb9b0a..34e433ab 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.cs @@ -27,6 +27,10 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Data; +using System.Text; +using System.Collections.Generic; + using WebsitePanel.EnterpriseServer; using WebsitePanel.Providers.HostedSolution; @@ -38,7 +42,16 @@ namespace WebsitePanel.Portal.ExchangeServer { DomainInfo[] domains = ES.Services.Servers.GetMyDomains(PanelSecurity.PackageId); - OrganizationDomainName[] list = ES.Services.Organizations.GetOrganizationDomains(PanelRequest.ItemID); + Organization[] orgs = ES.Services.Organizations.GetOrganizations(PanelSecurity.PackageId, false); + + List list = new List(); + + foreach (Organization o in orgs) + { + OrganizationDomainName[] tmpList = ES.Services.Organizations.GetOrganizationDomains(o.Id); + + foreach (OrganizationDomainName name in tmpList) list.Add(name); + } foreach (DomainInfo d in domains) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx index a0bf4b3c..b44f5a68 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx @@ -43,6 +43,12 @@ ValidationGroup="CreateOrganization">* + + + + + +
list = new List(); + + foreach (Organization o in orgs) + { + OrganizationDomainName[] tmpList = ES.Services.Organizations.GetOrganizationDomains(o.Id); + + foreach (OrganizationDomainName name in tmpList) list.Add(name); + } + + foreach (DomainInfo d in domains) + { + if (!d.IsDomainPointer) + { + bool bAdd = true; + foreach (OrganizationDomainName acceptedDomain in list) + { + if (d.DomainName.ToLower() == acceptedDomain.DomainName.ToLower()) + { + bAdd = false; + break; + } + + } + if (bAdd) ddlDomains.Items.Add(d.DomainName.ToLower()); + } + } + + if (ddlDomains.Items.Count == 0) + { + ddlDomains.Visible = btnCreate.Enabled = false; + } } protected void btnCreate_Click(object sender, EventArgs e) @@ -52,7 +91,8 @@ namespace WebsitePanel.Portal.ExchangeServer { int itemId = ES.Services.Organizations.CreateOrganization(PanelSecurity.PackageId, - txtOrganizationID.Text.Trim().ToLower(), txtOrganizationName.Text.Trim().ToLower()); + txtOrganizationID.Text.Trim().ToLower(), txtOrganizationName.Text.Trim().ToLower(), + ddlDomains.SelectedValue.Trim().ToLower()); if (itemId < 0) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.designer.cs index 45ffb4d3..9aca7c7a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.designer.cs @@ -120,6 +120,24 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.RegularExpressionValidator valRequireCorrectOrgID; + /// + /// locDomainName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDomainName; + + /// + /// ddlDomains control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlDomains; + /// /// btnCreate control. /// @@ -137,14 +155,5 @@ namespace WebsitePanel.Portal.ExchangeServer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs index ddd4a058..bfec236e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs @@ -171,7 +171,7 @@ namespace WebsitePanel.Portal if (user.Role != UserRole.Reseller) { - ES.Services.Organizations.CreateOrganization(result.Result, domainName.ToLower(), domainName.ToLower()); + ES.Services.Organizations.CreateOrganization(result.Result, domainName.ToLower(), domainName.ToLower(), domainName.ToLower()); if (result.Result < 0) { diff --git a/WebsitePanel/Sources/generate_es_proxies.bat b/WebsitePanel/Sources/generate_es_proxies.bat index d6b8b5e1..5a4fbd8d 100644 --- a/WebsitePanel/Sources/generate_es_proxies.bat +++ b/WebsitePanel/Sources/generate_es_proxies.bat @@ -56,8 +56,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OCSProxy.cs REM %WSDL% %SERVER_URL%/esOperatingSystems.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OperatingSystemsProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OperatingSystemsProxy.cs -REM %WSDL% %SERVER_URL%/esOrganizations.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs /namespace:WebsitePanel.EnterpriseServer.HostedSolution /type:webClient -REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs +%WSDL% %SERVER_URL%/esOrganizations.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs /namespace:WebsitePanel.EnterpriseServer.HostedSolution /type:webClient +%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs REM %WSDL% %SERVER_URL%/esPackages.asmx /out:.\WebsitePanel.EnterpriseServer.Client\PackagesProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\PackagesProxy.cs @@ -86,8 +86,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxy REM %WSDL% %SERVER_URL%/esWebApplicationGallery.asmx /out:.\WebsitePanel.EnterpriseServer.Client\WebApplicationGalleryProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\WebApplicationGalleryProxy.cs -%WSDL% %SERVER_URL%/esWebServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\WebServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient -%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\WebServersProxy.cs +REM %WSDL% %SERVER_URL%/esWebServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\WebServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\WebServersProxy.cs REM %WSDL% %SERVER_URL%/esVirtualizationServerForPrivateCloud.asmx /out:.\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxyForPrivateCloud.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxyForPrivateCloud.cs