Commit 7a13d758 authored by Romain Courteaud's avatar Romain Courteaud

Define field_prefix variable

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19919 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b3656e53
...@@ -74,6 +74,10 @@ request=context.REQUEST\n ...@@ -74,6 +74,10 @@ request=context.REQUEST\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n N_ = portal.Base_translateString\n
\n \n
# Extra security\n
if request.get(\'field_prefix\', None):\n
field_prefix = \'my_\' # Prevent changing the prefix through publisher\n
\n
# Use dialog_id if present, otherwise fall back on form_id.\n # Use dialog_id if present, otherwise fall back on form_id.\n
if dialog_id not in (\'\', None):\n if dialog_id not in (\'\', None):\n
form_id = dialog_id\n form_id = dialog_id\n
...@@ -182,7 +186,7 @@ return request[\'RESPONSE\'].redirect(redirect_url)\n ...@@ -182,7 +186,7 @@ return request[\'RESPONSE\'].redirect(redirect_url)\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>form_id, selection_index=0, selection_name=\'\', dialog_id=\'\', ignore_layout=0, editable_mode=1</string> </value> <value> <string>form_id, selection_index=0, selection_name=\'\', dialog_id=\'\', ignore_layout=0, editable_mode=1, field_prefix=\'my_\'</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -202,7 +206,7 @@ return request[\'RESPONSE\'].redirect(redirect_url)\n ...@@ -202,7 +206,7 @@ return request[\'RESPONSE\'].redirect(redirect_url)\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>6</int> </value> <value> <int>7</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -214,6 +218,7 @@ return request[\'RESPONSE\'].redirect(redirect_url)\n ...@@ -214,6 +218,7 @@ return request[\'RESPONSE\'].redirect(redirect_url)\n
<string>dialog_id</string> <string>dialog_id</string>
<string>ignore_layout</string> <string>ignore_layout</string>
<string>editable_mode</string> <string>editable_mode</string>
<string>field_prefix</string>
<string>Products.Formulator.Errors</string> <string>Products.Formulator.Errors</string>
<string>FormValidationError</string> <string>FormValidationError</string>
<string>Products.CMFActivity.Errors</string> <string>Products.CMFActivity.Errors</string>
...@@ -261,6 +266,7 @@ return request[\'RESPONSE\'].redirect(redirect_url)\n ...@@ -261,6 +266,7 @@ return request[\'RESPONSE\'].redirect(redirect_url)\n
<string></string> <string></string>
<int>0</int> <int>0</int>
<int>1</int> <int>1</int>
<string>my_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
741 744
\ 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