From tchemit@users.chorem.org Sun Sep 30 18:09:37 2012
From: tchemit@users.chorem.org
To: pollen-commits@list.chorem.org
Subject: [Pollen-commits] r3713 - in
	trunk/pollen-ui-struts2/src/main/webapp/WEB-INF: decorators	jsp/poll jsp/user
Date: Sun, 30 Sep 2012 18:09:37 +0200
Message-ID: <20120930160937.C202515A14@nuiton.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3173325282675997544=="

--===============3173325282675997544==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Author: tchemit
Date: 2012-09-30 18:09:37 +0200 (Sun, 30 Sep 2012)
New Revision: 3713

Url: http://chorem.org/repositories/revision/pollen/3713

Log:
fixes #817: Protect some forms

Modified:
   trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.=
jsp
   trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/pollForm.jsp
   trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp

Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-d=
efault.jsp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default=
.jsp	2012-09-30 12:57:25 UTC (rev 3712)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default=
.jsp	2012-09-30 16:09:37 UTC (rev 3713)
@@ -42,17 +42,15 @@
   <sj:head locale=3D"%{locale}" jqueryui=3D"true" jquerytheme=3D"%{jqueryThe=
me}"/>
 </head>
=20
-<%-- TODO AThimel 24/01/2012 Remove this when refactoring is over --%>
-<div id=3D"in-progress">
+<%--div id=3D"in-progress">
     <a href=3D"http://chorem.org/projects/pollen">
       <s:text name=3D"pollen.banner.newVersion"/>
     </a>
-</div>
+</div--%>
=20
-
 <script type=3D"text/javascript">
=20
-  jQuery(document).ready(function () {
+  $(document).ready(function () {
=20
     // apply common style
     $('fieldset').addClass('ui-widget-content ui-corner-all');
@@ -68,6 +66,26 @@
         dialog.dialog('open');
         return false;
     });
+
+    $(document).one('mousemove', function() {
+      function KMe(node, attrName, pattern) {
+        var attr =3D node.attr(attrName).replace( pattern + '\/', '');
+        //console.info("Unlock " + pattern + " " + node.attr('id') +
+        //             " - " + attrName + " =3D " + attr);
+        node.attr(attrName, attr);
+        node.removeClass(pattern);
+      }
+      $('form.KForm').each(function () {
+        KMe($(this),'action','KForm');
+      });
+      $('input[type=3D"submit"].KAction').each(function () {
+        var $this =3D $(this);
+        KMe($(this),'name','KAction');
+      });
+      $('a.KLink').each(function () {
+        KMe($(this),'href','KLink');
+      });
+    });
   });
 </script>
 <s:set var=3D"user" value=3D"%{#session.pollenSession.userAccount}"/>
@@ -139,7 +157,8 @@
=20
         <sj:dialog id=3D"lostPasswordDialog" autoOpen=3D"false" modal=3D"tru=
e" width=3D"500"/>
=20
-        <s:form id=3D"connection" method=3D"POST" namespace=3D"/user" action=
=3D"login">
+        <s:form id=3D"connection" method=3D"POST" namespace=3D"/user"
+                action=3D"KForm/login" cssClass=3D"KForm">
           <s:hidden name=3D"redirectUrl" value=3D"%{currentUrl}"/>
           <ul class=3D"top_middle<s:property value=3D'%{pageLogo}'/>">
             <li>
@@ -163,14 +182,15 @@
               </a>
             </li>
             <li>
-              <s:submit id=3D"submitform" action=3D"login" key=3D"pollen.act=
ion.login"
-                        align=3D"right"/>
+              <s:submit id=3D"submitform" action=3D"KAction/login" align=3D"=
right"
+                        key=3D"pollen.action.login" cssClass=3D"KAction"/>
             </li>
           </ul>
         </s:form>
       </div>
       <s:text name=3D"pollen.common.or"/>
-      <s:a action=3D"register" method=3D"input" namespace=3D"/user">
+      <s:a action=3D"KLink/register" method=3D"input" namespace=3D"/user"
+           cssClass=3D"KLink" id=3D'registerLink'>
         <s:text name=3D"pollen.menu.register"/>
       </s:a>
     </s:else>
@@ -193,7 +213,8 @@
         <div class=3D"top_left<s:property value=3D'%{pageLogo}'/>"></div>
         <ul class=3D"top_middle<s:property value=3D'%{pageLogo}'/>">
           <li>
-            <s:a action=3D"create" namespace=3D"/poll">
+            <s:a id=3D'createPollLink' action=3D"KLink/create" namespace=3D"=
/poll"
+                 cssClass=3D"KLink">
               <s:text name=3D"pollen.menu.createPoll"/>
             </s:a>
           </li>

Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/pollForm.j=
sp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/pollForm.jsp	201=
2-09-30 12:57:25 UTC (rev 3712)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/pollForm.jsp	201=
2-09-30 16:09:37 UTC (rev 3713)
@@ -85,7 +85,7 @@
 </h1>
=20
 <s:form method=3D"POST" id=3D"registerForm" namespace=3D"/poll"
-        enctype=3D"multipart/form-data">
+        enctype=3D"multipart/form-data" cssClass=3D"KForm" action=3D"KForm/c=
reate">
=20
 <s:hidden key=3D"poll.topiaId" label=3D""/>
=20
@@ -214,12 +214,6 @@
              label=3D'%{getText("pollen.common.pollOption.pollVoteVisibility=
")}'
              tooltip=3D"%{getText('pollen.common.pollOption.pollVoteVisibili=
ty.help')}"
              tooltipIconPath=3D"/img/tooltip.png"/>
-
-    <%--s:checkbox key=3D"poll.anonymous"
-                label=3D"%{getText('pollen.common.pollOption.anonymous')}"
-                disabled=3D"%{voteStarted}"
-                tooltip=3D"%{getText('pollen.common.pollOption.anonymous.hel=
p')}"
-                tooltipIconPath=3D"/img/tooltip.png"/--%>
     <s:checkbox key=3D"poll.anonymousVoteAllowed"
                 label=3D"%{getText('pollen.common.pollOption.anonymousVoteAl=
lowed')}"
                 disabled=3D"%{voteStarted}"
@@ -324,7 +318,8 @@
   <s:submit action=3D"clone/%{pollUri}" value=3D"%{actionLabel}" align=3D"ce=
nter"/>
 </s:elseif>
 <s:else>
-  <s:submit action=3D"create" value=3D"%{actionLabel}" align=3D"center"/>
+  <s:submit action=3D"KAction/create" value=3D"%{actionLabel}" align=3D"cent=
er"
+            cssClass=3D"KAction"/>
 </s:else>
 </s:form>
=20

Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.j=
sp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp	201=
2-09-30 12:57:25 UTC (rev 3712)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp	201=
2-09-30 16:09:37 UTC (rev 3713)
@@ -29,7 +29,8 @@
   <s:text name=3D"pollen.title.register"/>
 </h1>
=20
-<s:form method=3D"POST">
+<s:form method=3D"POST" namespace=3D"/user" action=3D"KForm/register"
+        cssClass=3D"KForm" id=3D"registerForm">
=20
   <fieldset>
     <legend><s:text name=3D"pollen.fieldset.connexionInformation"/></legend>
@@ -52,5 +53,6 @@
                  key=3D"pollen.common.lastName"/>
   </fieldset>
   <br/>
-  <s:submit action=3D"register" key=3D"pollen.action.register" align=3D"cent=
er"/>
+  <s:submit action=3D"KAction/register" key=3D"pollen.action.register"
+            align=3D"center" cssClass=3D"KAction"/>
 </s:form>


--===============3173325282675997544==--


