[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/pas/browser/loginform.pt loginform calls itself in its action

robert rottermann robert at redcor.ch
Wed Oct 13 09:09:02 EDT 2004


Log message for revision 28075:
  loginform calls itself in its action
  it checks whether the users id is 'zope.anybody'
  if yes it is displayed, if not it redirects to the
  object that caused the login challenge
  

Changed:
  U   Zope3/trunk/src/zope/app/pas/browser/loginform.pt

-=-
Modified: Zope3/trunk/src/zope/app/pas/browser/loginform.pt
===================================================================
--- Zope3/trunk/src/zope/app/pas/browser/loginform.pt	2004-10-13 12:48:45 UTC (rev 28074)
+++ Zope3/trunk/src/zope/app/pas/browser/loginform.pt	2004-10-13 13:09:00 UTC (rev 28075)
@@ -4,30 +4,33 @@
     Sign in
   </title>
 </head>
-<body><div metal:fill-slot="body"> 
+<body><div metal:fill-slot="body">
+    <div tal:omit-tag="" 
+        tal:define="principal python:request.principal.id" 
+        tal:condition="python:principal != 'zope.anybody'">
+        <span tal:define="dummy python:request.response.redirect(request['camefrom'])" />
+    </div>
     <p i18n:translate="">Please provide Login Information</p>
-    <form action="" method="post" 
-        tal:attributes="action request/camefrom"
-    >
-      <div class="row">
-       <div class="label" i18n:translate="">User Name</div>
-       <div class="field">
-        <input type="text" name="login"/>
-       </div>
-      </div>
+    <form action="" method="post">
+        <div class="row">
+            <div class="label" i18n:translate="">User Name</div>
+            <div class="field">
+                <input type="text" name="login"/>
+            </div>
+        </div>
 
-    <div class="row">
-      <div class="label" i18n:translate="">Password</div>
-      <div class="field">
-        <input type="password" name="password"/>
-      </div>
-    </div>
+        <div class="row">
+            <div class="label" i18n:translate="">Password</div>
+            <div class="field">
+                <input type="password" name="password"/>
+            </div>
+        </div>
     
-    <div class="row">
-      <input class="form-element" type="submit" 
-             name="SUBMIT" value="Log in" i18n:attributes="value login-button" />
-    </div>
-    
+        <div class="row">
+            <input class="form-element" type="submit" 
+                    name="SUBMIT" value="Log in" i18n:attributes="value login-button" />
+        </div>
+        <input type="hidden" name="camefrom" tal:attributes="value request/camefrom | nothing">
     </form>
 </div></body></html>
 



More information about the Zope3-Checkins mailing list