From 9fe30fd3d4dbb9cd0e0322b51040ac7d26263b03 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Thu, 8 Jul 2004 14:37:12 +0000 Subject: [PATCH] homonymes done --- etat_migration | 20 +++---- htdocs/admin/homonymes.php | 64 ++++++++++++++++++++ templates/admin/homonymes.tpl | 135 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 209 insertions(+), 10 deletions(-) create mode 100644 htdocs/admin/homonymes.php create mode 100644 templates/admin/homonymes.tpl diff --git a/etat_migration b/etat_migration index adc3491..b4a69f6 100644 --- a/etat_migration +++ b/etat_migration @@ -20,8 +20,7 @@ Etat | Ancien nom | Nouveau nom ;! | admin/comptesPOP.php | ??? ; | admin/correction_adr.php | ; | admin/evenements.php | -; | admin/homonymes.php | -; | admin/pg.php | +;! | admin/pg.php | ------+-[ marketing ]-----------------------------+---------------- ; | admin/marketing.php | marketing/ ; | admin/envoidirect.php | @@ -37,11 +36,6 @@ Etat | Ancien nom | Nouveau nom ; | 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 ------+-[ emails ... ]----------------------------+---------------- ; | routage-mail.php | ------+-[ inscription + mdp ]---------------------+---------------- @@ -70,6 +64,11 @@ Etat | Ancien nom | Nouveau nom ; | listes/liste.php | | ; | listes/mailtoins.inc.php | | ; | listes/trombiliste.php | / +------+-[ stats ]---------------------------------+---------------- +;! | parselogD.php | stats/... +;! | parselogN.php | stats/... +;! | parselogR.php | stats/... +;! | stats.php | stats/index.php ------+-[ sondages ]------------------------------+---------------- ;! | admin/gerer_sondages.php | \ ;! | sondage/accueil.php | | @@ -100,9 +99,6 @@ x | admin/utilisateurs.php | - y'a encore du boulot pour que ca valide ! x | epouse.php | - non testé (flemme de faire des su ...) x | parselog.php | stats/... (non testé, pas de logs sous la main) xx | AccesPermanentOff.php | cookie_off.php -xx | paiement/cyberpaiement.inc.php | dans include/ -xx | paiement/cyberpaiement_retour.php | - -xx | paiement/index.php | - xx | AccesPermanentOn.php | cookie_on.php xx | acces_redirect.php | carva_redirect.php xx | acces_smtp.php | - @@ -120,6 +116,7 @@ xx | admin/gerer_listes.php | - xx | admin/gerer_paiement.php | - xx | admin/gerer_skins.php | - xx | admin/graph_promo.php | stats/graph_promo.php +xx | admin/homonymes.php | xx | admin/index.php | - xx | admin/ins_confirmees.php | - xx | admin/logger_actions.php | - @@ -171,6 +168,9 @@ xx | motdepassemd5.php | - xx | nbpromo2.php | stats/nb_by_promo.php xx | newsletter.php | - xx | newsletter_req.php | - +xx | paiement/cyberpaiement.inc.php | dans include/ +xx | paiement/cyberpaiement_retour.php | - +xx | paiement/index.php | - xx | pattecassee.php | - xx | preferences.php | - xx | profil.php | TODO : reste 2-3 trucs comme popWin() a changer diff --git a/htdocs/admin/homonymes.php b/htdocs/admin/homonymes.php new file mode 100644 index 0000000..1399186 --- /dev/null +++ b/htdocs/admin/homonymes.php @@ -0,0 +1,64 @@ +db->query("SELECT prenom,username,loginbis FROM auth_user_md5 WHERE user_id='$target'"); + if (! list($prenom,$username,$loginbis) = mysql_fetch_row($res)) { + $target=0; + } else { + $page->assign('prenom',$prenom); + $page->assign('username',$username); + $page->assign('loginbis',$loginbis); + } +} + +$page->assign('op',$op); +$page->assign('target',$target); +$page->assign('baseurl',$baseurl); + +// on a un $target valide, on prepare les mails +if ($target) { + // from + $cc = "support+homonyme@polytechnique.org"; + $FROM = "From: Support Polytechnique.org <$cc>"; + + // on examine l'op a effectuer + switch ($op) { + case 'mail': + $mymail = new DiogenesMailer($cc,$username,"Dans 2 semaines, suppression de $loginbis@polytechnique.org",false,$cc); + $mymail->addHeader($FROM); + $mymail->setBody(stripslashes($_REQUEST['mailbody'])); + $mymail->send(); + $op = 'list'; + break; + case 'correct': + $globals->db->query("update auth_user_md5 set alias='' where user_id=$target"); + $mymail = new DiogenesMailer($cc,$username,"Mise en place du robot $loginbis@polytechnique.org",false,$cc); + $mymail->addHeader($FROM); + $mymail->setBody(stripslashes($_REQUEST['mailbody'])); + $mymail->send(); + $op = 'list'; + break; + } +} +if ($op == 'list') { + $res = $globals->db->query("SELECT loginbis FROM auth_user_md5 WHERE loginbis!='' GROUP BY loginbis ORDER BY loginbis"); + $hnymes = Array(); + while (list($loginbis) = mysql_fetch_row($res)) $hnymes[$loginbis] = Array(); + mysql_free_result($res); + + $res = $globals->db->query("SELECT loginbis,user_id,username,promo,prenom,nom,alias,date_mise_alias_temp AS date FROM auth_user_md5 WHERE loginbis!='' ORDER BY promo"); + while ($tab = mysql_fetch_assoc($res)) $hnymes[$tab['loginbis']][] = $tab; + mysql_free_result($res); + + $page->assign_by_ref('hnymes',$hnymes); +} + +$page->run(); +?> diff --git a/templates/admin/homonymes.tpl b/templates/admin/homonymes.tpl new file mode 100644 index 0000000..f60214d --- /dev/null +++ b/templates/admin/homonymes.tpl @@ -0,0 +1,135 @@ +{* $Id: homonymes.tpl,v 1.1 2004-07-08 14:37:13 x2000habouzit Exp $ *} + +
+ Gestion des homonymes +
+ +{dynamic} + +{if $op eq 'mail'} +

mail envoyé à {$username}

+{elseif $op eq 'correct'} +

mail envoyé à {$username}, alias supprimé

+{/if} + +{if $op eq 'list' || $op eq 'mail' || $op eq 'correct'} + +

+ Les utilisateurs signalés en rouge sont ceux qui conservent actuellement + l'alias prenom.nom et empêchent donc la mise en place du robot détrompeur. +

+ + + + + + + + {foreach from=$hnymes key=login item=row} + + + + {foreach from=$row item=user} + + + + + + {/foreach} + {/foreach} +
usernamedate de l'aliasop
+ {$login} +
   + {if $user.alias eq $login} + {$user.username} + {else} + {$user.username} + {/if} + {$user.date} + fiche + edit + {if $user.alias eq $login} + mailer + corriger + {/if} +
+ +{elseif $op eq 'mail-conf'} + +
+ + + + + + + + + + + + +
Envoyer un mail pour prévenir l'utilisateur
+ +
+ +
+
+ +{elseif $op eq 'correct-conf'} + +
+ + + + + + + + + + + + +
Mettre en place le robot {$loginbis}@polytechnique.org
+ +
+ +
+
+ +{/if} + +{/dynamic} + +{* vim:set et sw=2 sts=2 sws=2: *} -- 2.1.4