From 6a84cec4313304ef1a2d7d93bfa3e01cfa1c6706 Mon Sep 17 00:00:00 2001
From: x2000habouzit
Date: Wed, 4 Feb 2004 23:22:03 +0000
Subject: [PATCH] =?utf8?q?pleins=20de=20petits=20bugfixes.=20il=20reste=20?=
=?utf8?q?des=20bugs=20sur=20les=20pages=20en=20'x'=20uniquement,=20mais?=
=?utf8?q?=20c'est=20pas=20certifi=E9=20sans=20bug=20pour=20les=20autres?=
=?utf8?q?=20...?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
bonne nuit
---
etat_migration | 26 +++++++++++++-------------
htdocs/admin/postfix_blacklist.php | 4 ++--
htdocs/admin/postfix_perm.php | 6 +++---
htdocs/admin/postfix_retardes.php | 6 +++---
htdocs/pattecassee.php | 6 +++---
htdocs/rss.php | 2 +-
htdocs/stats/coupure.php | 4 ++--
include/nonhtml.inc.php | 19 ++++++++++++++++++-
templates/admin/postfix.common.tpl | 8 ++++----
templates/pattecassee.tpl | 4 ++--
templates/stats/coupure.tpl | 8 +++-----
11 files changed, 54 insertions(+), 39 deletions(-)
diff --git a/etat_migration b/etat_migration
index 97810f1..e964ea8 100644
--- a/etat_migration
+++ b/etat_migration
@@ -139,31 +139,28 @@ Etat | Ancien nom | Nouveau nom
------+-------------------------------------------+----------------
@@@ | groupex/donne-chall.php | -
@@@ | groupex/export-econfiance.php | -
-x | admin/graph_promo.php | stats/graph_promo.php
-x | admin/index.php | -
-x | admin/postfix_blacklist.php | -
-x | admin/postfix_perm.php | -
-x | admin/postfix_retardes.php | -
-x | admin/stats_promo.php | stats/stats_promo.php
-x | coupure.php | stats/coupure.php
+x | coupure.php | stats/coupure.php -> encore un pb (afficher deux coupures d'affilée)
x | domaineperso.php | -
-x | dons.php | -
x | epouse.php | -
x | groupex.php | groupex/index.php
-x | nbpromo2.php | stats/nb_by_promo.php
x | parselog.php | stats/...
-x | pattecassee.php | -
-x | rss.php | -
+x | pattecassee.php | - -> encore buggué
x | sendmail.php | -
x | trackers/index.php | -
x | trackers/tracker_admin.php | -
xx | AccesPermanentOff.php | cookie_off.php
xx | AccesPermanentOn.php | cookie_on.php
-xx | acces_wap.php | -
-xx | admin/deces_promo.php | -
xx | acces_redirect.php | carva_redirect.php
xx | acces_smtp.php | -
+xx | acces_wap.php | -
xx | admin/ax-xorg.php | -
+xx | admin/deces_promo.php | -
+xx | admin/graph_promo.php | stats/graph_promo.php
+xx | admin/index.php | -
+xx | admin/postfix_blacklist.php | -
+xx | admin/postfix_perm.php | -
+xx | admin/postfix_retardes.php | -
+xx | admin/stats_promo.php | stats/stats_promo.php
xx | admin/valider.php | -
xx | alias.php | -
xx | antispam.php | -
@@ -186,6 +183,7 @@ xx | docs/doc_patte_cassee.php | -
xx | docs/doc_smtp.php | -
xx | docs/doc_ssl.php | -
xx | docs/index.php | -
+xx | dons.php | -
xx | ethique.php | docs/ethique.php
xx | exit.php | -
xx | faq.php | docs/faq.php
@@ -193,7 +191,9 @@ xx | getphoto.php | -
xx | index.php | -
xx | login.php | -
xx | motdepassemd5.php | -
+xx | nbpromo2.php | stats/nb_by_promo.php
xx | preferences.php | -
+xx | rss.php | -
xx | secu.php | docs/secu.php
xx | skins.php | -
xx | vcard.php | -
diff --git a/htdocs/admin/postfix_blacklist.php b/htdocs/admin/postfix_blacklist.php
index 52f4429..cb8dfbc 100644
--- a/htdocs/admin/postfix_blacklist.php
+++ b/htdocs/admin/postfix_blacklist.php
@@ -16,9 +16,9 @@ if(isset($_REQUEST['nomligne'])) {
$blacklist = Array();
$fd = fopen ("/etc/postfix/spamaccess", "r");
-while (!feof ($fd)) {
+while ($fd && !feof ($fd)) {
$buffer = fgets($fd, 4096);
- if ($buffer[0]!='#' && (strlen($buffer)>1) { # FIXME $string[i] is deprecated
+ if ($buffer[0]!='#' && (strlen($buffer)>1)) { # FIXME $string[i] is deprecated
$blacklist[] = $buffer;
}
}
diff --git a/htdocs/admin/postfix_perm.php b/htdocs/admin/postfix_perm.php
index 26a4cf2..0936d95 100644
--- a/htdocs/admin/postfix_perm.php
+++ b/htdocs/admin/postfix_perm.php
@@ -1,5 +1,5 @@
1) { # FIXME $string[i] is deprecated
+ if ($buffer[0]!='#' && (strlen($buffer)>1)) { # FIXME $string[i] is deprecated
$permis[] = $buffer;
}
}
diff --git a/htdocs/admin/postfix_retardes.php b/htdocs/admin/postfix_retardes.php
index e286b85..8eb7989 100644
--- a/htdocs/admin/postfix_retardes.php
+++ b/htdocs/admin/postfix_retardes.php
@@ -1,5 +1,5 @@
1) { # FIXME $string[i] is deprecated
+ if ($buffer[0]!='#' && (strlen($buffer)>1)) { # FIXME $string[i] is deprecated
$retard[] = $buffer;
}
}
diff --git a/htdocs/pattecassee.php b/htdocs/pattecassee.php
index 3e2837e..f1281ca 100644
--- a/htdocs/pattecassee.php
+++ b/htdocs/pattecassee.php
@@ -50,7 +50,7 @@ L'
$mail->send();
$page->assign('erreur', "Mail envoyé ! :o)");
}
-} else if (array_key_exists('email', $_POST)) {
+} elseif (array_key_exists('email', $_POST)) {
$email = valide_email($_POST['email']);
$page->assign('email',$email);
$sel = mysql_query("SELECT e1.uid, e1.panne != 0 AS panne, count(e2.uid) AS nb_mails, u.nom, u.prenom, u.promo"
@@ -61,8 +61,8 @@ L'
." GROUP BY e1.uid");
if ($x = mysql_fetch_assoc($sel)) {
// on écrit dans la base que l'adresse est cassée
- if (!$x['panne'])
- mysql_query("UPDATE emails SET panne='".date("Y-m-d")."' WHERE email = '".$email."'");
+ if (!$x['panne'])
+ mysql_query("UPDATE emails SET panne='".date("Y-m-d")."' WHERE email = '".$email."'");
$page->assign_by_ref('x',$x);
}
}
diff --git a/htdocs/rss.php b/htdocs/rss.php
index 95292e0..101707a 100644
--- a/htdocs/rss.php
+++ b/htdocs/rss.php
@@ -9,7 +9,7 @@ if (isset($_REQUEST["promo"])) {
}
$requete.=" ORDER BY (e.promo_min != 0 AND e.promo_max != 0) DESC, e.peremption";
-$page->msyql_assign($requete,'rss');
+mysql_assign($page,$requete,'rss');
header("Content-Type: text/xml");
$page->display('rss.tpl');
diff --git a/htdocs/stats/coupure.php b/htdocs/stats/coupure.php
index fc68bf5..9f0e789 100644
--- a/htdocs/stats/coupure.php
+++ b/htdocs/stats/coupure.php
@@ -1,13 +1,13 @@
assign_by_ref('cp',$cp);
} else {
$beginning_date = date("Ymd", time() - 3600*24*21) . "000000";
diff --git a/include/nonhtml.inc.php b/include/nonhtml.inc.php
index c518cfc..ef8410c 100644
--- a/include/nonhtml.inc.php
+++ b/include/nonhtml.inc.php
@@ -1,8 +1,25 @@
assign_by_ref($var_name,$array);
+ if(!empty($var_nb_name))
+ $page->assign($var_nb_name, count($array));
+ return 0;
+}
+
$page = new Smarty();
$page->template_dir = $globals->spoolroot . "/templates/";
diff --git a/templates/admin/postfix.common.tpl b/templates/admin/postfix.common.tpl
index d0685eb..c9af14c 100644
--- a/templates/admin/postfix.common.tpl
+++ b/templates/admin/postfix.common.tpl
@@ -1,4 +1,4 @@
-{* $Id: postfix.common.tpl,v 1.1 2004-02-04 19:47:47 x2000habouzit Exp $ *}
+{* $Id: postfix.common.tpl,v 1.2 2004-02-04 23:22:05 x2000habouzit Exp $ *}
{dynamic}
{$erreur}
@@ -8,9 +8,9 @@
page d'admin |
-blacklist |
-permissions |
-mails retardés
+blacklist |
+permissions |
+mails retardés
{$expl}
diff --git a/templates/pattecassee.tpl b/templates/pattecassee.tpl
index 5efe1b1..e903e76 100644
--- a/templates/pattecassee.tpl
+++ b/templates/pattecassee.tpl
@@ -1,4 +1,4 @@
-{* $Id: pattecassee.tpl,v 1.1 2004-02-04 19:47:47 x2000habouzit Exp $ *}
+{* $Id: pattecassee.tpl,v 1.2 2004-02-04 23:22:05 x2000habouzit Exp $ *}
{dynamic on="0$erreur"}
{$erreur}
@@ -27,7 +27,7 @@
Nous t'invitons à prendre contact avec lui autrement que par email,
l'idéal étant de l'informer si possible que sa patte Polytechnique.org est cassée...!
-{else}
+{elseif $email}
Désolé mais plus personne n'utilise l'adresse {$email} comme adresse de redirection.
Nous ne pouvons donc malheureusement te fournir aucune information...
diff --git a/templates/stats/coupure.tpl b/templates/stats/coupure.tpl
index 544193b..f7d655f 100644
--- a/templates/stats/coupure.tpl
+++ b/templates/stats/coupure.tpl
@@ -1,16 +1,14 @@
-{* $Id: coupure.tpl,v 1.1 2004-02-04 19:47:48 x2000habouzit Exp $ *}
+{* $Id: coupure.tpl,v 1.2 2004-02-04 23:22:05 x2000habouzit Exp $ *}
{dynamic}
-
{if $cp}
-
détails de l'interruption de service |
|
début |
- {$cp.debut|date_forma:"%d/%m/%Y, %Hh%M"} |
+ {$cp.debut|date_format:"%d/%m/%Y, %Hh%M"} |
durée |
@@ -75,7 +73,7 @@
{/foreach}
-
+{/if}
{/dynamic}
{* vim:set et sw=2 sts=2 sws=2: *}
--
2.1.4