From eddda5644afe2f03cc0d527f9c330522f7b5a246 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Sat, 7 Jan 2006 12:42:42 +0000
Subject: [PATCH] explain why unauthorized leads to login page. enable
 automatic redirect when unauthorized.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5043 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_html_style/login_form.xml      | 12 +++++++++++-
 .../portal_skins/erp5_html_style/main_template.xml   |  6 +++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_html_style/login_form.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_html_style/login_form.xml
index 62af413188..968b915339 100755
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_html_style/login_form.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_html_style/login_form.xml
@@ -71,7 +71,17 @@
 <body>\n
 <div metal:fill-slot="main" i18n:domain="ui">\n
 <div class="Desktop">\n
-<h1 class="Desktop" i18n:translate="">Log in</h1>\n
+<span tal:condition="python: request.get(\'came_from\', None) is not None">\n
+  <h1 class="Desktop" i18n:translate="">You don\'t have enough permissions to access this page</h1>\n
+     <span i18n:translate=""> You can log in with another user name or \n
+     </span>\n
+     <a href="javascript:history.back();" \n
+          i18n:translate="">go back.</a>\n
+  <br/>  <br/>\n
+</span>\n
+<span tal:condition="python: request.get(\'came_from\', None) is None">\n
+  <h1 class="Desktop" i18n:translate="">Log in</h1>\n
+</span>\n
 <!-- <form action="" method="post"\n
       tal:attributes="action string:${here/portal_url}/logged_in"\n
 >\n
diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_html_style/main_template.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_html_style/main_template.xml
index 5c1a3ce58c..df42beefa9 100755
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_html_style/main_template.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_html_style/main_template.xml
@@ -95,7 +95,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
 \n
   <body LEFTMARGIN=0 TOPMARGIN=0 MARGINHEIGHT="0" MARGINWIDTH="0">\n
   <form action="Test" method="POST" id="main_form"\n
-      tal:attributes="action here/absolute_url"\n
+      tal:attributes="action request/came_from | here/absolute_url"\n
       tal:define="global has_local python: \'local_pt\' in here.objectIds();\n
                   global util_macros here/index_html_utils/macros;">\n
     <div metal:use-macro="here/global_definition/macros/global_definition" />\n
@@ -189,6 +189,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
             <key> <string>id</string> </key>
             <value> <string>main_template</string> </value>
         </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
       </dictionary>
     </pickle>
   </record>
-- 
2.30.9