diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index dc73f195..83559c7b 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -454,3 +454,324 @@ GO -- add Application Pools Restart Quota INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (411, 2, 13, N'Web.AppPoolsRestart', N'Application Pools Restart', 1, 0, NULL, NULL) GO + +-- Lync Enterprise Voice + +BEGIN +ALTER TABLE [dbo].[LyncUserPlans] ADD + +[RemoteUserAccess] [bit] NOT NULL DEFAULT 0, +[PublicIMConnectivity] [bit] NOT NULL DEFAULT 0, + +[AllowOrganizeMeetingsWithExternalAnonymous] [bit] NOT NULL DEFAULT 0, + +[Telephony] [int] NULL, + +[ServerURI] [nvarchar](300) NULL, + +[ArchivePolicy] [nvarchar](300) NULL, +[TelephonyDialPlanPolicy] [nvarchar](300) NULL, +[TelephonyVoicePolicy] [nvarchar](300) NULL + + +END +Go + +-- + +DROP PROCEDURE GetLyncUserPlan; + +DROP PROCEDURE AddLyncUserPlan; + +DROP PROCEDURE UpdateLyncUserPlan; + +DROP PROCEDURE DeleteLyncUserPlan; + +-- + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'DeleteLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[DeleteLyncUserPlan] +( + @LyncUserPlanId int +) +AS + +-- delete lyncuserplan +DELETE FROM LyncUserPlans +WHERE LyncUserPlanId = @LyncUserPlanId + +RETURN' +END +GO + +-- + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'UpdateLyncUserPlan') +BEGIN +EXEC sp_executesql N' CREATE PROCEDURE [dbo].[UpdateLyncUserPlan] +( + @LyncUserPlanId int, + @LyncUserPlanName nvarchar(300), + @LyncUserPlanType int, + @IM bit, + @Mobility bit, + @MobilityEnableOutsideVoice bit, + @Federation bit, + @Conferencing bit, + @EnterpriseVoice bit, + @VoicePolicy int, + @IsDefault bit, + + @RemoteUserAccess bit, + @PublicIMConnectivity bit, + + @AllowOrganizeMeetingsWithExternalAnonymous bit, + + @Telephony int, + + @ServerURI nvarchar(300), + + @ArchivePolicy nvarchar(300), + + @TelephonyDialPlanPolicy nvarchar(300), + @TelephonyVoicePolicy nvarchar(300) +) +AS + +UPDATE LyncUserPlans SET + LyncUserPlanName = @LyncUserPlanName, + LyncUserPlanType = @LyncUserPlanType, + IM = @IM, + Mobility = @Mobility, + MobilityEnableOutsideVoice = @MobilityEnableOutsideVoice, + Federation = @Federation, + Conferencing =@Conferencing, + EnterpriseVoice = @EnterpriseVoice, + VoicePolicy = @VoicePolicy, + IsDefault = @IsDefault, + + RemoteUserAccess = @RemoteUserAccess, + PublicIMConnectivity = @PublicIMConnectivity, + + AllowOrganizeMeetingsWithExternalAnonymous = @AllowOrganizeMeetingsWithExternalAnonymous, + + Telephony = @Telephony, + + ServerURI = @ServerURI, + + ArchivePolicy = @ArchivePolicy, + TelephonyDialPlanPolicy = @TelephonyDialPlanPolicy, + TelephonyVoicePolicy = @TelephonyVoicePolicy + +WHERE LyncUserPlanId = @LyncUserPlanId + + +RETURN' +END +GO + +-- + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'AddLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[AddLyncUserPlan] +( + @LyncUserPlanId int OUTPUT, + @ItemID int, + @LyncUserPlanName nvarchar(300), + @LyncUserPlanType int, + @IM bit, + @Mobility bit, + @MobilityEnableOutsideVoice bit, + @Federation bit, + @Conferencing bit, + @EnterpriseVoice bit, + @VoicePolicy int, + @IsDefault bit, + + @RemoteUserAccess bit, + @PublicIMConnectivity bit, + + @AllowOrganizeMeetingsWithExternalAnonymous bit, + + @Telephony int, + + @ServerURI nvarchar(300), + + @ArchivePolicy nvarchar(300), + @TelephonyDialPlanPolicy nvarchar(300), + @TelephonyVoicePolicy nvarchar(300) + +) +AS + + + +IF (((SELECT Count(*) FROM LyncUserPlans WHERE ItemId = @ItemID) = 0) AND (@LyncUserPlanType=0)) +BEGIN + SET @IsDefault = 1 +END +ELSE +BEGIN + IF ((@IsDefault = 1) AND (@LyncUserPlanType=0)) + BEGIN + UPDATE LyncUserPlans SET IsDefault = 0 WHERE ItemID = @ItemID + END +END + + +INSERT INTO LyncUserPlans +( + ItemID, + LyncUserPlanName, + LyncUserPlanType, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault, + + RemoteUserAccess, + PublicIMConnectivity, + + AllowOrganizeMeetingsWithExternalAnonymous, + + Telephony, + + ServerURI, + + ArchivePolicy, + TelephonyDialPlanPolicy, + TelephonyVoicePolicy + +) +VALUES +( + @ItemID, + @LyncUserPlanName, + @LyncUserPlanType, + @IM, + @Mobility, + @MobilityEnableOutsideVoice, + @Federation, + @Conferencing, + @EnterpriseVoice, + @VoicePolicy, + @IsDefault, + + @RemoteUserAccess, + @PublicIMConnectivity, + + @AllowOrganizeMeetingsWithExternalAnonymous, + + @Telephony, + + @ServerURI, + + @ArchivePolicy, + @TelephonyDialPlanPolicy, + @TelephonyVoicePolicy + +) + +SET @LyncUserPlanId = SCOPE_IDENTITY() + +RETURN' +END +GO + +-- + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetLyncUserPlan] +( + @LyncUserPlanId int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + LyncUserPlanType, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault, + + RemoteUserAccess, + PublicIMConnectivity, + + AllowOrganizeMeetingsWithExternalAnonymous, + + Telephony, + + ServerURI, + + ArchivePolicy, + TelephonyDialPlanPolicy, + TelephonyVoicePolicy + +FROM + LyncUserPlans +WHERE + LyncUserPlanId = @LyncUserPlanId +RETURN' +END +GO + + + + + +ALTER PROCEDURE [dbo].[GetLyncUserPlan] +( + @LyncUserPlanId int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + LyncUserPlanType, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault, + + RemoteUserAccess, + PublicIMConnectivity, + + AllowOrganizeMeetingsWithExternalAnonymous, + + Telephony, + + ServerURI, + + ArchivePolicy, + TelephonyDialPlanPolicy, + TelephonyVoicePolicy + +FROM + LyncUserPlans +WHERE + LyncUserPlanId = @LyncUserPlanId +RETURN +GO + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs index cce2aeac..952cc22f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs @@ -912,6 +912,15 @@ namespace WebsitePanel.EnterpriseServer { this.RemoveFederationDomainCompleted(this, new RemoveFederationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetPolicyList", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string[] GetPolicyList(int itemId, LyncPolicyType type, string name) + { + object[] results = this.Invoke("GetPolicyList", new object[] { + itemId, type, name}); + return ((string[])(results[0])); + } /// public new void CancelAsync(object userState) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs index 0aaf98a5..ae5d603b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs @@ -3444,7 +3444,20 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@Conferencing", lyncUserPlan.Conferencing), new SqlParameter("@EnterpriseVoice", lyncUserPlan.EnterpriseVoice), new SqlParameter("@VoicePolicy", lyncUserPlan.VoicePolicy), - new SqlParameter("@IsDefault", lyncUserPlan.IsDefault) + new SqlParameter("@IsDefault", lyncUserPlan.IsDefault), + + new SqlParameter("@RemoteUserAccess", lyncUserPlan.RemoteUserAccess), + new SqlParameter("@PublicIMConnectivity", lyncUserPlan.PublicIMConnectivity), + + new SqlParameter("@AllowOrganizeMeetingsWithExternalAnonymous", lyncUserPlan.AllowOrganizeMeetingsWithExternalAnonymous), + + new SqlParameter("@Telephony", lyncUserPlan.Telephony), + + new SqlParameter("@ServerURI", lyncUserPlan.ServerURI), + + new SqlParameter("@ArchivePolicy", lyncUserPlan.ArchivePolicy), + new SqlParameter("@TelephonyDialPlanPolicy", lyncUserPlan.TelephonyDialPlanPolicy), + new SqlParameter("@TelephonyVoicePolicy", lyncUserPlan.TelephonyVoicePolicy) ); return Convert.ToInt32(outParam.Value); @@ -3467,7 +3480,20 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@Conferencing", lyncUserPlan.Conferencing), new SqlParameter("@EnterpriseVoice", lyncUserPlan.EnterpriseVoice), new SqlParameter("@VoicePolicy", lyncUserPlan.VoicePolicy), - new SqlParameter("@IsDefault", lyncUserPlan.IsDefault) + new SqlParameter("@IsDefault", lyncUserPlan.IsDefault), + + new SqlParameter("@RemoteUserAccess", lyncUserPlan.RemoteUserAccess), + new SqlParameter("@PublicIMConnectivity", lyncUserPlan.PublicIMConnectivity), + + new SqlParameter("@AllowOrganizeMeetingsWithExternalAnonymous", lyncUserPlan.AllowOrganizeMeetingsWithExternalAnonymous), + + new SqlParameter("@Telephony", lyncUserPlan.Telephony), + + new SqlParameter("@ServerURI", lyncUserPlan.ServerURI), + + new SqlParameter("@ArchivePolicy", lyncUserPlan.ArchivePolicy), + new SqlParameter("@TelephonyDialPlanPolicy", lyncUserPlan.TelephonyDialPlanPolicy), + new SqlParameter("@TelephonyVoicePolicy", lyncUserPlan.TelephonyVoicePolicy) ); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs index a72d5b59..9652202e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs @@ -53,8 +53,11 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution List resSettings = new List(lyncSettings); - ExtendLyncSettings(resSettings, "primarydomaincontroller", GetProviderProperty(organizationServiceId, "primarydomaincontroller")); - ExtendLyncSettings(resSettings, "rootou", GetProviderProperty(organizationServiceId, "rootou")); + if (organizationServiceId != -1) + { + ExtendLyncSettings(resSettings, "primarydomaincontroller", GetProviderProperty(organizationServiceId, "primarydomaincontroller")); + ExtendLyncSettings(resSettings, "rootou", GetProviderProperty(organizationServiceId, "rootou")); + } ws.ServiceProviderSettingsSoapHeaderValue.Settings = resSettings.ToArray(); return ws; } @@ -345,6 +348,13 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution { LyncUserResult res = TaskManager.StartResultTask("LYNC", "SET_LYNC_USER_GENERAL_SETTINGS"); + string PIN = ""; + + string[] uriAndPin = ("" + lineUri).Split(':'); + + if (uriAndPin.Length > 0) lineUri = uriAndPin[0]; + if (uriAndPin.Length > 1) PIN = uriAndPin[1]; + LyncUser user = null; try @@ -378,20 +388,22 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution if (!string.IsNullOrEmpty(sipAddress)) { - if (sipAddress != usr.UserPrincipalName) + if (user.SipAddress != sipAddress) { - if (DataProvider.LyncUserExists(accountId, sipAddress)) + if (sipAddress != usr.UserPrincipalName) { - TaskManager.CompleteResultTask(res, LyncErrorCodes.ADDRESS_ALREADY_USED); - return res; + if (DataProvider.LyncUserExists(accountId, sipAddress)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.ADDRESS_ALREADY_USED); + return res; + } } + user.SipAddress = sipAddress; } - - user.SipAddress = sipAddress; - } - if (!string.IsNullOrEmpty(lineUri)) user.LineUri = lineUri; + user.LineUri = lineUri; + user.PIN = PIN; lync.SetLyncUserGeneralSettings(org.OrganizationId, usr.UserPrincipalName, user); @@ -411,7 +423,6 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } - public static int DeleteOrganization(int itemId) { // check account @@ -1011,6 +1022,51 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution #endregion + public static string[] GetPolicyList(int itemId, LyncPolicyType type, string name) + { + string[] ret = null; + try + { + if (itemId == -1) + { + // policy list in all lync servers + List allpolicylist = new List(); + List servers = ServerController.GetAllServers(); + foreach (ServerInfo server in servers) + { + List services = ServerController.GetServicesByServerIdGroupName(server.ServerId, ResourceGroups.Lync); + foreach (ServiceInfo service in services) + { + LyncServer lync = GetLyncServer(service.ServiceId, -1); + string[] values = lync.GetPolicyList(type, name); + foreach (string val in values) + if (allpolicylist.IndexOf(val) == -1) + allpolicylist.Add(val); + } + + } + ret = allpolicylist.ToArray(); + } + else + { + + Organization org = (Organization)PackageController.GetPackageItem(itemId); + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + ret = lync.GetPolicyList(type, name); + } + } + catch (Exception ex) + { + } + finally + { + } + + return ret; + } #region Private methods public static UInt64 ConvertPhoneNumberToLong(string ip) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs index 8006be54..3b35d88c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs @@ -151,5 +151,12 @@ namespace WebsitePanel.EnterpriseServer } #endregion + + [WebMethod] + public string[] GetPolicyList(int itemId, LyncPolicyType type, string name) + { + return LyncController.GetPolicyList(itemId, type, name); + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs index 16d7e005..39dee306 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs @@ -48,5 +48,7 @@ namespace WebsitePanel.Providers.HostedSolution bool RemoveFederationDomain(string organizationId, string domainName); void ReloadConfiguration(); + + string[] GetPolicyList(LyncPolicyType type, string name); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncPolicyType.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncPolicyType.cs new file mode 100644 index 00000000..d1971d37 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncPolicyType.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public enum LyncPolicyType + { + Archiving = 0, + DialPlan = 1, + Voice = 2, + Pin = 3 + } + +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs index e95a9436..dc5f7931 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs @@ -41,5 +41,7 @@ namespace WebsitePanel.Providers.HostedSolution public int AccountID { get; set; } public int LyncUserPlanId { get; set; } public string LyncUserPlanName { get; set; } + + public string PIN { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserPlan.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserPlan.cs index 75fac709..ea5ea424 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserPlan.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserPlan.cs @@ -122,6 +122,63 @@ namespace WebsitePanel.Providers.HostedSolution set { this.voicePolicy = value; } } + bool remoteUserAccess; + bool publicIMConnectivity; + bool allowOrganizeMeetingsWithExternalAnonymous; + + int telephony; + + string serverURI; + + string archivePolicy; + string telephonyDialPlanPolicy; + string telephonyVoicePolicy; + + public bool RemoteUserAccess + { + get { return this.remoteUserAccess; } + set { this.remoteUserAccess = value; } + } + public bool PublicIMConnectivity + { + get { return this.publicIMConnectivity; } + set { this.publicIMConnectivity = value; } + } + + public bool AllowOrganizeMeetingsWithExternalAnonymous + { + get { return this.allowOrganizeMeetingsWithExternalAnonymous; } + set { this.allowOrganizeMeetingsWithExternalAnonymous = value; } + } + + public int Telephony + { + get { return this.telephony; } + set { this.telephony = value; } + } + + public string ServerURI + { + get { return this.serverURI; } + set { this.serverURI = value; } + } + + public string ArchivePolicy + { + get { return this.archivePolicy; } + set { this.archivePolicy = value; } + } + + public string TelephonyDialPlanPolicy + { + get { return this.telephonyDialPlanPolicy; } + set { this.telephonyDialPlanPolicy = value; } + } + public string TelephonyVoicePolicy + { + get { return this.telephonyVoicePolicy; } + set { this.telephonyVoicePolicy = value; } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index 9b6ebfe7..4aa7d9d3 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -92,6 +92,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs index be5e9397..9b91a9fe 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs @@ -163,6 +163,11 @@ namespace WebsitePanel.Providers.HostedSolution ReloadConfigurationInternal(); } + public string[] GetPolicyList(LyncPolicyType type, string name) + { + return GetPolicyListInternal(type, name); + } + #endregion #region organization @@ -297,8 +302,8 @@ namespace WebsitePanel.Providers.HostedSolution string path = AddADPrefix(GetOrganizationPath(organizationId)); DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path); string[] sipDs = (string[])ActiveDirectoryUtils.GetADObjectPropertyMultiValue(ou, "msRTCSIP-Domains"); - - foreach (string sipD in sipDs) + + foreach (string sipD in sipDs) DeleteSipDomain(runSpace, sipD); //clear the msRTCSIP-Domains, TenantID, ObjectID @@ -518,6 +523,8 @@ namespace WebsitePanel.Providers.HostedSolution lyncUser.LineUri = (string)GetPSObjectProperty(user, "LineURI"); lyncUser.SipAddress = lyncUser.SipAddress.ToLower().Replace("sip:", ""); + lyncUser.LineUri = lyncUser.LineUri.ToLower().Replace("tel:+", ""); + lyncUser.LineUri = lyncUser.LineUri.ToLower().Replace("tel:", ""); } catch (Exception ex) { @@ -611,11 +618,20 @@ namespace WebsitePanel.Providers.HostedSolution cmd = new Command("Set-CsUser"); cmd.Parameters.Add("Identity", userUpn); - if (!string.IsNullOrEmpty(lyncUser.SipAddress)) cmd.Parameters.Add("SipAddress", "SIP:"+lyncUser.SipAddress); - if (!string.IsNullOrEmpty(lyncUser.SipAddress)) cmd.Parameters.Add("LineUri", lyncUser.LineUri); - + if (!string.IsNullOrEmpty(lyncUser.SipAddress)) cmd.Parameters.Add("SipAddress", "SIP:" + lyncUser.SipAddress); + if (!string.IsNullOrEmpty(lyncUser.LineUri)) cmd.Parameters.Add("LineUri", "TEL:+" + lyncUser.LineUri); + else cmd.Parameters.Add("LineUri", null); ExecuteShellCommand(runSpace, cmd, false); + if (!String.IsNullOrEmpty(lyncUser.PIN)) + { + cmd = new Command("Set-CsClientPin"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("Pin", lyncUser.PIN); + ExecuteShellCommand(runSpace, cmd, false); + } + + //initiate addressbook generation cmd = new Command("Update-CsAddressBook"); ExecuteShellCommand(runSpace, cmd, false); @@ -657,8 +673,14 @@ namespace WebsitePanel.Providers.HostedSolution bCloseRunSpace = true; } + // EnterpriseVoice + Command cmd = new Command("Set-CsUser"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("EnterpriseVoiceEnabled", plan.EnterpriseVoice); + ExecuteShellCommand(runSpace, cmd, false); + //CsExternalAccessPolicy - Command cmd = new Command("Grant-CsExternalAccessPolicy"); + cmd = new Command("Grant-CsExternalAccessPolicy"); cmd.Parameters.Add("Identity", userUpn); cmd.Parameters.Add("PolicyName", plan.Federation ? organizationId : null); ExecuteShellCommand(runSpace, cmd); @@ -678,6 +700,24 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("PolicyName", null); ExecuteShellCommand(runSpace, cmd); + // ArchivePolicy + cmd = new Command("Grant-CsArchivingPolicy"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("PolicyName", string.IsNullOrEmpty(plan.ArchivePolicy) ? null : plan.ArchivePolicy); + ExecuteShellCommand(runSpace, cmd); + + // DialPlan + cmd = new Command("Grant-CsDialPlan"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("PolicyName", string.IsNullOrEmpty(plan.TelephonyDialPlanPolicy) ? null : plan.TelephonyDialPlanPolicy); + ExecuteShellCommand(runSpace, cmd); + + // VoicePolicy + cmd = new Command("Grant-CsVoicePolicy"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("PolicyName", string.IsNullOrEmpty(plan.TelephonyVoicePolicy) ? null : plan.TelephonyVoicePolicy); + ExecuteShellCommand(runSpace, cmd); + //initiate user database replication cmd = new Command("Update-CsUserDatabase"); ExecuteShellCommand(runSpace, cmd, false); @@ -887,6 +927,90 @@ namespace WebsitePanel.Providers.HostedSolution HostedSolutionLog.LogEnd("DeleteMobilityPolicy"); } + internal string[] GetPolicyListInternal(LyncPolicyType type, string name) + { + List ret = new List(); + + switch (type) + { + case LyncPolicyType.Archiving: + { + Runspace runSpace = OpenRunspace(); + Command cmd = new Command("Get-CsArchivingPolicy"); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + foreach (PSObject res in result) + { + string Identity = GetPSObjectProperty(res, "Identity").ToString(); + ret.Add(Identity); + } + } + } + break; + case LyncPolicyType.DialPlan: + { + Runspace runSpace = OpenRunspace(); + Command cmd = new Command("Get-CsDialPlan"); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + foreach (PSObject res in result) + { + string Identity = GetPSObjectProperty(res, "Identity").ToString(); + string Description = "" + (string)GetPSObjectProperty(res, "Description"); + if (Description.ToLower().IndexOf(name.ToLower()) == -1) continue; + ret.Add(Identity); + } + + + } + } + break; + case LyncPolicyType.Voice: + { + Runspace runSpace = OpenRunspace(); + Command cmd = new Command("Get-CsVoicePolicy"); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + foreach (PSObject res in result) + { + string Identity = GetPSObjectProperty(res, "Identity").ToString(); + string Description = "" + (string)GetPSObjectProperty(res, "Description"); + if (Description.ToLower().IndexOf(name.ToLower()) == -1) continue; + + ret.Add(Identity); + } + + + } + } + break; + case LyncPolicyType.Pin: + { + Runspace runSpace = OpenRunspace(); + Command cmd = new Command("Get-CsPinPolicy"); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + foreach (PSObject res in result) + { + string Identity = GetPSObjectProperty(res, "Identity").ToString(); + string str = "" + GetPSObjectProperty(res, name); + ret.Add(str); + } + } + } + break; + + } + + + + return ret.ToArray(); + } + #endregion #region Sytsem Related Methods diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs index 299ccff6..afb3f428 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs @@ -627,6 +627,16 @@ namespace WebsitePanel.Providers.Lync { this.ReloadConfigurationCompleted(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/GetPolicyList", 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[] GetPolicyList(LyncPolicyType type, string name) + { + object[] results = this.Invoke("GetPolicyList", new object[] { + type, name}); + return ((string[])(results[0])); + } /// public new void CancelAsync(object userState) { diff --git a/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs index b55428ec..9e0e09e6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs @@ -247,7 +247,25 @@ namespace WebsitePanel.Server } } + [WebMethod, SoapHeader("settings")] + public string[] GetPolicyList(LyncPolicyType type, string name) + { + string[] ret = null; + try + { + Log.WriteStart("{0}.GetPolicyList", ProviderSettings.ProviderName); + ret = Lync.GetPolicyList(type, name); + Log.WriteEnd("{0}.GetPolicyList", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.GetPolicyList", ProviderSettings.ProviderName), ex); + throw; + } + + return ret; + } } 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 ac187873..c51c4818 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5262,6 +5262,12 @@ Mailbox plan updated + + Lync plan update failed + + + Lync plan updated + Failed to apply plans template diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx index e68f1c13..3c9b8873 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx @@ -60,11 +60,6 @@ - - - - - @@ -78,7 +73,136 @@
- + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+
+ + + + + + + + + +
+ + + +
+
+
+ + + + + + + + +
+ +
+
+
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + +
+ + + +
+
+ + + + + + + +
+ + + +
+
+ +
+
+ + + <%-- Disable because not used @@ -115,7 +239,7 @@
- + --%>
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.cs index 58072ca2..2bc16610 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.cs @@ -40,9 +40,19 @@ namespace WebsitePanel.Portal.Lync if (!IsPostBack) { - PackageContext cntx = ES.Services.Packages.GetPackageContext(PanelSecurity.PackageId); + string[] archivePolicy = ES.Services.Lync.GetPolicyList(PanelRequest.ItemID, LyncPolicyType.Archiving, null); + if (archivePolicy != null) + { + foreach (string policy in archivePolicy) + { + if (policy.ToLower()=="global") continue; + string txt = policy.Replace("Tag:",""); + ddArchivingPolicy.Items.Add( new System.Web.UI.WebControls.ListItem( txt, policy) ); + } + } + if (PanelRequest.GetInt("LyncUserPlanId") != 0) { Providers.HostedSolution.LyncUserPlan plan = ES.Services.Lync.GetLyncUserPlan(PanelRequest.ItemID, PanelRequest.GetInt("LyncUserPlanId")); @@ -54,6 +64,8 @@ namespace WebsitePanel.Portal.Lync chkConferencing.Checked = plan.Conferencing; chkMobility.Checked = plan.Mobility; chkEnterpriseVoice.Checked = plan.EnterpriseVoice; + + /* because not used switch (plan.VoicePolicy) { case LyncVoicePolicyType.None: @@ -74,16 +86,40 @@ namespace WebsitePanel.Portal.Lync chkNone.Checked = true; break; } + */ + + chkRemoteUserAccess.Checked = plan.RemoteUserAccess; + chkPublicIMConnectivity.Checked = plan.PublicIMConnectivity; + + chkAllowOrganizeMeetingsWithExternalAnonymous.Checked = plan.AllowOrganizeMeetingsWithExternalAnonymous; + + ddTelephony.SelectedIndex = plan.Telephony; + + tbServerURI.Text = plan.ServerURI; locTitle.Text = plan.LyncUserPlanName; this.DisableControls = true; + string planArchivePolicy = ""; + if (plan.ArchivePolicy != null) planArchivePolicy = plan.ArchivePolicy; + string planTelephonyDialPlanPolicy = ""; + if (plan.TelephonyDialPlanPolicy != null) planTelephonyDialPlanPolicy = plan.TelephonyDialPlanPolicy; + string planTelephonyVoicePolicy = ""; + if (plan.TelephonyVoicePolicy != null) planTelephonyVoicePolicy = plan.TelephonyVoicePolicy; + + ddArchivingPolicy.Items.Clear(); + ddArchivingPolicy.Items.Add(new System.Web.UI.WebControls.ListItem(planArchivePolicy.Replace("Tag:", ""), planArchivePolicy)); + ddTelephonyDialPlanPolicy.Items.Clear(); + ddTelephonyDialPlanPolicy.Items.Add(new System.Web.UI.WebControls.ListItem(planTelephonyDialPlanPolicy.Replace("Tag:", ""), planTelephonyDialPlanPolicy)); + ddTelephonyVoicePolicy.Items.Clear(); + ddTelephonyVoicePolicy.Items.Add(new System.Web.UI.WebControls.ListItem(planTelephonyVoicePolicy.Replace("Tag:", ""), planTelephonyVoicePolicy)); + } else { chkIM.Checked = true; chkIM.Enabled = false; - chkNone.Checked = true; + // chkNone.Checked = true; because not used if (cntx != null) { foreach (QuotaValueInfo quota in cntx.QuotasArray) @@ -110,6 +146,29 @@ namespace WebsitePanel.Portal.Lync } } + chkEnterpriseVoice.Enabled = false; + chkEnterpriseVoice.Checked = false; + + pnEnterpriseVoice.Visible = false; + pnServerURI.Visible = false; + + switch (ddTelephony.SelectedIndex) + { + case 1: + break; + case 2: + pnEnterpriseVoice.Visible = true; + chkEnterpriseVoice.Checked = true; + break; + case 3: + pnServerURI.Visible = true; + break; + case 4: + pnServerURI.Visible = true; + break; + + } + } protected void btnAdd_Click(object sender, EventArgs e) @@ -117,6 +176,37 @@ namespace WebsitePanel.Portal.Lync AddPlan(); } + protected void btnAccept_Click(object sender, EventArgs e) + { + string name = tbTelephoneProvider.Text; + + if (string.IsNullOrEmpty(name)) return; + + ddTelephonyDialPlanPolicy.Items.Clear(); + string[] dialPlan = ES.Services.Lync.GetPolicyList(PanelRequest.ItemID, LyncPolicyType.DialPlan, name); + if (dialPlan != null) + { + foreach (string policy in dialPlan) + { + if (policy.ToLower() == "global") continue; + string txt = policy.Replace("Tag:", ""); + ddTelephonyDialPlanPolicy.Items.Add(new System.Web.UI.WebControls.ListItem(txt, policy)); + } + } + + ddTelephonyVoicePolicy.Items.Clear(); + string[] voicePolicy = ES.Services.Lync.GetPolicyList(PanelRequest.ItemID, LyncPolicyType.Voice, name); + if (voicePolicy != null) + { + foreach (string policy in voicePolicy) + { + if (policy.ToLower() == "global") continue; + string txt = policy.Replace("Tag:", ""); + ddTelephonyVoicePolicy.Items.Add(new System.Web.UI.WebControls.ListItem(txt, policy)); + } + } + } + private void AddPlan() { try @@ -132,6 +222,10 @@ namespace WebsitePanel.Portal.Lync plan.EnterpriseVoice = chkEnterpriseVoice.Checked; + + plan.VoicePolicy = LyncVoicePolicyType.None; + + /* because not used if (!plan.EnterpriseVoice) { plan.VoicePolicy = LyncVoicePolicyType.None; @@ -149,7 +243,21 @@ namespace WebsitePanel.Portal.Lync else plan.VoicePolicy = LyncVoicePolicyType.None; - } + } + */ + + plan.RemoteUserAccess = chkRemoteUserAccess.Checked; + plan.PublicIMConnectivity = chkPublicIMConnectivity.Checked; + + plan.AllowOrganizeMeetingsWithExternalAnonymous = chkAllowOrganizeMeetingsWithExternalAnonymous.Checked; + + plan.Telephony = ddTelephony.SelectedIndex; + + plan.ServerURI = tbServerURI.Text; + + plan.ArchivePolicy = ddArchivingPolicy.SelectedValue; + plan.TelephonyDialPlanPolicy = ddTelephonyDialPlanPolicy.SelectedValue; + plan.TelephonyVoicePolicy = ddTelephonyVoicePolicy.SelectedValue; int result = ES.Services.Lync.AddLyncUserPlan(PanelRequest.ItemID, plan); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs index d3a71282..2b9ef0b7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs @@ -1,40 +1,11 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ - namespace WebsitePanel.Portal.Lync { @@ -166,15 +137,6 @@ namespace WebsitePanel.Portal.Lync { /// protected global::System.Web.UI.WebControls.CheckBox chkMobility; - /// - /// chkFederation control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CheckBox chkFederation; - /// /// chkConferencing control. /// @@ -194,67 +156,256 @@ namespace WebsitePanel.Portal.Lync { protected global::System.Web.UI.WebControls.CheckBox chkEnterpriseVoice; /// - /// secEnterpriseVoice control. + /// secPlanFeaturesFederation control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.CollapsiblePanel secEnterpriseVoice; + protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesFederation; /// - /// EnterpriseVoice control. + /// PlanFeaturesFederation control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Panel EnterpriseVoice; + protected global::System.Web.UI.WebControls.Panel PlanFeaturesFederation; /// - /// chkNone control. + /// chkFederation control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RadioButton chkNone; + protected global::System.Web.UI.WebControls.CheckBox chkFederation; /// - /// chkEmergency control. + /// chkRemoteUserAccess control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RadioButton chkEmergency; + protected global::System.Web.UI.WebControls.CheckBox chkRemoteUserAccess; /// - /// chkNational control. + /// chkPublicIMConnectivity control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RadioButton chkNational; + protected global::System.Web.UI.WebControls.CheckBox chkPublicIMConnectivity; /// - /// chkMobile control. + /// secPlanFeaturesArchiving control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RadioButton chkMobile; + protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesArchiving; /// - /// chkInternational control. + /// PlanFeaturesArchiving control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RadioButton chkInternational; + protected global::System.Web.UI.WebControls.Panel PlanFeaturesArchiving; + + /// + /// locArchivingPolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locArchivingPolicy; + + /// + /// ddArchivingPolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddArchivingPolicy; + + /// + /// secPlanFeaturesMeeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesMeeting; + + /// + /// PlanFeaturesMeeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PlanFeaturesMeeting; + + /// + /// chkAllowOrganizeMeetingsWithExternalAnonymous control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkAllowOrganizeMeetingsWithExternalAnonymous; + + /// + /// secPlanFeaturesTelephony control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesTelephony; + + /// + /// PlanFeaturesTelephony control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PlanFeaturesTelephony; + + /// + /// locTelephony control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTelephony; + + /// + /// ddTelephony control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddTelephony; + + /// + /// pnEnterpriseVoice control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnEnterpriseVoice; + + /// + /// locTelephonyProvider control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTelephonyProvider; + + /// + /// tbTelephoneProvider control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox tbTelephoneProvider; + + /// + /// btnAccept control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAccept; + + /// + /// AcceptRequiredValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator AcceptRequiredValidator; + + /// + /// locDialPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDialPlan; + + /// + /// ddTelephonyDialPlanPolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddTelephonyDialPlanPolicy; + + /// + /// locVoicePolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locVoicePolicy; + + /// + /// ddTelephonyVoicePolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddTelephonyVoicePolicy; + + /// + /// pnServerURI control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnServerURI; + + /// + /// locServerURI control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locServerURI; + + /// + /// tbServerURI control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox tbServerURI; /// /// btnAdd control. @@ -273,14 +424,5 @@ namespace WebsitePanel.Portal.Lync { /// 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/Lync/LyncCreateUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx index 4d36dcf4..92d9ad13 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx @@ -43,11 +43,41 @@ - + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+
-
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.cs index eabe3e15..24e9e225 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.cs @@ -30,6 +30,9 @@ using WebsitePanel.Providers.ResultObjects; using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + + namespace WebsitePanel.Portal.Lync { public partial class CreateLyncUser : WebsitePanelModuleBase @@ -43,8 +46,42 @@ namespace WebsitePanel.Portal.Lync if (plans.Length == 0) btnCreate.Enabled = false; } + } + protected void Page_PreRender(object sender, EventArgs e) + { + bool EnterpriseVoice = false; + + WebsitePanel.Providers.HostedSolution.LyncUserPlan plan = planSelector.plan; + if (plan != null) + EnterpriseVoice = plan.EnterpriseVoice; + + pnEnterpriseVoice.Visible = EnterpriseVoice; + + if (!EnterpriseVoice) + { + tbPhoneNumber.Text = ""; + tbPin.Text = ""; + } + + if (EnterpriseVoice) + { + string[] pinPolicy = ES.Services.Lync.GetPolicyList(PanelRequest.ItemID, LyncPolicyType.Pin, "MinPasswordLength"); + if (pinPolicy != null) + { + if (pinPolicy.Length > 0) + { + int MinPasswordLength = -1; + if (int.TryParse(pinPolicy[0], out MinPasswordLength)) + { + PinRegularExpressionValidator.ValidationExpression = "^([0-9]){" + MinPasswordLength.ToString() + ",}$"; + PinRegularExpressionValidator.ErrorMessage = "Must contain only numbers. Min. length " + MinPasswordLength.ToString(); + } + } + } + } + } protected void btnCreate_Click(object sender, EventArgs e) @@ -53,6 +90,11 @@ namespace WebsitePanel.Portal.Lync LyncUserResult res = ES.Services.Lync.CreateLyncUser(PanelRequest.ItemID, accountId, Convert.ToInt32(planSelector.planId)); if (res.IsSuccess && res.ErrorCodes.Count == 0) { + + //#1 + LyncUser lyncUser = ES.Services.Lync.GetLyncUserGeneralSettings(PanelRequest.ItemID, accountId); + ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, accountId, lyncUser.SipAddress, tbPhoneNumber.Text + ":" + tbPin.Text); + Response.Redirect(EditUrl("AccountID", accountId.ToString(), "edit_lync_user", "SpaceID=" + PanelSecurity.PackageId, "ItemID=" + PanelRequest.ItemID)); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs index af2c5bee..507fa043 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs @@ -1,40 +1,11 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ - namespace WebsitePanel.Portal.Lync { @@ -139,6 +110,69 @@ namespace WebsitePanel.Portal.Lync { /// protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserPlanSelector planSelector; + /// + /// pnEnterpriseVoice control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnEnterpriseVoice; + + /// + /// locPhoneNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPhoneNumber; + + /// + /// tbPhoneNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox tbPhoneNumber; + + /// + /// PhoneFormatValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator PhoneFormatValidator; + + /// + /// locLyncPin control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locLyncPin; + + /// + /// tbPin control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox tbPin; + + /// + /// PinRegularExpressionValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator PinRegularExpressionValidator; + /// /// btnCreate control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx index 64305427..d2866e5e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx @@ -47,11 +47,41 @@ - + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+
-
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs index b3b2782b..820c2c3e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs @@ -40,6 +40,40 @@ namespace WebsitePanel.Portal.Lync { if (!IsPostBack) BindItems(); + } + + protected void Page_PreRender(object sender, EventArgs e) + { + bool EnterpriseVoice = false; + + WebsitePanel.Providers.HostedSolution.LyncUserPlan plan = planSelector.plan; + if (plan != null) + EnterpriseVoice = plan.EnterpriseVoice; + + pnEnterpriseVoice.Visible = EnterpriseVoice; + + if (!EnterpriseVoice) + { + tbPhoneNumber.Text = ""; + tbPin.Text = ""; + } + + if (EnterpriseVoice) + { + string[] pinPolicy = ES.Services.Lync.GetPolicyList(PanelRequest.ItemID, LyncPolicyType.Pin, "MinPasswordLength"); + if (pinPolicy != null) + { + if (pinPolicy.Length > 0) + { + int MinPasswordLength = -1; + if (int.TryParse(pinPolicy[0], out MinPasswordLength)) + { + PinRegularExpressionValidator.ValidationExpression = "^([0-9]){" + MinPasswordLength.ToString() + ",}$"; + PinRegularExpressionValidator.ErrorMessage = "Must contain only numbers. Min. length " + MinPasswordLength.ToString(); + } + } + } + } } @@ -54,6 +88,7 @@ namespace WebsitePanel.Portal.Lync planSelector.planId = lyncUser.LyncUserPlanId.ToString(); lyncUserSettings.sipAddress = lyncUser.SipAddress; + tbPhoneNumber.Text = lyncUser.LineUri; } protected void btnSave_Click(object sender, EventArgs e) @@ -65,7 +100,7 @@ namespace WebsitePanel.Portal.Lync LyncUserResult res = ES.Services.Lync.SetUserLyncPlan(PanelRequest.ItemID, PanelRequest.AccountID, Convert.ToInt32(planSelector.planId)); if (res.IsSuccess && res.ErrorCodes.Count == 0) { - res = ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID, lyncUserSettings.sipAddress, string.Empty); + res = ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID, lyncUserSettings.sipAddress, tbPhoneNumber.Text + ":" + tbPin.Text); } if (res.IsSuccess && res.ErrorCodes.Count == 0) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs index 52aaa081..3598ce62 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs @@ -1,40 +1,11 @@ -// Copyright (c) 2011, 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. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ - namespace WebsitePanel.Portal.Lync { @@ -139,6 +110,69 @@ namespace WebsitePanel.Portal.Lync { ///
protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserSettings lyncUserSettings; + /// + /// pnEnterpriseVoice control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnEnterpriseVoice; + + /// + /// locPhoneNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPhoneNumber; + + /// + /// tbPhoneNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox tbPhoneNumber; + + /// + /// PhoneFormatValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator PhoneFormatValidator; + + /// + /// locLyncPin control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locLyncPin; + + /// + /// tbPin control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox tbPin; + + /// + /// PinRegularExpressionValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator PinRegularExpressionValidator; + /// /// btnSave control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx index c6d336f8..a68ff60a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx @@ -1,2 +1,2 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncUserPlanSelector.ascx.cs" Inherits="WebsitePanel.Portal.Lync.UserControls.LyncUserPlanSelector" %> - \ No newline at end of file + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.cs index 31ba7eef..5867d11a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.cs @@ -35,11 +35,14 @@ namespace WebsitePanel.Portal.Lync.UserControls { private string planToSelect; - + public string planId { - get { return ddlPlan.SelectedItem.Value; } + get { + if (ddlPlan.Items.Count == 0) return ""; + return ddlPlan.SelectedItem.Value; + } set { planToSelect = value; @@ -72,6 +75,19 @@ namespace WebsitePanel.Portal.Lync.UserControls } } + public WebsitePanel.Providers.HostedSolution.LyncUserPlan plan + { + get + { + WebsitePanel.Providers.HostedSolution.LyncUserPlan[] plans = ES.Services.Lync.GetLyncUserPlans(PanelRequest.ItemID); + foreach (WebsitePanel.Providers.HostedSolution.LyncUserPlan planitem in plans) + { + if (planitem.LyncUserPlanId.ToString() == planId) return planitem; + } + return null; + } + } + private void BindPlans() { WebsitePanel.Providers.HostedSolution.LyncUserPlan[] plans = ES.Services.Lync.GetLyncUserPlans(PanelRequest.ItemID); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs index 5f4303c8..00a2ed12 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs @@ -1,41 +1,11 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - //------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ - namespace WebsitePanel.Portal.Lync.UserControls { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx index 55701dac..10eae934 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx @@ -40,58 +40,185 @@
- - - - - - - - -
- - - - -
-
-
- - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
-
-
+ + + + + + + + +
+ + + + +
+
+
+ + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+
+ + + + + + + + + +
+ + + +
+
+
+ + + + + + + + +
+ +
+
+
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + +
+ + + +
+
+ + + + + + + +
+ + + +
+
+ +
+
+ + +<%-- Disable because not used @@ -128,6 +255,7 @@
+ --%>
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs index 51fbf72a..b33a0ce2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs @@ -55,6 +55,52 @@ namespace WebsitePanel.Portal internal static List list; + protected void ddArchivingPolicyUpdate() + { + string[] archivePolicy = ES.Services.Lync.GetPolicyList(-1, LyncPolicyType.Archiving, null); + if (archivePolicy != null) + { + foreach (string policy in archivePolicy) + { + if (policy.ToLower() == "global") continue; + string txt = policy.Replace("Tag:", ""); + if (ddArchivingPolicy.Items.FindByValue(policy)==null) + ddArchivingPolicy.Items.Add(new System.Web.UI.WebControls.ListItem(txt, policy)); + } + } + } + + protected void Page_PreRender(object sender, EventArgs e) + { + + if (ddArchivingPolicy.Items.Count == 0) + ddArchivingPolicyUpdate(); + + chkEnterpriseVoice.Enabled = false; + chkEnterpriseVoice.Checked = false; + + pnEnterpriseVoice.Visible = false; + pnServerURI.Visible = false; + + switch (ddTelephony.SelectedIndex) + { + case 1: + break; + case 2: + pnEnterpriseVoice.Visible = true; + chkEnterpriseVoice.Checked = true; + break; + case 3: + pnServerURI.Visible = true; + break; + case 4: + pnServerURI.Visible = true; + break; + + } + + } + public void BindSettings(UserSettings settings) { @@ -113,8 +159,7 @@ namespace WebsitePanel.Portal } } - - LyncUserPlan plan = new LyncUserPlan(); + Providers.HostedSolution.LyncUserPlan plan = new Providers.HostedSolution.LyncUserPlan(); plan.LyncUserPlanName = txtPlan.Text; plan.IsDefault = false; @@ -124,24 +169,21 @@ namespace WebsitePanel.Portal plan.Conferencing = chkConferencing.Checked; plan.EnterpriseVoice = chkEnterpriseVoice.Checked; - if (!plan.EnterpriseVoice) - { - plan.VoicePolicy = LyncVoicePolicyType.None; - } - else - { - if (chkEmergency.Checked) - plan.VoicePolicy = LyncVoicePolicyType.Emergency; - else if (chkNational.Checked) - plan.VoicePolicy = LyncVoicePolicyType.National; - else if (chkMobile.Checked) - plan.VoicePolicy = LyncVoicePolicyType.Mobile; - else if (chkInternational.Checked) - plan.VoicePolicy = LyncVoicePolicyType.International; - else - plan.VoicePolicy = LyncVoicePolicyType.None; - } + plan.VoicePolicy = LyncVoicePolicyType.None; + + plan.RemoteUserAccess = chkRemoteUserAccess.Checked; + plan.PublicIMConnectivity = chkPublicIMConnectivity.Checked; + + plan.AllowOrganizeMeetingsWithExternalAnonymous = chkAllowOrganizeMeetingsWithExternalAnonymous.Checked; + + plan.Telephony = ddTelephony.SelectedIndex; + + plan.ServerURI = tbServerURI.Text; + + plan.ArchivePolicy = ddArchivingPolicy.SelectedValue; + plan.TelephonyDialPlanPolicy = ddTelephonyDialPlanPolicy.SelectedValue; + plan.TelephonyVoicePolicy = ddTelephonyVoicePolicy.SelectedValue; if (PanelSecurity.SelectedUser.Role == UserRole.Administrator) plan.LyncUserPlanType = (int)LyncUserPlanType.Administrator; @@ -234,7 +276,7 @@ namespace WebsitePanel.Portal } catch (Exception) { - messageBox.ShowErrorMessage("EXCHANGE_DELETE_MAILBOXPLAN"); + messageBox.ShowErrorMessage("LYNC_DELETE_PLAN"); } BindPlans(); @@ -261,7 +303,6 @@ namespace WebsitePanel.Portal orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); } - plan = ES.Services.Lync.GetLyncUserPlan(orgs[0].Id, planId); txtPlan.Text = plan.LyncUserPlanName; @@ -271,26 +312,35 @@ namespace WebsitePanel.Portal chkConferencing.Checked = plan.Conferencing; chkMobility.Checked = plan.Mobility; chkEnterpriseVoice.Checked = plan.EnterpriseVoice; - switch (plan.VoicePolicy) + + chkRemoteUserAccess.Checked = plan.RemoteUserAccess; + chkPublicIMConnectivity.Checked = plan.PublicIMConnectivity; + + chkAllowOrganizeMeetingsWithExternalAnonymous.Checked = plan.AllowOrganizeMeetingsWithExternalAnonymous; + ddTelephony.SelectedIndex = plan.Telephony; + + tbServerURI.Text = plan.ServerURI; + + string planArchivePolicy = ""; + if (plan.ArchivePolicy != null) planArchivePolicy = plan.ArchivePolicy; + string planTelephonyDialPlanPolicy = ""; + if (plan.TelephonyDialPlanPolicy != null) planTelephonyDialPlanPolicy = plan.TelephonyDialPlanPolicy; + string planTelephonyVoicePolicy = ""; + if (plan.TelephonyVoicePolicy != null) planTelephonyVoicePolicy = plan.TelephonyVoicePolicy; + + ddArchivingPolicyUpdate(); + ListItem li = ddArchivingPolicy.Items.FindByValue(planArchivePolicy); + if (li == null) { - case LyncVoicePolicyType.None: - break; - case LyncVoicePolicyType.Emergency: - chkEmergency.Checked = true; - break; - case LyncVoicePolicyType.National: - chkNational.Checked = true; - break; - case LyncVoicePolicyType.Mobile: - chkMobile.Checked = true; - break; - case LyncVoicePolicyType.International: - chkInternational.Checked = true; - break; - default: - chkNone.Checked = true; - break; + li = new System.Web.UI.WebControls.ListItem(planArchivePolicy.Replace("Tag:", ""), planArchivePolicy); + ddArchivingPolicy.Items.Add(li); } + ddArchivingPolicy.SelectedIndex = ddArchivingPolicy.Items.IndexOf(li); + + ddTelephonyDialPlanPolicy.Items.Clear(); + ddTelephonyDialPlanPolicy.Items.Add(new System.Web.UI.WebControls.ListItem(planTelephonyDialPlanPolicy.Replace("Tag:", ""), planTelephonyDialPlanPolicy)); + ddTelephonyVoicePolicy.Items.Clear(); + ddTelephonyVoicePolicy.Items.Add(new System.Web.UI.WebControls.ListItem(planTelephonyVoicePolicy.Replace("Tag:", ""), planTelephonyVoicePolicy)); btnUpdatePlan.Enabled = (string.IsNullOrEmpty(txtPlan.Text)) ? false : true; @@ -298,7 +348,6 @@ namespace WebsitePanel.Portal } catch (Exception) { - messageBox.ShowErrorMessage("EXCHANGE_DELETE_MAILBOXPLAN"); } BindPlans(); @@ -375,7 +424,6 @@ namespace WebsitePanel.Portal plan = new Providers.HostedSolution.LyncUserPlan(); plan.LyncUserPlanId = (int)ViewState["LyncUserPlanID"]; - plan.LyncUserPlanName = txtPlan.Text; plan.IsDefault = false; @@ -385,24 +433,22 @@ namespace WebsitePanel.Portal plan.Conferencing = chkConferencing.Checked; plan.EnterpriseVoice = chkEnterpriseVoice.Checked; - if (!plan.EnterpriseVoice) - { - plan.VoicePolicy = LyncVoicePolicyType.None; - } - else - { - if (chkEmergency.Checked) - plan.VoicePolicy = LyncVoicePolicyType.Emergency; - else if (chkNational.Checked) - plan.VoicePolicy = LyncVoicePolicyType.National; - else if (chkMobile.Checked) - plan.VoicePolicy = LyncVoicePolicyType.Mobile; - else if (chkInternational.Checked) - plan.VoicePolicy = LyncVoicePolicyType.International; - else - plan.VoicePolicy = LyncVoicePolicyType.None; - } + plan.VoicePolicy = LyncVoicePolicyType.None; + + plan.RemoteUserAccess = chkRemoteUserAccess.Checked; + plan.PublicIMConnectivity = chkPublicIMConnectivity.Checked; + + plan.AllowOrganizeMeetingsWithExternalAnonymous = chkAllowOrganizeMeetingsWithExternalAnonymous.Checked; + + plan.Telephony = ddTelephony.SelectedIndex; + + plan.ServerURI = tbServerURI.Text; + + plan.ArchivePolicy = ddArchivingPolicy.SelectedValue; + plan.TelephonyDialPlanPolicy = ddTelephonyDialPlanPolicy.SelectedValue; + plan.TelephonyVoicePolicy = ddTelephonyVoicePolicy.SelectedValue; + if (PanelSecurity.SelectedUser.Role == UserRole.Administrator) plan.LyncUserPlanType = (int)LyncUserPlanType.Administrator; @@ -417,11 +463,11 @@ namespace WebsitePanel.Portal if (result < 0) { - messageBox.ShowErrorMessage("EXCHANGE_UPDATEPLANS"); + messageBox.ShowErrorMessage("LYNC_UPDATEPLANS"); } else { - messageBox.ShowSuccessMessage("EXCHANGE_UPDATEPLANS"); + messageBox.ShowSuccessMessage("LYNC_UPDATEPLANS"); } } @@ -503,6 +549,39 @@ namespace WebsitePanel.Portal BindPlans(); } + protected void btnAccept_Click(object sender, EventArgs e) + { + + string name = tbTelephoneProvider.Text; + + if (string.IsNullOrEmpty(name)) return; + + ddTelephonyDialPlanPolicy.Items.Clear(); + string[] dialPlan = ES.Services.Lync.GetPolicyList(-1, LyncPolicyType.DialPlan, name); + if (dialPlan != null) + { + foreach (string policy in dialPlan) + { + if (policy.ToLower() == "global") continue; + string txt = policy.Replace("Tag:", ""); + ddTelephonyDialPlanPolicy.Items.Add(new System.Web.UI.WebControls.ListItem(txt, policy)); + } + } + + ddTelephonyVoicePolicy.Items.Clear(); + string[] voicePolicy = ES.Services.Lync.GetPolicyList(-1, LyncPolicyType.Voice, name); + if (voicePolicy != null) + { + foreach (string policy in voicePolicy) + { + if (policy.ToLower() == "global") continue; + string txt = policy.Replace("Tag:", ""); + ddTelephonyVoicePolicy.Items.Add(new System.Web.UI.WebControls.ListItem(txt, policy)); + } + } + + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.designer.cs index 71f46a10..d036ed13 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.designer.cs @@ -1,40 +1,11 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ - namespace WebsitePanel.Portal { @@ -139,15 +110,6 @@ namespace WebsitePanel.Portal { ///
protected global::System.Web.UI.WebControls.CheckBox chkMobility; - /// - /// chkFederation control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CheckBox chkFederation; - /// /// chkConferencing control. /// @@ -167,67 +129,256 @@ namespace WebsitePanel.Portal { protected global::System.Web.UI.WebControls.CheckBox chkEnterpriseVoice; /// - /// secEnterpriseVoice control. + /// secPlanFeaturesFederation control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.CollapsiblePanel secEnterpriseVoice; + protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesFederation; /// - /// EnterpriseVoice control. + /// PlanFeaturesFederation control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Panel EnterpriseVoice; + protected global::System.Web.UI.WebControls.Panel PlanFeaturesFederation; /// - /// chkNone control. + /// chkFederation control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RadioButton chkNone; + protected global::System.Web.UI.WebControls.CheckBox chkFederation; /// - /// chkEmergency control. + /// chkRemoteUserAccess control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RadioButton chkEmergency; + protected global::System.Web.UI.WebControls.CheckBox chkRemoteUserAccess; /// - /// chkNational control. + /// chkPublicIMConnectivity control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RadioButton chkNational; + protected global::System.Web.UI.WebControls.CheckBox chkPublicIMConnectivity; /// - /// chkMobile control. + /// secPlanFeaturesArchiving control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RadioButton chkMobile; + protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesArchiving; /// - /// chkInternational control. + /// PlanFeaturesArchiving control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RadioButton chkInternational; + protected global::System.Web.UI.WebControls.Panel PlanFeaturesArchiving; + + /// + /// locArchivingPolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locArchivingPolicy; + + /// + /// ddArchivingPolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddArchivingPolicy; + + /// + /// secPlanFeaturesMeeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesMeeting; + + /// + /// PlanFeaturesMeeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PlanFeaturesMeeting; + + /// + /// chkAllowOrganizeMeetingsWithExternalAnonymous control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkAllowOrganizeMeetingsWithExternalAnonymous; + + /// + /// secPlanFeaturesTelephony control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesTelephony; + + /// + /// PlanFeaturesTelephony control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PlanFeaturesTelephony; + + /// + /// locTelephony control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTelephony; + + /// + /// ddTelephony control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddTelephony; + + /// + /// pnEnterpriseVoice control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnEnterpriseVoice; + + /// + /// locTelephonyProvider control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTelephonyProvider; + + /// + /// tbTelephoneProvider control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox tbTelephoneProvider; + + /// + /// btnAccept control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAccept; + + /// + /// AcceptRequiredValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator AcceptRequiredValidator; + + /// + /// locDialPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDialPlan; + + /// + /// ddTelephonyDialPlanPolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddTelephonyDialPlanPolicy; + + /// + /// locVoicePolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locVoicePolicy; + + /// + /// ddTelephonyVoicePolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddTelephonyVoicePolicy; + + /// + /// pnServerURI control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnServerURI; + + /// + /// locServerURI control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locServerURI; + + /// + /// tbServerURI control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox tbServerURI; /// /// btnAddPlan control.