various fixes
authorx2000habouzit <x2000habouzit>
Thu, 26 Aug 2004 12:31:15 +0000 (12:31 +0000)
committerx2000habouzit <x2000habouzit>
Thu, 26 Aug 2004 12:31:15 +0000 (12:31 +0000)
include/xorg.page.inc.php
templates/admin/index.tpl
templates/logger-view.tpl
templates/table-editor.tpl

index e305ef6..e364a26 100644 (file)
@@ -24,7 +24,12 @@ function function_dyn($params) {
 }
 
 function escape_html(&$string) {
-    return is_string($string) ? htmlspecialchars($string) : $string;
+    if(is_string($string)) {
+       $transtbl = Array('<' => '&lt;', '>' => '&gt;', '"' => '&quot;');
+       return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,4};)/", "&amp;" , strtr($string, $transtbl));
+    } else {
+       return $string;
+    }
 }
 
 class XorgPage extends DiogenesCorePage {
index f711c70..6f57ad3 100644 (file)
@@ -1,4 +1,4 @@
-{* $Id: index.tpl,v 1.2 2004-07-08 09:20:57 x2000habouzit Exp $ *}
+{* $Id: index.tpl,v 1.3 2004-08-26 12:31:16 x2000habouzit Exp $ *}
 
 <div class="rubrique">Administration Polytechnique.org</div>
 
@@ -19,7 +19,7 @@
 <tr class="impair"><td>
   <strong>S&eacute;curit&eacute; : </strong>
   <a href="logger.php">Logs des sessions</a> &nbsp;&nbsp;|&nbsp;&nbsp;
-  <a href="logger_user.php">Logs utilisateur</a> &nbsp;&nbsp;|&nbsp;&nbsp;
+  <a href="utilisateurs.php">Logs utilisateur</a> &nbsp;&nbsp;|&nbsp;&nbsp;
   <a href="logger_actions.php">Actions</a>
 </td></tr>
 </table>
index 96bb96a..1488c7d 100644 (file)
@@ -1,4 +1,4 @@
-{* $Id: logger-view.tpl,v 1.3 2004-08-24 09:07:57 x2000habouzit Exp $ *}
+{* $Id: logger-view.tpl,v 1.4 2004-08-26 12:31:15 x2000habouzit Exp $ *}
 
 <div class="rubrique">
   Parcours des logs du site
 
 <table class="bicol">
 <tr>
-  <th colspan="2">Propri&eacute;t&eacute;s de la session</th>
+  <th colspan="2">{$msg_session_properties}</th>
 </tr>
 <tr class="impair">
-  <td><strong>user</strong></td>
+  <td class="titre">{$msg_user}</td>
   <td>{$session.username} {if $session.suer}(suid by {$session.suer}){/if} [<a href="?logauth={$session.auth}&amp;loguser={$session.username}">user's log</a>]</td>
 </tr>
 <tr class="pair">
-  <td><strong>hote</strong></td>
-  <td><tt>IP: {$session.ip}</tt><br /><em>{$session.host}</em></td>
+  <td class="titre">{$msg_host}</td>
+  <td><em>{$session.host}</em> <tt>IP: {$session.ip}</tt></td>
 </tr>
 <tr class="impair">
-  <td><strong>browser</strong></td>
+  <td class="titre">{$msg_browser}</td>
   <td>{$session.browser}</td>
 </tr>
 </table>
@@ -30,9 +30,9 @@
 
 <table class="bicol">
 <tr>
-  <th>stamp</th>
-  <th>action</th>
-  <th>data</th>
+  <th>{$msg_date}</th>
+  <th>{$msg_action}</th>
+  <th>{$msg_data}</th>
 </tr>
 {foreach from=$events item=myevent}
 <tr class="{cycle values="impair,pair"}">
 {/foreach}
 </table>
 
-
 {else}
 
 <form method="post" action="{$smarty.server.PHP_SELF}">
 <table class="bicol">
 <tr>
-  <th colspan="2">filter by..</th>
+  <th colspan="2">{$msg_filter_by}</th>
 </tr>
 <tr>
-  <td>..<strong>date</strong></td>
+  <td><strong>{$msg_date}</strong></td>
   <td>
-    year
+    {$msg_year}
     <select name="year" onchange="this.form.submit()">
       {html_options options=$years selected=$year}
     </select>
-    &nbsp;month
+    &nbsp;{$msg_month}
     <select name="month" onchange="this.form.submit()">
       {html_options options=$months selected=$month}
     </select>
-    &nbsp;day
+    &nbsp;{$msg_day}
     <select name="day" onchange="this.form.submit()">
       {html_options options=$days selected=$day}
     </select>
   </td>
 </tr>
 <tr>
-  <td>..<strong>user</strong></td>
+  <td><strong>{$msg_user}</strong></td>
   <td>
     <input type="text" name="loguser" value="{$loguser}" />
     {html_options name="logauth" options=$auths selected=$logauth}
-    <input type="submit" />
+    <input type="submit" value="{$msg_submit}" />
   </td>
 </tr>
 </table>
 
 <table class="bicol" style="font-size: 90%">
   <tr>
-    <th>start</th>
-    <th>user</th>
-    <th>summary</th>
-    <th>actions</th>
+    <th>{$msg_start}</th>
+    <th>{$msg_user}</th>
+    <th>{$msg_summary}</th>
+    <th>{$msg_actions}</th>
   </tr>
 {foreach from=$sessions item=mysess}
   <tr class="{cycle values="impair,pair"}">
 {/foreach}
     </td>
   </tr>
-{/foreach}
+  {/foreach}
+{if $msg_nofilters}
+<tr>
+  <td>{$msg_nofilters}</td>
+</tr>
+{/if}
 </table>
 {/if}
 
index 4981732..497238c 100644 (file)
@@ -1,4 +1,4 @@
-{* $Id: table-editor.tpl,v 1.6 2004-08-24 09:07:57 x2000habouzit Exp $ *}
+{* $Id: table-editor.tpl,v 1.7 2004-08-26 12:31:15 x2000habouzit Exp $ *}
 
 {dynamic}
 
@@ -9,29 +9,31 @@
 {if !$doedit}
 
 {literal}
-<script language="javascript" type="text/javascript">
+<script type="text/javascript">
   <!--
   function del( myid ) {
     if (confirm ("You are about to delete this entry. Do you want to proceed?")) {
-      document.operations.action.value = "del";
-      document.operations.{/literal}{$prefix}{literal}id.value = myid;
-      document.operations.submit();
+      document.forms.operations.action.value = "del";
+      document.forms.operations.{/literal}{$prefix}{literal}id.value = myid;
+      document.forms.operations.submit();
       return true;
     }
   }
   function edit( myid ) {
-    document.operations.action.value = "edit";
-    document.operations.{/literal}{$prefix}{literal}id.value = myid;
-    document.operations.submit();
+    document.forms.operations.action.value = "edit";
+    document.forms.operations.{/literal}{$prefix}{literal}id.value = myid;
+    document.forms.operations.submit();
     return true;
   }
   // -->
 </script>
 {/literal}
 
-<form method="post" action="{$smarty.server.PHP_SELF}" name="operations">
-<input type="hidden" name="action" value="" />
-<input type="hidden" name="{$prefix}id" value="" />
+<form method="post" action="{$smarty.server.PHP_SELF}" id="operations">
+  <div>
+    <input type="hidden" name="action" value="" />
+    <input type="hidden" name="{$prefix}id" value="" />
+  </div>
 </form>
 
 <table class="bicol">
 {else}
 
 <form method="post" action="{$smarty.server.PHP_SELF}">
-  <input type="hidden" name="action" value="update" />
-  {if $id!=''}
-  <input type="hidden" name="{$prefix}id" value="{$id}"/>
-  {/if}
   <table class="bicol">
     <tr class="impair">
       <th colspan="2">
-        {if $id!=''}modification de l'entrée {$id}
-        {else}nouvelle entrée{/if}
+        <input type="hidden" name="action" value="update" />
+        {if $id!=''}
+        <input type="hidden" name="{$prefix}id" value="{$id}"/>
+        modification de l'entrée 
+        {else}
+        nouvelle entrée
+        {/if}
       </th>
     </tr>
     {foreach from=$vars key=mykey item=myval}