cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jer...@apache.org
Subject svn commit: r487993 - /cocoon/branches/BRANCH_2_1_X/src/webapp/samples/flow/prefs/prefs.js
Date Sun, 17 Dec 2006 15:53:16 GMT
Author: jeremy
Date: Sun Dec 17 07:53:15 2006
New Revision: 487993

URL: http://svn.apache.org/viewvc?view=rev&rev=487993
Log:
limit the number of attempts to login, otherwise if a crawler indexes this page, it loops
indefinitely

Modified:
    cocoon/branches/BRANCH_2_1_X/src/webapp/samples/flow/prefs/prefs.js

Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/flow/prefs/prefs.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/webapp/samples/flow/prefs/prefs.js?view=diff&rev=487993&r1=487992&r2=487993
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/flow/prefs/prefs.js (original)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/flow/prefs/prefs.js Sun Dec 17 07:53:15
2006
@@ -136,6 +136,8 @@
   var errorMsg = cocoon.parameters["errorMsg"];
   var login = "";
   var password = "";
+  var attempts = 0;
+  var maxattempts = 3;
 
   while (true) {
     cocoon.sendPageAndWait("page/login",
@@ -154,9 +156,14 @@
     user = userRegistry.getUserWithLogin(login, password);
 
     if (user != undefined) {
+      attempts = 0;
       break;
     } else {
       errorMsg = "No such user or bad password";
+      attempts++;
+      if (attempts > maxattempts) {
+        cocoon.redirectTo("register");
+      }
     }
   }
 



Mime
View raw message