Commit 67ce0e68 authored by Xiaowu Zhang's avatar Xiaowu Zhang

web_renderjs_ui&core&authentication_policy: display policy and message

no idea how to get policy from preference correctly
parent 7002d756
# Ideally, we should get those from authentication policy preference
# But how to get meaningfully text for Regular Expression?
document = context.portal_catalog(reference="NXD-Password.Policy", limit=1)
if document:
return document[0].getTextContent()
return ''
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Preference_getPasswordPolicy</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -24,8 +24,17 @@ ...@@ -24,8 +24,17 @@
<div data-role="page"> <div data-role="page">
<div class="gadget-content"> <div class="gadget-content">
<article class="ui-content"> <article class="ui-content">
<section>
<div class="visible" data-gadget-scope="notification" tal:condition="exists: request/portal_status_message">
<button type="submit" class="error" tal:attributes="data-i18n request/portal_status_message"><span tal:content="request/portal_status_message"></span></button>
</div>
</section>
<section> <section>
<tal:block tal:condition="python: context.getPortalObject().portal_preferences.isAuthenticationPolicyEnabled()">
<label i18n:domain="ui" i18n:translate="">Password Policy</label>
<tal:block tal:replace="structure python: context.Preference_getPasswordPolicy()"></tal:block>
</tal:block>
<form method="post" tal:attributes="action python: context.absolute_url()" class="field_container"> <form method="post" tal:attributes="action python: context.absolute_url()" class="field_container">
<section class="ui-content-header-plain"> <section class="ui-content-header-plain">
<h3 class="ui-content-title ui-body-c"> <h3 class="ui-content-title ui-body-c">
......
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
<string>your_password</string> <string>your_password</string>
<string>password_confirm</string> <string>password_confirm</string>
<string>your_password_key</string> <string>your_password_key</string>
<string>your_password_policy</string>
</list> </list>
</value> </value>
</item> </item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment