organization password settings added (without GPO)

This commit is contained in:
vfedosevich 2015-04-06 07:09:53 -07:00
parent e320b4c79e
commit 60214cdcf1
40 changed files with 2351 additions and 152 deletions

View file

@ -237,4 +237,10 @@
<data name="lnkRdsUsers.Text" xml:space="preserve">
<value>RDS Users</value>
</data>
<data name="lnkEditOrganizationSettings.Text" xml:space="preserve">
<value>Edit</value>
</data>
<data name="OrganizationSettings.Text" xml:space="preserve">
<value>Organization settings</value>
</data>
</root>

View file

@ -0,0 +1,216 @@
<?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="btnSave.Text" xml:space="preserve">
<value>Save Changes</value>
</data>
<data name="chkLockOutSettigns.Text" xml:space="preserve">
<value>Enable Lockout Settings</value>
</data>
<data name="chkPasswordComplexity" xml:space="preserve">
<value>Enable Password Complexity</value>
</data>
<data name="colPasswordSettings.Text" xml:space="preserve">
<value>Password settings</value>
</data>
<data name="lblAccountLockoutDuration.Text" xml:space="preserve">
<value>Account lockout duration:</value>
</data>
<data name="lblEnforcePasswordHistory.Text" xml:space="preserve">
<value>Enforce password history:</value>
</data>
<data name="lblLockedOut.Text" xml:space="preserve">
<value>Account lockout threshold:</value>
</data>
<data name="lblLockOutSettigns.Text" xml:space="preserve">
<value>Lock out settings:</value>
</data>
<data name="lblMaximumLength.Text" xml:space="preserve">
<value>Maximum length:</value>
</data>
<data name="lblMinimumLength.Text" xml:space="preserve">
<value>Minimum length:</value>
</data>
<data name="lblMinimumNumbers.Text" xml:space="preserve">
<value>Numbers:</value>
</data>
<data name="lblMinimumSymbols.Text" xml:space="preserve">
<value>Non-alphanumeric symbols:</value>
</data>
<data name="lblMinimumUppercase.Text" xml:space="preserve">
<value>Uppercase letters:</value>
</data>
<data name="lblResetAccountLockout.Text" xml:space="preserve">
<value>Reset account lockout counter after (minutes):</value>
</data>
<data name="lblShouldContain.Text" xml:space="preserve">
<value>Password should contain at least:</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Edit settings</value>
</data>
<data name="valCorrectAccountLockoutDuration.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valCorrectEnforcePasswordHistory.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valCorrectLockedOut.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valCorrectMaxLength.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valCorrectMinLength.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valCorrectNumbers.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valCorrectSymbols.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valCorrectUppercase.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireAccountLockoutDuration.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireEnforcePasswordHistory.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireMaxLength.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireMinLength.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireNumbers.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireSymbols.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireUppercase.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valResetAccountLockout.Text" xml:space="preserve">
<value>*</value>
</data>
</root>

View file

@ -49,23 +49,7 @@ namespace WebsitePanel.Portal.ExchangeServer
if (!IsPostBack)
{
password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy");
PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID);
if (passwordPolicy.IsSuccess)
{
password.MinimumLength = passwordPolicy.Value.MinLength;
if (passwordPolicy.Value.IsComplexityEnable)
{
password.MinimumNumbers = 1;
password.MinimumSymbols = 1;
password.MinimumUppercase = 1;
}
}
else
{
messageBox.ShowMessage(passwordPolicy, "EXCHANGE_CREATE_MAILBOX", "HostedOrganization");
return;
}
BindPasswordSettings();
string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false);
if (!string.IsNullOrEmpty(instructions))
@ -135,6 +119,37 @@ namespace WebsitePanel.Portal.ExchangeServer
}
private void BindPasswordSettings()
{
var grainedPasswordSettigns = ES.Services.Organizations.GetOrganizationPasswordSettings(PanelRequest.ItemID);
if (grainedPasswordSettigns != null)
{
password.SetUserPolicy(grainedPasswordSettigns);
}
else
{
password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy");
PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID);
if (passwordPolicy.IsSuccess)
{
password.MinimumLength = passwordPolicy.Value.MinLength;
if (passwordPolicy.Value.IsComplexityEnable)
{
password.MinimumNumbers = 1;
password.MinimumSymbols = 1;
password.MinimumUppercase = 1;
}
}
else
{
messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization");
}
}
}
protected void btnCreate_Click(object sender, EventArgs e)
{
CreateMailbox();

View file

@ -40,23 +40,7 @@ namespace WebsitePanel.Portal.HostedSolution
{
if (!IsPostBack)
{
password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy");
PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID);
if (passwordPolicy.IsSuccess)
{
password.MinimumLength = passwordPolicy.Value.MinLength;
if (passwordPolicy.Value.IsComplexityEnable)
{
password.MinimumNumbers = 1;
password.MinimumSymbols = 1;
password.MinimumUppercase = 1;
}
}
else
{
messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization");
}
BindPasswordSettings();
string instructions = ES.Services.Organizations.GetOrganizationUserSummuryLetter(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false);
if (!string.IsNullOrEmpty(instructions))
@ -88,6 +72,37 @@ namespace WebsitePanel.Portal.HostedSolution
}
private void BindPasswordSettings()
{
var grainedPasswordSettigns = ES.Services.Organizations.GetOrganizationPasswordSettings(PanelRequest.ItemID);
if (grainedPasswordSettigns != null)
{
password.SetUserPolicy(grainedPasswordSettigns);
}
else
{
password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy");
PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID);
if (passwordPolicy.IsSuccess)
{
password.MinimumLength = passwordPolicy.Value.MinLength;
if (passwordPolicy.Value.IsComplexityEnable)
{
password.MinimumNumbers = 1;
password.MinimumSymbols = 1;
password.MinimumUppercase = 1;
}
}
else
{
messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization");
}
}
}
protected void btnCreate_Click(object sender, EventArgs e)
{
CreateMailbox();

View file

@ -37,6 +37,14 @@
<asp:Label runat="server" ID="lblCreatedValue" />
</td>
</tr>
<tr>
<td class="OrgStatsRow">
<asp:Label runat="server" meta:resourcekey="OrganizationSettings" ID="Label1" />
</td>
<td>
<asp:HyperLink ID="lnkEditOrganizationSettings" runat="server" meta:resourcekey="lnkEditOrganizationSettings"></asp:HyperLink>
</td>
</tr>
</table>
<br />
<table width="100%">

View file

@ -175,6 +175,9 @@ namespace WebsitePanel.Portal.ExchangeServer
lblOrganizationNameValue.Text = org.Name;
lblOrganizationIDValue.Text = org.OrganizationId;
lblCreatedValue.Text = org.CreatedDate.Date.ToShortDateString();
lnkEditOrganizationSettings.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "organization_settings_password_settings",
"SpaceID=" + PanelSecurity.PackageId);
OrganizationStatistics orgStats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);

View file

@ -84,6 +84,24 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblCreatedValue;
/// <summary>
/// Label1 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 Label1;
/// <summary>
/// lnkEditOrganizationSettings 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.HyperLink lnkEditOrganizationSettings;
/// <summary>
/// organizationStatsPanel control.
/// </summary>

View file

@ -0,0 +1,164 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSettingsPasswordSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationSettingsPasswordSettings" %>
<%@ Register Src="UserControls/OrganizationSettingsTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/ItemButtonPanel.ascx" TagName="ItemButtonPanel" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<script type="text/javascript" src="/JavaScript/jquery.min.js?v=1.4.4"></script>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Settings"></asp:Localize>
<asp:Literal ID="litOrganizationName" runat="server" Text="Organization" />
</div>
<div class="FormBody">
<wsp:CollectionTabs id="tabs" runat="server" SelectedTab="organization_settings_password_s
ettings" />
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<asp:UpdatePanel runat="server" ID="PasswordPolicyPanel" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<wsp:CollapsiblePanel id="colPasswordSettings" runat="server" TargetControlID="panelPasswordSettings" meta:resourcekey="colPasswordSettings" Text="Password settings">
</wsp:CollapsiblePanel>
<asp:Panel runat="server" ID="panelPasswordSettings">
<table id="PolicyTable" runat="server" cellpadding="2">
<tr>
<td class="Normal" style="width:150px;"><asp:Label ID="lblMinimumLength" runat="server"
meta:resourcekey="lblMinimumLength" Text="Minimum length:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtMinimumLength" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireMinLength" runat="server" ControlToValidate="txtMinimumLength" meta:resourcekey="valRequireMinLength"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectMinLength" runat="server" ControlToValidate="txtMinimumLength" meta:resourcekey="valCorrectMinLength"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator></td>
</tr>
<tr>
<td class="Normal"><asp:Label ID="lblMaximumLength" runat="server"
meta:resourcekey="lblMaximumLength" Text="Maximum length:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtMaximumLength" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireMaxLength" runat="server" ControlToValidate="txtMaximumLength" meta:resourcekey="valRequireMaxLength"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectMaxLength" runat="server" ControlToValidate="txtMaximumLength" meta:resourcekey="valCorrectMaxLength"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="Normal" style="width:150px;"><asp:Label ID="lblEnforcePasswordHistory" runat="server"
meta:resourcekey="lblEnforcePasswordHistory" Text="Enforce Password History:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtEnforcePasswordHistory" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireEnforcePasswordHistory" runat="server" ControlToValidate="txtEnforcePasswordHistory" meta:resourcekey="valRequireEnforcePasswordHistory"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectEnforcePasswordHistory" runat="server" ControlToValidate="txtEnforcePasswordHistory" meta:resourcekey="valCorrectEnforcePasswordHistory"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator></td>
</tr>
<tr id="RowChkLockOutSettigns" runat="server">
<td colspan="2" class="NormalBold">
<asp:CheckBox id="chkLockOutSettigns" runat="server" meta:resourcekey="chkLockOutSettigns"
Text="Enable Lockout Settings" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="chkLockOutSettigns_CheckedChanged" />
</td>
</tr>
<tr id="RowAccountLockoutDuration" runat="server">
<td class="Normal" style="width:150px;"><asp:Label ID="lblAccountLockoutDuration" runat="server"
meta:resourcekey="lblAccountLockoutDuration" Text="Account Lockout Duration:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtAccountLockoutDuration" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireAccountLockoutDuration" runat="server" ControlToValidate="txtAccountLockoutDuration" meta:resourcekey="valRequireAccountLockoutDuration"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectAccountLockoutDuration" runat="server" ControlToValidate="txtAccountLockoutDuration" meta:resourcekey="valCorrectAccountLockoutDuration"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator></td>
</tr>
<tr id="RowLockedOut" runat="server">
<td class="Normal">
<asp:Label ID="lblLockedOut" runat="server"
meta:resourcekey="lblLockedOut" Text="Account Lockout threshold:"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtLockedOut" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RegularExpressionValidator ID="valCorrectLockedOut" runat="server" ControlToValidate="txtLockedOut" meta:resourcekey="valCorrectLockedOut"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,10}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
<tr id="RowResetAccountLockout" runat="server">
<td class="Normal">
<asp:Label ID="lblResetAccountLockout" runat="server"
meta:resourcekey="lblResetAccountLockout" Text="Reset account lockout counter after (minutes):"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtResetAccountLockout" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RegularExpressionValidator ID="valResetAccountLockout" runat="server" ControlToValidate="txtResetAccountLockout" meta:resourcekey="valResetAccountLockout"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,10}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td colspan="2" class="NormalBold">
<asp:CheckBox id="chkPasswordComplexity" runat="server" meta:resourcekey="chkPasswordComplexity"
Text="Enable Password Complexity" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="chkPasswordComplexity_CheckedChanged" />
</td>
</tr>
<tr id="RowMinimumUppercase" runat="server">
<td class="Normal">
<asp:Label ID="lblMinimumUppercase" runat="server"
meta:resourcekey="lblMinimumUppercase" Text="Uppercase letters:"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtMinimumUppercase" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireUppercase" runat="server" ControlToValidate="txtMinimumUppercase" meta:resourcekey="valRequireUppercase"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectUppercase" runat="server" ControlToValidate="txtMinimumUppercase" meta:resourcekey="valCorrectUppercase"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
<tr id="RowMinimumNumbers" runat="server">
<td class="Normal">
<asp:Label ID="lblMinimumNumbers" runat="server"
meta:resourcekey="lblMinimumNumbers" Text="Numbers:"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtMinimumNumbers" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireNumbers" runat="server" ControlToValidate="txtMinimumNumbers" meta:resourcekey="valRequireNumbers"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectNumbers" runat="server" ControlToValidate="txtMinimumNumbers" meta:resourcekey="valCorrectNumbers"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
<tr id="RowMinimumSymbols" runat="server">
<td class="Normal">
<asp:Label ID="lblMinimumSymbols" runat="server"
meta:resourcekey="lblMinimumSymbols" Text="Non-alphanumeric symbols:"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtMinimumSymbols" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireSymbols" runat="server" ControlToValidate="txtMinimumSymbols" meta:resourcekey="valRequireSymbols"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectSymbols" runat="server" ControlToValidate="txtMinimumSymbols" meta:resourcekey="valCorrectSymbols"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
<tr id="rowEqualUsername" runat="server" visible="false">
<td class="Normal" colspan="2">
<asp:CheckBox id="chkNotEqualUsername" runat="server" meta:resourcekey="chkNotEqualUsername" Text="Should not be equal to username" />
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<div class="FormFooterClean">
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="EditPasswordSettings"
OnSaveClick="btnSave_Click" OnSaveExitClick="btnSaveExit_Click" />
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,163 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.HostedSolution;
namespace WebsitePanel.Portal.ExchangeServer
{
public partial class OrganizationSettingsPasswordSettings : WebsitePanelModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
litOrganizationName.Text = org.OrganizationId;
BindSettings();
}
}
private void BindSettings()
{
var settings = ES.Services.Organizations.GetOrganizationPasswordSettings(PanelRequest.ItemID);
if (settings == null)
{
var defaultSettings = ES.Services.Users.GetUserSettings(PanelSecurity.LoggedUserId, UserSettings.EXCHANGE_POLICY);
BindDefaultSettings(defaultSettings[UserSettings.HOSTED_ORGANIZATION_PASSWORD_POLICY]);
}
else
{
BindSettings(settings);
}
ToggleLockoutControls(chkLockOutSettigns.Checked);
ToggleComplexityControls(chkPasswordComplexity.Checked);
}
private void BindDefaultSettings(string defaultSettings)
{
// parse settings
string[] parts = defaultSettings.Split(';');
txtMinimumLength.Text = parts[1];
txtMaximumLength.Text = parts[2];
txtMinimumUppercase.Text = parts[3];
txtMinimumNumbers.Text = parts[4];
txtMinimumSymbols.Text = parts[5];
chkNotEqualUsername.Checked = Utils.ParseBool(parts[6], false);
txtLockedOut.Text = parts[7];
txtEnforcePasswordHistory.Text = PasswordPolicyEditor.GetValueSafe(parts, 8, "0");
txtAccountLockoutDuration.Text = PasswordPolicyEditor.GetValueSafe(parts, 9, "0");
txtResetAccountLockout.Text = PasswordPolicyEditor.GetValueSafe(parts, 10, "0");
chkLockOutSettigns.Checked = PasswordPolicyEditor.GetValueSafe(parts, 11, false);
chkPasswordComplexity.Checked = PasswordPolicyEditor.GetValueSafe(parts, 12, true);
}
private void BindSettings(OrganizationPasswordSettings settings)
{
txtMinimumLength.Text = settings.MinimumLength.ToString();
txtMaximumLength.Text = settings.MaximumLength.ToString();
txtMinimumUppercase.Text = settings.UppercaseLettersCount.ToString();
txtMinimumNumbers.Text = settings.NumbersCount.ToString();
txtMinimumSymbols.Text = settings.SymbolsCount.ToString();
txtLockedOut.Text = settings.AccountLockoutThreshold.ToString();
txtEnforcePasswordHistory.Text = settings.EnforcePasswordHistory.ToString();
txtAccountLockoutDuration.Text = settings.AccountLockoutDuration.ToString();
txtResetAccountLockout.Text = settings.ResetAccountLockoutCounterAfter.ToString();
chkLockOutSettigns.Checked = settings.LockoutSettingsEnabled;
chkPasswordComplexity.Checked = settings.PasswordComplexityEnabled;
}
private OrganizationPasswordSettings GetSettings()
{
var settings = new OrganizationPasswordSettings();
settings.MinimumLength = Utils.ParseInt(txtMinimumLength.Text, 3);
settings.MaximumLength = Utils.ParseInt(txtMaximumLength.Text, 7);
settings.UppercaseLettersCount = Utils.ParseInt(txtMinimumUppercase.Text, 3);
settings.NumbersCount = Utils.ParseInt(txtMinimumNumbers.Text, 3);
settings.SymbolsCount = Utils.ParseInt(txtMinimumSymbols.Text, 3);
settings.AccountLockoutThreshold = Utils.ParseInt(txtLockedOut.Text, 3);
settings.EnforcePasswordHistory = Utils.ParseInt(txtEnforcePasswordHistory.Text, 3);
settings.AccountLockoutDuration = Utils.ParseInt(txtAccountLockoutDuration.Text, 3);
settings.ResetAccountLockoutCounterAfter = Utils.ParseInt(txtResetAccountLockout.Text, 3);
settings.LockoutSettingsEnabled = chkLockOutSettigns.Checked;
settings.PasswordComplexityEnabled =chkPasswordComplexity.Checked;
return settings;
}
private bool SavePasswordSettings()
{
try
{
ES.Services.Organizations.UpdateOrganizationPasswordSettings(PanelRequest.ItemID, GetSettings());
}
catch (Exception ex)
{
ShowErrorMessage("ORANIZATIONSETTINGS_NOT_UPDATED", ex);
return false;
}
return true;
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
{
return;
}
SavePasswordSettings();
}
private void ToggleLockoutControls(bool visible)
{
RowAccountLockoutDuration.Visible = visible;
RowLockedOut.Visible = visible;
RowResetAccountLockout.Visible = visible;
}
protected void chkLockOutSettigns_CheckedChanged(object sender, EventArgs e)
{
ToggleLockoutControls(chkLockOutSettigns.Checked);
}
private void ToggleComplexityControls(bool visible)
{
RowMinimumUppercase.Visible = visible;
RowMinimumNumbers.Visible = visible;
RowMinimumSymbols.Visible = visible;
}
protected void chkPasswordComplexity_CheckedChanged(object sender, EventArgs e)
{
ToggleComplexityControls(chkPasswordComplexity.Checked);
}
protected void btnSaveExit_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
{
return;
}
if (SavePasswordSettings())
{
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "organization_home", "SpaceID=" + PanelSecurity.PackageId));
}
}
}
}

View file

@ -0,0 +1,519 @@
//------------------------------------------------------------------------------
// <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.ExchangeServer {
public partial class OrganizationSettingsPasswordSettings {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// Image1 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.Image Image1;
/// <summary>
/// locTitle 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.Localize locTitle;
/// <summary>
/// litOrganizationName 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.Literal litOrganizationName;
/// <summary>
/// tabs control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.OrganizationSettingsTabs tabs;
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// PasswordPolicyPanel 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 PasswordPolicyPanel;
/// <summary>
/// colPasswordSettings control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel colPasswordSettings;
/// <summary>
/// panelPasswordSettings 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 panelPasswordSettings;
/// <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>
/// lblMinimumLength 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 lblMinimumLength;
/// <summary>
/// txtMinimumLength 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 txtMinimumLength;
/// <summary>
/// valRequireMinLength 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 valRequireMinLength;
/// <summary>
/// valCorrectMinLength 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 valCorrectMinLength;
/// <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;
/// <summary>
/// lblEnforcePasswordHistory 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 lblEnforcePasswordHistory;
/// <summary>
/// txtEnforcePasswordHistory 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 txtEnforcePasswordHistory;
/// <summary>
/// valRequireEnforcePasswordHistory 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 valRequireEnforcePasswordHistory;
/// <summary>
/// valCorrectEnforcePasswordHistory 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 valCorrectEnforcePasswordHistory;
/// <summary>
/// RowChkLockOutSettigns 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.HtmlTableRow RowChkLockOutSettigns;
/// <summary>
/// chkLockOutSettigns 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 chkLockOutSettigns;
/// <summary>
/// RowAccountLockoutDuration 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.HtmlTableRow RowAccountLockoutDuration;
/// <summary>
/// lblAccountLockoutDuration 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 lblAccountLockoutDuration;
/// <summary>
/// txtAccountLockoutDuration 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 txtAccountLockoutDuration;
/// <summary>
/// valRequireAccountLockoutDuration 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 valRequireAccountLockoutDuration;
/// <summary>
/// valCorrectAccountLockoutDuration 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 valCorrectAccountLockoutDuration;
/// <summary>
/// RowLockedOut 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.HtmlTableRow RowLockedOut;
/// <summary>
/// lblLockedOut 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 lblLockedOut;
/// <summary>
/// txtLockedOut 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 txtLockedOut;
/// <summary>
/// valCorrectLockedOut 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 valCorrectLockedOut;
/// <summary>
/// RowResetAccountLockout 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.HtmlTableRow RowResetAccountLockout;
/// <summary>
/// lblResetAccountLockout 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 lblResetAccountLockout;
/// <summary>
/// txtResetAccountLockout 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 txtResetAccountLockout;
/// <summary>
/// valResetAccountLockout 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 valResetAccountLockout;
/// <summary>
/// chkPasswordComplexity 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 chkPasswordComplexity;
/// <summary>
/// RowMinimumUppercase 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.HtmlTableRow RowMinimumUppercase;
/// <summary>
/// lblMinimumUppercase 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 lblMinimumUppercase;
/// <summary>
/// txtMinimumUppercase 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 txtMinimumUppercase;
/// <summary>
/// valRequireUppercase 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 valRequireUppercase;
/// <summary>
/// valCorrectUppercase 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 valCorrectUppercase;
/// <summary>
/// RowMinimumNumbers 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.HtmlTableRow RowMinimumNumbers;
/// <summary>
/// lblMinimumNumbers 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 lblMinimumNumbers;
/// <summary>
/// txtMinimumNumbers 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 txtMinimumNumbers;
/// <summary>
/// valRequireNumbers 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 valRequireNumbers;
/// <summary>
/// valCorrectNumbers 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 valCorrectNumbers;
/// <summary>
/// RowMinimumSymbols 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.HtmlTableRow RowMinimumSymbols;
/// <summary>
/// lblMinimumSymbols 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 lblMinimumSymbols;
/// <summary>
/// txtMinimumSymbols 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 txtMinimumSymbols;
/// <summary>
/// valRequireSymbols 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 valRequireSymbols;
/// <summary>
/// valCorrectSymbols 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 valCorrectSymbols;
/// <summary>
/// rowEqualUsername 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.HtmlTableRow rowEqualUsername;
/// <summary>
/// chkNotEqualUsername 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 chkNotEqualUsername;
/// <summary>
/// buttonPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ItemButtonPanel buttonPanel;
}
}

View file

@ -59,18 +59,7 @@ namespace WebsitePanel.Portal.HostedSolution
{
try
{
password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy");
PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID);
if (passwordPolicy.IsSuccess)
{
password.MinimumLength = passwordPolicy.Value.MinLength;
if (passwordPolicy.Value.IsComplexityEnable)
{
password.MinimumNumbers = 1;
password.MinimumSymbols = 1;
password.MinimumUppercase = 1;
}
}
BindPasswordSettings();
// get settings
OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID,
@ -273,6 +262,37 @@ namespace WebsitePanel.Portal.HostedSolution
}
private void BindPasswordSettings()
{
var grainedPasswordSettigns = ES.Services.Organizations.GetOrganizationPasswordSettings(PanelRequest.ItemID);
if (grainedPasswordSettigns != null)
{
password.SetUserPolicy(grainedPasswordSettigns);
}
else
{
password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy");
PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID);
if (passwordPolicy.IsSuccess)
{
password.MinimumLength = passwordPolicy.Value.MinLength;
if (passwordPolicy.Value.IsComplexityEnable)
{
password.MinimumNumbers = 1;
password.MinimumSymbols = 1;
password.MinimumUppercase = 1;
}
}
else
{
messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization");
}
}
}
private bool CheckServiceLevelQuota(QuotaValueInfo quota)
{

View file

@ -0,0 +1,123 @@
<?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="Tab.PasswordSettings" xml:space="preserve">
<value>Password Settings</value>
</data>
</root>

View file

@ -0,0 +1,32 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSettingsTabs.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.OrganizationSettingsTabs" %>
<table width="100%" cellpadding="0" cellspacing="1">
<tr>
<td class="Tabs">
<asp:DataList ID="osTabs" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" EnableViewState="false">
<ItemStyle Wrap="False" />
<ItemTemplate >
<asp:HyperLink ID="lnkTab" runat="server" CssClass="Tab" NavigateUrl='<%# Eval("Url") %>' OnClick="return tabClicked();">
<%# Eval("Name") %>
</asp:HyperLink>
</ItemTemplate>
<SelectedItemStyle Wrap="False" />
<SelectedItemTemplate>
<asp:HyperLink ID="lnkSelTab" runat="server" CssClass="ActiveTab" NavigateUrl='<%# Eval("Url") %>' OnClick="return tabClicked;">
<%# Eval("Name") %>
</asp:HyperLink>
</SelectedItemTemplate>
</asp:DataList>
</td>
</tr>
</table>
<br />
<script type="text/javascript">
function tabClicked() {
ShowProgressDialog('Loading');
ShowProgressDialogInternal();
return true;
}
</script>

View file

@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Portal.Code.UserControls;
namespace WebsitePanel.Portal.ExchangeServer.UserControls
{
public partial class OrganizationSettingsTabs : WebsitePanelControlBase
{
public string SelectedTab { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
BindTabs();
}
private void BindTabs()
{
List<Tab> tabsList = new List<Tab>();
tabsList.Add(CreateTab("organization_settings_password_settings", "Tab.PasswordSettings"));
int idx = 0;
foreach (Tab tab in tabsList)
{
if (String.Compare(tab.Id, SelectedTab, true) == 0)
{
break;
}
idx++;
}
osTabs.SelectedIndex = idx;
osTabs.DataSource = tabsList;
osTabs.DataBind();
}
private Tab CreateTab(string id, string text)
{
return new Tab(id, GetLocalizedString(text),
HostModule.EditUrl("ItemID", PanelRequest.ItemID.ToString(), id,
"SpaceID=" + PanelSecurity.PackageId
));
}
}
}

View file

@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <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.ExchangeServer.UserControls {
public partial class OrganizationSettingsTabs {
/// <summary>
/// osTabs 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.DataList osTabs;
}
}

View file

@ -13,7 +13,7 @@
</td>
<td>
<wsp:PasswordPolicyEditor id="mailboxPasswordPolicy" runat="server" />
<wsp:PasswordPolicyEditor id="mailboxPasswordPolicy" runat="server" ShowLockoutSettings="true"/>
</td>
</tr>
</table>

View file

@ -1,30 +1,11 @@
// Copyright (c) 2015, Outercurve Foundation.
// All rights reserved.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// 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.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {

View file

@ -120,11 +120,26 @@
<data name="chkEnabled.Text" xml:space="preserve">
<value>Enable Policy</value>
</data>
<data name="chkLockOutSettigns.Text" xml:space="preserve">
<value>Enable Lockout Settings</value>
</data>
<data name="chkNotEqualUsername.Text" xml:space="preserve">
<value>Should not be equal to username</value>
</data>
<data name="chkPasswordComplexity" xml:space="preserve">
<value>Enable Password Complexity</value>
</data>
<data name="lblAccountLockoutDuration.Text" xml:space="preserve">
<value>Account lockout duration:</value>
</data>
<data name="lblEnforcePasswordHistory.Text" xml:space="preserve">
<value>Enforce password history:</value>
</data>
<data name="lblLockedOut.Text" xml:space="preserve">
<value>Lock out after # attempts:</value>
<value>Account lockout threshold:</value>
</data>
<data name="lblLockOutSettigns.Text" xml:space="preserve">
<value>Lock out settings:</value>
</data>
<data name="lblMaximumLength.Text" xml:space="preserve">
<value>Maximum length:</value>
@ -141,9 +156,18 @@
<data name="lblMinimumUppercase.Text" xml:space="preserve">
<value>Uppercase letters:</value>
</data>
<data name="lblResetAccountLockout.Text" xml:space="preserve">
<value>Reset account lockout counter after (minutes):</value>
</data>
<data name="lblShouldContain.Text" xml:space="preserve">
<value>Password should contain at least:</value>
</data>
<data name="valCorrectAccountLockoutDuration.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valCorrectEnforcePasswordHistory.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valCorrectLockedOut.Text" xml:space="preserve">
<value>*</value>
</data>
@ -162,6 +186,12 @@
<data name="valCorrectUppercase.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireAccountLockoutDuration.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireEnforcePasswordHistory.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireMaxLength.Text" xml:space="preserve">
<value>*</value>
</data>
@ -177,4 +207,7 @@
<data name="valRequireUppercase.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valResetAccountLockout.Text" xml:space="preserve">
<value>*</value>
</data>
</root>

View file

@ -27,6 +27,7 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Configuration.Internal;
using System.Data;
using System.Configuration;
using System.Collections;
@ -41,6 +42,7 @@ using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.HostedSolution;
namespace WebsitePanel.Portal
{
@ -112,7 +114,14 @@ namespace WebsitePanel.Portal
public int MaximumLength
{
get { return (ViewState["MaximumLength"] != null) ? (int)ViewState["MaximumLength"] : 0; }
set { ViewState["MaximumLength"] = value; }
set
{
{
txtPassword.MaxLength = value;
txtConfirmPassword.MaxLength = value;
ViewState["MaximumLength"] = value;
}
}
}
public int MinimumNumbers
@ -182,6 +191,38 @@ namespace WebsitePanel.Portal
ToggleControls();
}
public void SetUserPolicy(OrganizationPasswordSettings settings)
{
int minimumUppercase;
int minimumNumbers;
int minimumSymbols;
if (settings.PasswordComplexityEnabled)
{
minimumUppercase = settings.UppercaseLettersCount;
minimumNumbers = settings.NumbersCount;
minimumSymbols = settings.SymbolsCount;
}
else
{
minimumUppercase = 0;
minimumNumbers = 0;
minimumSymbols = 0;
}
PolicyValue = string.Join(";", true, settings.MinimumLength, settings.MaximumLength, minimumUppercase, minimumNumbers, minimumSymbols, true);
ToggleControls();
}
public void SetUserPolicy(bool enabled, int minLength, int maxLength, int minimumUppercase, int minimumNumbers, int minimumSymbols, bool notEqualToUsername)
{
PolicyValue = string.Join(";", enabled, minLength, maxLength, minimumUppercase, minimumNumbers, minimumSymbols, notEqualToUsername);
ToggleControls();
}
protected void Page_Load(object sender, EventArgs e)
{
txtPassword.Attributes["value"] = txtPassword.Text;

View file

@ -28,10 +28,59 @@
</td>
</tr>
<tr>
<td colspan="2" class="NormalBold"><asp:Label ID="lblShouldContain" runat="server"
meta:resourcekey="lblShouldContain" Text="Password should contain at least:"></asp:Label></td>
<td class="Normal" style="width:150px;"><asp:Label ID="lblEnforcePasswordHistory" runat="server"
meta:resourcekey="lblEnforcePasswordHistory" Text="Enforce Password History:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtEnforcePasswordHistory" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireEnforcePasswordHistory" runat="server" ControlToValidate="txtEnforcePasswordHistory" meta:resourcekey="valRequireEnforcePasswordHistory"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectEnforcePasswordHistory" runat="server" ControlToValidate="txtEnforcePasswordHistory" meta:resourcekey="valCorrectEnforcePasswordHistory"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator></td>
</tr>
<tr id="RowChkLockOutSettigns" runat="server">
<td colspan="2" class="NormalBold">
<asp:CheckBox id="chkLockOutSettigns" runat="server" meta:resourcekey="chkLockOutSettigns"
Text="Enable Lockout Settings" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="chkLockOutSettigns_CheckedChanged" />
</td>
</tr>
<tr id="RowAccountLockoutDuration" runat="server">
<td class="Normal" style="width:150px;"><asp:Label ID="lblAccountLockoutDuration" runat="server"
meta:resourcekey="lblAccountLockoutDuration" Text="Account Lockout Duration:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtAccountLockoutDuration" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireAccountLockoutDuration" runat="server" ControlToValidate="txtAccountLockoutDuration" meta:resourcekey="valRequireAccountLockoutDuration"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectAccountLockoutDuration" runat="server" ControlToValidate="txtAccountLockoutDuration" meta:resourcekey="valCorrectAccountLockoutDuration"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator></td>
</tr>
<tr id="RowLockedOut" runat="server">
<td class="Normal">
<asp:Label ID="lblLockedOut" runat="server"
meta:resourcekey="lblLockedOut" Text="Account Lockout threshold:"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtLockedOut" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RegularExpressionValidator ID="valCorrectLockedOut" runat="server" ControlToValidate="txtLockedOut" meta:resourcekey="valCorrectLockedOut"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,10}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
<tr id="RowResetAccountLockout" runat="server">
<td class="Normal">
<asp:Label ID="lblResetAccountLockout" runat="server"
meta:resourcekey="lblResetAccountLockout" Text="Reset account lockout counter after (minutes):"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtResetAccountLockout" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RegularExpressionValidator ID="valResetAccountLockout" runat="server" ControlToValidate="txtResetAccountLockout" meta:resourcekey="valResetAccountLockout"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,10}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td colspan="2" class="NormalBold">
<asp:CheckBox id="chkPasswordComplexity" runat="server" meta:resourcekey="chkPasswordComplexity"
Text="Enable Password Complexity" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="chkPasswordComplexity_CheckedChanged" />
</td>
</tr>
<tr id="RowMinimumUppercase" runat="server">
<td class="Normal">
<asp:Label ID="lblMinimumUppercase" runat="server"
meta:resourcekey="lblMinimumUppercase" Text="Uppercase letters:"></asp:Label>
@ -43,7 +92,7 @@
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<tr id="RowMinimumNumbers" runat="server">
<td class="Normal">
<asp:Label ID="lblMinimumNumbers" runat="server"
meta:resourcekey="lblMinimumNumbers" Text="Numbers:"></asp:Label>
@ -55,7 +104,7 @@
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<tr id="RowMinimumSymbols" runat="server">
<td class="Normal">
<asp:Label ID="lblMinimumSymbols" runat="server"
meta:resourcekey="lblMinimumSymbols" Text="Non-alphanumeric symbols:"></asp:Label>
@ -72,18 +121,6 @@
<asp:CheckBox id="chkNotEqualUsername" runat="server" meta:resourcekey="chkNotEqualUsername" Text="Should not be equal to username" />
</td>
</tr>
<tr>
<td class="Normal">
<asp:Label ID="lblLockedOut" runat="server"
meta:resourcekey="lblLockedOut" Text="Lock out after :"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtLockedOut" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RegularExpressionValidator ID="valCorrectLockedOut" runat="server" ControlToValidate="txtLockedOut" meta:resourcekey="valCorrectLockedOut"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,10}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</tr>
</table>
</ContentTemplate>

View file

@ -42,6 +42,8 @@ namespace WebsitePanel.Portal
{
public partial class PasswordPolicyEditor : WebsitePanelControlBase
{
public bool ShowLockoutSettings { get; set; }
public string Value
{
get
@ -56,6 +58,12 @@ namespace WebsitePanel.Portal
sb.Append(chkNotEqualUsername.Checked.ToString()).Append(";");
sb.Append(txtLockedOut.Text).Append(";");
sb.Append(txtEnforcePasswordHistory.Text).Append(";");
sb.Append(txtAccountLockoutDuration.Text).Append(";");
sb.Append(txtResetAccountLockout.Text).Append(";");
sb.Append(chkLockOutSettigns.Checked.ToString()).Append(";");
sb.Append(chkPasswordComplexity.Checked.ToString()).Append(";");
return sb.ToString();
}
set
@ -70,6 +78,7 @@ namespace WebsitePanel.Portal
txtMinimumNumbers.Text = "0";
txtMinimumSymbols.Text = "0";
txtLockedOut.Text = "3";
chkPasswordComplexity.Checked = true;
}
else
{
@ -85,8 +94,17 @@ namespace WebsitePanel.Portal
txtMinimumSymbols.Text = parts[5];
chkNotEqualUsername.Checked = Utils.ParseBool(parts[6], false);
txtLockedOut.Text = parts[7];
txtEnforcePasswordHistory.Text = GetValueSafe(parts, 8, "0");
txtAccountLockoutDuration.Text = GetValueSafe(parts, 9, "0");
txtResetAccountLockout.Text = GetValueSafe(parts, 10, "0");
chkLockOutSettigns.Checked = GetValueSafe(parts, 11, false) && ShowLockoutSettings;
chkPasswordComplexity.Checked = GetValueSafe(parts, 12, true);
}
catch
{
/* skip */
}
catch { /* skip */ }
}
ToggleControls();
}
@ -99,11 +117,56 @@ namespace WebsitePanel.Portal
private void ToggleControls()
{
PolicyTable.Visible = chkEnabled.Checked;
ToggleLockOutSettignsControls();
TogglePasswordCompelxitySettignsControls();
RowChkLockOutSettigns.Visible = ShowLockoutSettings;
}
protected void chkEnabled_CheckedChanged(object sender, EventArgs e)
{
ToggleControls();
}
private void ToggleLockOutSettignsControls()
{
RowAccountLockoutDuration.Visible = chkLockOutSettigns.Checked;
RowLockedOut.Visible = chkLockOutSettigns.Checked;
RowResetAccountLockout.Visible = chkLockOutSettigns.Checked;
}
private void TogglePasswordCompelxitySettignsControls()
{
RowMinimumUppercase.Visible = chkPasswordComplexity.Checked;
RowMinimumNumbers.Visible = chkPasswordComplexity.Checked;
RowMinimumSymbols.Visible = chkPasswordComplexity.Checked;
}
protected void chkLockOutSettigns_CheckedChanged(object sender, EventArgs e)
{
ToggleLockOutSettignsControls();
}
protected void chkPasswordComplexity_CheckedChanged(object sender, EventArgs e)
{
TogglePasswordCompelxitySettignsControls();
}
public static T GetValueSafe<T>(string[] array, int index, T defaultValue)
{
if (array.Length > index)
{
if (string.IsNullOrEmpty(array[index]))
{
return defaultValue;
}
return (T)Convert.ChangeType(array[index], typeof(T));
}
return defaultValue;
}
}
}

View file

@ -1,31 +1,3 @@
// Copyright (c) 2015, 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.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -140,13 +112,193 @@ namespace WebsitePanel.Portal {
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectMaxLength;
/// <summary>
/// lblShouldContain control.
/// lblEnforcePasswordHistory 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 lblShouldContain;
protected global::System.Web.UI.WebControls.Label lblEnforcePasswordHistory;
/// <summary>
/// txtEnforcePasswordHistory 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 txtEnforcePasswordHistory;
/// <summary>
/// valRequireEnforcePasswordHistory 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 valRequireEnforcePasswordHistory;
/// <summary>
/// valCorrectEnforcePasswordHistory 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 valCorrectEnforcePasswordHistory;
/// <summary>
/// RowChkLockOutSettigns 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.HtmlTableRow RowChkLockOutSettigns;
/// <summary>
/// chkLockOutSettigns 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 chkLockOutSettigns;
/// <summary>
/// RowAccountLockoutDuration 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.HtmlTableRow RowAccountLockoutDuration;
/// <summary>
/// lblAccountLockoutDuration 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 lblAccountLockoutDuration;
/// <summary>
/// txtAccountLockoutDuration 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 txtAccountLockoutDuration;
/// <summary>
/// valRequireAccountLockoutDuration 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 valRequireAccountLockoutDuration;
/// <summary>
/// valCorrectAccountLockoutDuration 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 valCorrectAccountLockoutDuration;
/// <summary>
/// RowLockedOut 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.HtmlTableRow RowLockedOut;
/// <summary>
/// lblLockedOut 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 lblLockedOut;
/// <summary>
/// txtLockedOut 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 txtLockedOut;
/// <summary>
/// valCorrectLockedOut 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 valCorrectLockedOut;
/// <summary>
/// RowResetAccountLockout 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.HtmlTableRow RowResetAccountLockout;
/// <summary>
/// lblResetAccountLockout 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 lblResetAccountLockout;
/// <summary>
/// txtResetAccountLockout 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 txtResetAccountLockout;
/// <summary>
/// valResetAccountLockout 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 valResetAccountLockout;
/// <summary>
/// chkPasswordComplexity 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 chkPasswordComplexity;
/// <summary>
/// RowMinimumUppercase 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.HtmlTableRow RowMinimumUppercase;
/// <summary>
/// lblMinimumUppercase control.
@ -184,6 +336,15 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectUppercase;
/// <summary>
/// RowMinimumNumbers 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.HtmlTableRow RowMinimumNumbers;
/// <summary>
/// lblMinimumNumbers control.
/// </summary>
@ -220,6 +381,15 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectNumbers;
/// <summary>
/// RowMinimumSymbols 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.HtmlTableRow RowMinimumSymbols;
/// <summary>
/// lblMinimumSymbols control.
/// </summary>
@ -273,32 +443,5 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkNotEqualUsername;
/// <summary>
/// lblLockedOut 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 lblLockedOut;
/// <summary>
/// txtLockedOut 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 txtLockedOut;
/// <summary>
/// valCorrectLockedOut 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 valCorrectLockedOut;
}
}

View file

@ -244,6 +244,13 @@
<DependentUpon>OrganizationDeletedUserGeneralSettings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ExchangeServer\OrganizationSettingsPasswordSettings.ascx.cs">
<DependentUpon>OrganizationSettingsPasswordSettings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ExchangeServer\OrganizationSettingsPasswordSettings.ascx.designer.cs">
<DependentUpon>OrganizationSettingsPasswordSettings.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\OrganizationUserResetPassword.ascx.cs">
<DependentUpon>OrganizationUserResetPassword.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -265,6 +272,13 @@
<Compile Include="ExchangeServer\UserControls\EnterpriseStorageOwaUsersList.ascx.designer.cs">
<DependentUpon>EnterpriseStorageOwaUsersList.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\UserControls\OrganizationSettingsTabs.ascx.cs">
<DependentUpon>OrganizationSettingsTabs.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ExchangeServer\UserControls\OrganizationSettingsTabs.ascx.designer.cs">
<DependentUpon>OrganizationSettingsTabs.ascx</DependentUpon>
</Compile>
<Compile Include="ProviderControls\HyperV2012R2_Settings.ascx.cs">
<DependentUpon>HyperV2012R2_Settings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -4557,9 +4571,11 @@
<Content Include="ExchangeServer\EnterpriseStorageFolderSettingsFolderPermissions.ascx" />
<Content Include="ExchangeServer\EnterpriseStorageFolderSettingsOwaEditing.ascx" />
<Content Include="ExchangeServer\ExchangeCheckDomainName.ascx" />
<Content Include="ExchangeServer\OrganizationSettingsPasswordSettings.ascx" />
<Content Include="ExchangeServer\OrganizationUserResetPassword.ascx" />
<Content Include="ExchangeServer\UserControls\EnterpriseStorageEditFolderTabs.ascx" />
<Content Include="ExchangeServer\UserControls\EnterpriseStorageOwaUsersList.ascx" />
<Content Include="ExchangeServer\UserControls\OrganizationSettingsTabs.ascx" />
<Content Include="ProviderControls\HyperV2012R2_Settings.ascx" />
<Content Include="ScheduleTaskControls\UserPasswordExpirationNotificationView.ascx" />
<Content Include="SettingsUserPasswordExpirationLetter.ascx" />
@ -4622,6 +4638,8 @@
</Content>
<Content Include="ExchangeServer\App_LocalResources\OrganizationUserResetPassword.ascx.resx" />
<Content Include="App_LocalResources\SettingsUserPasswordExpirationLetter.ascx.resx" />
<Content Include="ExchangeServer\UserControls\App_LocalResources\OrganizationSettingsTabs.ascx.resx" />
<Content Include="ExchangeServer\App_LocalResources\OrganizationSettingsPasswordSettings.ascx.resx" />
<EmbeddedResource Include="RDS\App_LocalResources\RDSEditCollectionSettings.ascx.resx" />
<Content Include="RDSServersEditServer.ascx" />
<Content Include="RDS\AssignedRDSServers.ascx" />