Commit accabc14 authored by Łukasz Nowak's avatar Łukasz Nowak

Merge branch 'master' into certificate_authority

parents 0e04e3f8 b43adf6c
Changes Changes
======= =======
0.1 (unreleased) 0.2 (unreleased)
---------------- ----------------
* No changes yet. * No changes yet.
0.1 (2011-08-08)
----------------
* erp5.util.testnode imported from recipe like slapos.cookbook
[Łukasz Nowak]
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<key> <string>permissions</string> </key> <key> <string>permissions</string> </key>
<value> <value>
<tuple> <tuple>
<string>Modify portal content</string> <string>View</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</item> </item>
<item> <item>
<key> <string>last_id</string> </key> <key> <string>last_id</string> </key>
<value> <string>11</string> </value> <value> <string>12</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
......
...@@ -10,25 +10,29 @@ ...@@ -10,25 +10,29 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>elementary_type/lines</string> <string>elementary_type/boolean</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>Return list of last used passwords.</string> </value> <value> <string>If checked will enforce authentication policy rules site wide.</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>last_changed_password_value_property</string> </value> <value> <string>preferred_authentication_policy_enabled_property</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value> <value> <string>Standard Property</string> </value>
</item> </item>
<item>
<key> <string>preference</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>property_default</string> </key> <key> <string>property_default</string> </key>
<value> <string>python: []</string> </value> <value> <string>python: False</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The number of authentication failures an user is allowed to make before being blocked into the system.</string> </value> <value> <string>The number of authentication failures an user is allowed to make before being blocked by the system.</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The time interval ( (in hours) before real password expire happens. During it interval an warning will be shown to user after every successful login.</string> </value> <value> <string>The time interval ( (in hours) before real password expire happens. During it an warning will be shown to user after every successful log in.</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -2,33 +2,37 @@ ...@@ -2,33 +2,37 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="Base Type" module="erp5.portal_type"/> <global name="Standard Property" module="erp5.portal_type"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>content_icon</string> </key> <key> <string>categories</string> </key>
<value> <string>document.gif</string> </value> <value>
<tuple>
<string>elementary_type/boolean</string>
</tuple>
</value>
</item> </item>
<item> <item>
<key> <string>content_meta_type</string> </key> <key> <string>description</string> </key>
<value> <string>ERP5 Export Customer BT5 Configurator Item</string> </value> <value> <string>If checked system will automatically start a password recovery process when current password has expired.</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>id</string> </key>
<value> <string> Create a new bt5 for customer configuration. </string> </value> <value> <string>preferred_system_recover_expired_password_property</string> </value>
</item> </item>
<item> <item>
<key> <string>factory</string> </key> <key> <string>portal_type</string> </key>
<value> <string>addExportCustomerBT5ConfiguratorItem</string> </value> <value> <string>Standard Property</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>preference</string> </key>
<value> <string>Export Customer BT5 Configurator Item</string> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>type_class</string> </key> <key> <string>property_default</string> </key>
<value> <string>ExportCustomerBT5ConfiguratorItem</string> </value> <value> <string>python: False</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>If selected will make sure that any part of user\'s name (i.e. first and / or last name) are not contained in password.</string> </value> <value> <string>If selected will make sure that any part of user\'s name (i.e. first and / or last name) is not contained in password.</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -50,24 +50,62 @@ ...@@ -50,24 +50,62 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>configuration_save = context.restrictedTraverse(configuration_save_url)\n <value> <string>"""\n
group_id = context.getGlobalConfigurationAttr(\'group_id\')\n Form validator which will check if password is valid for the user.\n
"""\n
from Products.ERP5Type.Document import newTempBase\n
from Products.Formulator.Errors import ValidationError\n
\n \n
# These must be last\n portal = context.getPortalObject()\n
configuration_save.addConfigurationItem("Export Customer BT5 Configurator Item")\n \n
message_dict = { 0: \'Unknown error\',\n
-1: \'Too short.\',\n
-2: \'Not complex enough.\',\n
-3: \'You have changed your password too recently.\',\n
-4: \'You have already used this password.\',\n
-5: \'You can not use any parts of your first and last name in password.\'}\n
\n
def doValidation(person, password):\n
# raise so Formulator shows proper message\n
result_code_list = person.Person_analyzePassword(password)\n
if result_code_list!=[]:\n
translateString = context.Base_translateString\n
message = \' \'.join([translateString(message_dict[x]) for x in result_code_list])\n
raise ValidationError(\'external_validator_failed\', context, error_text=message)\n
return 1\n
\n
user_login = request.get(\'field_user_login\', None)\n
# find Person object (or authenticated member) and validate it on it (password recovered for an existing account)\n
person = context.ERP5Site_getAuthenticatedMemberPersonValue(user_login)\n
if person is not None:\n
return doValidation(person, password)\n
\n
# use a temp object (new account created)\n
first_name = request.get(\'field_your_first_name\', None) \n
last_name = request.get(\'field_your_last_name\', None) \n
kw = {\'title\': \'%s %s\' %(first_name, last_name),\n
\'first_name\': first_name,\n
\'last_name\': last_name}\n
person = newTempBase(portal, kw[\'title\'], **kw)\n
\n
return doValidation(person, password)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>configuration_save_url=None, **kw</string> </value> <value> <string>password, request</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>_proxy_roles</string> </key>
<value> <string>BusinessConfiguration_displayUNGDownload</string> </value> <value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>id</string> </key>
<value> <string></string> </value> <value> <string>Base_isPasswordValid</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
<?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>_body</string> </key>
<value> <string>"""External Validator for Person_viewDetails/my_password\n
checks that password and confimation matches.\n
"""\n
# XXX: unify\n
password_confirm = request.get(\'field_your_password\',\n
request.get(\'your_password\'))\n
\n
if password_confirm == editor :\n
return 1\n
return 0\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>editor, request</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_validatePasswordsMatch</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -53,21 +53,30 @@ ...@@ -53,21 +53,30 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
"""\n """\n
Returns if password is valid or not.\n Returns if password is valid or not. \n
If not valid return a negative code to indicate failure.\n
"""\n """\n
import re\n from Products.Formulator.Errors import ValidationError\n
from DateTime import DateTime\n from DateTime import DateTime\n
import re\n
\n \n
MARKER = [\'\', None]\n MARKER = [\'\', None]\n
\n \n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
request = context.REQUEST\n
is_temp_object = context.isTempObject()\n is_temp_object = context.isTempObject()\n
result_code_list = []\n
min_password_length = portal.portal_preferences.getPreferredMinPasswordLength()\n min_password_length = portal.portal_preferences.getPreferredMinPasswordLength()\n
\n \n
if password is None:\n
# means simply that password will be reseted in this case \n
# it\'s a valid value (i.e. it\'s job of form validation yo handle this in UI appropriately)\n
return []\n
\n
# not long enough\n # not long enough\n
if min_password_length is not None:\n if min_password_length is not None:\n
if len(password) < min_password_length:\n if len(password) < min_password_length:\n
return 0\n result_code_list.append(-1)\n
\n \n
# password contain X out of following Y regular expression groups ?\n # password contain X out of following Y regular expression groups ?\n
regular_expression_list = portal.portal_preferences.getPreferredRegularExpressionGroupList()\n regular_expression_list = portal.portal_preferences.getPreferredRegularExpressionGroupList()\n
...@@ -81,25 +90,34 @@ if regular_expression_list:\n ...@@ -81,25 +90,34 @@ if regular_expression_list:\n
#context.log(\'%s %s %s %s\' %(password, group_counter, min_regular_expression_group_number, regular_expression_list))\n #context.log(\'%s %s %s %s\' %(password, group_counter, min_regular_expression_group_number, regular_expression_list))\n
if group_counter < min_regular_expression_group_number:\n if group_counter < min_regular_expression_group_number:\n
# not enough groups match\n # not enough groups match\n
return 0\n result_code_list.append(-2)\n
\n \n
if not is_temp_object:\n if not is_temp_object:\n
# not changed in last period ?\n # not changed in last period ?\n
now = DateTime()\n now = DateTime()\n
one_hour = 1/24.0\n one_hour = 1/24.0\n
min_password_lifetime_duration = portal.portal_preferences.getPreferredMinPasswordLifetimeDuration()\n min_password_lifetime_duration = portal.portal_preferences.getPreferredMinPasswordLifetimeDuration()\n
last_password_modification_date = context.getLastPasswordModificationDate()\n #last_password_modification_date = context.getLastPasswordModificationDate()\n
last_password_modification_date = None\n
last_password_event = portal.portal_catalog.getResultValue(\n
portal_type = \'Password Event\',\n
default_destination_uid = context.getUid(),\n
validation_state = \'confirmed\',\n
sort_on = ((\'creation_date\', \'DESC\',),))\n
if last_password_event is not None:\n
last_password_modification_date = last_password_event.getCreationDate()\n
\n
if last_password_modification_date is not None and \\\n if last_password_modification_date is not None and \\\n
min_password_lifetime_duration is not None and \\\n min_password_lifetime_duration is not None and \\\n
(last_password_modification_date + min_password_lifetime_duration*one_hour) > now:\n (last_password_modification_date + min_password_lifetime_duration*one_hour) > now:\n
# too early to change password\n # too early to change password\n
return 0\n result_code_list.append(-3)\n
\n \n
# not already used before ?\n # not already used before ?\n
preferred_number_of_last_password_to_check = portal.portal_preferences.getPreferredNumberOfLastPasswordToCheck()\n preferred_number_of_last_password_to_check = portal.portal_preferences.getPreferredNumberOfLastPasswordToCheck()\n
if preferred_number_of_last_password_to_check not in [None, 0]:\n if preferred_number_of_last_password_to_check not in [None, 0]:\n
if context.isPasswordAlreadyUsed(password):\n if context.isPasswordAlreadyUsed(password):\n
return 0\n result_code_list.append(-4)\n
\n \n
# not contain the full name of the user in password or any parts of it (i.e. last and / or first name)\n # not contain the full name of the user in password or any parts of it (i.e. last and / or first name)\n
if portal.portal_preferences.isPrefferedForceUsernameCheckInPassword():\n if portal.portal_preferences.isPrefferedForceUsernameCheckInPassword():\n
...@@ -121,16 +139,16 @@ if portal.portal_preferences.isPrefferedForceUsernameCheckInPassword():\n ...@@ -121,16 +139,16 @@ if portal.portal_preferences.isPrefferedForceUsernameCheckInPassword():\n
if (first_name not in MARKER and first_name in lower_password) or \\\n if (first_name not in MARKER and first_name in lower_password) or \\\n
(last_name not in MARKER and last_name in lower_password):\n (last_name not in MARKER and last_name in lower_password):\n
# user\'s name must not be contained in password\n # user\'s name must not be contained in password\n
return 0\n result_code_list.append(-5)\n
\n \n
return 1\n return result_code_list\n
]]></string> </value> ]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>password</string> </value> <value> <string>password, request={}</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
...@@ -142,7 +160,7 @@ return 1\n ...@@ -142,7 +160,7 @@ return 1\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Person_isPasswordValid</string> </value> <value> <string>Person_analyzePassword</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -55,37 +55,49 @@ ...@@ -55,37 +55,49 @@
"""\n """\n
Return true if user account is blocked.\n Return true if user account is blocked.\n
"""\n """\n
\n
from DateTime import DateTime\n from DateTime import DateTime\n
from Products.ZSQLCatalog.SQLCatalog import Query\n
\n \n
request = context.REQUEST\n request = context.REQUEST\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
portal_preferences = portal.portal_preferences\n portal_preferences = portal.portal_preferences\n
\n \n
if not context.ERP5Site_isAuthenticationPolicyEnabled():\n if not portal_preferences.isAuthenticationPolicyEnabled():\n
# no policy, no sense to block account\n # no policy, no sense to block account\n
return 0\n return 0\n
\n \n
now = DateTime()\n now = DateTime()\n
one_second = 1/24.0/60.0/60.0\n one_second = 1/24.0/60.0/60.0\n
key = \'authentication_failure_list\'\n
session_id = context.Person_getAuthenticationSessionId()\n
# session might not be initialized yet\n
session = portal.portal_sessions[session_id]\n
authentication_failure_list = session[key]\n
\n
check_duration = portal_preferences.getPreferredAuthenticationFailureCheckDuration()\n check_duration = portal_preferences.getPreferredAuthenticationFailureCheckDuration()\n
block_duration = portal_preferences.getPreferredAuthenticationFailureBlockDuration()\n block_duration = portal_preferences.getPreferredAuthenticationFailureBlockDuration()\n
max_authentication_failures = portal_preferences.getPreferredMaxAuthenticationFailure()\n max_authentication_failures = portal_preferences.getPreferredMaxAuthenticationFailure()\n
\n
check_time = now - check_duration*one_second\n check_time = now - check_duration*one_second\n
failures_for_period = [x for x in authentication_failure_list if x >= check_time]\n
\n \n
#context.log(\'%s %s %s\' %(authentication_failure_list, failures_for_period, max_authentication_failures))\n # some failures might be still unindexed\n
if len(failures_for_period)>= max_authentication_failures:\n tag = \'authentication_event_%s\' %context.getReference()\n
# block login as too many authentication failure for given time interval back\n unindexed_failures = portal.portal_activities.countMessageWithTag(tag)\n
block_timeout = failures_for_period[-1] + block_duration*one_second\n \n
#context.log(\'check=%s block=%s release=%s-> %s\' %(check_duration, block_duration, block_timeout, failures_for_period))\n if unindexed_failures >= max_authentication_failures:\n
if block_timeout > now:\n # no need to check further\n
return 1\n
\n
# some are already indexed\n
kw = {\'portal_type\': \'Authentication Event\',\n
\'default_destination_uid\': context.getUid(),\n
\'creation_date\': Query(creation_date = check_time,\n
range=\'min\'),\n
\'validation_state\' : \'confirmed\',\n
\'sort_on\' : ((\'creation_date\', \'ASC\',),),\n
\'limit\': max_authentication_failures\n
}\n
indexed_failure_list = portal.portal_catalog(**kw)\n
indexed_failures = len(indexed_failure_list)\n
\n
if (indexed_failures + unindexed_failures) >= max_authentication_failures:\n
last_authentication_failure = indexed_failure_list[-1].getObject()\n
block_timeout = last_authentication_failure.getCreationDate() + block_duration*one_second\n
if block_timeout >= now:\n
context.log(\'block %s\' %context.getReference())\n context.log(\'block %s\' %context.getReference())\n
request.set(\'is_user_account_blocked\', True)\n request.set(\'is_user_account_blocked\', True)\n
return 1\n return 1\n
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
"""\n """\n
Returns if user account is Person\'s password is expired.\n Returns if user account is Person\'s password is expired.\n
Start password recovery process for expired password (if configured).\n
"""\n """\n
from Products.ERP5Type.Cache import CachingMethod\n from Products.ERP5Type.Cache import CachingMethod\n
\n \n
...@@ -66,27 +67,33 @@ def _isPasswordExpired():\n ...@@ -66,27 +67,33 @@ def _isPasswordExpired():\n
now = DateTime()\n now = DateTime()\n
max_password_lifetime_duration = portal.portal_preferences.getPreferredMaxPasswordLifetimeDuration()\n max_password_lifetime_duration = portal.portal_preferences.getPreferredMaxPasswordLifetimeDuration()\n
password_lifetime_expire_warning_duration = portal.portal_preferences.getPreferredPasswordLifetimeExpireWarningDuration()\n password_lifetime_expire_warning_duration = portal.portal_preferences.getPreferredPasswordLifetimeExpireWarningDuration()\n
last_password_modification_date = context.getLastPasswordModificationDate()\n last_password_event = portal.portal_catalog.getResultValue(\n
early_warning = False\n portal_type = \'Password Event\',\n
if last_password_modification_date is not None:\n default_destination_uid = context.getUid(),\n
validation_state = \'confirmed\',\n
sort_on = ((\'creation_date\', \'DESC\',),))\n
expire_date_warning = 0 \n
if last_password_event is not None:\n
last_password_modification_date = last_password_event.getCreationDate()\n
expire_date = last_password_modification_date + max_password_lifetime_duration*one_hour \n expire_date = last_password_modification_date + max_password_lifetime_duration*one_hour \n
if password_lifetime_expire_warning_duration not in (0, None,):\n if password_lifetime_expire_warning_duration not in (0, None,):\n
# calculate early warning period\n # calculate early warning period\n
if now > expire_date - password_lifetime_expire_warning_duration*one_hour:\n if now > expire_date - password_lifetime_expire_warning_duration*one_hour and \\\n
early_warning = True\n expire_date > now:\n
expire_date_warning = expire_date\n
if expire_date < now:\n if expire_date < now:\n
# password is expired\n # password is expired\n
#context.log(\'expired %s\' %context.getReference())\n context.log(\'expired %s\' %context.getReference())\n
return True, early_warning\n return True, expire_date_warning\n
return False, early_warning\n return False, expire_date_warning\n
\n \n
_isPasswordExpired = CachingMethod(_isPasswordExpired,\n _isPasswordExpired = CachingMethod(_isPasswordExpired,\n
id=\'Person_isPasswordExpired\',\n id=\'Person_isPasswordExpired\',\n
cache_factory=\'erp5_content_short\')\n cache_factory=\'erp5_content_short\')\n
is_password_expired, is_user_account_password_expired_warning_on = _isPasswordExpired()\n is_password_expired, expire_date = _isPasswordExpired()\n
\n \n
request.set(\'is_user_account_password_expired\', is_password_expired)\n request.set(\'is_user_account_password_expired\', is_password_expired)\n
request.set(\'is_user_account_password_expired_warning_on\', is_user_account_password_expired_warning_on)\n request.set(\'is_user_account_password_expired_expire_date\', expire_date)\n
\n \n
return is_password_expired\n return is_password_expired\n
......
...@@ -50,49 +50,38 @@ ...@@ -50,49 +50,38 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>"""\n
"""\n
File a failed authentication attempt.\n File a failed authentication attempt.\n
"""\n """\n
from DateTime import DateTime\n from DateTime import DateTime\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
portal_preferences = portal.portal_preferences\n
\n \n
if not context.ERP5Site_isAuthenticationPolicyEnabled():\n if not portal_preferences.isAuthenticationPolicyEnabled():\n
# no policy, no sense to file failure\n # no policy, no sense to file failure\n
return 0\n return 0\n
\n \n
key = \'authentication_failure_list\'\n activate_kw = {\'tag\': \'authentication_event_%s\' %context.getReference()}\n
session_id = context.Person_getAuthenticationSessionId()\n authentication_event = portal.system_event_module.newContent(\n
session = portal.portal_sessions[session_id]\n portal_type = "Authentication Event",\n
\n activate_kw = activate_kw)\n
if key not in session.keys():\n authentication_event.setDestinationValue(context)\n
# init it only once\n authentication_event.confirm()\n
session[key] = []\n return authentication_event\n
\n </string> </value>
authentication_failure_list = session[key]\n
authentication_failure_list.append(DateTime())\n
\n
# we care for only recent failures, no need to save all so purge old one\n
max_authentication_failures = portal.portal_preferences.getPreferredMaxAuthenticationFailure()\n
if len(authentication_failure_list)> max_authentication_failures:\n
authentication_failure_list.reverse()\n
authentication_failure_list = authentication_failure_list[0:max_authentication_failures]\n
authentication_failure_list.reverse()\n
\n
# update backend\n
session[key] = authentication_failure_list\n
\n
#context.log(\'notify login failure %s %s %s\' %(session_id, session, len(session[key])))\n
return session[key]\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Person_notifyLoginFailure</string> </value> <value> <string>Person_notifyLoginFailure</string> </value>
......
...@@ -51,29 +51,40 @@ ...@@ -51,29 +51,40 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
Determine if a security policy is enabled or not by reading System Preferences.\n File a password expire event.\n
"""\n """\n
from Products.ERP5Type.Cache import CachingMethod\n portal = context.getPortalObject()\n
portal_preferences = portal.portal_preferences\n
\n \n
def _isAuthenticationPolicyEnabled():\n if not portal_preferences.isAuthenticationPolicyEnabled() or \\\n
portal = context.getPortalObject()\n not portal.portal_preferences.isPreferredSystemRecoverExpiredPassword():\n
portal_preferences = portal.portal_preferences\n # no policy, no sense to file expire at all or symply system do not configured to\n
return portal_preferences.getPreferredMaxAuthenticationFailure() or \\\n return 0\n
portal_preferences.getPreferredMaxPasswordLifetimeDuration()\n
\n \n
_isAuthenticationPolicyEnabled = CachingMethod(_isAuthenticationPolicyEnabled,\n module = portal.getDefaultModule(portal_type=\'Credential Recovery\')\n
id=\'Person_isAuthenticationPolicyEnabled\',\n credential_recovery = module.newContent(\n
cache_factory=\'erp5_content_short\')\n portal_type="Credential Recovery",\n
return _isAuthenticationPolicyEnabled()\n reference=context.getReference(),\n
destination_decision_value=context,\n
language=portal.Localizer.get_selected_language())\n
credential_recovery.submit()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_isAuthenticationPolicyEnabled</string> </value> <value> <string>Person_notifyPasswordExpire</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -50,24 +50,46 @@ ...@@ -50,24 +50,46 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>from Products.ZSQLCatalog.SQLCatalog import Query\n
\n \n
if not portal.ERP5Site_isAuthenticationPolicyEnabled():\n portal = context.getPortalObject()\n
# no policy, no sense to block account\n portal_preferences = portal.portal_preferences\n
\n
if not portal.portal_preferences.isAuthenticationPolicyEnabled():\n
# no policy, no sense to unblock account\n
return 0\n return 0\n
\n \n
key = \'authentication_failure_list\'\n now = DateTime()\n
session_id = context.Person_getAuthenticationSessionId()\n one_second = 1/24.0/60.0/60.0\n
session = portal.portal_sessions[session_id]\n check_duration = portal_preferences.getPreferredAuthenticationFailureCheckDuration()\n
session[key] = []\n block_duration = portal_preferences.getPreferredAuthenticationFailureBlockDuration()\n
max_authentication_failures = portal_preferences.getPreferredMaxAuthenticationFailure()\n
check_time = now - check_duration*one_second\n
\n
# acknowledge last authentication events for user\n
kw = {\'portal_type\': \'Authentication Event\',\n
\'default_destination_uid\': context.getUid(),\n
\'creation_date\': Query(creation_date = check_time,\n
range=\'min\'),\n
\'validation_state\' : \'confirmed\',\n
\'sort_on\' : ((\'creation_date\', \'ASC\',),),\n
}\n
\n
authentication_event_list = [x.getObject() for x in portal.portal_catalog(**kw)]\n
\n
for authentication_event in authentication_event_list:\n
authentication_event.activate().acknowledge(comment=\'User account unblocked.\')\n
\n
if not batch_mode:\n if not batch_mode:\n
message = context.Base_translateString(\'User Login unblocked.\')\n message = context.Base_translateString(\'User Login unblocked.\')\n
context.Base_redirect(form_id=form_id, keep_items={\'portal_status_message\': message})\n context.Base_redirect(form_id=form_id, keep_items={\'portal_status_message\': message})\n
\n
return\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>form_id, batch_mode=False</string> </value> <value> <string>form_id="view", batch_mode=False</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list>
<string>my_preferred_authentication_policy_enabled</string>
<string>my_preferred_max_authentication_failure</string> <string>my_preferred_max_authentication_failure</string>
<string>my_preferred_authentication_failure_check_duration</string> <string>my_preferred_authentication_failure_check_duration</string>
<string>my_preferred_authentication_failure_block_duration</string> <string>my_preferred_authentication_failure_block_duration</string>
...@@ -97,6 +98,7 @@ ...@@ -97,6 +98,7 @@
<string>my_preffered_force_username_check_in_password</string> <string>my_preffered_force_username_check_in_password</string>
<string>my_preferred_min_regular_expression_group_number</string> <string>my_preferred_min_regular_expression_group_number</string>
<string>my_preferred_regular_expression_group</string> <string>my_preferred_regular_expression_group</string>
<string>my_preferred_system_recover_expired_password</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_preferred_authentication_policy_enabled</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Enable Authentication Policy</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Maximal Failed Authentication Atttempts</string> </value> <value> <string>Maximal Failed Authentication Attempts</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_preferred_system_recover_expired_password</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>System Recover Expired Password</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -65,7 +65,9 @@ ...@@ -65,7 +65,9 @@
\n \n
<!-- Password is expired permanently. -->\n <!-- Password is expired permanently. -->\n
<tal:block tal:condition="is_user_account_password_expired">\n <tal:block tal:condition="is_user_account_password_expired">\n
<tal:block tal:define="url python: \'%s/login_form?portal_status_message=%s\' % (here.absolute_url(), here.Base_translateString(\'Password is expired.\'));\n <tal:block tal:define="message python: {False: \'Password is expired.\',\n
True: \'Password is expired. You will soon receive an email with details about how you can recover it.\'}.get(here.getPortalObject().portal_preferences.isPreferredSystemRecoverExpiredPassword());\n
url python: \'%s/login_form?portal_status_message=%s\' % (here.absolute_url(), here.Base_translateString(message));\n
url python: request.get(\'came_from\') and \'%s&amp;came_from=%s\' % (url, request[\'came_from\']) or url;\n url python: request.get(\'came_from\') and \'%s&amp;came_from=%s\' % (url, request[\'came_from\']) or url;\n
dummy python: response.redirect(url);"/>\n dummy python: response.redirect(url);"/>\n
</tal:block>\n </tal:block>\n
...@@ -73,15 +75,15 @@ ...@@ -73,15 +75,15 @@
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
<tal:block tal:condition="not: isAnon"\n <tal:block tal:condition="not: isAnon"\n
tal:define="is_user_account_password_expired_warning_on python:request.get(\'is_user_account_password_expired_warning_on\', False);">\n tal:define="is_user_account_password_expired_expire_date python:request.get(\'is_user_account_password_expired_expire_date\', 0);">\n
\n \n
<!-- Password will expire soon just warn user ? -->\n <!-- Password will expire soon just warn user ? -->\n
<tal:block tal:condition="is_user_account_password_expired_warning_on">\n <tal:block tal:condition="is_user_account_password_expired_expire_date">\n
<tal:block tal:define="came_from python: request.get(\'came_from\') or here.absolute_url();\n <tal:block tal:define="came_from python: request.get(\'came_from\') or here.absolute_url();\n
dummy python: response.redirect(\'%s/ERP5Site_viewNewPersonCredentialUpdateDialog?portal_status_message=%s&amp;cancel_url=%s\' %(came_from, here.Base_translateString(\'Your password will expire soon. You are advised to change it as soon as possible.\'), came_from));" />\n dummy python: response.redirect(\'%s/ERP5Site_viewNewPersonCredentialUpdateDialog?portal_status_message=%s&amp;cancel_url=%s\' %(came_from, here.Base_translateString(\'Your password will expire at %s. You are advised to change it as soon as possible.\' %context.Base_FormatDate(is_user_account_password_expired_expire_date, hour_minute=1)), came_from));" />\n
</tal:block>\n </tal:block>\n
\n \n
<tal:block tal:condition="not: is_user_account_password_expired_warning_on">\n <tal:block tal:condition="not: is_user_account_password_expired_expire_date">\n
<tal:block tal:define="came_from python: request.get(\'came_from\') or here.absolute_url();\n <tal:block tal:define="came_from python: request.get(\'came_from\') or here.absolute_url();\n
dummy python: response.redirect(came_from);" />\n dummy python: response.redirect(came_from);" />\n
</tal:block>\n </tal:block>\n
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string>Used to provide password trackability.</string> </value>
</item> </item>
<item> <item>
<key> <string>groups</string> </key> <key> <string>groups</string> </key>
......
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
<item> <item>
<key> <string>after_script_name</string> </key> <key> <string>after_script_name</string> </key>
<value> <value>
<tuple/> <list>
<string>Person_changePassword</string>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -55,8 +57,10 @@ ...@@ -55,8 +57,10 @@
<value> <value>
<list> <list>
<string>setPassword</string> <string>setPassword</string>
<string>setEncodedPassword</string> <string>_setPassword</string>
<string>_forceSetPassword</string> <string>_forceSetPassword</string>
<string>edit</string>
<string>setEncodedPassword</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -75,9 +79,7 @@ ...@@ -75,9 +79,7 @@
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
<value> <value>
<list> <tuple/>
<string>Person_changePassword</string>
</list>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -59,14 +59,13 @@ number_of_last_password_to_check = portal.portal_preferences.getPreferredNumberO ...@@ -59,14 +59,13 @@ number_of_last_password_to_check = portal.portal_preferences.getPreferredNumberO
\n \n
if number_of_last_password_to_check is not None and number_of_last_password_to_check:\n if number_of_last_password_to_check is not None and number_of_last_password_to_check:\n
# save password and modification date\n # save password and modification date\n
person.setLastPasswordModificationDate(DateTime())\n
old_password_list = person.getLastChangedPasswordValueList()\n
current_password = person.getPassword()\n current_password = person.getPassword()\n
if current_password is not None:\n if current_password is not None:\n
# we care only if password is set\n password_event = portal.system_event_module.newContent(portal_type = \'Password Event\',\n
old_password_list.append(current_password)\n source_value = person,\n
person.setLastChangedPasswordValueList(old_password_list)\n destination_value = person,\n
#context.log(\'%s %s %s\' %(person.getPassword(), person.getLastPasswordModificationDate(), old_password_list))\n password = current_password)\n
password_event.confirm()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
erp5_credential erp5_credential
\ No newline at end of file erp5_system_event
\ No newline at end of file
6 18
\ No newline at end of file \ No newline at end of file
Person | LoginAccountProvider
\ No newline at end of file
AuthenticationPolicyPreference AuthenticationPolicyPreference
LoginAccountProvider \ No newline at end of file
\ No newline at end of file
...@@ -40,5 +40,4 @@ def migrateToEmbeddedFile(self, force=0): ...@@ -40,5 +40,4 @@ def migrateToEmbeddedFile(self, force=0):
id = self.id id = self.id
if force == 1: if force == 1:
changeObjectClass(container, id, getattr(erp5.portal_type, embedded_type)) changeObjectClass(container, id, getattr(erp5.portal_type, embedded_type))
container._getOb(id).portal_type = embedded_type
return '%s: %s -> %s' % (self.getRelativeUrl(), portal_type, embedded_type), return '%s: %s -> %s' % (self.getRelativeUrl(), portal_type, embedded_type),
...@@ -50,8 +50,7 @@ ...@@ -50,8 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>from email.utils import formataddr\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
if body is None:\n if body is None:\n
...@@ -64,11 +63,7 @@ if subject is None:\n ...@@ -64,11 +63,7 @@ if subject is None:\n
# From\n # From\n
if from_url is None:\n if from_url is None:\n
sender = context.getSourceValue()\n sender = context.getSourceValue()\n
if sender.getTitle():\n from_url = formataddr((sender.getTitle(), sender.getDefaultEmailText()))\n
from_url = \'"%s" <%s>\' % (sender.getTitle(),\n
sender.getDefaultEmailText())\n
else:\n
from_url = sender.getDefaultEmailText()\n
\n \n
# Return-Path\n # Return-Path\n
if reply_url is None:\n if reply_url is None:\n
...@@ -83,10 +78,7 @@ if to_url is None:\n ...@@ -83,10 +78,7 @@ if to_url is None:\n
for recipient in context.getDestinationValueList():\n for recipient in context.getDestinationValueList():\n
email = recipient.getDefaultEmailText()\n email = recipient.getDefaultEmailText()\n
if email:\n if email:\n
if recipient.getTitle():\n to_url_list.append(formataddr((recipient.getTitle(), email)))\n
to_url_list.append(\'"%s" <%s>\' % (recipient.getTitle(), email))\n
else:\n
to_url_list.append(email)\n
else:\n else:\n
raise ValueError, \'Recipient %s has no defined email\' % recipient\n raise ValueError, \'Recipient %s has no defined email\' % recipient\n
elif same_type(to_url, \'\'):\n elif same_type(to_url, \'\'):\n
...@@ -138,9 +130,7 @@ if context.getTypeInfo() is not None:\n ...@@ -138,9 +130,7 @@ if context.getTypeInfo() is not None:\n
\n \n
if download:\n if download:\n
return mail_message\n return mail_message\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
...@@ -65,7 +65,7 @@ portal_catalog = portal.portal_catalog\n ...@@ -65,7 +65,7 @@ portal_catalog = portal.portal_catalog\n
valid_portal_type_list = (\'Notification Message\',)\n valid_portal_type_list = (\'Notification Message\',)\n
\n \n
# Find the applicable language\n # Find the applicable language\n
if language is None:\n if language in (None, \'\'):\n
language = portal.Localizer.get_selected_language()\n language = portal.Localizer.get_selected_language()\n
\n \n
# Find the default language\n # Find the default language\n
......
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -70,6 +76,10 @@ ...@@ -70,6 +76,10 @@
<tuple/> <tuple/>
</value> </value>
</item> </item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
......
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>XXX \r\n <value> <string>XXX \r\n
...@@ -80,6 +86,10 @@ Currently, method ids are hardcoded, and it could be better to use a generic tri ...@@ -80,6 +86,10 @@ Currently, method ids are hardcoded, and it could be better to use a generic tri
<tuple/> <tuple/>
</value> </value>
</item> </item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
......
987 992
\ No newline at end of file \ No newline at end of file
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
<item>Category Configurator Item</item> <item>Category Configurator Item</item>
<item>Currency Configurator Item</item> <item>Currency Configurator Item</item>
<item>Customer BT5 Configurator Item</item> <item>Customer BT5 Configurator Item</item>
<item>Export Customer BT5 Configurator Item</item>
<item>Organisation Configurator Item</item> <item>Organisation Configurator Item</item>
<item>Permission Configurator Item</item> <item>Permission Configurator Item</item>
<item>Person Configurator Item</item> <item>Person Configurator Item</item>
......
520 521
\ No newline at end of file \ No newline at end of file
...@@ -10,7 +10,6 @@ Configuration Save | view ...@@ -10,7 +10,6 @@ Configuration Save | view
Configurator Tool | view Configurator Tool | view
Currency Configurator Item | view Currency Configurator Item | view
Customer BT5 Configurator Item | view Customer BT5 Configurator Item | view
Export Customer BT5 Configurator Item | view
Organisation Configurator Item | view Organisation Configurator Item | view
Permission Configurator Item | view Permission Configurator Item | view
Person Configurator Item | view Person Configurator Item | view
...@@ -26,6 +25,5 @@ Site Property Configurator Item | view ...@@ -26,6 +25,5 @@ Site Property Configurator Item | view
Solver Configurator Item | view Solver Configurator Item | view
Standard BT5 Configurator Item | view Standard BT5 Configurator Item | view
System Preference Configurator Item | view System Preference Configurator Item | view
Trash Fake Site Configurator Item | view
Workflow Security Configurator Item | view Workflow Security Configurator Item | view
portal_actions | use_configurator portal_actions | use_configurator
\ No newline at end of file
...@@ -13,7 +13,6 @@ Configuration Save | Categories Spreadsheet Configurator Item ...@@ -13,7 +13,6 @@ Configuration Save | Categories Spreadsheet Configurator Item
Configuration Save | Category Configurator Item Configuration Save | Category Configurator Item
Configuration Save | Currency Configurator Item Configuration Save | Currency Configurator Item
Configuration Save | Customer BT5 Configurator Item Configuration Save | Customer BT5 Configurator Item
Configuration Save | Export Customer BT5 Configurator Item
Configuration Save | Organisation Configurator Item Configuration Save | Organisation Configurator Item
Configuration Save | Permission Configurator Item Configuration Save | Permission Configurator Item
Configuration Save | Person Configurator Item Configuration Save | Person Configurator Item
......
...@@ -10,7 +10,6 @@ Configuration Save ...@@ -10,7 +10,6 @@ Configuration Save
Configurator Tool Configurator Tool
Currency Configurator Item Currency Configurator Item
Customer BT5 Configurator Item Customer BT5 Configurator Item
Export Customer BT5 Configurator Item
Organisation Configurator Item Organisation Configurator Item
Permission Configurator Item Permission Configurator Item
Person Configurator Item Person Configurator Item
...@@ -26,5 +25,4 @@ Site Property Configurator Item ...@@ -26,5 +25,4 @@ Site Property Configurator Item
Solver Configurator Item Solver Configurator Item
Standard BT5 Configurator Item Standard BT5 Configurator Item
System Preference Configurator Item System Preference Configurator Item
Trash Fake Site Configurator Item
Workflow Security Configurator Item Workflow Security Configurator Item
\ No newline at end of file
...@@ -58,8 +58,6 @@ for name in bt5_installation_list:\n ...@@ -58,8 +58,6 @@ for name in bt5_installation_list:\n
configuration_save.addConfigurationItem("Standard BT5 Configurator Item",\n configuration_save.addConfigurationItem("Standard BT5 Configurator Item",\n
title=name, bt5_id=name,\n title=name, bt5_id=name,\n
update_catalog=0)\n update_catalog=0)\n
\n
configuration_save.addConfigurationItem("Export Customer BT5 Configurator Item")\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
19 20
\ No newline at end of file \ No newline at end of file
...@@ -77,9 +77,6 @@ configuration_save.addConfigurationItem("Portal Type Configurator Item",\n ...@@ -77,9 +77,6 @@ configuration_save.addConfigurationItem("Portal Type Configurator Item",\n
configuration_save.addConfigurationItem("Portal Type Configurator Item",\n configuration_save.addConfigurationItem("Portal Type Configurator Item",\n
target_portal_type=\'Inventory\',\n target_portal_type=\'Inventory\',\n
add_propertysheet_list=(\'InventoryConstraint\',))\n add_propertysheet_list=(\'InventoryConstraint\',))\n
\n
# These must be last\n
configuration_save.addConfigurationItem("Export Customer BT5 Configurator Item")\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -115,9 +115,6 @@ configuration_save.addConfigurationItem("Portal Type Configurator Item",\n ...@@ -115,9 +115,6 @@ configuration_save.addConfigurationItem("Portal Type Configurator Item",\n
configuration_save.addConfigurationItem("Portal Type Configurator Item",\n configuration_save.addConfigurationItem("Portal Type Configurator Item",\n
target_portal_type=\'Sale Packing List Line\',\n target_portal_type=\'Sale Packing List Line\',\n
add_propertysheet_list=(\'TradeOrderLine\',))\n add_propertysheet_list=(\'TradeOrderLine\',))\n
\n
# These must be last\n
configuration_save.addConfigurationItem("Export Customer BT5 Configurator Item")\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
604 605
\ No newline at end of file \ No newline at end of file
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
import os import os
from Products.ERP5Configurator import tests from Products.ERP5Configurator import tests
def Zuite_getTestDocumentsHome(self): def Zuite_getTestDocumentPath(self, filename):
""" """
Get test documents folder as string. Get the full path of the document to be used into the test.
""" """
return os.path.join( return os.path.join(
os.path.abspath( os.path.abspath(
os.path.dirname(tests.__file__)),'test_data') os.path.dirname(tests.__file__)),'test_data/%s' % filename)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Zuite" module="Products.Zelenium.zuite"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>configurator_consulting_standard_zuite</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<!-- Set longer timeout as it takes time at configurator side to prepare everything needed. -->\n <!-- Set longer timeout as it takes time at configurator side to prepare everything needed. -->\n
<tr>\n <tr>\n
<td>setTimeout</td>\n <td>setTimeout</td>\n
<td>1200000</td>\n <td>120000000</td>\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
<span metal:use-macro="container/Zuite_CommonTemplate/macros/wait_for_activities" />\n <span metal:use-macro="container/Zuite_CommonTemplate/macros/wait_for_activities" />\n
......
...@@ -89,9 +89,6 @@ configuration_dict = {\n ...@@ -89,9 +89,6 @@ configuration_dict = {\n
"business_configuration_id": "STANDARD_CONFIGURATOR_TEST",\n "business_configuration_id": "STANDARD_CONFIGURATOR_TEST",\n
\'bt_repository_list\':[\'http://www.erp5.org/dists/snapshot/bt5/\'],\n \'bt_repository_list\':[\'http://www.erp5.org/dists/snapshot/bt5/\'],\n
\n \n
# More configurations\n
"oood_hostname": "localhost",\n
"oood_port": 8008,\n
}\n }\n
\n \n
return configuration_dict\n return configuration_dict\n
......
...@@ -2,74 +2,26 @@ ...@@ -2,74 +2,26 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/> <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>Script_magic</string> </key> <key> <string>_function</string> </key>
<value> <int>3</int> </value> <value> <string>Zuite_getTestDocumentPath</string> </value>
</item> </item>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>_module</string> </key>
<value> <value> <string>ConfiguratorTestUtils</string> </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>_body</string> </key>
<value> <string>test_documents_home = context.Zuite_getConfiguratorTestDocumentsHome()\n
return \'%s/%s\' %(test_documents_home, filename)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>filename</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Zuite_getConfiguratorFilenameLocation</string> </value> <value> <string>Zuite_getConfiguratorFilenameLocation</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -69,8 +69,11 @@ default_site_preference.setPreferredHtmlStyleUnsavedFormWarning(False)\n ...@@ -69,8 +69,11 @@ default_site_preference.setPreferredHtmlStyleUnsavedFormWarning(False)\n
default_site_preference.setPreferredHtmlStyleDevelopperMode(None)\n default_site_preference.setPreferredHtmlStyleDevelopperMode(None)\n
default_site_preference.setPreferredHtmlStyleAccessTab(\'1\')\n default_site_preference.setPreferredHtmlStyleAccessTab(\'1\')\n
\n \n
default_site_preference.setPreferredOoodocServerAddress(configuration_info.get("oood_hostname",\'localhost\'))\n previous_conversion_server_address = portal.portal_preferences.getPreferredOoodocServerAddress()\n
default_site_preference.setPreferredOoodocServerPortNumber(configuration_info.get("oood_port",8008))\n default_site_preference.setPreferredOoodocServerAddress(previous_conversion_server_address)\n
\n
previous_conversion_port = portal.portal_preferences.getPreferredOoodocServerPortNumber()\n
default_site_preference.setPreferredOoodocServerPortNumber(previous_conversion_port)\n
\n \n
if default_site_preference.getPreferenceState() != \'global\':\n if default_site_preference.getPreferenceState() != \'global\':\n
default_site_preference.enable()\n default_site_preference.enable()\n
......
2011-08-16 rafael
* Remove useless code and do not re-setup conversion server.
2011-04-13 lucas 2011-04-13 lucas
* The 'Hello' text is not displayed anymore. * The 'Hello' text is not displayed anymore.
......
erp5_crm
erp5_configurator_standard erp5_configurator_standard
erp5_ui_test_core erp5_ui_test_core
\ No newline at end of file
669 674
\ No newline at end of file \ No newline at end of file
portal_tests/configurator_consulting_standard_zuite
portal_tests/configurator_consulting_standard_zuite/**
portal_tests/configurator_standard_zuite portal_tests/configurator_standard_zuite
portal_tests/configurator_standard_zuite/** portal_tests/configurator_standard_zuite/**
\ No newline at end of file
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
</item> </item>
<item> <item>
<key> <string>after_script_id</string> </key> <key> <string>after_script_id</string> </key>
<value> <string>BusinessConfiguration_displayUNGDownload</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
......
...@@ -128,6 +128,14 @@ if default_available_language and default_available_language != "en":\n ...@@ -128,6 +128,14 @@ if default_available_language and default_available_language != "en":\n
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>**kw</string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>BusinessConfiguration_setupUNGPreferences</string> </value> <value> <string>BusinessConfiguration_setupUNGPreferences</string> </value>
......
...@@ -59,14 +59,6 @@ configuration_save.addConfigurationItem("Customer BT5 Configurator Item", \n ...@@ -59,14 +59,6 @@ configuration_save.addConfigurationItem("Customer BT5 Configurator Item", \n
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>configuration_save_url=None, **kw</string> </value> <value> <string>configuration_save_url=None, **kw</string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>BusinessConfiguration_setupUNGWizardBT5</string> </value> <value> <string>BusinessConfiguration_setupUNGWizardBT5</string> </value>
......
2011-08-04 Gabriel L. Oliveira
* Fix proxy of transition's scripts
2011-04-12 Lucas 2011-04-12 Lucas
* Added default image into business configuration. * Added default image into business configuration.
......
49 52
\ No newline at end of file \ No newline at end of file
...@@ -58,6 +58,10 @@ class CredentialRequest(Ticket, EncryptedPasswordMixin): ...@@ -58,6 +58,10 @@ class CredentialRequest(Ticket, EncryptedPasswordMixin):
# should be able to do it # should be able to do it
pass pass
def checkPasswordValueAcceptable(self, value):
# all passwords are acceptable on Credential Request
pass
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getTitle') 'getTitle')
def getTitle(self, **kw): def getTitle(self, **kw):
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</item> </item>
<item> <item>
<key> <string>last_id</string> </key> <key> <string>last_id</string> </key>
<value> <string>3</string> </value> <value> <string>6</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/boolean</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>If set will store all outgoing events (i.e. Mail Message) inside ERP5 CRM module.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>preferred_store_events_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>preference</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>write_permission</string> </key>
<value> <string>Manage properties</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/boolean</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>If checked system will automatically generate password else user will be allowed to set it through a Credential Recovery.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>preferred_system_generate_password_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>preference</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -156,6 +156,7 @@ ...@@ -156,6 +156,7 @@
<string>my_dialog_mode_required_default_email_text</string> <string>my_dialog_mode_required_default_email_text</string>
<string>my_dialog_mode_date_of_birth</string> <string>my_dialog_mode_date_of_birth</string>
<string>my_view_mode_date_of_birth</string> <string>my_view_mode_date_of_birth</string>
<string>my_view_mode_group_list</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>items</string>
<string>size</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_view_mode_group_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The groups of the person in the organisation.</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_category_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Groups</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: getattr(context.portal_categories.group, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id=\'translated_title\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -64,7 +64,8 @@ context.REQUEST.set(\'came_from\', context.getUrlString())\n ...@@ -64,7 +64,8 @@ context.REQUEST.set(\'came_from\', context.getUrlString())\n
\n \n
portal.portal_password.mailPasswordResetRequest(user_login=reference,\n portal.portal_password.mailPasswordResetRequest(user_login=reference,\n
REQUEST=context.REQUEST,\n REQUEST=context.REQUEST,\n
notification_message=notification_message)\n notification_message=notification_message,\n
store_as_event=portal.portal_preferences.isPreferredStoreEvents())\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -50,15 +50,20 @@ ...@@ -50,15 +50,20 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""For a credential request as context, we set the related person informations,\n <value> <string>"""\n
the assignments of the person and send notificaiton email\n For a credential request as context, we set the related person informations,\n
Proxy:\n the assignments of the person and send notificaiton email\n
Auditor -- allow to get credential request informations"""\n Proxy:\n
Auditor -- allow to get credential request informations\n
"""\n
\n \n
# check the script is not called from a url\n # check the script is not called from a url\n
if REQUEST is not None:\n if REQUEST is not None:\n
return None\n return None\n
\n \n
portal = context.getPortalObject()\n
portal_preferences = context.portal_preferences\n
\n
# XXX by default we don\'t want to automatically create/update organisation\n # XXX by default we don\'t want to automatically create/update organisation\n
# Someone should confirm this informations before creating the organisation\n # Someone should confirm this informations before creating the organisation\n
#if context.getOrganisationTitle():\n #if context.getOrganisationTitle():\n
...@@ -70,19 +75,23 @@ context.CredentialRequest_setDefaultDestinationDecision([x for x in related_port ...@@ -70,19 +75,23 @@ context.CredentialRequest_setDefaultDestinationDecision([x for x in related_port
# Check consistency of the subscription, pass a copy of the dict\n # Check consistency of the subscription, pass a copy of the dict\n
context.Credential_checkConsistency([x for x in related_portal_type])\n context.Credential_checkConsistency([x for x in related_portal_type])\n
\n \n
# Fill related object with credential request\n
for portal_type in related_portal_type:\n
getattr(context,\'CredentialRequest_setRegisteredInformationTo%s\' % portal_type.replace(\' \',\'\'))()\n
\n
# Create assignment\n # Create assignment\n
context.CredentialRequest_updatePersonAssignment()\n context.CredentialRequest_updatePersonAssignment()\n
\n \n
# Create account\n # Create account\n
login, password = context.CredentialRequest_createUser()\n login, password = context.CredentialRequest_createUser()\n
\n \n
# Fill related object with credential request\n
for portal_type in related_portal_type:\n
getattr(context,\'CredentialRequest_setRegisteredInformationTo%s\' % portal_type.replace(\' \',\'\'))()\n
\n
# Update Local Roles\n # Update Local Roles\n
context.CredentialRequest_updateLocalRolesOnSecurityGroups()\n context.CredentialRequest_updateLocalRolesOnSecurityGroups()\n
\n \n
if password is not None:\n
if password.startswith(\'{SSHA}\'):\n
#password is encoded, set it to None to script witch send the password to user\n
password = None\n
# Send notification in activities\n # Send notification in activities\n
context.activate(activity=\'SQLQueue\').CredentialRequest_sendAcceptedNotification(login, password)\n context.activate(activity=\'SQLQueue\').CredentialRequest_sendAcceptedNotification(login, password)\n
</string> </value> </string> </value>
......
...@@ -50,13 +50,18 @@ ...@@ -50,13 +50,18 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Set reference and password to create a user. Create a global user if SSO enable.\n <value> <string>"""\n
Proxy:\n Set reference and password to create a user. Create a global user if SSO enable.\n
Manager -- allow to set password on all account"""\n Proxy:\n
Manager -- allow to set password on all account\n
"""\n
\n
#Don\'t allow to call from url\n #Don\'t allow to call from url\n
if REQUEST:\n if REQUEST:\n
raise ValueError, "You can not call this script from the url"\n raise ValueError, "You can not call this script from the url"\n
\n \n
portal = context.getPortalObject()\n
portal_preferences = context.portal_preferences\n
person = context.getDestinationDecisionValue(portal_type="Person")\n person = context.getDestinationDecisionValue(portal_type="Person")\n
\n \n
# Create user of the person only if not exist\n # Create user of the person only if not exist\n
...@@ -80,9 +85,20 @@ if not person.getPassword():\n ...@@ -80,9 +85,20 @@ if not person.getPassword():\n
password = context.getPassword()\n password = context.getPassword()\n
person.setEncodedPassword(password)\n person.setEncodedPassword(password)\n
else:\n else:\n
#We should generate a password\n if not portal_preferences.isPreferredSystemGeneratePassword():\n
password = context.Person_generatePassword(alpha=5, numeric=3)\n # user will set it trough a credential recovery process\n
person.setPassword(password)\n password = None\n
module = portal.getDefaultModule(portal_type=\'Credential Recovery\')\n
credential_recovery = module.newContent(\n
portal_type="Credential Recovery",\n
reference=login,\n
destination_decision=person.getRelativeUrl(),\n
language=portal.Localizer.get_selected_language())\n
credential_recovery.submit()\n
else:\n
# system should generate a password\n
password = context.Person_generatePassword(alpha=5, numeric=3)\n
person.setPassword(password)\n
\n \n
# create a global account\n # create a global account\n
if context.ERP5Site_isSingleSignOnEnable():\n if context.ERP5Site_isSingleSignOnEnable():\n
...@@ -95,10 +111,6 @@ else:\n ...@@ -95,10 +111,6 @@ else:\n
#Check assignment for the current instance\n #Check assignment for the current instance\n
person.Person_validateGlobalUserAccount()\n person.Person_validateGlobalUserAccount()\n
\n \n
if password.startswith(\'{SSHA}\'):\n
#password is encoded, set it to None to script witch send the password to user\n
password = None\n
\n
return login, password\n return login, password\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -50,17 +50,14 @@ ...@@ -50,17 +50,14 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Send an email after accept a credential request\n <value> <string>"""\n
Proxy: Assignee, Assignor, Member -- allow to send notification by mail\n Send an email after accept a credential request\n
\n Proxy: Assignee, Assignor, Member -- allow to send notification by mail.\n
Example of notification message:\n
Congratulation, the creation of you new Instance Name account \'${login_name}\' is finished.\\nYour password is \'${login_password}\'\\nThank you"))\n
Congratulation, the creation of you new Instance Name account \'${user_id}\' is finished.\\n\\nThank you",\n
"""\n """\n
\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
recipient = context.getDestinationDecisionValue(portal_type="Person")\n recipient = context.getDestinationDecisionValue(portal_type="Person")\n
\n \n
\n
#Define the type of notification\n #Define the type of notification\n
notification_type = "without-password"\n notification_type = "without-password"\n
if password:\n if password:\n
...@@ -68,7 +65,8 @@ if password:\n ...@@ -68,7 +65,8 @@ if password:\n
\n \n
#Get message from catalog\n #Get message from catalog\n
notification_reference = \'crendential_request-confirmation-%s\' % notification_type\n notification_reference = \'crendential_request-confirmation-%s\' % notification_type\n
notification_message = context.NotificationTool_getDocumentValue(reference=notification_reference, language=recipient.getLanguage())\n notification_message = portal.portal_notifications.getDocumentValue(reference=notification_reference, \n
language=recipient.getLanguage())\n
if notification_message is None:\n if notification_message is None:\n
raise ValueError, \'Unable to found Notification Message with reference "%s".\' % notification_reference\n raise ValueError, \'Unable to found Notification Message with reference "%s".\' % notification_reference\n
\n \n
...@@ -94,7 +92,7 @@ portal.portal_notifications.sendMessage(\n ...@@ -94,7 +92,7 @@ portal.portal_notifications.sendMessage(\n
message=mail_text,\n message=mail_text,\n
message_text_format=notification_message.getContentType(),\n message_text_format=notification_message.getContentType(),\n
notifier_list=(portal.portal_preferences.getPreferredLoginAndPasswordNotifier(),),\n notifier_list=(portal.portal_preferences.getPreferredLoginAndPasswordNotifier(),),\n
store_as_event=True,\n store_as_event= portal.portal_preferences.isPreferredStoreEvents(),\n
event_keyword_argument_dict={\'follow_up\':context.getRelativeUrl()},\n event_keyword_argument_dict={\'follow_up\':context.getRelativeUrl()},\n
)\n )\n
</string> </value> </string> </value>
......
...@@ -105,6 +105,7 @@ for role in context.getRoleList():\n ...@@ -105,6 +105,7 @@ for role in context.getRoleList():\n
site = context.getSite(),\n site = context.getSite(),\n
activity = context.getActivityList(),\n activity = context.getActivityList(),\n
function = context.getFunctionList(),\n function = context.getFunctionList(),\n
group = context.getGroupList(),\n
destination = organisation_url,\n destination = organisation_url,\n
start_date = today,\n start_date = today,\n
stop_date = delay)\n stop_date = delay)\n
...@@ -116,6 +117,14 @@ for role in context.getRoleList():\n ...@@ -116,6 +117,14 @@ for role in context.getRoleList():\n
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>REQUEST=None</string> </value> <value> <string>REQUEST=None</string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Assignee</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>CredentialRequest_updatePersonAssignment</string> </value> <value> <string>CredentialRequest_updatePersonAssignment</string> </value>
......
...@@ -140,8 +140,9 @@ ...@@ -140,8 +140,9 @@
<string>my_default_credential_question_question</string> <string>my_default_credential_question_question</string>
<string>my_default_credential_question_question_free_text</string> <string>my_default_credential_question_question_free_text</string>
<string>my_default_credential_question_answer</string> <string>my_default_credential_question_answer</string>
<string>my_role_list</string> <string>my_group_list</string>
<string>my_function</string> <string>my_function</string>
<string>my_role_list</string>
<string>my_site</string> <string>my_site</string>
<string>my_translated_validation_state_title</string> <string>my_translated_validation_state_title</string>
</list> </list>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_group_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_group_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewCredentialFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -10,16 +10,16 @@ ...@@ -10,16 +10,16 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>sort</string> <string>all_columns</string>
<string>domain_tree</string> <string>columns</string>
<string>domain_root_list</string> <string>domain_root_list</string>
<string>title</string> <string>domain_tree</string>
<string>portal_types</string> <string>portal_types</string>
<string>columns</string>
<string>selection_name</string>
<string>search_columns</string> <string>search_columns</string>
<string>selection_name</string>
<string>sort</string>
<string>sort_columns</string> <string>sort_columns</string>
<string>all_columns</string> <string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -140,12 +140,8 @@ ...@@ -140,12 +140,8 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>title</string> <string>destination_decision_title</string>
<string>Usual Name</string> <string>Related to</string>
</tuple>
<tuple>
<string>default_email_text</string>
<string>Email</string>
</tuple> </tuple>
<tuple> <tuple>
<string>delivery.start_date</string> <string>delivery.start_date</string>
......
...@@ -64,6 +64,14 @@ if context.getPassword():\n ...@@ -64,6 +64,14 @@ if context.getPassword():\n
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Credential_updatePersonPassword</string> </value> <value> <string>Credential_updatePersonPassword</string> </value>
......
...@@ -50,11 +50,12 @@ ...@@ -50,11 +50,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>\'\'\'\n <value> <string>"""\n
This script is used to create the new credential recovery\n This script is used to create the new credential recovery\n
Proxy : Manager proxy role is required to make possible for \n Proxy : Manager proxy role is required to make possible for \n
anonymous to create a new Credential Recovery\n anonymous to create a new Credential Recovery\n
\'\'\'\n """\n
\n
def createCredentialRecovery(**kw):\n def createCredentialRecovery(**kw):\n
module = portal.getDefaultModule(portal_type=\'Credential Recovery\')\n module = portal.getDefaultModule(portal_type=\'Credential Recovery\')\n
credential_recovery = module.newContent(\n credential_recovery = module.newContent(\n
...@@ -99,7 +100,7 @@ else:\n ...@@ -99,7 +100,7 @@ else:\n
\'reference\': reference}\n \'reference\': reference}\n
\n \n
keep_items[\'portal_status_message\'] = portal.Base_translateString(message)\n keep_items[\'portal_status_message\'] = portal.Base_translateString(message)\n
portal.Base_redirect(form_id=\'login_form\', keep_items=keep_items)\n return portal.Base_redirect(form_id=\'login_form\', keep_items=keep_items)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -121,7 +121,7 @@ else:\n ...@@ -121,7 +121,7 @@ else:\n
message_str = "Credential Request Created."\n message_str = "Credential Request Created."\n
\n \n
\n \n
portal.Base_redirect(form_id=\'login_form\', \n return portal.Base_redirect(form_id=\'login_form\', \n
keep_items = dict(portal_status_message=context.Base_translateString(message_str)))\n keep_items = dict(portal_status_message=context.Base_translateString(message_str)))\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -55,7 +55,7 @@ portal = context.getPortalObject()\n ...@@ -55,7 +55,7 @@ portal = context.getPortalObject()\n
person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n \n
if person is None:\n if person is None:\n
portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n portal_status_message = "Can\'t find corresponding person, it\'s not possible to update your credentials."\n
else:\n else:\n
# create the credential update\n # create the credential update\n
module = context.getDefaultModule(portal_type=\'Credential Update\')\n module = context.getDefaultModule(portal_type=\'Credential Update\')\n
...@@ -89,9 +89,17 @@ else:\n ...@@ -89,9 +89,17 @@ else:\n
credential_update.edit(password=password)\n credential_update.edit(password=password)\n
\n \n
credential_update.submit()\n credential_update.submit()\n
portal_status_message = "Credential Update Created."\n
\n \n
portal_status_message = context.Base_translateString("Credential Update Created.")\n # if we are changing password for current logged in user then do it\n
# within same transaction and update client side credentials cookie \n
username = person.getReference()\n
if password and username == str(portal.portal_membership.getAuthenticatedMember()):\n
credential_update.accept()\n
portal.cookie_authentication.credentialsChanged(username, username, password)\n
portal_status_message = "Password changed."\n
\n \n
portal_status_message = context.Base_translateString(portal_status_message)\n
portal.Base_redirect(keep_items = {\'portal_status_message\': portal_status_message})\n portal.Base_redirect(keep_items = {\'portal_status_message\': portal_status_message})\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -112,6 +112,8 @@ ...@@ -112,6 +112,8 @@
<list> <list>
<string>my_preferred_ask_credential_question</string> <string>my_preferred_ask_credential_question</string>
<string>my_preferred_email_verification_check</string> <string>my_preferred_email_verification_check</string>
<string>my_preferred_system_generate_password</string>
<string>my_preferred_store_events</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_preferred_store_events</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Store Outgoing Events</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_preferred_system_generate_password</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>System Generate Password</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -50,18 +50,17 @@ ...@@ -50,18 +50,17 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>object = state_change[\'object\']\n
if portal.portal_workflow.isTransitionPossible(context, \'publish\'):\n object.Base_checkConsistency()\n
context.publish()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>state_change</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSite_publishDocumentByActivity</string> </value> <value> <string>checkConsistency</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -27,10 +27,7 @@ ...@@ -27,10 +27,7 @@
<item> <item>
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
<value> <value>
<tuple> <tuple/>
<string>close</string>
<string>close_action</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StateDefinition" module="Products.DCWorkflow.States"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>closed</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Closed</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Delete objects</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -27,10 +27,7 @@ ...@@ -27,10 +27,7 @@
<item> <item>
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
<value> <value>
<tuple> <tuple/>
<string>close</string>
<string>close_action</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Accept</string> </value> <value> <string>Accept</string> </value>
...@@ -42,7 +46,7 @@ ...@@ -42,7 +46,7 @@
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
<value> <string></string> </value> <value> <string>checkConsistency</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Submit</string> </value> <value> <string>Submit</string> </value>
...@@ -65,8 +69,8 @@ ...@@ -65,8 +69,8 @@
<key> <string>roles</string> </key> <key> <string>roles</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Assignee</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>global</string> </value> <value> <string>global</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Credential Requests to Approve (%(count)s)</string> </value> <value> <string>Credential Requests to Approve (%(count)s)</string> </value>
......
379 390
\ No newline at end of file \ No newline at end of file
...@@ -203,6 +203,15 @@ for i in context.portal_types.objectValues():\n ...@@ -203,6 +203,15 @@ for i in context.portal_types.objectValues():\n
for action_title, action_provider_id in context.Base_getActionTitleListFromAllActionProvider(context.getPortalObject()):\n for action_title, action_provider_id in context.Base_getActionTitleListFromAllActionProvider(context.getPortalObject()):\n
add_message(action_title, action_provider_id)\n add_message(action_title, action_provider_id)\n
\n \n
#\n
# ZODB Property Sheet\n
#\n
for property_sheet in context.portal_property_sheets.objectValues():\n
for property_ in property_sheet.objectValues():\n
if property_.getId().endswith(\'constraint\'):\n
for key, value in property_.showDict().items():\n
if key.startswith(\'message_\'):\n
add_message(value, portal_url.getRelativeContentURL(property_))\n
\n \n
#\n #\n
# Output\n # Output\n
......
2011-08-08 yusei
* Extract messages from constraints in ZODB property sheets for POT.
2011-04-14 yusei 2011-04-14 yusei
* Remove old unnecessary tales expression from relation string field. * Remove old unnecessary tales expression from relation string field.
......
661 662
\ No newline at end of file \ No newline at end of file
...@@ -86,6 +86,14 @@ if classification not in MARKER:\n ...@@ -86,6 +86,14 @@ if classification not in MARKER:\n
if follow_up_list:\n if follow_up_list:\n
document_kw[\'follow_up_list\'] = follow_up_list\n document_kw[\'follow_up_list\'] = follow_up_list\n
\n \n
if attach_document_to_context:\n
# attach document to current context using follow_up\n
follow_up_list = document_kw.setdefault(\'follow_up_list\', [])\n
if context_url not in follow_up_list:\n
# attach to context only if not already attached\n
follow_up_list.append(context_url)\n
document_kw[\'follow_up_list\'] = follow_up_list\n
\n
document_kw.update({\'discover_metadata\': not synchronous_metadata_discovery})\n document_kw.update({\'discover_metadata\': not synchronous_metadata_discovery})\n
if url is not None:\n if url is not None:\n
# we contribute and URL, this happens entirely asynchronous\n # we contribute and URL, this happens entirely asynchronous\n
...@@ -128,13 +136,7 @@ for key in property_id_list:\n ...@@ -128,13 +136,7 @@ for key in property_id_list:\n
value = form.get(key, kw.get(key, None))\n value = form.get(key, kw.get(key, None))\n
if value not in MARKER:\n if value not in MARKER:\n
document_edit_kw[key] = value\n document_edit_kw[key] = value\n
if attach_document_to_context:\n \n
# attach document to current context using follow_up\n
follow_up_list = document.getFollowUpList()\n
if context_url not in follow_up_list:\n
# attach to context only if not already attached\n
follow_up_list.append(context_url)\n
document.setFollowUpList(follow_up_list)\n
# edit document \n # edit document \n
if document_edit_kw is not {}:\n if document_edit_kw is not {}:\n
document.edit(**document_edit_kw)\n document.edit(**document_edit_kw)\n
......
137 138
\ No newline at end of file \ No newline at end of file
<key_list> <key_list>
<key>grand_grand_grand_parent_simulation_state | catalog,catalog,catalog,catalog/simulation_state/z_related_grand_grand_grand_parent</key> <key>grand_grand_grand_parent_simulation_state | catalog,catalog,catalog,catalog/simulation_state/z_related_grand_grand_grand_parent</key>
<key>grand_grand_parent_specialise_portal_type | category,catalog,catalog,catalog/portal_type/z_related_grand_grand_parent_specialise</key> <key>grand_grand_parent_specialise_portal_type | category,catalog,catalog,catalog/portal_type/z_related_grand_grand_parent_specialise</key>
<key>grand_grand_parent_specialise_reference | category,catalog,catalog,catalog/reference/z_related_grand_grand_parent_specialise</key>
</key_list> </key_list>
\ No newline at end of file
2011-07-25 Kazuhiko
* add grand_grand_parent_specialise_reference related key.
2010-05-05 yo 2010-05-05 yo
* Allow several simulation rules to have Mapped Property. * Allow several simulation rules to have Mapped Property.
......
373 374
\ No newline at end of file \ No newline at end of file
grand_grand_grand_parent_simulation_state | catalog,catalog,catalog,catalog/simulation_state/z_related_grand_grand_grand_parent grand_grand_grand_parent_simulation_state | catalog,catalog,catalog,catalog/simulation_state/z_related_grand_grand_grand_parent
grand_grand_parent_specialise_portal_type | category,catalog,catalog,catalog/portal_type/z_related_grand_grand_parent_specialise grand_grand_parent_specialise_portal_type | category,catalog,catalog,catalog/portal_type/z_related_grand_grand_parent_specialise
\ No newline at end of file grand_grand_parent_specialise_reference | category,catalog,catalog,catalog/reference/z_related_grand_grand_parent_specialise
\ No newline at end of file
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>global</string> </value> <value> <string>global</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Payment Transaction Groups to Open (%(count)s)</string> </value> <value> <string>Payment Transaction Groups to Open (%(count)s)</string> </value>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>global</string> </value> <value> <string>global</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Payment Transaction Groups to Close (%(count)s)</string> </value> <value> <string>Payment Transaction Groups to Close (%(count)s)</string> </value>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>global</string> </value> <value> <string>global</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Payment Transaction Groups to Deliver (%(count)s)</string> </value> <value> <string>Payment Transaction Groups to Deliver (%(count)s)</string> </value>
...@@ -18,7 +22,7 @@ ...@@ -18,7 +22,7 @@
<key> <string>actbox_url</string> </key> <key> <string>actbox_url</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
payment_transaction_group_module/view?reset:int=1&portal_type=Payment Transaction Group&local_roles=Assignee&validation_state=closed payment_transaction_group_module/view?reset:int=1&portal_type=Payment Transaction Group&local_roles=Assignor&validation_state=closed
]]></string> </value> ]]></string> </value>
</item> </item>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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