Fixes the layout of the password box for cookie-authenticated users (the box was...
[platal.git] / templates / admin / valider.tpl
index 040473b..408b86e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -20,7 +20,6 @@
 {*                                                                        *}
 {**************************************************************************}
 
-{javascript name="jquery"}
 <script type="text/javascript">//<![CDATA[
 {literal}
 function toggleField(name, id, obj) {
@@ -47,8 +46,8 @@ function toggleField(name, id, obj) {
   <tr>
     <td class="titre" style="width: 20%">Demandeur&nbsp;:</td>
     <td>
-      <a href="profile/{$valid->bestalias}" class="popup2">
-        {$valid->prenom} {$valid->nom} (X{$valid->promo})
+      <a href="profile/{$valid->user->login()}" class="popup2">
+        {$valid->user->fullName()} (X{$valid->user->promo()})
       </a>
     </td>
   </tr>
@@ -73,9 +72,10 @@ function toggleField(name, id, obj) {
   <tr {if $preview_id neq $valid->id()}style="display: none"{/if} id="edit_{$valid->id()}">
     <td colspan="2" class="center">
       <form enctype="multipart/form-data" action="{$platal->pl_self(0)}/edit/{$valid->id()}#valid{$valid->id()}" method="post">
+        {xsrf_token_field}
         <div>
           {include file=$valid->editor()}
-          <input type="hidden" name="uid"    value="{$valid->uid}" />
+          <input type="hidden" name="uid"    value="{$valid->user->id()}" />
           <input type="hidden" name="type"   value="{$valid->type}" />
           <input type="hidden" name="stamp"  value="{$valid->stamp}" />
           <br />
@@ -106,8 +106,9 @@ function toggleField(name, id, obj) {
   <tr {if $valid->comments|@count eq 0}style="display: none"{/if} id="comment_{$valid->id()}">
     <td colspan='2' class='center'>
       <form action="admin/validate" method="post">
+        {xsrf_token_field}
         <div>
-          <input type="hidden" name="uid"    value="{$valid->uid}" />
+          <input type="hidden" name="uid"    value="{$valid->user->id()}" />
           <input type="hidden" name="type"   value="{$valid->type}" />
           <input type="hidden" name="stamp"  value="{$valid->stamp}" />
           <input type="hidden" name="formid" value="{0|rand:65535}" />
@@ -131,6 +132,7 @@ function toggleField(name, id, obj) {
   <tr>
     <td colspan='2' {popup caption="Règles de validation" text=$valid->ruleText()}>
       <form action="admin/validate" method="post">
+        {xsrf_token_field}
         <div>
           Réponse préremplie&nbsp;:
           <select onchange="this.form.comm.value=this.value">
@@ -145,7 +147,7 @@ function toggleField(name, id, obj) {
           Ajouté dans l'email&nbsp;:<br />
           <textarea rows="5" cols="50" name="comm"></textarea><br />
 
-          <input type="hidden" name="uid"    value="{$valid->uid}" />
+          <input type="hidden" name="uid"    value="{$valid->user->id()}" />
           <input type="hidden" name="type"   value="{$valid->type}" />
           <input type="hidden" name="stamp"  value="{$valid->stamp}" />
           <input type="submit" name="accept" value="Accepter" />