ad0.text AS app0text, ad0.url AS app0url, ai0.type AS app0type,
ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type,
es.label AS secteur, ef.fonction_fr AS fonction,
- IF(n.nat=\'\',n.pays,n.nat) AS nat, n.a2 AS iso3166,';
+ IF(n.nat=\'\',n.pays,n.nat) AS nat, n.a2 AS iso3166,
+ COUNT(em.email) > 0 AS actif,';
// hide private information if not logged
if (S::logged())
$globals->search->result_fields .='
LEFT JOIN geoloc_pays AS n ON (u.nationalite = n.a2)
LEFT JOIN adresses AS adr ON (u.user_id = adr.uid AND FIND_IN_SET(\'active\',adr.statut))
LEFT JOIN geoloc_pays AS gp ON (adr.country = gp.a2)
- LEFT JOIN geoloc_region AS gr ON (adr.country = gr.a2 AND adr.region = gr.region)';
+ LEFT JOIN geoloc_region AS gr ON (adr.country = gr.a2 AND adr.region = gr.region)
+ LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = \'active\')';
// }}}
// {{{ function display_lines()
'marketing/private' => $this->make_hook('private', AUTH_MDP, 'admin'),
'marketing/public' => $this->make_hook('public', AUTH_COOKIE),
+ 'marketing/broken' => $this->make_hook('broken', AUTH_COOKIE),
);
}
}
}
+ function handler_broken(&$page, $uid = null)
+ {
+ $page->changeTpl('marketing/broken.tpl');
+
+ if (is_null($uid)) {
+ return;
+ }
+
+ $res = Xdb::query("SELECT u.nom, u.prenom, u.promo, a.alias AS forlife
+ FROM auth_user_md5 AS u
+ INNER JOIN aliases AS a ON a.id = u.user_id
+ WHERE u.user_id = {?}", S::i('uid'));
+ if (!$res->numRows()) {
+ return;
+ }
+ $user = $res->fetchOneAssoc();
+ $page->assign('user', $user);
+
+ $email = trim(Post::v('mail'));
+ if (Post::has('valide') && strlen($email) > 0) {
+ require_once('diogenes/diogenes.hermes.inc.php');
+ $mailer = new HermesMailer();
+ $mailer->setFrom(S::v('bestalias') . '@polytechnique.org');
+ $mailer->addTo('resetpass@polytechnique.org');
+ $mailer->setSubject("Proposition d'adresse mail pour " . $user['forlife']);
+
+ $message = S::v('nom') . ' ' . S::v('prenom') . ' (X' . S::v('promo') . ') '
+ . 'propose l\'adresse suivante pour un camarade qui n\'a plus de '
+ . 'redirections actives :' . "\n\n"
+ . '* ' . $user['forlife'] . ' => ' . $email . "\n";
+ $mailer->setTxtBody(wordwrap($message, 78));
+ $mailer->send();
+ $page->assign('sent', true);
+ }
+ }
+
function handler_promo(&$page, $promo = null)
{
$page->changeTpl('marketing/promo.tpl');
<div class="long">
{if $c.wasinscrit}
- {if $c.web || $c.mobile || $c.countrytxt || $c.city || $c.region || $c.entreprise || $c.freetext}
+ {if $c.web || $c.mobile || $c.countrytxt || $c.city || $c.region || $c.entreprise || $c.freetext || (!$c.dcd && !$c.actif )}
<table cellspacing="0" cellpadding="0">
{if $c.web}
<tr>
<td class="rt">{$c.freetext|nl2br}</td>
</tr>
{/if}
+ {if !$c.dcd && !$c.actif && $c.wasinscrit}
+ <tr>
+ <td class="smaller" colspan="2">
+ Ce camarade n'a plus d'adresse redirection valide.
+ <a href="marketing/broken/{$c.user_id}">
+ Si tu en connais une, <strong>n'hésite pas à nous la transmettre</strong>
+ </a>
+ </td>
+ </tr>
+ {/if}
</table>
{/if}
{/if}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2006 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+
+{if $sent}
+
+<p>
+ Merci de nous avoir communiqué cette information !
+</p>
+
+{elseif $user}
+
+<h1>
+ Recherche d'adresses pour {$user.nom} {$user.prenom} (X{$user.promo})
+</h1>
+
+<p>
+ Avec le temps toutes les adresses de redirection de notre camarade sont devenues invalides et produisent
+ des erreurs lorsqu'on lui envoie un mail. Nous sommes donc à la recherche d'adresses valides où nous pourrions
+ contacter ce camarade.
+</p>
+<p>
+ Les adresses emails qui tu pourras nous donner ne seront pas ajouter directement aux redirections de {$user.prenom}.
+</p>
+<p>
+ Merci de participer à cette recherche.
+</p>
+
+<form method="post" action="{$platal->path}">
+ <table class="bicol" summary="Fiche camarade">
+ <tr class="impair"><td>Nom :</td><td>{$user.nom}</td></tr>
+ <tr class="pair"><td>Prénom :</td><td>{$user.prenom}</td></tr>
+ <tr class="impair"><td>Promo :</td><td>{$user.promo}</td></tr>
+ <tr class="pair">
+ <td>Adresse email :</td>
+ <td>
+ <input type="text" name="mail" size="30" maxlength="50" />
+ </td>
+ </tr>
+ </table>
+ <div class="center">
+ <input type="submit" name="valide" value="Valider" />
+ </div>
+</form>
+{/if}
+
+
+{* vim:set et sw=2 sts=2 sws=2: *}