Added maximum OrgId length parameter to hosted organization policies.
This commit is contained in:
parent
9984d6d1cc
commit
306e3147eb
10 changed files with 419 additions and 34 deletions
|
@ -120,4 +120,7 @@
|
||||||
<data name="secMailboxPassword.Text" xml:space="preserve">
|
<data name="secMailboxPassword.Text" xml:space="preserve">
|
||||||
<value>User Password Policy</value>
|
<value>User Password Policy</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="secOrg.Text" xml:space="preserve">
|
||||||
|
<value>Organization Id Policy</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -27,8 +27,6 @@
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Data;
|
|
||||||
using System.Text;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using WebsitePanel.EnterpriseServer;
|
using WebsitePanel.EnterpriseServer;
|
||||||
using WebsitePanel.Providers.HostedSolution;
|
using WebsitePanel.Providers.HostedSolution;
|
||||||
|
@ -39,18 +37,19 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
{
|
{
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
DomainInfo[] domains = ES.Services.Servers.GetMyDomains(PanelSecurity.PackageId);
|
DomainInfo[] domains = ES.Services.Servers.GetMyDomains(PanelSecurity.PackageId);
|
||||||
|
|
||||||
Organization[] orgs = ES.Services.Organizations.GetOrganizations(PanelSecurity.PackageId, false);
|
Organization[] orgs = ES.Services.Organizations.GetOrganizations(PanelSecurity.PackageId, false);
|
||||||
|
var list = new List<OrganizationDomainName>();
|
||||||
List<OrganizationDomainName> list = new List<OrganizationDomainName>();
|
SetPolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "OrgIdPolicy");
|
||||||
|
|
||||||
foreach (Organization o in orgs)
|
foreach (Organization o in orgs)
|
||||||
{
|
{
|
||||||
OrganizationDomainName[] tmpList = ES.Services.Organizations.GetOrganizationDomains(o.Id);
|
OrganizationDomainName[] tmpList = ES.Services.Organizations.GetOrganizationDomains(o.Id);
|
||||||
|
|
||||||
foreach (OrganizationDomainName name in tmpList) list.Add(name);
|
foreach (OrganizationDomainName name in tmpList)
|
||||||
|
{
|
||||||
|
list.Add(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (DomainInfo d in domains)
|
foreach (DomainInfo d in domains)
|
||||||
|
@ -65,9 +64,11 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
bAdd = false;
|
bAdd = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (bAdd) ddlDomains.Items.Add(d.DomainName.ToLower());
|
if (bAdd)
|
||||||
|
{
|
||||||
|
ddlDomains.Items.Add(d.DomainName.ToLower());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,6 +78,50 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetPolicy(int packageId, string settingsName, string key)
|
||||||
|
{
|
||||||
|
PackageInfo package = PackagesHelper.GetCachedPackage(packageId);
|
||||||
|
|
||||||
|
if (package != null)
|
||||||
|
{
|
||||||
|
SetOrgIdPolicy(package.UserId, settingsName, key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetOrgIdPolicy(int userId, string settingsName, string key)
|
||||||
|
{
|
||||||
|
UserInfo user = UsersHelper.GetCachedUser(userId);
|
||||||
|
|
||||||
|
if (user != null)
|
||||||
|
{
|
||||||
|
UserSettings settings = ES.Services.Users.GetUserSettings(userId, settingsName);
|
||||||
|
|
||||||
|
if (settings != null && settings["OrgIdPolicy"] != null)
|
||||||
|
{
|
||||||
|
SetOrgIdPolicy(settings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetOrgIdPolicy(UserSettings settings)
|
||||||
|
{
|
||||||
|
string policyValue = settings["OrgIdPolicy"];
|
||||||
|
string[] values = policyValue.Split(';');
|
||||||
|
|
||||||
|
if (values.Length > 1 && Convert.ToBoolean(values[0]))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int maxLength = Convert.ToInt32(values[1]);
|
||||||
|
txtOrganizationID.MaxLength = maxLength;
|
||||||
|
valRequireCorrectOrgID.ValidationExpression = string.Format("[a-zA-Z0-9.-]{{1,{0}}}", maxLength);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void btnCreate_Click(object sender, EventArgs e)
|
protected void btnCreate_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
CreateOrganization();
|
CreateOrganization();
|
||||||
|
@ -85,14 +130,13 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
private void CreateOrganization()
|
private void CreateOrganization()
|
||||||
{
|
{
|
||||||
if (!Page.IsValid)
|
if (!Page.IsValid)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
int itemId = ES.Services.Organizations.CreateOrganization(PanelSecurity.PackageId, txtOrganizationID.Text.Trim().ToLower(), txtOrganizationName.Text.Trim().ToLower(), ddlDomains.SelectedValue.Trim().ToLower());
|
||||||
int itemId = ES.Services.Organizations.CreateOrganization(PanelSecurity.PackageId,
|
|
||||||
txtOrganizationID.Text.Trim().ToLower(), txtOrganizationName.Text.Trim().ToLower(),
|
|
||||||
ddlDomains.SelectedValue.Trim().ToLower());
|
|
||||||
|
|
||||||
if (itemId < 0)
|
if (itemId < 0)
|
||||||
{
|
{
|
||||||
|
@ -100,9 +144,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "organization_home",
|
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "organization_home", "ItemID=" + itemId));
|
||||||
"ItemID=" + itemId));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SettingsExchangePolicy.ascx.cs" Inherits="WebsitePanel.Portal.SettingsExchangePolicy" %>
|
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SettingsExchangePolicy.ascx.cs" Inherits="WebsitePanel.Portal.SettingsExchangePolicy" %>
|
||||||
<%@ Register Src="UserControls/PasswordPolicyEditor.ascx" TagName="PasswordPolicyEditor" TagPrefix="wsp" %>
|
<%@ Register Src="UserControls/PasswordPolicyEditor.ascx" TagName="PasswordPolicyEditor" TagPrefix="wsp" %>
|
||||||
|
<%@ Register Src="UserControls/OrgIdPolicyEditor.ascx" TagName="OrgIdPolicyEditor" TagPrefix="wsp" %>
|
||||||
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="UserControls/CollapsiblePanel.ascx" %>
|
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="UserControls/CollapsiblePanel.ascx" %>
|
||||||
|
|
||||||
<wsp:CollapsiblePanel id="secMailboxPassword" runat="server"
|
<wsp:CollapsiblePanel id="secMailboxPassword" runat="server"
|
||||||
|
@ -16,3 +17,16 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</asp:Panel>
|
</asp:Panel>
|
||||||
|
|
||||||
|
<wsp:CollapsiblePanel id="secOrg" runat="server" TargetControlID="OrgIdPanel" meta:resourcekey="secOrg" Text="Organization Id Policy"/>
|
||||||
|
<asp:Panel ID="OrgIdPanel" runat="server" Height="0" style="overflow:hidden;">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td class="SubHead" width="150" nowrap>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<wsp:OrgIdPolicyEditor id="orgIdPolicy" runat="server" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</asp:Panel>
|
|
@ -26,33 +26,27 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Data;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Web;
|
|
||||||
using System.Web.Security;
|
|
||||||
using System.Web.UI;
|
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using System.Web.UI.WebControls.WebParts;
|
|
||||||
using System.Web.UI.HtmlControls;
|
|
||||||
|
|
||||||
using WebsitePanel.EnterpriseServer;
|
using WebsitePanel.EnterpriseServer;
|
||||||
|
|
||||||
namespace WebsitePanel.Portal
|
namespace WebsitePanel.Portal
|
||||||
{
|
{
|
||||||
public partial class SettingsExchangePolicy : WebsitePanelControlBase, IUserSettingsEditorControl
|
public partial class SettingsExchangePolicy : WebsitePanelControlBase, IUserSettingsEditorControl
|
||||||
{
|
{
|
||||||
|
#region IUserSettingsEditorControl Members
|
||||||
|
|
||||||
public void BindSettings(UserSettings settings)
|
public void BindSettings(UserSettings settings)
|
||||||
{
|
{
|
||||||
// mailbox
|
// mailbox
|
||||||
mailboxPasswordPolicy.Value = settings["MailboxPasswordPolicy"];
|
mailboxPasswordPolicy.Value = settings["MailboxPasswordPolicy"];
|
||||||
|
orgIdPolicy.Value = settings["OrgIdPolicy"];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveSettings(UserSettings settings)
|
public void SaveSettings(UserSettings settings)
|
||||||
{
|
{
|
||||||
// mailbox
|
|
||||||
settings["MailboxPasswordPolicy"] = mailboxPasswordPolicy.Value;
|
settings["MailboxPasswordPolicy"] = mailboxPasswordPolicy.Value;
|
||||||
}
|
settings["OrgIdPolicy"] = orgIdPolicy.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:2.0.50727.1433
|
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
|
@ -39,5 +38,32 @@ namespace WebsitePanel.Portal {
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::WebsitePanel.Portal.PasswordPolicyEditor mailboxPasswordPolicy;
|
protected global::WebsitePanel.Portal.PasswordPolicyEditor mailboxPasswordPolicy;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// secOrg control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::WebsitePanel.Portal.CollapsiblePanel secOrg;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// OrgIdPanel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Panel OrgIdPanel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// orgIdPolicy control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::WebsitePanel.Portal.UserControls.OrgIdPolicyEditor orgIdPolicy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,132 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="enablePolicyCheckBox.Text" xml:space="preserve">
|
||||||
|
<value>Enable Policy</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblMaximumLength.Text" xml:space="preserve">
|
||||||
|
<value>Maximum OrgId length:</value>
|
||||||
|
</data>
|
||||||
|
<data name="valCorrectMaxLength.Text" xml:space="preserve">
|
||||||
|
<value>*</value>
|
||||||
|
</data>
|
||||||
|
<data name="valRequireMaxLength.Text" xml:space="preserve">
|
||||||
|
<value>*</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
|
@ -0,0 +1,18 @@
|
||||||
|
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrgIdPolicyEditor.ascx.cs" Inherits="WebsitePanel.Portal.UserControls.OrgIdPolicyEditor" %>
|
||||||
|
<asp:UpdatePanel runat="server" ID="OrgIdPolicyPanel" UpdateMode="Conditional" ChildrenAsTriggers="true">
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:CheckBox id="enablePolicyCheckBox" runat="server" meta:resourcekey="enablePolicyCheckBox" Text="Enable Policy" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="EnablePolicy_CheckedChanged"/>
|
||||||
|
<table id="PolicyTable" runat="server" cellpadding="2">
|
||||||
|
<tr>
|
||||||
|
<td class="Normal" style="width:150px;">
|
||||||
|
<asp:Label ID="lblMaximumLength" runat="server" meta:resourcekey="lblMaximumLength" Text="Maximum OrgId length:"/>
|
||||||
|
</td>
|
||||||
|
<td class="Normal">
|
||||||
|
<asp:TextBox ID="txtMaximumLength" runat="server" CssClass="NormalTextBox" Width="40px"/>
|
||||||
|
<asp:RequiredFieldValidator ID="valRequireMaxLength" runat="server" ControlToValidate="txtMaximumLength" meta:resourcekey="valRequireMaxLength" ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"/>
|
||||||
|
<asp:RegularExpressionValidator ID="valCorrectMaxLength" runat="server" ControlToValidate="txtMaximumLength" meta:resourcekey="valCorrectMaxLength" Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
|
@ -0,0 +1,69 @@
|
||||||
|
using System;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.UI;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Portal.UserControls
|
||||||
|
{
|
||||||
|
public partial class OrgIdPolicyEditor : UserControl
|
||||||
|
{
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
public string Value
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
sb.Append(enablePolicyCheckBox.Checked.ToString()).Append(";");
|
||||||
|
sb.Append(txtMaximumLength.Text).Append(";");
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (String.IsNullOrEmpty(value))
|
||||||
|
{
|
||||||
|
enablePolicyCheckBox.Checked = true;
|
||||||
|
txtMaximumLength.Text = "128";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string[] parts = value.Split(';');
|
||||||
|
enablePolicyCheckBox.Checked = Utils.ParseBool(parts[0], false);
|
||||||
|
txtMaximumLength.Text = parts[1];
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ToggleControls();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ToggleControls()
|
||||||
|
{
|
||||||
|
PolicyTable.Visible = enablePolicyCheckBox.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Event Handlers
|
||||||
|
|
||||||
|
protected void EnablePolicy_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ToggleControls();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace WebsitePanel.Portal.UserControls {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class OrgIdPolicyEditor {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// OrgIdPolicyPanel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.UpdatePanel OrgIdPolicyPanel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// enablePolicyCheckBox control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.CheckBox enablePolicyCheckBox;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PolicyTable control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlTable PolicyTable;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblMaximumLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblMaximumLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtMaximumLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.TextBox txtMaximumLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valRequireMaxLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireMaxLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valCorrectMaxLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectMaxLength;
|
||||||
|
}
|
||||||
|
}
|
|
@ -412,6 +412,13 @@
|
||||||
<Compile Include="UserControls\EditFeedsList.ascx.designer.cs">
|
<Compile Include="UserControls\EditFeedsList.ascx.designer.cs">
|
||||||
<DependentUpon>EditFeedsList.ascx</DependentUpon>
|
<DependentUpon>EditFeedsList.ascx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="UserControls\OrgIdPolicyEditor.ascx.cs">
|
||||||
|
<DependentUpon>OrgIdPolicyEditor.ascx</DependentUpon>
|
||||||
|
<SubType>ASPXCodeBehind</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="UserControls\OrgIdPolicyEditor.ascx.designer.cs">
|
||||||
|
<DependentUpon>OrgIdPolicyEditor.ascx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="VPSForPC\MonitoringPage.aspx.cs">
|
<Compile Include="VPSForPC\MonitoringPage.aspx.cs">
|
||||||
<DependentUpon>MonitoringPage.aspx</DependentUpon>
|
<DependentUpon>MonitoringPage.aspx</DependentUpon>
|
||||||
<SubType>ASPXCodeBehind</SubType>
|
<SubType>ASPXCodeBehind</SubType>
|
||||||
|
@ -3855,6 +3862,7 @@
|
||||||
<Content Include="SettingsExchangeMailboxPlansPolicy.ascx" />
|
<Content Include="SettingsExchangeMailboxPlansPolicy.ascx" />
|
||||||
<Content Include="SettingsLyncUserPlansPolicy.ascx" />
|
<Content Include="SettingsLyncUserPlansPolicy.ascx" />
|
||||||
<Content Include="UserControls\EditFeedsList.ascx" />
|
<Content Include="UserControls\EditFeedsList.ascx" />
|
||||||
|
<Content Include="UserControls\OrgIdPolicyEditor.ascx" />
|
||||||
<Content Include="VPSForPC\MonitoringPage.aspx" />
|
<Content Include="VPSForPC\MonitoringPage.aspx" />
|
||||||
<Content Include="VPSForPC\VdcAccountVLanAdd.ascx" />
|
<Content Include="VPSForPC\VdcAccountVLanAdd.ascx" />
|
||||||
<Content Include="VPSForPC\VdcAccountVLanNetwork.ascx" />
|
<Content Include="VPSForPC\VdcAccountVLanNetwork.ascx" />
|
||||||
|
@ -4991,6 +4999,7 @@
|
||||||
<Content Include="ExchangeServer\App_LocalResources\OrganizationAddDomainName.ascx.resx">
|
<Content Include="ExchangeServer\App_LocalResources\OrganizationAddDomainName.ascx.resx">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="UserControls\App_LocalResources\OrgIdPolicyEditor.ascx.resx" />
|
||||||
<None Include="Resources\Windows2008_Settings.ascx.resx" />
|
<None Include="Resources\Windows2008_Settings.ascx.resx" />
|
||||||
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
|
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue