<?xml version="1.0" encoding="utf-8"?>
  <finScript version="1.00" exportedUtcDate="2024-07-04T04:02:17.0000000">
    <CreatedUserId>Admin</CreatedUserId>
    <CreatedUtcDate>2024-07-04T03:56:19.7290000</CreatedUtcDate>
    <UpdatedUserId>Admin</UpdatedUserId>
    <UpdatedUtcDate>2024-07-04T04:00:31.1740000</UpdatedUtcDate>
    <ScriptId>UserPolicyEdit</ScriptId>
    <Description>User Policy Edit HTML Widget</Description>
    <ScriptType>HtmlWidget</ScriptType>
    <Active>true</Active>
    <AllowUI>false</AllowUI>
    <Bookmarks />
    <Category />
    <Code>' HtmlWidget_UserPolicyEdit
Option Explicit On
Option Strict On

' #################################################################
' User Policy Edit form HTML Widget
'
' Version: 1.05 (04/07/2024)
'
' Usage: System-supplied HTML Widget
' #################################################################
' Version        Date  User     Job       Description
' -------  ----------  -------  --------  -------------------------
'    1.00  07/12/2021  ISS      J027858   Created
'    1.01  09/11/2023  ISS      J032229   Added auto-disable settings
'    1.02  08/02/2024  ISS      J032879   Added DaysNeverLoggedIn
'    1.03  21/02/2024  ISS      J032924   Fixed Disable User Days range checks
'    1.04  10/06/2024  ISS      J033668   Updated tooltip for lockout login attempts
'    1.05  04/07/2024  ISS      J033850   Updated tooltip again
' #################################################################

' Constants
Private Const FORM_KEY As String = "UserPolicies"

' Objects
Private mCombinedParameters As ISKeyValueList
Private mParameters As ISKeyValueList
Private mStartupParameters As ISKeyValueList

' Standard Parameters
Private mDuplicateRecordId As String
Private mPage As String
Private mReadOnly As Boolean
Private mUserPolicyId As String

Public Function Main(eventId As String,
                     parametersJson As String,
                     startUpParametersJson As String,
                     hostingContext As isefinHtmlWidgetHostingContext,
                     requestInfo As finScriptRequestInfo,
                     ByRef returnValue As String) As Boolean

  ' Assume Success
  Main = True

  ' Get Parameters
  mParameters = finBL.CreateKeyValueList()
  mParameters.FromSimpleJsonString(parametersJson)
  mStartupParameters = finBL.CreateKeyValueList()
  mStartupParameters.FromSimpleJsonString(startUpParametersJson)

  ' Get Combined Parameters (Startup Parameters updated with event Parameters)
  mCombinedParameters = mStartupParameters.Clone()
  mCombinedParameters.UpdateFromKeyValueList(mParameters, True)

  ' Get Standard Parameters
  With mStartupParameters
    mUserPolicyId = .GetString("UserPolicyId") ' Always use Startup Parameters since the User Policy Id may be updated
  End With
  With mCombinedParameters
    mDuplicateRecordId = .GetString("DuplicateRecordId")
    mPage = .GetString("Page")
    mReadOnly = .GetBoolean("ReadOnly")
  End With

  ' Validate
  Main = finBL.HtmlWidgetUtilities.HasPermissionToViewFormKey(FORM_KEY)

  ' Handle Events
  If Main Then
    Select Case eventId
      Case ""
        ' Main event, i.e., return initial HTML content (excluding html and body tags)
        returnValue = ScriptInfo.TemplateText

      Case "Finish"
        ' Finish wizard
        Main = Finish(parametersJson, requestInfo, returnValue)

     Case "GetInitialisationInfo"
        ' Get Initialisation Information required for this wizard
        Main = GetInitialisationInfo(returnValue)

      Case Else
        Main = False
        finBL.Error.ErrorBeginFormat("Unhandled event '{0}'", eventId)
    End Select
  End If

End Function

''' &lt;summary&gt;
'''  Load User Policy.
''' &lt;/summary&gt;
Private Function GetUserPolicy(ByRef userPolicy As ISUserPolicy) As Boolean

  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Validate

  ' Create and Load User Policy
  If Success Then
    ' Create User Policy
    userPolicy = finBL.CreateUserPolicy()

    ' Load User Policy
    If Len(mDuplicateRecordId) &lt;&gt; 0 Then
      ' New record (by duplicating existing)
      Success = userPolicy.Load(mDuplicateRecordId)
      If Success Then userPolicy.Duplicate()
    ElseIf Len(mUserPolicyId) = 0 Then
      ' New record
    Else
      Success = userPolicy.Load(mUserPolicyId)
    End If
  End If

  Return Success

End Function

''' &lt;summary&gt;
'''  Get Initialisation Information required for this wizard.
''' &lt;/summary&gt;
Public Function GetInitialisationInfo(ByRef response As String) As Boolean

  Dim FormInitialisationInfo As FormInitialisationInfo
  Dim Success As Boolean
  Dim UserPolicy As ISUserPolicy

  ' Assume Success
  Success = True

  ' Validate

  ' Get User Policy
  If Success Then
    Success = GetUserPolicy(UserPolicy)
  End If

  ' Get Initialisation Info
  If Success Then
    FormInitialisationInfo = New FormInitialisationInfo()
    With FormInitialisationInfo
      ' Form
      .PageId = mPage
      If finBL.Database.IsReadOnly OrElse mReadOnly Then
        .ReadOnly = True
      Else
        .ReadOnly = False
      End If

      ' Record
      .Pk = UserPolicy.Pk
      .Timestamp = UserPolicy.Timestamp

      ' Page Permissions (defined here since they are used below)
      .AllowPageGeneral = True
      .AllowPagePasswordPolicy = True
      .AllowPageDisableUser = True
      .AllowPageEventLogging = True

      ' General
      .UserPolicyId = UserPolicy.UserPolicyId ' Always need to return User Policy Id
      If .AllowPageGeneral Then
        .Active = UserPolicy.Active
        .Description = UserPolicy.Description

        .AllowRunApp = UserPolicy.AllowRunApp
        .AllowRunWebApp = UserPolicy.AllowRunWebApp
        .AllowRunBL = UserPolicy.AllowRunBL
        .AllowExclusiveAccess = UserPolicy.AllowExclusiveAccess

        .AutoLockMinutes = UserPolicy.AutoLockMinutes

        .EmailMandatory = UserPolicy.EmailMandatory
      End If

      ' Password Policy
      If .AllowPagePasswordPolicy Then
        .LoginFailedDelaySeconds = UserPolicy.LoginFailedDelaySeconds

        .LoginLockoutAttempts = UserPolicy.LoginLockoutAttempts
        .LoginLockoutTimespan = UserPolicy.LoginLockoutTimespan
        .LoginLockoutMinutes = UserPolicy.LoginLockoutMinutes

        .PasswordMinLength = UserPolicy.PasswordMinLength
        .PasswordStrong = UserPolicy.PasswordStrong

        .PasswordMaxAgeDays = UserPolicy.PasswordMaxAgeDays
        .PasswordHistoryLength = UserPolicy.PasswordHistoryLength
      End If

      ' Disable User
      If .AllowPageDisableUser Then
        .DisableAutomatic = UserPolicy.DisableAutomatic
        .DisableDaysNeverLoggedIn = UserPolicy.DisableDaysNeverLoggedIn
        .DisableDaysSinceLogin = UserPolicy.DisableDaysSinceLogin
        .DisableDaysSincePasswordExpired = UserPolicy.DisableDaysSincePasswordExpired
      End If
      
      ' Event Logging
      If .AllowPageEventLogging Then
        .LogEventLoginFailed = UserPolicy.LogEventLoginFailed
        .LogEventLoginLockout = UserPolicy.LogEventLoginLockout
        .LogEventLoginSuccess = UserPolicy.LogEventLoginSuccess
        .LogEventChangedPassword = UserPolicy.LogEventChangedPassword
      End If

      ' Other

      ' Permissions

      ' Lists

      ' Configuration
      .HideOtherPages = mCombinedParameters.GetBoolean("HideOtherPages", False)
      .PromptOnSave = finBL.CloudConnectFunctions.CloudConnectSettings.PromptOnSave
    End With
  End If

  ' Response
  If Success Then
    Success = finBL.Runtime.WebUtilities.SerialiseObjectToJsonString(FormInitialisationInfo, response)
  End If

  Return Success

End Function

''' &lt;summary&gt;
'''  Finish, i.e., Save User Policy.
''' &lt;/summary&gt;
''' &lt;param name="parametersJson"&gt;
'''  A JSON formatted record (FormInitialisationInfo) object.
''' &lt;/param&gt;
Private Function Finish(parametersJson As String,
                        requestInfo As finScriptRequestInfo,
                        ByRef returnValue As String) As Boolean

  Dim obj As Object
  Dim Record As FormInitialisationInfo
  Dim Success As Boolean
  Dim UserPolicy As ISUserPolicy

  ' Assume Success
  Success = True

  ' Parse Parameters
  If finBL.Runtime.WebUtilities.DeserialiseJsonStringToObject(parametersJson, GetType(FormInitialisationInfo), obj) Then
    Record = DirectCast(obj, FormInitialisationInfo)
  Else
    Success = False
  End If

  ' Get User Policy
  If Success Then
    Success = GetUserPolicy(UserPolicy)
  End If

  ' Validate
  If Success Then
    If Record.Timestamp &lt;&gt; UserPolicy.Timestamp Then
      Success = False
      finBL.Error.ErrorBegin("This record has been updated by another User.")
    End If
  End If

  ' Update and Save
  ' NOTE: Recheck Permissions in addition to the 'AllowPage' properties before updating to prevent spoofing
  If Success Then
    ' Begin Transaction
    If finBL.Database.TransactionBegin() Then
      ' Update User Policy
      With UserPolicy
        ' General
        If Record.AllowPageGeneral Then
          .UserPolicyId = Record.UserPolicyId
          .Active = Record.Active
          .Description = Record.Description

          .AllowRunApp = Record.AllowRunApp
          .AllowRunWebApp = Record.AllowRunWebApp
          .AllowRunBL = Record.AllowRunBL
          .AllowExclusiveAccess = Record.AllowExclusiveAccess

          .AutoLockMinutes = Record.AutoLockMinutes

          .EmailMandatory = Record.EmailMandatory
        End If

        ' Password Policy
        If Record.AllowPagePasswordPolicy Then
          .LoginFailedDelaySeconds = Record.LoginFailedDelaySeconds

          .LoginLockoutAttempts = Record.LoginLockoutAttempts
          .LoginLockoutTimespan = Record.LoginLockoutTimespan
          .LoginLockoutMinutes = Record.LoginLockoutMinutes

          .PasswordMinLength = Record.PasswordMinLength
          .PasswordStrong = Record.PasswordStrong

          .PasswordMaxAgeDays = Record.PasswordMaxAgeDays
          .PasswordHistoryLength = Record.PasswordHistoryLength
        End If

        ' Disable User
        If Record.AllowPageDisableUser
          .DisableAutomatic = Record.DisableAutomatic
          .DisableDaysNeverLoggedIn = Record.DisableDaysNeverLoggedIn
          .DisableDaysSinceLogin = Record.DisableDaysSinceLogin
          .DisableDaysSincePasswordExpired = Record.DisableDaysSincePasswordExpired
        End If
        
        ' Event Logging
        If Record.AllowPageEventLogging Then
          .LogEventLoginFailed = Record.LogEventLoginFailed
          .LogEventLoginLockout = Record.LogEventLoginLockout
          .LogEventLoginSuccess = Record.LogEventLoginSuccess
          .LogEventChangedPassword = Record.LogEventChangedPassword
        End If
      End With

      ' Save
      If Success Then
        Success = UserPolicy.Save()
      End If

      ' Commit/ Rollback Transaction
      If Success Then
        finBL.Database.TransactionCommit()
      Else
        finBL.Database.TransactionRollback()
      End If
    Else
      Success = False
    End If
  End If

  Return Success

End Function

''' &lt;summary&gt;
'''  Validate a Wizard page.
''' &lt;/summary&gt;
''' &lt;param name="returnValue"&gt;
'''  A JSON object; "true" if validation passed, otherwise, information as to why validation failed.
''' &lt;/param&gt;
Private Function WizardValidate(parametersJson As String,
                                ByRef returnValue As String) As Boolean

  Dim Data As Object
  Dim FailedControlId As String
  Dim FailedMessage As String
  Dim PageId As String
  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Get Parameters
  ' NOTE: Use the module mCombinedParameters since this contains Startup and event Parameters in a single Key/Value List
  With mCombinedParameters
    PageId = .GetString("PageId")
  End With

  ' Validate Page
  Select Case PageId
    Case "General"
      ' General
  End Select

  ' Finalise
  If Success Then
    Success = finBL.Runtime.WebUtilities.SerialiseObjectToJsonString(New WizardValidateResponse(Data, FailedMessage, FailedControlId), returnValue)
  End If

  Return Success

End Function


''' &lt;summary&gt;
'''  Wizard Initialisation Information.
''' &lt;/summary&gt;
''' &lt;remarks&gt;
'''  This object is also used to save the Employment.
''' &lt;/remarks&gt;
Public Class FormInitialisationInfo

  ' Form
  Public PageId As String
  Public [ReadOnly] As Boolean

  ' Record
  Public Pk As Integer
  Public Timestamp As Integer

  ' General
  Public UserPolicyId As String
  Public Active As Boolean
  Public Description As String

  Public AllowRunApp As Boolean
  Public AllowRunWebApp As Boolean
  Public AllowRunBL As Boolean
  Public AllowExclusiveAccess As Boolean

  Public AutoLockMinutes As Integer
  Public EmailMandatory As Boolean

  ' Password Policy
  Public LoginFailedDelaySeconds As Double

  Public LoginLockoutAttempts As Integer
  Public LoginLockoutTimespan As Integer
  Public LoginLockoutMinutes As Integer

  Public PasswordMinLength As Integer
  Public PasswordStrong As Boolean

  Public PasswordMaxAgeDays As Integer
  Public PasswordHistoryLength As Integer

  ' Disable User
  Public DisableAutomatic As Boolean
  Public DisableDaysNeverLoggedIn As Integer
  Public DisableDaysSinceLogin As Integer
  Public DisableDaysSincePasswordExpired As Integer
  
  ' Event Logging
  Public LogEventLoginFailed As Integer
  Public LogEventLoginLockout As Integer
  Public LogEventLoginSuccess As Integer
  Public LogEventChangedPassword As Integer

  ' Permissions
  Public AllowPageGeneral As Boolean
  Public AllowPagePasswordPolicy As Boolean
  Public AllowPageDisableUser As Boolean
  Public AllowPageEventLogging As Boolean

  ' Lists

  ' Configuration
  Public HideOtherPages As Boolean
  Public PromptOnSave As Boolean

End Class



''' &lt;summary&gt;
'''  Validation details.
''' &lt;/summary&gt;
Public Class WizardValidateResponse

  Public Data As Object
  Public FailedMessage As String
  Public FailedControlId As String

  Public Sub New(data As Object,
                 failedMessage As String,
                 failedControlId As String)

    Me.Data = data
    Me.FailedMessage = failedMessage
    Me.FailedControlId = failedControlId

  End Sub

End Class</Code>
    <Language>VisualBasic</Language>
    <Notes>System-supplied HTML Widget to edit a User Policy.</Notes>
    <PermissionKeyExecute />
    <ReferenceLinq>false</ReferenceLinq>
    <RunWithoutPrompts>false</RunWithoutPrompts>
    <TemplateText>&lt;div id="frmMain" class="is-widget-content" style="visibility:hidden"&gt;

  &lt;!-- Form Header --&gt;
  &lt;header&gt;
    &lt;!-- Tabs --&gt;
    &lt;div id="tabDetails" class="is-tabs"&gt;
      &lt;ul&gt;
        &lt;li tabId="General"&gt;General&lt;/li&gt;
        &lt;li tabId="PasswordPolicy"&gt;Password Policy&lt;/li&gt;
        &lt;li tabId="DisableUser"&gt;Disable User&lt;/li&gt;
        &lt;li tabId="EventLogging"&gt;Event Logging&lt;/li&gt;
      &lt;ul&gt;
    &lt;/div&gt;
  &lt;/header&gt;


  &lt;!-- Pages --&gt;
  &lt;div class="is-widget-form-body"&gt;
    &lt;!-- General --&gt;
    &lt;div id="pageGeneral"&gt;
      &lt;table class="is-form"&gt;
        &lt;colgroup&gt;
          &lt;col style="width:8em" /&gt;
          &lt;col /&gt;
        &lt;/colgroup&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblCodeAndName"&gt;Code and Description&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="txtUserPolicyId"&gt;Code:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="txtUserPolicyId"/&gt; &lt;input id="chkActive" type="checkbox"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="txtDescription"&gt;Description:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="txtDescription"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label&gt;User access to finPOWER Connect&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="chkAllowRunApp" type="checkbox" /&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="chkAllowRunWebApp" type="checkbox" /&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="chkAllowRunBL" type="checkbox" /&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="chkAllowExclusiveAccess" type="checkbox" /&gt;&lt;/th&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblAutoLock"&gt;Auto-Lock options&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numAutoLockMinutes"&gt;Minutes:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numAutoLockMinutes"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label&gt;Other options&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="chkEmailMandatory" type="checkbox" /&gt;&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;


    &lt;!-- Password Policy --&gt;
    &lt;div id="pagePasswordPolicy"&gt;
      &lt;table class="is-form"&gt;
        &lt;colgroup&gt;
          &lt;col style="width:8em" /&gt;
          &lt;col /&gt;
        &lt;/colgroup&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label&gt;Pause after receiving invalid login credentials&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numLoginFailedDelaySeconds"&gt;Delay (secs):&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numLoginFailedDelaySeconds"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblLoginLockout"&gt;Number of login attempts before lockout&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numLoginLockoutAttempts"&gt;Login Attempts:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numLoginLockoutAttempts"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numLoginLockoutTimespan"&gt;Timespan&amp;nbsp;(mins):&amp;nbsp;&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numLoginLockoutTimespan"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numLoginLockoutMinutes"&gt;Lockout (mins):&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numLoginLockoutMinutes"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblPasswordComplexity"&gt;Password complexity options&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numPasswordMinLength"&gt;Minimum&amp;nbsp;Length:&amp;nbsp;&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numPasswordMinLength"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="chkPasswordStrong" type="checkbox" /&gt;&lt;/th&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label&gt;Password expiry time and history to prevent re-use&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numPasswordMaxAgeDays"&gt;Expiry Days:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numPasswordMaxAgeDays"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numPasswordHistoryLength"&gt;History Length:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numPasswordHistoryLength"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;


    &lt;!-- Disable User --&gt;
    &lt;div id="pageDisableUser"&gt;
      &lt;table class="is-form"&gt;
        &lt;colgroup&gt;
          &lt;col style="width:16em" /&gt;
          &lt;col /&gt;
        &lt;/colgroup&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblDisableUser"&gt;Specify conditions to automatically disable Users&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="chkDisableAutomatic" type="checkbox"/&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numDisableDaysNeverLoggedIn"&gt;Days never logged in:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numDisableDaysNeverLoggedIn"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numDisableDaysSinceLogin"&gt;Days since logging in:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numDisableDaysSinceLogin"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numDisableDaysSincePasswordExpired"&gt;Days since password expired:&amp;nbsp;&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numDisableDaysSincePasswordExpired"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;


    &lt;!-- Event Logging --&gt;
    &lt;div id="pageEventLogging"&gt;
      &lt;table class="is-form"&gt;
        &lt;colgroup&gt;
          &lt;col style="width:8em" /&gt;
          &lt;col /&gt;
        &lt;/colgroup&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label&gt;Event Logging options&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboLogEventLoginFailed"&gt;Login Failed:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboLogEventLoginFailed"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboLogEventLoginLockout"&gt;Login Lockout:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboLogEventLoginLockout"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboLogEventLoginSuccess"&gt;Login&amp;nbsp;Succeeded:&amp;nbsp;&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboLogEventLoginSuccess"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboLogEventChangedPassword"&gt;Changed&amp;nbsp;Password:&amp;nbsp;&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboLogEventChangedPassword"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;

  &lt;/div&gt;


  &lt;!-- Form Footer --&gt;
  &lt;footer&gt;
    &lt;button id="cmdCancel" class="is-button"&gt;Cancel&lt;/button&gt;
    &lt;button id="cmdFinish" class="is-button ok"&gt;Save&lt;/button&gt;
  &lt;/footer&gt;

&lt;/div&gt;


&lt;script&gt;
// Properties
var mRecord;

var mOriginalJson;

// Controls
var C = {
  //   General
  lblCodeAndName: null,
  chkActive: null,
  txtUserPolicyId: null,
  txtDescription: null,

  chkAllowRunApp: null,
  chkAllowRunWebApp: null,
  chkAllowRunBL: null,
  chkAllowExclusiveAccess: null,

  lblAutoLock: null,
  numAutoLockMinutes: null,

  chkEmailMandatory: null,

  //   Password Policy
  numLoginFailedDelaySeconds: null,

  lblLoginLockout: null,
  numLoginLockoutAttempts: null,
  numLoginLockoutTimespan: null,
  numLoginLockoutMinutes: null,

  lblPasswordComplexity: null,
  numPasswordMinLength: null,
  chkPasswordStrong: null,

  numPasswordMaxAgeDays: null,
  numPasswordHistoryLength: null,

  // Disable User
  lblDisableUser: null,
  chkDisableAutomatic: null,
  numDisableDaysNeverLoggedIn: null,
  numDisableDaysSinceLogin: null,
  numDisableDaysSincePasswordExpired: null,

  //   Event Logging
  cboLogEventLoginFailed: null,
  cboLogEventLoginLockout: null,
  cboLogEventLoginSuccess: null,
  cboLogEventChangedPassword: null,
}

// Form
var frmMain;
var tabDetails;

// Buttons
var cmdCancel;
var cmdFinish;

// Other

// ==========
// Initialise
// ==========
$(function () {
  // Mobile optimisations
  $(window).resize(Form_Resize);

  // --------
  // Controls
  // --------
  //   General
  C.lblCodeAndName = widget.UI.Label("lblCodeAndName", {});
  C.txtUserPolicyId = widget.UI.TextBox("txtUserPolicyId", {
    allowBlank: false,
    maxLength: 5,
    width: widget.UI.FIELD_WIDTH_CODE_5,
  });
  C.chkActive = widget.UI.CheckBox("chkActive", {
    caption: "Active?",
  });
  C.txtDescription = widget.UI.TextBox("txtDescription", {
    allowBlank: false,
    maxLength: 50,
  });

  C.chkAllowRunApp = widget.UI.CheckBox("chkAllowRunApp", {
    caption: "Allow Windows desktop application access?"
  });
  C.chkAllowRunWebApp = widget.UI.CheckBox("chkAllowRunWebApp", {
    caption: "Allow Web Services and Cloud-based application access?"
  });
  C.chkAllowRunBL = widget.UI.CheckBox("chkAllowRunBL", {
    caption: "Allow Business Layer access?"
  });
  C.chkAllowExclusiveAccess = widget.UI.CheckBox("chkAllowExclusiveAccess", {
    caption: "Allow Databases to be opened in 'Exclusive' mode?"
  });

  C.lblAutoLock = widget.UI.Label("lblAutoLock", {
    tooltipText: "Defines the time period (in minutes) an inactive finPOWER Connect desktop session should automatically lock (0 minutes = will not lock).\n\nNOTE: This setting does not apply to finPOWER Connect Cloud. For this see 'Session Timeout Minutes' on the General, Security page of the finPOWER Connect Cloud Configuration form in finPOWER Connect desktop."
  });
  C.numAutoLockMinutes = widget.UI.NumberBox("numAutoLockMinutes", {
    allowBlank: false,
    decimals: 0,
    minValue: 0,
    maxValue: 1440,
  });

  C.chkEmailMandatory = widget.UI.CheckBox("chkEmailMandatory", {
    caption: "Email is mandatory?"
  });

  //   Password Policy
  C.numLoginFailedDelaySeconds = widget.UI.NumberBox("numLoginFailedDelaySeconds", {
    allowBlank: false,
    decimals: 2,
    minValue: 0,
    maxValue: 5,
    width: "4em",
  });

  C.lblLoginLockout = widget.UI.Label("lblLoginLockout", {
    tooltipText: "Defines the number of login attempts within a time period that causes the User to be locked out. Set to zero to disable automatic lockout.\n\nThe Lockout will be cancelled after the lockout minutes. Set to zero to prevent lockout being cancelled automatically.",
  });
  C.numLoginLockoutAttempts = widget.UI.NumberBox("numLoginLockoutAttempts", {
    allowBlank: false,
    decimals: 0,
    minValue: 0,
    maxValue: 10,
    width: "4em",
  });
  C.numLoginLockoutTimespan = widget.UI.NumberBox("numLoginLockoutTimespan", {
    allowBlank: false,
    decimals: 0,
    minValue: 0,
    maxValue: 1440,
    width: "4em",
  });
  C.numLoginLockoutMinutes = widget.UI.NumberBox("numLoginLockoutMinutes", {
    allowBlank: false,
    decimals: 0,
    minValue: 0,
    maxValue: 1440,
    width: "4em",
  });

  C.lblPasswordComplexity = widget.UI.Label("lblPasswordComplexity", {
    tooltipText: "A Strong Password must contain both upper and lower case letters, numbers and symbols and cannot contain the User's User ID.",
  });
  C.numPasswordMinLength = widget.UI.NumberBox("numPasswordMinLength", {
    allowBlank: false,
    decimals: 0,
    minValue: 4,
    maxValue: 50,
    width: "4em",
  });
  C.chkPasswordStrong = widget.UI.CheckBox("chkPasswordStrong", {
    caption: "Force strong passwords?"
  });

  C.numPasswordMaxAgeDays = widget.UI.NumberBox("numPasswordMaxAgeDays", {
    allowBlank: false,
    decimals: 0,
    minValue: 0,
    maxValue: 365,
    width: "4em",
  });
  C.numPasswordHistoryLength = widget.UI.NumberBox("numPasswordHistoryLength", {
    allowBlank: false,
    decimals: 0,
    minValue: 0,
    maxValue: 24,
    width: "4em",
  });

  // Disable User

  C.lblDisableUser = widget.UI.Label("lblDisableUser", {
    caption: "Automatically disable in Account Processes?",
    tooltipText: "Defines whether Account Processes will automatically disable Users that have not logged in for a specified number of days, and/or whose password has remained expired for a specified number of days.",
  });
  C.chkDisableAutomatic = widget.UI.CheckBox("chkDisableAutomatic", {
    caption: "Automatically disable in Account Processes?",
    
    onChange: chkDisableAutomatic_Change,
  });
  C.numDisableDaysNeverLoggedIn = widget.UI.NumberBox("numDisableDaysNeverLoggedIn", {
    allowBlank: false,
    decimals: 0,
    minValue: 0,
    maxValue: 999,
    width: "4em",
  });
  C.numDisableDaysSinceLogin = widget.UI.NumberBox("numDisableDaysSinceLogin", {
    allowBlank: false,
    decimals: 0,
    minValue: 0,
    maxValue: 999,
    width: "4em",
  });
  C.numDisableDaysSincePasswordExpired = widget.UI.NumberBox("numDisableDaysSincePasswordExpired", {
    allowBlank: false,
    decimals: 0,
    minValue: 0,
    maxValue: 999,
    width: "4em",
  });

  //   Event Logging
  C.cboLogEventLoginFailed = widget.UI.DBCombo("cboLogEventLoginFailed", {
    allowBlank: false,
    limitToList: true,
    maxLength: 1,
    width: "3em",
  });
  C.cboLogEventLoginLockout = widget.UI.DBCombo("cboLogEventLoginLockout", {
    allowBlank: false,
    limitToList: true,
    maxLength: 1,
    width: "3em",
  });
  C.cboLogEventLoginSuccess = widget.UI.DBCombo("cboLogEventLoginSuccess", {
    allowBlank: false,
    limitToList: true,
    maxLength: 1,
    width: "3em",
  });
  C.cboLogEventChangedPassword = widget.UI.DBCombo("cboLogEventChangedPassword", {
    allowBlank: false,
    limitToList: true,
    maxLength: 1,
    width: "3em",
  });

  // Grids

  // Create Widget form
  // NOTE: Hide by default for a cleaner startup
  frmMain = new widget.UI.Form("frmMain", { visible: false });

  // Create Tabs
  tabDetails = new widget.UI.Tabs("tabDetails", {
    style: "normal",
    onSelectedTabChanged: tabDetails_Refresh,
  });

  // Handle resize
  $(window).resize(Form_Resize);

  // Disable Close Button (this causes the 'FormClose' notification action to be invoked instead)
  widget.DisableCloseButton();
  widget.ActionNotificationHandle(Widget_NotificationHandler)

  // Handle Wizard Buttons
  cmdCancel = $("#cmdCancel");
  cmdFinish = $("#cmdFinish");
  cmdCancel.click(tabDetails_Cancel);
  cmdFinish.click(Form_ExecuteAction_Finish);

  // Reset
  Form_Reset();
});

// ==========
// Reset Form
// ==========
function Form_Reset() {
  // Resize
  Form_Resize();

  // Load Record (i.e., initialise wizard)
  Record_Load();
}

// ===========
// Load Record
// ===========
function Record_Load() {
  // Initialise
  mRecord = null;

  // Hide content
  frmMain.Visible(false);

  // Block UI
  widget.UI.Block("Initialising, please wait...");

  // Load Initialisation details
  widget.GetString("GetInitialisationInfo", {},
    // Success
    Record_Load_Done,

    // Fail
    function (message) {
      widget.UI.MsgBoxAlert("fail: " + message);
      Fields_Load();
    }
  );
}

function Record_Load_Done(data) {
  // Initialise
  mRecord = JSON.parse(data);

  // Set Tab
  if (mRecord &amp;&amp; mRecord.PageId) {
    tabDetails.SelectedTabId(mRecord.PageId);

    // Hide other Pages
    if (mRecord.HideOtherPages) {
      tabDetails.ShowSingleTab(mRecord.PageId);
    }
  }
  else {
    tabDetails.SelectedTabId("General");
  }

  // Page Permissions
  if (!mRecord.AllowPageGeneral) tabDetails.TabVisible("General", false);
  if (!mRecord.AllowPagePasswordPolicy) tabDetails.TabVisible("PasswordPolicy", false);
  if (!mRecord.AllowPageEventLogging) tabDetails.TabVisible("EventLogging", false);

  // Load Fields
  Fields_Load();

  // Save Fields (so UserData is in correct format for mOriginalJson)
  Fields_Save();

  // Save original JSON for Form_IsDirty
  mOriginalJson = JSON.stringify(mRecord);
}

// ===========
// Load Fields
// ===========
function Fields_Load() {
  if (mRecord) {
    // General
    C.txtUserPolicyId.Text(mRecord.UserPolicyId);
    C.chkActive.Value(mRecord.Active);
    C.txtDescription.Text(mRecord.Description);

    C.chkAllowRunApp.Value(mRecord.AllowRunApp);
    C.chkAllowRunWebApp.Value(mRecord.AllowRunWebApp);
    C.chkAllowRunBL.Value(mRecord.AllowRunBL);
    C.chkAllowExclusiveAccess.Value(mRecord.AllowExclusiveAccess);

    C.numAutoLockMinutes.Value(mRecord.AutoLockMinutes);

    C.chkEmailMandatory.Value(mRecord.EmailMandatory);

    // Password Policy
    C.numLoginFailedDelaySeconds.Value(mRecord.LoginFailedDelaySeconds);

    C.numLoginLockoutAttempts.Value(mRecord.LoginLockoutAttempts);
    C.numLoginLockoutTimespan.Value(mRecord.LoginLockoutTimespan);
    C.numLoginLockoutMinutes.Value(mRecord.LoginLockoutMinutes);

    C.numPasswordMinLength.Value(mRecord.PasswordMinLength);
    C.chkPasswordStrong.Value(mRecord.PasswordStrong);

    C.numPasswordMaxAgeDays.Value(mRecord.PasswordMaxAgeDays);
    C.numPasswordHistoryLength.Value(mRecord.PasswordHistoryLength);

    // Disable User
    C.chkDisableAutomatic.Value(mRecord.DisableAutomatic);
    C.numDisableDaysNeverLoggedIn.Value(mRecord.DisableDaysNeverLoggedIn);
    C.numDisableDaysSinceLogin.Value(mRecord.DisableDaysSinceLogin);
    C.numDisableDaysSincePasswordExpired.Value(mRecord.DisableDaysSincePasswordExpired);

    // Event Logging
    C.cboLogEventLoginFailed.Text(mRecord.LogEventLoginFailed + "");
    C.cboLogEventLoginLockout.Text(mRecord.LogEventLoginLockout + "");
    C.cboLogEventLoginSuccess.Text(mRecord.LogEventLoginSuccess + "");
    C.cboLogEventChangedPassword.Text(mRecord.LogEventChangedPassword + "");
  }

  // Unblock UI
  widget.UI.Unblock();

  // Update Controls

  // Update fields
  Fields_Update();

  // Refresh Tab
  tabDetails_Refresh();
  tabDetails_Resize();
}

// ===========
// Save Fields
// ===========
function Fields_Save() {
  // General
  mRecord.UserPolicyId = C.txtUserPolicyId.Text();
  mRecord.Active = C.chkActive.Value();
  mRecord.Description = C.txtDescription.Text();

  mRecord.AllowRunApp = C.chkAllowRunApp.Value();
  mRecord.AllowRunWebApp = C.chkAllowRunWebApp.Value();
  mRecord.AllowRunBL = C.chkAllowRunBL.Value();
  mRecord.AllowExclusiveAccess = C.chkAllowExclusiveAccess.Value();

  mRecord.AutoLockMinutes = C.numAutoLockMinutes.Value();

  mRecord.EmailMandatory = C.chkEmailMandatory.Value();

  // Password Policy
  mRecord.LoginFailedDelaySeconds = C.numLoginFailedDelaySeconds.Value();

  mRecord.LoginLockoutAttempts = C.numLoginLockoutAttempts.Value();
  mRecord.LoginLockoutTimespan = C.numLoginLockoutTimespan.Value();
  mRecord.LoginLockoutMinutes = C.numLoginLockoutMinutes.Value();

  mRecord.PasswordMinLength = C.numPasswordMinLength.Value();
  mRecord.PasswordStrong = C.chkPasswordStrong.Value();

  mRecord.PasswordMaxAgeDays = C.numPasswordMaxAgeDays.Value();
  mRecord.PasswordHistoryLength = C.numPasswordHistoryLength.Value();

  // Disable User
  mRecord.DisableAutomatic = C.chkDisableAutomatic.Value();
  mRecord.DisableDaysNeverLoggedIn = C.numDisableDaysNeverLoggedIn.Value();
  mRecord.DisableDaysSinceLogin = C.numDisableDaysSinceLogin.Value();
  mRecord.DisableDaysSincePasswordExpired = C.numDisableDaysSincePasswordExpired.Value();

  // Event Logging
  mRecord.LogEventLoginFailed = parseInt(C.cboLogEventLoginFailed.Text());
  mRecord.LogEventLoginLockout = parseInt(C.cboLogEventLoginLockout.Text());
  mRecord.LogEventLoginSuccess = parseInt(C.cboLogEventLoginSuccess.Text());
  mRecord.LogEventChangedPassword = parseInt(C.cboLogEventChangedPassword.Text());
}

// =============
// Update Fields
// =============
function Fields_Update() {
  // Heading
  if (mRecord) {
    if (mRecord.UserPolicyId) {
      widget.SetHeading("User Policy (" + mRecord.UserPolicyId + ")");
    }
    else {
      widget.SetHeading("New User Policy");
    }
  }

  // Lists
  if (mRecord) {
    // General
    var arrEventLevels = [
      { Code: "0", Description: "Do not Log"},
      { Code: "1", Description: "Low Severity"},
      { Code: "2", Description: ""},
      { Code: "3", Description: ""},
      { Code: "4", Description: ""},
      { Code: "5", Description: "Medium Severity"},
      { Code: "6", Description: ""},
      { Code: "7", Description: ""},
      { Code: "8", Description: ""},
      { Code: "9", Description: "High Severity"}
    ];
    C.cboLogEventLoginFailed.RefreshFromCodeDescriptionList(arrEventLevels);
    C.cboLogEventLoginLockout.RefreshFromCodeDescriptionList(arrEventLevels);
    C.cboLogEventLoginSuccess.RefreshFromCodeDescriptionList(arrEventLevels);
    widget.ArrayRemove(arrEventLevels, arrEventLevels[0]); // Change of Password does not allow no logging
    C.cboLogEventChangedPassword.RefreshFromCodeDescriptionList(arrEventLevels);
  }

  // Controls
  if (mRecord) {
  }

  // Pages
  if (mRecord) {
    // NOTE: Even though many pages are updated in tabDetails_Refresh, we must update them here to ensure controls are hidden since this is not a wizard and all pages are validated on "Finish"
    pageGeneral_Refresh();
    pagePasswordPolicy_Refresh();
    pageDisableUser_Refresh();
    pageEventLogging_Refresh();
  }

  // Read-Only?
  if (mRecord &amp;&amp; mRecord.ReadOnly) {
    cmdFinish.prop("disabled", true);
    frmMain.FormReadOnly(C, true);
  }

  // Show content
  frmMain.Visible(mRecord != null);

  // Resize Tab
  tabDetails_Resize();
}

// ===========
// Resize Form
// ===========
function Form_Resize() {
  // Mobile Optimisations
  var el = $(".mobile-indent th.indent1, .mobile-indent th.no-indent1");
  if (window.innerWidth &lt; 500) {
    el.addClass("no-indent1").removeClass("indent1");
  }
  else {
    el.addClass("indent1").removeClass("no-indent1");
  }

  // General

  // Tab
  tabDetails_Resize();
}

// ========
// Is Dirty
// ========
function Form_IsDirty() {
  if (mRecord) {
    // Save Fields
    Fields_Save();

    // Is Dirty?
    return mOriginalJson != JSON.stringify(mRecord);
  }
  else {
    return false;
  }
}

// ==============
// Wizard Buttons
// ==============
function tabDetails_Cancel() {
  if (Form_IsDirty()) {
    // Confirm
    widget.UI.MsgBoxConfirm("Are you sure you want to close this form without saving your changes?", { heading: "Close Form" }, tabDetails_Cancel_Finalise);
  }
  else {
    // Cancel immediately
    tabDetails_Cancel_Finalise();
  }
}

function tabDetails_Cancel_Finalise() {
  if (widget.CanClose()) {
    widget.Close();
  }
  else {
    widget.Reset();
  }
}

// ==========
// Resize Tab
// ==========
function tabDetails_Resize() {
  switch (tabDetails.SelectedTabId()) {
    case "General":
      // General
      C.txtDescription.WidthResizeFromParent();
      break;

    case "PasswordPolicy":
      break;

    case "EventLogging":
      break;
  }
}

// ===========
// Refresh Tab
// ===========
function tabDetails_Refresh() {
   // Load details
  switch (tabDetails.SelectedTabId()) {
    case "General":
      pageGeneral_Refresh();
      break;

    case "PasswordPolicy":
      pagePasswordPolicy_Refresh();
      break;

    case "DisableUser":
      pageDisableUser_Refresh();
      break;

    case "EventLogging":
      pageEventLogging_Refresh();
      break;

    default:
      break;
  }

  // Resize
  tabDetails_Resize();

  // Focus
  switch (tabDetails.SelectedTabId()) {
    default:
      tabDetails.FocusFirst();
      break;
  }
}

// =================
// Execute an Action
// =================
function Form_ExecuteAction(actionId, data) {
  switch(actionId) {
    default:
      window.alert("Unhandled action '" + actionId + "'");
  }
}

// =============
// Finish Action
// =============
function Form_ExecuteAction_Finish() {
  // Assume Success
  var Ok = true;

  // Validate
  Ok = tabDetails.Validate();

  // Prompt
  if (Ok) {
    if (mRecord.PromptOnSave) {
      // Confirm
      widget.UI.MsgBoxConfirm("Are you sure you want to save this record?",
                              { heading: "Save" },
                              Form_ExecuteAction_FinishPost);

    }
    else {
      // Save without prompting
      Form_ExecuteAction_FinishPost();
    }
  }
}

function Form_ExecuteAction_FinishPost() {
  // Disable Form
  widget.UI.Block("Saving, please wait...");

  // Create Parameters
  // NOTE: We will simply update mRecord, clone this and send back (less some information)
  Fields_Save();
  var params = JSON.parse(JSON.stringify(mRecord));
  //params.GendersList = null;

  // Finish
  widget.GetString("Finish", params,
    function (data) {
      // Close Form
      widget.Close();

      // Refresh Parent (to show updated details)
      // NOTE: Pass in Record Id just in case this has changed
      widget.RefreshParent(C.txtUserPolicyId.Text());
    },

    function (data) {
      // Show Error
      widget.UI.MsgBoxAlert(data);

      // Enable Form
      widget.UI.Unblock();
    }
  );
}

// ===========
// pageGeneral
// ===========
function pageGeneral_Refresh() {
  if (!mRecord) return;

  // Controls
}

// ==================
// pagePasswordPolicy
// ==================
function pagePasswordPolicy_Refresh() {
  if (!mRecord) return;

  // Controls
}

// ==================
// pageDisableUser
// ==================
function pageDisableUser_Refresh() {
  if (!mRecord) return;

  // Controls
  chkDisableAutomatic_Change();
}

// ================
// pageEventLogging
// ================
function pageEventLogging_Refresh() {
  if (!mRecord) return;

  // Controls
}

// ====================
// Notification Handler
// ====================
function Widget_NotificationHandler(actionId, data) {
   switch(actionId) {
     case "FormClose":
      // Form Close button is disabled so act as if 'Cancel' has been clicked
      tabDetails_Cancel();
      break;
   }
}

function chkDisableAutomatic_Change(sender, e) {
  C.numDisableDaysNeverLoggedIn.ReadOnly(!C.chkDisableAutomatic.Value());
  C.numDisableDaysSinceLogin.ReadOnly(!C.chkDisableAutomatic.Value());
  C.numDisableDaysSincePasswordExpired.ReadOnly(!C.chkDisableAutomatic.Value());
}

&lt;/script&gt;</TemplateText>
    <TemplateTextBookmarks />
    <TimeoutSeconds>60</TimeoutSeconds>
    <UniqueId>kzm2NSweC0KkYwzMARhbQQ</UniqueId>
    <AllowRefresh>true</AllowRefresh>
    <Caption>User Policy</Caption>
    <HtmlWidgetAllowInitialEventCaching>false</HtmlWidgetAllowInitialEventCaching>
    <HtmlWidgetMaxHeight>800</HtmlWidgetMaxHeight>
    <HtmlWidgetMaxWidth>800</HtmlWidgetMaxWidth>
    <HtmlWidgetNeverApplyStyling>false</HtmlWidgetNeverApplyStyling>
    <HtmlWidgetResourceChartsApex>false</HtmlWidgetResourceChartsApex>
    <HtmlWidgetResourceCssSummaryPage2>false</HtmlWidgetResourceCssSummaryPage2>
    <HtmlWidgetResourceCssWidget>true</HtmlWidgetResourceCssWidget>
    <HtmlWidgetResourceJQuery>true</HtmlWidgetResourceJQuery>
    <HtmlWidgetResourceJQueryVersion />
    <HtmlWidgetSpecialEventGetFolderCount>false</HtmlWidgetSpecialEventGetFolderCount>
    <HtmlWidgetSpecialEventShowAsSummaryPage>false</HtmlWidgetSpecialEventShowAsSummaryPage>
    <HtmlWidgetSummaryPageObjectType>None</HtmlWidgetSummaryPageObjectType>
    <Icon>UserPolicy</Icon>
    <RestrictedOriginsListEnabled>false</RestrictedOriginsListEnabled>
    <RunAsAdministrator>false</RunAsAdministrator>
    <WebServiceName />
    <WebServiceAllowAnonymous>false</WebServiceAllowAnonymous>
    <WebServiceSendDebugInformation>false</WebServiceSendDebugInformation>
    <ShowInMenu>None</ShowInMenu>
    <ParametersType>Custom</ParametersType>
    <Parameters>
      <ISParameterDefs version="1.00">
        <Parameters>
          <Parameter name="" type="SectionStart">
            <BlankTip />
            <Caption>Form options.</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <SectionColumns>1</SectionColumns>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="HideOtherPages" type="Boolean">
            <BlankTip />
            <Caption>Hide pages other than the one being edited?</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value>True</Value>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="" type="SectionStart">
            <BlankTip />
            <Caption>Configuration options.</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <SectionColumns>1</SectionColumns>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="" type="SectionStart">
            <BlankTip />
            <Caption>TESTING</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <SectionColumns>1</SectionColumns>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="UserPolicyId" type="Range">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <LimitToList>false</LimitToList>
            <MaxLength>10</MaxLength>
            <RangeSingle>true</RangeSingle>
            <RangeType>Standard</RangeType>
            <RangeLookupSource>UserPolicies</RangeLookupSource>
            <RangeLookupSqlWhere />
          </Parameter>
          <Parameter name="DuplicateRecordId" type="List">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <List>RANGE.ClientTypes</List>
            <LimitToList>false</LimitToList>
            <MaxLength>0</MaxLength>
            <Rows>1</Rows>
          </Parameter>
          <Parameter name="Page" type="List">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <List>General,PasswordPolicy,EventLogging</List>
            <LimitToList>false</LimitToList>
            <MaxLength>0</MaxLength>
            <Rows>1</Rows>
          </Parameter>
          <Parameter name="ReadOnly" type="Boolean">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value>False</Value>
            <Visible>true</Visible>
          </Parameter>
        </Parameters>
      </ISParameterDefs>
    </Parameters>
  </finScript>