From: x2000habouzit
Date: Wed, 4 Feb 2004 19:47:45 +0000 (+0000)
Subject: BIG commit.
X-Git-Tag: xorg/old~1907
X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=45b76a2eccfad963c03bc4be301910c3c920048c;p=platal.git
BIG commit.
c'est le travail de 4 jours sans le net ://///
ATTENTION, je n'ai pas pu tester le code, les pages sont donc marquées en 'x' dans la liste des pages basculées, je vais tenter de déboguer ca (c même pas sur que ca compile ...) mais rien ne vous interdit d'y jeter un oueil.
désolé pour le log pourri, mais bon, 50 logs à se taper c chiant ....
---
diff --git a/etat_migration b/etat_migration
index 03c2aa3..79c478a 100644
--- a/etat_migration
+++ b/etat_migration
@@ -3,45 +3,29 @@
,---------------------.
| NB Etats : |
| -> rien de fait |
-| x -> en cours |
+| x -> à tester |
| xx -> en templates |
| xxx -> anonyme |
+| !!! -> postponned |
| --- -> supprimée |
+| @@@ -> non modifiée |
`---------------------'
# PS pour trier : V...:!sort
------+-------------------------------------------+----------------
Etat | Ancien nom | Nouveau nom
-------+-------------------------------------------+----------------
- | acces_wap.php |
+------+-[ admin ]---------------------------------+----------------
+ | admin/FormatePrenomNOM.php |
+ | admin/FormatePrenomNOM2.php |
| admin/admin_faqs.php |
| admin/admin_trombino.php |
- | admin/ax-xorg.php |
| admin/comptesPOP.php |
| admin/correction_adr.php |
- | admin/deces_promo.php |
| admin/envoidirect.php |
| admin/evenements.php |
- | admin/FormatePrenomNOM2.php |
- | admin/FormatePrenomNOM.php |
- | admin/gerer_applis.php |
- | admin/gerer_auth-groupex.php |
- | admin/gerer_binets.php |
- | admin/gerer_coupure.php |
- | admin/gerer_groupesx.php |
- | admin/gerer_listes.php |
- | admin/gerer_paiement.php |
- | admin/gerer_skins.php |
- | admin/gerer_sondages.php |
- | admin/graph_promo.php |
| admin/homonymes.php |
- | admin/index.php |
| admin/ins_confirmees.php |
- | admin/logger_actions.php |
- | admin/logger_events.php |
- | admin/logger.php |
- | admin/logger_user.php |
| admin/marketing.php |
| admin/marketing_promo.php |
| admin/marketing_volontaire.php |
@@ -50,33 +34,22 @@ Etat | Ancien nom | Nouveau nom
| admin/newsletter_pattecassee.php |
| admin/newsletter_prep.php |
| admin/pg.php |
- | admin/postfix_blacklist.php |
- | admin/postfix_perm.php |
- | admin/postfix_retardes.php |
| admin/relance.php |
- | admin/stats_promo.php |
- | admin/statut_antispam.php |
+ | admin/utilisateurs.php |
| admin/utilisateurs_identification.php |
| admin/utilisateurs_marketing.php |
- | admin/utilisateurs.php |
- | confbanana.php |
- | coupure.php | stats/coupure.php
+------+-[ docs ]----------------------------------+----------------
| docs/FROM.php | docs/from.php
- | domaineperso.php |
- | domaine.php |
- | dons.php |
- | emails.php |
- | emploi.php |
- | emploi_public.php |
| en-cours.php | docs/en-cours.php
- | epouse.php |
- | evenements.php |
- | groupex/donne-chall.php |
- | groupex/export-econfiance.php |
- | groupex.php |
- | index.coupure.php |
- | info-groupesx.php |
- | inscrire.php |
+ | info-groupesx.php | docs/info-groupesx.php
+ | plan.php | ? docs/plan.php
+ | services.php | docs/services.php
+------+-[ stats ]---------------------------------+----------------
+ | parselogD.php | stats/...
+ | parselogN.php | stats/...
+ | parselogR.php | stats/...
+ | stats.php | stats/index.php
+------+-[ listes ]--------------------------------+----------------
| listes/creation.php |
| listes/gere_listes.php |
| listes/gere_msg.php |
@@ -84,69 +57,109 @@ Etat | Ancien nom | Nouveau nom
| listes/liste.php |
| listes/mailtoins.inc.php |
| listes/trombiliste.php |
- | maj.php |
- | marketing.php |
- | mescontacts_pdf.php |
- | mescontacts.php |
- | news/abonnements.php |
- | news/article.php |
- | news/attachment.php |
- | news/config.news.inc.php |
- | news/faq_admin.php |
- | news/index.php |
- | newsletter.php |
- | newsletter_req.php |
- | news/newsportal.php |
- | news/offreemploi.php |
- | news/post.php |
- | news/thread.php |
+------+-[ paiement ]------------------------------+----------------
| paiement/cyberpaiement.inc.php |
| paiement/cyberpaiement_retour.php |
| paiement/index.php |
- | parselogD.php | stats/...
- | parselogN.php | stats/...
- | parselog.php | stats/...
- | parselogR.php | stats/...
- | pattecassee.php |
- | pg.confirm.php |
- | pg.php |
- | plan.php | ? docs/plan.php
- | profil2.php |
- | profil.php |
- | recherche.php |
- | recovery.php |
- | redirect/error.php |
- | redirect/redirect.php |
- | routage-mail.php |
- | rss.php |
- | sendmail.php |
- | services.php | docs/services.php
+------+-[ sondages ]------------------------------+----------------
| sondage/accueil.php |
| sondage/bloc.php |
| sondage/droits.php |
| sondage/exemples.php |
| sondage/modifie.php |
- | sondage/questionnaire.php |
| sondage/question.php |
+ | sondage/questionnaire.php |
| sondage/reponse.php |
| sondage/resultats.php |
| sondage/titre.php |
| sondage/validation.php |
- | stats.php | stats/index.php
- | step4.php |
- | tmpPWD.php |
- | trackers/index.php |
- | trackers/tracker_admin.php |
- | trackers/tracker_delete.php |
- | trackers/tracker_show.php |
- | trackers/tracker_show_rq.php |
+------+-[ trezo ]---------------------------------+----------------
| trezo/gere_operations.php |
| trezo/index.php |
| trezo/trezo.inc.php |
+------+-[ emails ... ]----------------------------+----------------
+ | emails.php |
+ | routage-mail.php |
+------+-[ inscription + mdp ]---------------------+----------------
+ | inscrire.php |
+ | maj.php |
+ | recovery.php |
+ | step4.php |
+ | tmpPWD.php |
+------+-[ bordel ]--------------------------------+----------------
+ | domaine.php |
+ | emploi.php |
+ | emploi_public.php |
+ | evenements.php |
+ | index.coupure.php |
+ | marketing.php |
+ | mescontacts.php |
+ | mescontacts_pdf.php |
+ | newsletter.php |
+ | newsletter_req.php |
+ | pg.confirm.php |
+ | pg.php |
+ | profil.php |
+ | profil2.php |
+ | recherche.php |
+ | redirect/error.php |
+ | redirect/redirect.php |
| trombino.php |
| trombipromo.php |
| x.php |
+------+-[ admin ]---------------------------------+----------------
+!!! | admin/gerer_applis.php | \
+!!! | admin/gerer_auth-groupex.php | |
+!!! | admin/gerer_binets.php | |
+!!! | admin/gerer_coupure.php | |
+!!! | admin/gerer_groupesx.php | > utiliser les classes Diogènes, j'ai pas diogènes hors ligne :/
+!!! | admin/gerer_listes.php | |
+!!! | admin/gerer_paiement.php | |
+!!! | admin/gerer_skins.php | |---> mef la table a changé
+!!! | admin/gerer_sondages.php | /
+!!! | admin/logger.php | \
+!!! | admin/logger_actions.php | \ Utiliser les classes de Jeremy, donc pour plus tard
+!!! | admin/logger_events.php | /
+!!! | admin/logger_user.php | /
+------+-[ news ]----------------------------------+----------------
+!!! | news/abonnements.php | \
+!!! | news/article.php | |
+!!! | news/attachment.php | |
+!!! | news/config.news.inc.php | |
+!!! | news/faq_admin.php | \ s'en débarasser ?
+!!! | news/index.php | /
+!!! | news/newsportal.php | |
+!!! | news/offreemploi.php | |
+!!! | news/post.php | |
+!!! | news/thread.php | /
+!!! | confbanana.php | -> dépend de banana, à passer plus tard ...
+------+-[ trackers ]------------------------------+----------------
+ x | trackers/tracker_show.php | -
+ x | trackers/tracker_show_rq.php | -
------+-------------------------------------------+----------------
+@@@ | groupex/donne-chall.php | -
+@@@ | groupex/export-econfiance.php | -
+x | acces_wap.php | -
+x | admin/ax-xorg.php | -
+x | admin/deces_promo.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 | 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 | 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_redirect.php | carva_redirect.php
@@ -180,12 +193,13 @@ xx | getphoto.php | -
xx | index.php | -
xx | login.php | -
xx | motdepassemd5.php | -
-xx | nbpromo2.php | stats/nb_by_promo.php
xx | preferences.php | -
xx | secu.php | docs/secu.php
xx | skins.php | -
xx | vcard.php | -
------+-------------------------------------------+----------------
---- | aide.php |
---- | auth-wiki.php |
+--- | trackers/tracker_delete.php | -
+--- | admin/statut_antispam.php | inutilisée et même pas en var superglobales ...
+--- | aide.php | --> faq.php
+--- | auth-wiki.php | obsolete
------+-------------------------------------------+----------------
diff --git a/guide-todo b/guide-todo
new file mode 100644
index 0000000..7283862
--- /dev/null
+++ b/guide-todo
@@ -0,0 +1,31 @@
+CSS :
+ - éviter autant que possible les hook en head inutiles pour des css
+ - récupérer la classe css qui vous convient le mieux dans les existantes,
+ et sinon, créer une classe la plus générale possible (factorisation de la css -> plus rapide à parser, à dl, etc ...)
+ - ajouter *qqs* ID bien particuliers : #skin (fait), #x (pour x.php), #profil (pour le profil) ...
+
+XHTML :
+ - b, u, i, center, font, ... sont à proscrire (utiliser em, strong ou des css)
+ - (v)align=, border=, ... sont à proscrire (utiliser les css qvb ou un style=)
+ - les attributs/balises sont en minuscule
+ - les balises ferment toutes (attention, à cause de certains browsers,
est à éviter, utiliser
etc ...)
+
+Code :
+ - passer les validations en templates correctement
+ - optimiser le cache (y'a surement des erreurs de cache d'ailleurs)
+ - utiliser XOrgPage::mysql_assign(...) au lieu de :
+ ,-------------------------------------------------
+ | $res = mysql_query(...);
+ | $truc = array();
+ | while($truc[] = mysql_fetch_assoc($res));
+ | array_pop($truc);
+ | mysql_free_result($res);
+ `-------------------------------------------------
+
+TODO:
+ - revérifier tous les liens du site une fois basculé (utiliser tjs {"..."|url} et mettre à jour les liens)
+ - regarder du coté de $default_modifiers pour éviter de l'injection de code (genre array('escape:"html"'))
+ - compile_check à false pour le site de prod ...
+ - affiner le cache :
+ pour les pages dont la modification est controlée, faire détuire le cache et utiliser is_cached
+ (exemple : liste des trackers ... liste des domaines ... etc)
diff --git a/htdocs/acces_wap.php b/htdocs/acces_wap.php
new file mode 100644
index 0000000..bb56655
--- /dev/null
+++ b/htdocs/acces_wap.php
@@ -0,0 +1,45 @@
+assign('OK',true);
+ $page->display('OK');
+} else { // pas de formulaire soumis
+ $sql = "SELECT FIND_IN_SET('actif',flags) AS actif,
+ FIND_IN_SET('useimage',flags) AS useimage,
+ screenwidth,screenheight,fromaddr,otheraddr,
+ FIND_IN_SET('ccfrom',flags) AS ccfrom,
+ IMAPserver,IMAPport,IMAPdir,
+ FIND_IN_SET('IMAPssl',flags) AS IMAPssl
+ FROM wap WHERE uid = ".$_SESSION['uid'];
+ $result = mysql_query($sql);
+
+ if (mysql_num_rows($result)==0) {
+ //l'utilisateur n'a pas de profil WAP => on le crée
+ mysql_query("INSERT INTO wap (uid) VALUES (".$_SESSION['uid'].")");
+ $result = mysql_query($sql);
+ }
+
+ $page->assign('wap', mysql_fetch_assoc($result));
+ mysql_free_result($result);
+}
+?>
diff --git a/htdocs/admin/ax-xorg.php b/htdocs/admin/ax-xorg.php
new file mode 100644
index 0000000..ac2f862
--- /dev/null
+++ b/htdocs/admin/ax-xorg.php
@@ -0,0 +1,29 @@
+mysql_assign($sql,'diffs','nb_diffs');
+
+// gens à l'ax mais pas chez nous
+$sql = "SELECT ia.promo,ia.nom,ia.nom_patro,ia.prenom
+ FROM identification_ax as ia
+ LEFT JOIN identification AS i ON i.matricule_ax = ia.matricule_ax
+ WHERE i.nom IS NULL";
+$page->mysql_assign($sql,'mank','nb_mank');
+
+// gens chez nous et pas à l'ax
+$sql = "SELECT promo,nom,prenom FROM identification WHERE matricule_ax IS NULL";
+$page->mysql_assign($sql,'plus','nb_plus');
+
+
+$page->display();
+?>
diff --git a/htdocs/admin/deces_promo.php b/htdocs/admin/deces_promo.php
new file mode 100644
index 0000000..c864a31
--- /dev/null
+++ b/htdocs/admin/deces_promo.php
@@ -0,0 +1,24 @@
+assign('promo',$promo);
+
+if (isset($_REQUEST["valider"]) && $_REQUEST["valider"] == "Valider") {
+ $res = mysql_query("SELECT matricule FROM identification WHERE promo = $promo");
+ while (list($mat) = mysql_fetch_row($res)) {
+ mysql_query("UPDATE identification SET deces='".$_REQUEST[$mat]."' WHERE matricule = '".$mat."'");
+ }
+}
+
+$sql = "SELECT matricule, nom, prenom, deces FROM identification WHERE promo = $promo ORDER BY nom,prenom";
+$page->mysql_assign($sql, 'decedes');
+
+$page->display();
+?>
diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php
new file mode 100644
index 0000000..a74573d
--- /dev/null
+++ b/htdocs/admin/index.php
@@ -0,0 +1,6 @@
+display();
+?>
diff --git a/htdocs/admin/postfix_blacklist.php b/htdocs/admin/postfix_blacklist.php
new file mode 100644
index 0000000..52f4429
--- /dev/null
+++ b/htdocs/admin/postfix_blacklist.php
@@ -0,0 +1,31 @@
+assign('erreur', "Action: DEL($nomligne)");
+ } else if (!empty($_REQUEST['add'])) {
+ exec("/home/web/spam/ajouterBlacklist ".$nomligne);
+ $page->assign('erreur', "Action: ADD($nomligne)");
+ }
+}
+
+$blacklist = Array();
+$fd = fopen ("/etc/postfix/spamaccess", "r");
+while (!feof ($fd)) {
+ $buffer = fgets($fd, 4096);
+ if ($buffer[0]!='#' && (strlen($buffer)>1) { # FIXME $string[i] is deprecated
+ $blacklist[] = $buffer;
+ }
+}
+fclose($fd);
+
+$page->assign_by_ref('list',$blacklist);
+$page->assign('title','Bannis de polytechnique.org');
+$page->assign('expl','Ne mettre dans les cases que des emails (aucun espace ni commentaire supplémentaire)');
+$page->display();
+?>
diff --git a/htdocs/admin/postfix_perm.php b/htdocs/admin/postfix_perm.php
new file mode 100644
index 0000000..26a4cf2
--- /dev/null
+++ b/htdocs/admin/postfix_perm.php
@@ -0,0 +1,31 @@
+assign('erreur', "Action: DEL($nomligne)");
+ } else if (!empty($_REQUEST['add'])) {
+ exec("/home/web/spam/ajouterPermissions '".$nomligne."'");
+ $page->assign('erreur', "Action: ADD($nomligne)");
+ }
+}
+
+$permis = Array();
+$fd = fopen ("/etc/postfix/spampermis", "r");
+while (!feof ($fd)) {
+ $buffer = fgets($fd, 4096);
+ if ($buffer[0]!='#' && (strlen($buffer)>1) { # FIXME $string[i] is deprecated
+ $permis[] = $buffer;
+ }
+}
+fclose($fd);
+
+$page->assign_by_ref('list',$blacklist);
+$page->assign('title','Permissions de polytechnique.org');
+$page->assign('expl','On peut placer dans les cases les emails de personnes pouvant diffuser sans restriction.');
+$page->display();
+?>
diff --git a/htdocs/admin/postfix_retardes.php b/htdocs/admin/postfix_retardes.php
new file mode 100644
index 0000000..e286b85
--- /dev/null
+++ b/htdocs/admin/postfix_retardes.php
@@ -0,0 +1,25 @@
+assign('erreur', "Action: DEL({$_REQUEST['nomligne']})");
+}
+
+$retard = Array();
+$fd = fopen ("/etc/postfix/spamdefer", "r");
+
+while (!feof ($fd)) {
+ $buffer = fgets($fd, 4096);
+ if ($buffer[0]!='#' && (strlen($buffer)>1) { # FIXME $string[i] is deprecated
+ $retard[] = $buffer;
+ }
+}
+fclose($fd);
+
+$page->assign_by_ref('list',$blacklist);
+$page->assign('title','Mails retardés de polytechnique.org');
+$page->assign('expl','Les envoyeurs ici présents verront leurs mails retardés toutes les heures jusqu\'au délai de 5j (bounce). Placer ici uniquement des emails (pas de commentaires).');
+$page->display();
+?>
diff --git a/htdocs/domaineperso.php b/htdocs/domaineperso.php
new file mode 100644
index 0000000..700ba40
--- /dev/null
+++ b/htdocs/domaineperso.php
@@ -0,0 +1,16 @@
+assign('result', add_domain($_REQUEST['dnom']));
+
+$domaines = liste_domaines():
+
+$page->assign('nb_dom',count($domaines));
+$page->assign_by_ref('domaines',$domaines);
+
+$page->display();
+?>
diff --git a/htdocs/dons.php b/htdocs/dons.php
new file mode 100644
index 0000000..b3144bf
--- /dev/null
+++ b/htdocs/dons.php
@@ -0,0 +1,5 @@
+display();
+?>
diff --git a/htdocs/epouse.php b/htdocs/epouse.php
new file mode 100644
index 0000000..7225c88
--- /dev/null
+++ b/htdocs/epouse.php
@@ -0,0 +1,36 @@
+assign('not_femme',!$flags->hasflag("femme"));
+
+$epouse = replace_accent(trim(clean_request('epouse')));
+$epouse = strtoupper($epouse);
+$page->assign('epouse_req',$epouse);
+
+if (!empty($_REQUEST['submit']) && ($epouse != $epouse_old)) {
+ // on vient de recevoir une requete, differente de l'ancien nom de mariage
+ if ($epouse == $nom) {
+ $page->assign('same',true);
+ } else { // le nom de mariage est distinct du nom à l'X
+ // on calcule l'alias pour l'afficher
+ $myepouse = new EpouseReq($_SESSION['uid'], $_SESSION['username'], $epouse);
+ list($prenom_username,) = explode('.',$_SESSION['username']);
+ $alias_old=make_username($prenom_username,$epouse_old);
+ $myepouse->submit();
+
+ $page->assign('epouse_old',$epouse_old);
+ $page->assign('alias_old',$alias_old);
+ $page->assign('myepouse',$myepouse);
+ }
+}
+
+$page->display($flags->hasflag("femme") ? '' : 'not_femme');
+?>
diff --git a/htdocs/groupex/donne-chall.php b/htdocs/groupex/donne-chall.php
new file mode 100644
index 0000000..f982c7c
--- /dev/null
+++ b/htdocs/groupex/donne-chall.php
@@ -0,0 +1,10 @@
+
diff --git a/htdocs/groupex/export-econfiance.php b/htdocs/groupex/export-econfiance.php
new file mode 100644
index 0000000..e535a25
--- /dev/null
+++ b/htdocs/groupex/export-econfiance.php
@@ -0,0 +1,32 @@
+\n\n\n\n";
+
+while (list ($prenom1,$nom1,$email1) = mysql_fetch_row($all)) {
+ $res .= "\n";
+ $res .= "\t".$nom1."\n";
+ $res .= "\t".$prenom1."\n";
+ $res .= "\t".$email1."\n";
+ $res .= "\n\n";
+}
+mysql_free_result($all);
+
+$res .= "\n\n";
+
+echo $res;
+
+}
+
+?>
diff --git a/htdocs/groupex/index.php b/htdocs/groupex/index.php
new file mode 100644
index 0000000..2e97041
--- /dev/null
+++ b/htdocs/groupex/index.php
@@ -0,0 +1,13 @@
+assign('nb_dom',count($domaines));
+$page->assign_by_ref('domaines',$domaines);
+
+$page->display();
+?>
diff --git a/htdocs/login.php b/htdocs/login.php
index d029be7..05f0b3c 100644
--- a/htdocs/login.php
+++ b/htdocs/login.php
@@ -53,18 +53,14 @@ $page->assign_by_ref('publicite', $publicite);
// affichage des evenements
// annonces promos triées par présence d'une limite sur les promos
// puis par dates croissantes d'expiration
-$res = mysql_query(
- "SELECT e.id,e.titre,e.texte,a.username,a.nom,a.prenom,a.promo
+$sql = "SELECT e.id,e.titre,e.texte,a.username,a.nom,a.prenom,a.promo
FROM evenements AS e INNER JOIN auth_user_md5 AS a
ON e.user_id=a.user_id
WHERE FIND_IN_SET(flags, 'valide') AND peremption >= NOW()
AND (e.promo_min = 0 || e.promo_min <= {$_SESSION['promo']})
AND (e.promo_max = 0 || e.promo_max >= {$_SESSION['promo']})
- ORDER BY (e.promo_min != 0 AND e.promo_max != 0) DESC, e.peremption");
-$evenement = Array();
-while($evenement[] = mysql_fetch_assoc($res));
-@array_pop($evenement);
-mysql_free_result($res);
-$page->assign_by_ref('evenement', $evenement);
+ ORDER BY (e.promo_min != 0 AND e.promo_max != 0) DESC, e.peremption";
+$page->mysql_assign($sql, 'evenement');
+
$page->display();
?>
diff --git a/htdocs/pattecassee.php b/htdocs/pattecassee.php
new file mode 100644
index 0000000..3e2837e
--- /dev/null
+++ b/htdocs/pattecassee.php
@@ -0,0 +1,71 @@
+", "", $em);
+ list($ident, $dom) = explode("@", $em);
+ if ($dom == "m4x.org" or $dom == "polytechnique.org") {
+ list($ident1) = explode("_", $ident);
+ list($ident) = explode("+", $ident1);
+ }
+ return $ident . "@" . $dom;
+}
+
+if (array_key_exists('email', $_GET) && array_key_exists('action', $_GET)) {
+ $email = valide_email($_GET['email']);
+ // vérifications d'usage
+ $sel = mysql_query(
+ "SELECT e.uid, a.username
+ FROM emails AS e
+ INNER JOIN auth_user_md5 AS a ON e.uid = a.user_id
+ WHERE e.email='$email'");
+ if (list($uid, $dest) = mysql_fetch_row($sel)) {
+ // envoi du mail
+ $message = "Bonjour !
+
+Ce mail a été généré automatiquement par le service de patte cassée de
+Polytechnique.org car un autre utilisateur, "
+.$_SESSION["prenom"]." ".$_SESSION["nom"].",
+nous a signalé qu'en t'envoyant un mail, il avait reçu un message d'erreur
+indiquant que ton adresse de redirection " . $email . "
+ne fonctionnait plus !
+
+Nous te suggérons de vérifier cette adresse, et le cas échéant de mettre
+à jour sur le site tes adresses
+de redirection...
+
+Pour plus de rensignements sur le service de patte cassée, n'hésites pas à
+consulter la page .
+
+
+A bientôt sur Polytechnique.org !
+L'équipe d'administration ";
+
+ $mail = new DiogenesMailer('Polytechnique.org ', $dest, "Une de tes adresse de redirection Polytechnique.org ne marche plus !!", false);
+ $mail->setBody($message);
+ $mail->send();
+ $page->assign('erreur', "Mail envoyé ! :o)");
+ }
+} else if (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"
+ ." FROM emails as e1"
+ ." LEFT JOIN emails as e2 ON(e1.uid = e2.uid AND FIND_IN_SET('active', e2.flags) AND e1.num != e2.num)"
+ ." INNER JOIN auth_user_md5 as u ON(e1.uid = u.user_id)"
+ ." WHERE e1.email ='$email'"
+ ." 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."'");
+ $page->assign_by_ref('x',$x);
+ }
+}
+
+$page->display();
+?>
diff --git a/htdocs/rss.php b/htdocs/rss.php
new file mode 100644
index 0000000..95292e0
--- /dev/null
+++ b/htdocs/rss.php
@@ -0,0 +1,16 @@
+= NOW()";
+
+if (isset($_REQUEST["promo"])) {
+ $requete.=" AND (e.promo_min = 0 || e.promo_min <= {$_REQUEST['promo']}) AND (e.promo_max = 0 || e.promo_max >= {$_REQUEST['promo']})";
+ $page->assign('promo',$_REQUEST["promo"]);
+}
+
+$requete.=" ORDER BY (e.promo_min != 0 AND e.promo_max != 0) DESC, e.peremption";
+$page->msyql_assign($requete,'rss');
+
+header("Content-Type: text/xml");
+$page->display('rss.tpl');
+?>
diff --git a/htdocs/sendmail.php b/htdocs/sendmail.php
new file mode 100644
index 0000000..09c32b4
--- /dev/null
+++ b/htdocs/sendmail.php
@@ -0,0 +1,47 @@
+\n Indique au moins un destinataire.\n
\n";
+ } else {
+ if (get_magic_quotes_gpc()) {
+ $_REQUEST['contenu'] = str_replace('
', '', stripslashes($_REQUEST['contenu']));
+ $_REQUEST['to'] = stripslashes($_REQUEST['to']);
+ $_REQUEST['sujet'] = stripslashes($_REQUEST['sujet']);
+ $_REQUEST['from'] = stripslashes($_REQUEST['from']);
+ $_REQUEST['cc'] = stripslashes($_REQUEST['cc']);
+ $_REQUEST['bcc'] = stripslashes($_REQUEST['bcc']);
+ $autre_to = stripslashes($autre_to);
+ }
+ require("mailer.inc.php");
+ $FROM = "From: {$_REQUEST['from']}";
+ //$_REQUEST['contenu'] = chunk_split($_REQUEST['contenu'], 76, "\n"); // pas bon, ne tient pas compte des mots
+ $dest = $_REQUEST['to'].', '.$autre_to;
+ $mymail = new mailer($_SESSION['username'], $dest, $_REQUEST['sujet'], false, $_REQUEST['cc'], $_REQUEST['bcc']);
+ $mymail->addHeader($FROM);
+ $mymail->setBody(wordwrap($_REQUEST['contenu'],72,"\n"));
+ if ($mymail->send()) {
+ $page->assign('error',"Ton mail a bien été envoyé.");
+ $_REQUEST = array();
+ } else {
+ $page->assign('error',"Erreur lors de l'envoi du courriel, réessaye.\n");
+ }
+ } // ! if ($_REQUEST['to'] == '' and $_REQUEST['cc'] == '')
+}
+
+$sql = "SELECT u.prenom, u.nom, u.promo, u.username
+ FROM auth_user_md5 as u, contacts as c
+ WHERE u.user_id = c.contact AND c.uid = {$_SESSION['uid']}
+ ORDER BY u.nom, u.prenom";
+$page->mysql_assoc($sql, 'contacts','nb_contacts');
+
+$page->display();
+?>
diff --git a/htdocs/skins.php b/htdocs/skins.php
index 81052dd..0347b4d 100644
--- a/htdocs/skins.php
+++ b/htdocs/skins.php
@@ -9,17 +9,11 @@ if (isset($_REQUEST['submit'])) { // formulaire soumis, traitons les donn
set_skin();
}
-$res = mysql_query("SELECT id,skin_tpl,skin_popup,snapshot,name,s.date,comment,auteur,count(*) AS nb FROM skins AS s
- LEFT JOIN auth_user_md5 AS a ON s.id=a.skin
- WHERE !FIND_IN_SET('cachee',type) AND skin_tpl != ''
- GROUP BY id ORDER BY s.date DESC");
-echo mysql_error();
-$skins = Array();
-while($skins[] = mysql_fetch_assoc($res));
-mysql_free_result($res);
-array_pop($skins);
-
-$page->assign_by_ref('skins',$skins);
+$sql = "SELECT id,skin_tpl,skin_popup,snapshot,name,s.date,comment,auteur,count(*) AS nb FROM skins AS s
+ LEFT JOIN auth_user_md5 AS a ON s.id=a.skin
+ WHERE !FIND_IN_SET('cachee',type) AND skin_tpl != ''
+ GROUP BY id ORDER BY s.date DESC";
+$page->mysql_assign($sql, 'skins');
$page->assign('stochaskin',SKIN_STOCHASKIN_ID);
$page->display();
diff --git a/htdocs/stats/coupure.php b/htdocs/stats/coupure.php
new file mode 100644
index 0000000..fc68bf5
--- /dev/null
+++ b/htdocs/stats/coupure.php
@@ -0,0 +1,20 @@
+assign_by_ref('cp',$cp);
+} else {
+ $beginning_date = date("Ymd", time() - 3600*24*21) . "000000";
+ $sql = "select id, UNIX_TIMESTAMP(debut) as debut, resume, services from coupures where debut > '" . $beginning_date
+ . "' order by debut desc";
+ $page->mysql_assign($sql, 'coupures');
+}
+
+$page->display();
+?>
diff --git a/htdocs/stats/graph_promo.php b/htdocs/stats/graph_promo.php
new file mode 100644
index 0000000..a621c4e
--- /dev/null
+++ b/htdocs/stats/graph_promo.php
@@ -0,0 +1,49 @@
+DATE_SUB(NOW(),INTERVAL $JOURS DAY), TO_DAYS(date_ins)-TO_DAYS(NOW()), ".(-($JOURS+1)).") AS jour,
+ count(username) AS nb
+ FROM auth_user_md5 WHERE promo = $promo GROUP BY jour");
+
+//genere des donnees compatibles avec GNUPLOT
+$inscrits='';
+
+// la première ligne contient le total des inscrits avant la date de départ (J - $JOURS)
+list(,$init_nb)=mysql_fetch_row($donnees);
+$total = $init_nb;
+
+list($numjour, $nb) = mysql_fetch_row($donnees);
+for ($i=-$JOURS;$i<=0;$i++) {
+ if ($numjour<$i) {
+ if(!list($numjour, $nb) = mysql_fetch_row($donnees)) {
+ $numjour = 0;
+ $nb = 0;
+ }
+ }
+ if ($numjour==$i) $total+=$nb;
+ $inscrits .= date('d/m/y',$i*DUREEJOUR+time())." ".$total."\n";
+}
+
+//Genere le graphique à la volée avec GNUPLOT
+header( "Content-type: image/png");
+
+$gnuplot="gnuplot <
diff --git a/htdocs/stats/nb_by_promo.php b/htdocs/stats/nb_by_promo.php
index 2e2eaf8..37623cb 100644
--- a/htdocs/stats/nb_by_promo.php
+++ b/htdocs/stats/nb_by_promo.php
@@ -7,8 +7,8 @@ $max=0; $min=3000;
while(list($promo,$nb)=mysql_fetch_row($result)) {
$promo=intval($promo);
if(!isset($nbpromo[$promo/10]))
- $nbpromo[$promo/10] = Array('','', '','', '','', '','', '','');
- $nbpromo[$promo/10][$promo%10]=$nb;
+ $nbpromo[$promo/10] = Array('','','','','','','','','',''); // tableau de 10 cases vides
+ $nbpromo[$promo/10][$promo%10]=Array('promo' => $promo, 'nb' => $nb);
}
$page->assign_by_ref('nbs', $nbpromo);
diff --git a/htdocs/stats/parselog.php b/htdocs/stats/parselog.php
new file mode 100644
index 0000000..a6440e9
--- /dev/null
+++ b/htdocs/stats/parselog.php
@@ -0,0 +1,6 @@
+display();
+?>
diff --git a/htdocs/stats/stats_promo.php b/htdocs/stats/stats_promo.php
new file mode 100644
index 0000000..3952122
--- /dev/null
+++ b/htdocs/stats/stats_promo.php
@@ -0,0 +1,8 @@
+assign('promo',$promo);
+$page->display();
+?>
diff --git a/htdocs/vcard.php b/htdocs/vcard.php
index 30a7b6e..ed6aedb 100644
--- a/htdocs/vcard.php
+++ b/htdocs/vcard.php
@@ -1,6 +1,5 @@
template_dir = $globals->spoolroot . "/templates/";
-$page->compile_dir = $globals->spoolroot . "/templates_c/";
-$page->plugins_dir[]= $globals->spoolroot . "/plugins/";
-$page->cache_dir = $globals->spoolroot . "/cache/";
-$page->compile_check = true;
-$page->caching = false;
-
$page->register_modifier('qp_enc', 'quoted_printable_encode');
$page->register_function('format_adr', 'format_adr');
diff --git a/include/domaine.inc.php b/include/domaine.inc.php
new file mode 100644
index 0000000..5ac8bb9
--- /dev/null
+++ b/include/domaine.inc.php
@@ -0,0 +1,57 @@
+Félicitations, ton domaine a été ajouté aux domaines gérés par Polytechnique.org.\n"
+ . "Clique sur le lien ci-dessous pour lui ajouter des alias\n";
+ } else
+ return "Erreur : ".mysql_error()."
\n";
+ } else {
+ return "Tu as déjà un nom de domaine perso, tu ne peux pas en avoir plusieurs.
\n";
+ }
+}
+
+?>
diff --git a/include/insert.pattecassee.inc.php b/include/insert.pattecassee.inc.php
new file mode 100644
index 0000000..103d5b2
--- /dev/null
+++ b/include/insert.pattecassee.inc.php
@@ -0,0 +1,24 @@
+
diff --git a/include/nonhtml.inc.php b/include/nonhtml.inc.php
new file mode 100644
index 0000000..c518cfc
--- /dev/null
+++ b/include/nonhtml.inc.php
@@ -0,0 +1,16 @@
+template_dir = $globals->spoolroot . "/templates/";
+$page->compile_dir = $globals->spoolroot . "/templates_c/";
+$page->plugins_dir[]= $globals->spoolroot . "/plugins/";
+$page->cache_dir = $globals->spoolroot . "/cache/";
+
+$page->config_overwrite=false;
+$page->compile_check=true;
+$page->caching=false;
+?>
diff --git a/include/valid_emploi.inc.php b/include/valid_emploi.inc.php
index e1cd333..a7de1a1 100644
--- a/include/valid_emploi.inc.php
+++ b/include/valid_emploi.inc.php
@@ -47,7 +47,7 @@ class EmploiReq extends Validate {
{$texte} |
-
+ |
|
diff --git a/include/valid_evts.inc.php b/include/valid_evts.inc.php
index e935129..e23cba8 100644
--- a/include/valid_evts.inc.php
+++ b/include/valid_evts.inc.php
@@ -77,7 +77,7 @@ class EvtReq extends Validate {
{$this->comment} |
-
+ |
diff --git a/include/valid_ml.inc.php b/include/valid_ml.inc.php
index 2ae23ca..c991dd4 100644
--- a/include/valid_ml.inc.php
+++ b/include/valid_ml.inc.php
@@ -190,8 +190,7 @@ ________EOF;
global $no_update_bd;
if($no_update_bd) return false;
- require_once("flagset.inc.php");
- $type = new flagset();
+ $type = new DiogenesFlagset();
if ($this->libre) $type->addflag('libre');
if ($this->publique) $type->addflag('publique');
if ($this->archive) $type->addflag('archive');
diff --git a/include/valid_photos.inc.php b/include/valid_photos.inc.php
index 64dae9f..b930003 100644
--- a/include/valid_photos.inc.php
+++ b/include/valid_photos.inc.php
@@ -70,8 +70,8 @@ class PhotoReq extends Validate {
|
-
-
+
+
|
diff --git a/include/xorg.page.inc.php b/include/xorg.page.inc.php
index 81276d4..814c9bb 100644
--- a/include/xorg.page.inc.php
+++ b/include/xorg.page.inc.php
@@ -43,7 +43,7 @@ class XorgPage extends DiogenesCorePage {
}
function make_id($append_to_id="") {
- $ret = str_replace('/','|',$this->_tpl);
+ $ret = $this->_tpl;
if($append_to_id)
$ret.="|$append_to_id";
@@ -57,6 +57,22 @@ class XorgPage extends DiogenesCorePage {
function doAuth() { }
+ function mysql_assign($sql_query,$var_name,$var_nb_name='') {
+ $sql = mysql_query($sql_query);
+ if(mysql_errno($sql))
+ return(mysql_error($sql));
+
+ $array = Array();
+ while($array[] = mysql_fetch_assoc($sql));
+ array_pop($array);
+ mysql_free_result($sql);
+
+ $this->assign_by_ref($var_name,$array);
+ if(!empty($var_nb_name))
+ $this->assign($var_nb_name, count($array));
+ return 0;
+ }
+
}
diff --git a/scripts/xhtml/get_classes.pl b/scripts/xhtml/get_classes.pl
index 39a0104..25f2ce9 100755
--- a/scripts/xhtml/get_classes.pl
+++ b/scripts/xhtml/get_classes.pl
@@ -59,9 +59,12 @@ sub parse_tag($$) {
# tag interdits en xhtml
print STDERR "${red}XHTML error: ${yel}<$1> ${blu}($file)${gra}\n"
- if($tag =~ /^(b|i|u|center)( |$)/);
+ if($tag =~ /^(b|i|u|big|small|font|center)( |$)/);
print STDERR "${red}XHTML error: ${yel}<$1> sans '/' ${blu}($file)${gra}\n"
if($tag =~ /^(br|hr|img|link|input)( [^\/]*)?$/);
+
+ print STDERR "${red}XHTML error: ${yel}attribut $1 ${blu}($file)${gra}\n"
+ if($tag =~ / (align|width|border|color|valign)=/);
# récupération des classes utilisées ...
if($tag =~ /^(\w+).* class=('{[^}]*}'|"{[^}]*}"|'[^{}']*'|"[^{}"]*")/) {
diff --git a/templates/acces_smtp.tpl b/templates/acces_smtp.tpl
index cd4360b..e308439 100644
--- a/templates/acces_smtp.tpl
+++ b/templates/acces_smtp.tpl
@@ -1,4 +1,4 @@
-{* $Id: acces_smtp.tpl,v 1.2 2004-02-02 11:48:35 x2000habouzit Exp $ *}
+{* $Id: acces_smtp.tpl,v 1.3 2004-02-04 19:47:47 x2000habouzit Exp $ *}
{dynamic on="0$message"}
@@ -51,7 +51,7 @@
{/if}