Commit ad7a17ba authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'origin/master'

parents 3399ce16 90528638
...@@ -99,7 +99,7 @@ for item in item_list:\n ...@@ -99,7 +99,7 @@ for item in item_list:\n
sub_field_property_dict[\'key\'] = item_key\n sub_field_property_dict[\'key\'] = item_key\n
sub_field_property_dict[\'required\'] = 0\n sub_field_property_dict[\'required\'] = 0\n
sub_field_property_dict[\'field_type\'] = multi and \'MultiListField\' or \'ListField\'\n sub_field_property_dict[\'field_type\'] = multi and \'MultiListField\' or \'ListField\'\n
sub_field_property_dict[\'size\'] = multi and 10 or 1\n sub_field_property_dict[\'size\'] = multi and 15 or 1\n
sub_field_property_dict[\'item_list\'] = [(\'\',\'\')]\n sub_field_property_dict[\'item_list\'] = [(\'\',\'\')]\n
sub_field_property_dict[\'value\'] = []\n sub_field_property_dict[\'value\'] = []\n
sub_field_dict[item_key] = sub_field_property_dict\n sub_field_dict[item_key] = sub_field_property_dict\n
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
</item> </item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string></string> </value> <value> <string>style="max-width: none"</string> </value>
</item> </item>
<item> <item>
<key> <string>extra_item</string> </key> <key> <string>extra_item</string> </key>
......
...@@ -86,6 +86,10 @@ ...@@ -86,6 +86,10 @@
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
<list> <list>
<tuple>
<string>int_index</string>
<string>Index</string>
</tuple>
<tuple> <tuple>
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
......
377 379
\ No newline at end of file \ No newline at end of file
...@@ -61,7 +61,7 @@ if context.hasDocumentReference():\n ...@@ -61,7 +61,7 @@ if context.hasDocumentReference():\n
message_reference = context.getDocumentReference()\n message_reference = context.getDocumentReference()\n
else:\n else:\n
message_reference = portal.portal_preferences.getPreferredCredentialPasswordRecoveryMessageReference()\n message_reference = portal.portal_preferences.getPreferredCredentialPasswordRecoveryMessageReference()\n
if message_reference is None:\n if message_reference is None:\n
raise ValueError, "Preference not configured"\n raise ValueError, "Preference not configured"\n
notification_message = portal.NotificationTool_getDocumentValue(message_reference,\n notification_message = portal.NotificationTool_getDocumentValue(message_reference,\n
context.getLanguage())\n context.getLanguage())\n
......
...@@ -63,7 +63,10 @@ for person in person_list:\n ...@@ -63,7 +63,10 @@ for person in person_list:\n
usernames = " ".join(usernames)\n usernames = " ".join(usernames)\n
\n \n
reference_list = [x.getReference() for x in person_list]\n reference_list = [x.getReference() for x in person_list]\n
message_reference = portal.portal_preferences.getPreferredCredentialUsernameRecoveryMessageReference()\n if context.hasDocumentReference():\n
message_reference = context.getDocumentReference()\n
else:\n
message_reference = portal.portal_preferences.getPreferredCredentialUsernameRecoveryMessageReference()\n
if message_reference is None:\n if message_reference is None:\n
raise ValueError, "Preference not configured"\n raise ValueError, "Preference not configured"\n
\n \n
......
...@@ -56,14 +56,19 @@ ...@@ -56,14 +56,19 @@
\'\'\'\n \'\'\'\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
person_module = portal.getDefaultModule(\'Person\')\n person_module = portal.getDefaultModule(\'Person\')\n
request = context.REQUEST\n
web_site = context.getWebSiteValue()\n
if web_site:\n
request.set("came_from", web_site.absolute_url())\n
if choice == "password":\n if choice == "password":\n
request = context.REQUEST\n
request.set(\'reference\', reference)\n request.set(\'reference\', reference)\n
portal_preferences = context.portal_preferences\n portal_preferences = context.portal_preferences\n
result = person_module.searchFolder(reference={\'query\': reference, \'key\': \'ExactMatch\'})\n result = person_module.searchFolder(reference={\'query\': reference, \'key\': \'ExactMatch\'})\n
if len(result) != 1:\n if len(result) != 1:\n
portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n
return context.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n if web_site:\n
return web_site.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
return portal.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
\n \n
person = result[0]\n person = result[0]\n
\n \n
...@@ -93,7 +98,9 @@ elif choice == "username":\n ...@@ -93,7 +98,9 @@ elif choice == "username":\n
result = portal.portal_catalog(portal_type="Email", parent_portal_type="Person", **query_kw)\n result = portal.portal_catalog(portal_type="Email", parent_portal_type="Person", **query_kw)\n
if len(result) == 0:\n if len(result) == 0:\n
portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n
return context.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n if web_site:\n
return web_site.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
return portal.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
person_list = [x.getParentValue() for x in result]\n person_list = [x.getParentValue() for x in result]\n
return context.ERP5Site_newCredentialRecovery(default_email_text=default_email_text, person_list=person_list)\n return context.ERP5Site_newCredentialRecovery(default_email_text=default_email_text, person_list=person_list)\n
</string> </value> </string> </value>
......
...@@ -66,7 +66,8 @@ def createCredentialRecovery(**kw):\n ...@@ -66,7 +66,8 @@ def createCredentialRecovery(**kw):\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
portal_preferences = portal.portal_preferences\n portal_preferences = portal.portal_preferences\n
keep_items = {}\n keep_items = {}\n
\n web_site = context.getWebSiteValue()\n
document_reference = None\n
if default_email_text is not None:\n if default_email_text is not None:\n
# Case for recovery of username\n # Case for recovery of username\n
if person_list is None:\n if person_list is None:\n
...@@ -74,14 +75,19 @@ if default_email_text is not None:\n ...@@ -74,14 +75,19 @@ if default_email_text is not None:\n
result = portal.portal_catalog(portal_type="Email", parent_portal_type="Person", **query_kw)\n result = portal.portal_catalog(portal_type="Email", parent_portal_type="Person", **query_kw)\n
if len(result) == 0:\n if len(result) == 0:\n
portal_status_message = portal.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n portal_status_message = portal.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n
if web_site:\n
return web_site.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
return portal.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n return portal.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
\n \n
person_list = [x.getObject().getParentValue() for x in result]\n person_list = [x.getObject().getParentValue() for x in result]\n
\n \n
# Create recovery\n # Create recovery\n
message = "We have sent you an email containing your username(s). Please check your inbox and your junk/spam mail for this email."\n message = "We have sent you an email containing your username(s). Please check your inbox and your junk/spam mail for this email."\n
if web_site:\n
document_reference = web_site.getCredentialUsernameRecoveryMessageReference() \n
createCredentialRecovery(default_email_text=default_email_text,\n createCredentialRecovery(default_email_text=default_email_text,\n
destination_decision_value_list=person_list,\n destination_decision_value_list=person_list,\n
document_reference=document_reference,\n
language=portal.Localizer.get_selected_language())\n language=portal.Localizer.get_selected_language())\n
else:\n else:\n
# Case for recovery of password\n # Case for recovery of password\n
...@@ -90,10 +96,11 @@ else:\n ...@@ -90,10 +96,11 @@ else:\n
result = person_module.searchFolder(reference=reference)\n result = person_module.searchFolder(reference=reference)\n
if len(result) != 1:\n if len(result) != 1:\n
portal_status_message = portal.Base_translateString("Can\'t find corresponding person, it\'s not possible to recover your credentials.")\n portal_status_message = portal.Base_translateString("Can\'t find corresponding person, it\'s not possible to recover your credentials.")\n
return context.Base_redirect(\'\', keep_items = dict(portal_status_message=portal_status_message ))\n if web_site:\n
web_site.Base_redirect(\'\', keep_items = dict(portal_status_message=portal_status_message ))\n
return portal.Base_redirect(\'\', keep_items = dict(portal_status_message=portal_status_message ))\n
\n \n
person_list = [result[0].getObject(),]\n person_list = [result[0].getObject(),]\n
\n
\n \n
# Check the response\n # Check the response\n
person = person_list[0]\n person = person_list[0]\n
...@@ -103,15 +110,20 @@ else:\n ...@@ -103,15 +110,20 @@ else:\n
question_answer = question_answer and question_answer.lower()\n question_answer = question_answer and question_answer.lower()\n
answer = default_credential_question_answer and default_credential_question_answer.lower() or \'\'\n answer = default_credential_question_answer and default_credential_question_answer.lower() or \'\'\n
message = "We have sent you an email to enable you to reset your password. Please check your inbox and your junk/spam mail for this email and follow the link to reset your password."\n message = "We have sent you an email to enable you to reset your password. Please check your inbox and your junk/spam mail for this email and follow the link to reset your password."\n
if web_site:\n
document_reference = web_site.getCredentialPasswordRecoveryMessageReference()\n
\n
if (question_title or question_free_text) and (answer == question_answer):\n if (question_title or question_free_text) and (answer == question_answer):\n
createCredentialRecovery(reference=reference,\n createCredentialRecovery(reference=reference,\n
default_credential_question_answer=default_credential_question_answer,\n default_credential_question_answer=default_credential_question_answer,\n
destination_decision_value_list=person_list,\n destination_decision_value_list=person_list,\n
document_reference=document_reference,\n
language=portal.Localizer.get_selected_language())\n language=portal.Localizer.get_selected_language())\n
elif (question_free_text is None and question_answer is None) or \\\n elif (question_free_text is None and question_answer is None) or \\\n
not portal_preferences.isPreferredAskCredentialQuestion():\n not portal_preferences.isPreferredAskCredentialQuestion():\n
createCredentialRecovery(reference=reference,\n createCredentialRecovery(reference=reference,\n
destination_decision_value_list=person_list,\n destination_decision_value_list=person_list,\n
document_reference=document_reference,\n
language=portal.Localizer.get_selected_language())\n language=portal.Localizer.get_selected_language())\n
else:\n else:\n
message = "You didn\'t enter the correct answer."\n message = "You didn\'t enter the correct answer."\n
...@@ -120,6 +132,8 @@ else:\n ...@@ -120,6 +132,8 @@ 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
if web_site:\n
return web_site.Base_redirect(form_id=\'login_form\', keep_items=keep_items)\n
return 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>
......
431 432
\ No newline at end of file \ No newline at end of file
...@@ -50,21 +50,32 @@ ...@@ -50,21 +50,32 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>"""This script is indented to be used in email emage to mark the event as received\n
when the recipient opens the email in his email client.\n
\n
We do not want to mark an email as read when backoffice agent displays the event\n
in ERP5 though.\n
"""\n
portal = context.getPortalObject()\n
request = context.REQUEST\n request = context.REQUEST\n
event_id = request[\'id\']\n
\n \n
user = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n user = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
# If we have a logged in user it\'s probably a backoffice agent.\n
if user is None:\n if user is None:\n
if portal.Base_getHMACHexdigest(portal.Base_getEventHMACKey(), request[\'id\']) != request["hash"]:\n # If the referer contains the url of the event we are probably viewing the event\n
# from ERP5 interface. We do not want to mark the event as received in that case\n
if not (\'/event_module/%s\' % event_id) in request.HTTP_REFERER:\n
if portal.Base_getHMACHexdigest(portal.Base_getEventHMACKey(), event_id) != request["hash"]:\n
from zExceptions import Unauthorized\n from zExceptions import Unauthorized\n
raise Unauthorized\n raise Unauthorized()\n
\n \n
portal.portal_activities.activate(\n portal.portal_activities.activate(\n
activity="SQLQueue").Base_markEventAsReceived(event_id=request[\'id\'], \n activity="SQLQueue").Base_markEventAsReceived(event_id=request[\'id\'], \n
hmac=request["hash"])\n hmac=request["hash"])\n
\n \n
redirect_url = "%s/Base_download" %(context.getRelativeUrl(),)\n # serve the image\n
context.REQUEST[ \'RESPONSE\' ].redirect(redirect_url)\n return context.index_html(request, request.RESPONSE, format=None)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -50,21 +50,32 @@ ...@@ -50,21 +50,32 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>"""This script is indented to be used in email emage to mark the event as delivered\n
when the recipient opens the email in his email client.\n
\n
We do not want to mark an email as read when backoffice agent displays the event\n
in ERP5 though.\n
"""\n
portal = context.getPortalObject()\n
request = context.REQUEST\n request = context.REQUEST\n
event_id = request[\'id\']\n
\n \n
user = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n user = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
# If we have a logged in user it\'s probably a backoffice agent.\n
if user is None:\n if user is None:\n
if portal.Base_getHMACHexdigest(portal.Base_getEventHMACKey(), request[\'id\']) != request["hash"]:\n # If the referer contains the url of the event we are probably viewing the event\n
# from ERP5 interface. We do not want to mark the event as delivered in that case\n
if not (\'/event_module/%s\' % event_id) in request.HTTP_REFERER:\n
if portal.Base_getHMACHexdigest(portal.Base_getEventHMACKey(), event_id) != request["hash"]:\n
from zExceptions import Unauthorized\n from zExceptions import Unauthorized\n
raise Unauthorized\n raise Unauthorized()\n
\n \n
portal.portal_activities.activate(\n portal.portal_activities.activate(\n
activity="SQLQueue").Base_markEventAsDelivered(event_id=request[\'id\'], \n activity="SQLQueue").Base_markEventAsDelivered(event_id=request[\'id\'], \n
hmac=request["hash"])\n hmac=request["hash"])\n
\n \n
redirect_url = "%s/Base_download" %(context.getRelativeUrl(),)\n # serve the image\n
context.REQUEST[ \'RESPONSE\' ].redirect(redirect_url)\n return context.index_html(request, request.RESPONSE, format=None)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
696 697
\ No newline at end of file \ No newline at end of file
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</item> </item>
<item> <item>
<key> <string>priority</string> </key> <key> <string>priority</string> </key>
<value> <float>4.1</float> </value> <value> <float>20</float> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</item> </item>
<item> <item>
<key> <string>priority</string> </key> <key> <string>priority</string> </key>
<value> <float>4.2</float> </value> <value> <float>21</float> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
413 414
\ No newline at end of file \ No newline at end of file
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