{
return array(
'index' => $this->make_hook('index', AUTH_PUBLIC),
- 'cacert.pem' => $this->make_hook('cacert', AUTH_PUBLIC),
+ 'cacert.pem' => $this->make_hook('cacert', AUTH_PUBLIC),
'changelog' => $this->make_hook('changelog', AUTH_PUBLIC),
// Preferences thingies
'recovery' => $this->make_hook('recovery', AUTH_PUBLIC),
'exit' => $this->make_hook('exit', AUTH_PUBLIC),
'deconnexion.php' => $this->make_hook('exit', AUTH_PUBLIC),
-
- // happenings related thingies
- 'rss' => $this->make_hook('rss', AUTH_PUBLIC),
);
}
function handler_cacert(&$page)
{
- if (preg_match('/MSIE/i', $_SERVER['HTTP_USER_AGENT']))
- {
- $data = file_get_contents('/etc/ssl/xorgCA/cacert.der');
- } else {
- $data = file_get_contents('/etc/ssl/xorgCA/cacert.pem');
- }
- header('Content-Type: application/x-x509-ca-cert');
- header('Content-Length: '.strlen($data));
+ $data = file_get_contents("/etc/ssl/xorgCA/cacert.pem","r");
+ header("Pragma:");
+ header("Set-Cookie:");
+ header("Cache-Control:");
+ header("Expires:");
+ header("Content-Type: application/x-x509-ca-cert");
+ header("Content-Length: ".strlen($data));
echo $data;
exit;
}
$res = XDB::query(
"SELECT user_id, naissance
FROM auth_user_md5 AS u
- INNER JOIN aliases AS a ON (u.user_id=a.id AND type!='homonyme')
+ INNER JOIN aliases AS a ON (u.user_id=a.id AND type != 'homonyme')
WHERE a.alias={?} AND u.perms IN ('admin','user') AND u.deces=0", $mailorg);
list($uid, $naissance) = $res->fetchOneRow();
$res = XDB::query('SELECT email FROM emails WHERE uid = {?} AND NOT FIND_IN_SET("filter", flags)', $uid);
$mails = implode(', ', $res->fetchColumn());
- require_once "diogenes/diogenes.hermes.inc.php";
- $mymail = new HermesMailer();
+ $mymail = new PlMailer();
$mymail->setFrom('"Gestion des mots de passe" <support+password@polytechnique.org>');
$mymail->addTo($mails);
$mymail->setSubject('Ton certificat d\'authentification');
$logger = $_SESSION['log'] = new CoreLogger($uid);
$logger->log('recovery', $emails);
} else {
- $page->trig('Pas de résultat correspondant aux champs entrés dans notre base de données.');
+ $page->trig('Les informations que tu as rentrées ne permettent pas de récupérer ton mot de passe.<br />'.
+ 'Si tu as un homonyme, utilise prenom.nom.promo comme login');
}
}
LEFT JOIN auth_user_quick AS a ON s.id=a.skin
WHERE skin_tpl != '' AND ext != ''
GROUP BY id ORDER BY s.date DESC";
- $page->assign_by_ref('skins', XDB::iterator($sql));
+ $page->assign('skins', XDB::iterator($sql));
}
function handler_exit(&$page, $level = null)
{
if (S::has('suid')) {
- if (S::has('suid')) {
- $a4l = S::v('forlife');
- $suid = S::v('suid');
- $log = S::v('log');
- $log->log("suid_stop", S::v('forlife') . " by " . $suid['forlife']);
- $_SESSION = $suid;
- S::kill('suid');
- pl_redirect('admin/utilisateurs.php', 'login='.$a4l);
- } else {
- pl_redirect('events');
- }
+ $a4l = S::v('forlife');
+ $suid = S::v('suid');
+ $log = S::v('log');
+ $log->log("suid_stop", S::v('forlife') . " by " . $suid['forlife']);
+ $_SESSION = $suid;
+ S::kill('suid');
+ pl_redirect('admin/user/' . $a4l);
}
if ($level == 'forget' || $level == 'forgetall') {
$page->changeTpl('exit.tpl');
}
}
-
- function handler_rss(&$page, $user = null, $hash = null)
- {
- require_once 'rss.inc.php';
-
- $uid = init_rss('rss.tpl', $user, $hash);
-
- $rss = XDB::iterator(
- 'SELECT e.id, e.titre, e.texte, e.creation_date
- FROM auth_user_md5 AS u
- INNER JOIN evenements AS e ON ( (e.promo_min = 0 || e.promo_min <= u.promo)
- AND (e.promo_max = 0 || e.promo_max >= u.promo) )
- WHERE u.user_id = {?} AND FIND_IN_SET(e.flags, "valide")
- AND peremption >= NOW()', $uid);
- $page->assign('rss', $rss);
- }
}
?>