<?php
/***************************************************************************
- * Copyright (C) 2003-2009 Polytechnique.org *
+ * Copyright (C) 2003-2010 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
function handler_cacert(&$page)
{
- $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;
+ pl_cached_content_headers("application/x-x509-ca-cert");
+ readfile("/etc/ssl/xorgCA/cacert.pem");
exit;
}
# carva will extend to users not in the main domain.
$res = XDB::query("SELECT alias
FROM aliases
- WHERE id = {?} AND FIND_IN_SET('bestalias', flags)",
+ WHERE uid = {?} AND FIND_IN_SET('bestalias', flags)",
S::user()->id());
$page->assign('bestalias', $res->fetchOneCell());
}
# carva will extend to users not in the main domain.
$res = XDB::query("SELECT alias
FROM aliases
- WHERE id = {?} AND FIND_IN_SET('bestalias', flags)",
+ WHERE uid = {?} AND FIND_IN_SET('bestalias', flags)",
S::user()->id());
$page->assign('bestalias', $res->fetchOneCell());
}
$page->assign('ok', true);
$url = rand_url_id();
- XDB::execute('INSERT INTO perte_pass (certificat,uid,created)
+ XDB::execute('INSERT INTO account_lost_passwords (certificat,uid,created)
VALUES ({?},{?},NOW())', $url, $user->id());
$res = XDB::query('SELECT email
FROM emails
if ($res->numRows()) {
$mails = $res->fetchOneCell();
} else {
- $res = XDB::query('SELECT email
+ $res = XDB::query("SELECT email
FROM emails
- WHERE uid = {?} AND NOT FIND_IN_SET("filter", flags)', $user->id());
+ WHERE uid = {?} AND NOT FIND_IN_SET('filter', flags)", $user->id());
$mails = implode(', ', $res->fetchColumn());
}
$mymail = new PlMailer();
$mymail->setFrom('"Gestion des mots de passe" <support+password@' . $globals->mail->domain . '>');
$mymail->addTo($mails);
- $mymail->setSubject('Ton certificat d\'authentification');
+ $mymail->setSubject("Ton certificat d'authentification");
$mymail->setTxtBody("Visite la page suivante qui expire dans six heures :
{$globals->baseurl}/tmpPWD/$url
--
Polytechnique.org
-\"Le portail des élèves & anciens élèves de l'Ecole polytechnique\"
+\"Le portail des élèves & anciens élèves de l'École polytechnique\"
Email envoyé à ".Env::v('login') . (Post::has('email') ? "
Adresse de secours : " . Post::v('email') : ""));
{
global $globals;
// XXX: recovery requires data from the profile
- XDB::execute('DELETE FROM perte_pass
+ XDB::execute('DELETE FROM account_lost_passwords
WHERE DATE_SUB(NOW(), INTERVAL 380 MINUTE) > created');
$res = XDB::query('SELECT uid
- FROM perte_pass WHERE certificat={?}', $certif);
+ FROM account_lost_passwords WHERE certificat={?}', $certif);
$ligne = $res->fetchOneAssoc();
if (!$ligne) {
$page->changeTpl('platal/index.tpl');
SET password={?}
WHERE uid = {?} AND state = \'active\'',
$password, $uid);
- XDB::query('DELETE FROM perte_pass
+ XDB::query('DELETE FROM account_lost_passwords
WHERE certificat={?}', $certif);
// If GoogleApps is enabled, and the user did choose to use synchronized passwords,