* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
- 'index' => $this->make_hook('index', AUTH_PUBLIC),
- 'cacert.pem' => $this->make_hook('cacert', AUTH_PUBLIC),
- 'changelog' => $this->make_hook('changelog', AUTH_PUBLIC),
+ 'index' => $this->make_hook('index', AUTH_PUBLIC),
+ 'cacert.pem' => $this->make_hook('cacert', AUTH_PUBLIC),
+ 'changelog' => $this->make_hook('changelog', AUTH_PUBLIC),
- 'prefs' => $this->make_hook('prefs', AUTH_COOKIE),
- 'prefs/rss' => $this->make_hook('prefs_rss', AUTH_COOKIE),
- 'prefs/webredirect'
- => $this->make_hook('webredir', AUTH_MDP),
- 'prefs/skin' => $this->make_hook('skin', AUTH_COOKIE),
+ 'prefs' => $this->make_hook('prefs', AUTH_COOKIE),
+ 'prefs/rss' => $this->make_hook('prefs_rss', AUTH_COOKIE),
+ 'prefs/webredirect' => $this->make_hook('webredir', AUTH_MDP),
+ 'prefs/skin' => $this->make_hook('skin', AUTH_COOKIE),
- 'password' => $this->make_hook('password', AUTH_MDP),
- 'tmpPWD' => $this->make_hook('tmpPWD', AUTH_PUBLIC),
- 'password/smtp' => $this->make_hook('smtppass', AUTH_MDP),
- 'recovery' => $this->make_hook('recovery', AUTH_PUBLIC),
- 'exit' => $this->make_hook('exit', AUTH_PUBLIC),
- 'review' => $this->make_hook('review', AUTH_PUBLIC),
- 'deconnexion.php' => $this->make_hook('exit', AUTH_PUBLIC),
+ 'password' => $this->make_hook('password', AUTH_MDP),
+ 'tmpPWD' => $this->make_hook('tmpPWD', AUTH_PUBLIC),
+ 'password/smtp' => $this->make_hook('smtppass', AUTH_MDP),
+ 'recovery' => $this->make_hook('recovery', AUTH_PUBLIC),
+ 'exit' => $this->make_hook('exit', AUTH_PUBLIC),
+ 'review' => $this->make_hook('review', AUTH_PUBLIC),
+ 'deconnexion.php' => $this->make_hook('exit', AUTH_PUBLIC),
- $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");
$page->changeTpl('platal/changeLog.tpl');
$clog = pl_entities(file_get_contents(dirname(__FILE__).'/../ChangeLog'));
$page->changeTpl('platal/changeLog.tpl');
$clog = pl_entities(file_get_contents(dirname(__FILE__).'/../ChangeLog'));
// url catch only (not all wiki syntax)
$clog = preg_replace(array(
'/((?:https?|ftp):\/\/(?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/ui',
// url catch only (not all wiki syntax)
$clog = preg_replace(array(
'/((?:https?|ftp):\/\/(?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/ui',
+
+ # FIXME: this code is not multi-domain compatible. We should decide how
+ # 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)",
+ S::user()->id());
+ $page->assign('bestalias', $res->fetchOneCell());
+
+ # FIXME: this code is not multi-domain compatible. We should decide how
+ # 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)",
+ S::user()->id());
+ $page->assign('bestalias', $res->fetchOneCell());
// updates the Google Apps password as well.
if ($globals->mailstorage->googleapps_domain) {
require_once 'googleapps.inc.php';
// updates the Google Apps password as well.
if ($globals->mailstorage->googleapps_domain) {
require_once 'googleapps.inc.php';
- $log =& S::v('log');
- S::logger()->log('passwd', '');
-
- if (Cookie::v('ORGaccess')) {
- setcookie('ORGaccess', hash_encrypt($password), (time()+25920000), '/', '' ,0);
- }
+ S::logger()->log('passwd');
+ Platal::session()->setAccessCookie(true);
- require_once 'wiki.inc.php';
- wiki_require_page('Xorg.SMTPSécurisé');
- wiki_require_page('Xorg.NNTPSécurisé');
+ $wp = new PlWikiPage('Xorg.SMTPSécurisé');
+ $wp->buildCache();
+ $wp = new PlWikiPage('Xorg.NNTPSécurisé');
+ $wp->buildCache();
- WHERE uid = {?} AND NOT FIND_IN_SET("filter", flags)', $uid);
- $mails = implode(', ', $res->fetchColumn());
+ WHERE uid = {?} AND NOT FIND_IN_SET('filter', flags)
+ AND NOT FIND_IN_SET('active', flags)",
+ $uid);
+ if ($res->numRows() > 0) {
+ $mails .= ', ' . implode(', ', $res->fetchColumn());
+ }
}
$mymail = new PlMailer();
$mymail->setFrom('"Gestion des mots de passe" <support+password@' . $globals->mail->domain . '>');
}
$mymail = new PlMailer();
$mymail->setFrom('"Gestion des mots de passe" <support+password@' . $globals->mail->domain . '>');
} else {
$page->trigError('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');
} else {
$page->trigError('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');
// updates the Google Apps password as well.
if ($globals->mailstorage->googleapps_domain) {
require_once 'googleapps.inc.php';
// updates the Google Apps password as well.
if ($globals->mailstorage->googleapps_domain) {
require_once 'googleapps.inc.php';
if (Env::has('newskin')) { // formulaire soumis, traitons les données envoyées
XDB::execute('UPDATE auth_user_quick
if (Env::has('newskin')) { // formulaire soumis, traitons les données envoyées
XDB::execute('UPDATE auth_user_quick
- setcookie('ORGaccess', '', time() - 3600, '/', '', 0);
- Cookie::kill('ORGaccess');
- if (isset($_SESSION['log']))
- S::logger()->log("cookie_off");
+ Platal::session()->killAccessCookie();
- setcookie('ORGuid', '', time() - 3600, '/', '', 0);
- Cookie::kill('ORGuid');
- setcookie('ORGdomain', '', time() - 3600, '/', '', 0);
- Cookie::kill('ORGdomain');
+ Platal::session()->killLoginFormCookies();
- if (isset($_SESSION['log'])) {
- $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
- S::logger()->log('deconnexion',$ref);
+ if (S::logged()) {
+ S::logger()->log('deconnexion', @$_SERVER['HTTP_REFERER']);
+ Platal::session()->destroy();
- require_once 'wiki.inc.php';
- require_once dirname(__FILE__) . '/platal/review.inc.php';
- $dir = wiki_work_dir();
+ // Include X-XRDS-Location response-header for Yadis discovery
+ global $globals;
+ header('X-XRDS-Location: ' . $globals->baseurl . '/openid/xrds');
+
+ $this->load('review.inc.php');
- if (!is_dir($dir)) {
- $page->kill("Impossible de trouver le wiki");
- }
- if (!file_exists($dir . '/' . $dom . '.Admin')) {
- $page->kill("Impossible de trouver la page d'administration");
- }
- $conf = preg_grep('/^text=/', explode("\n", file_get_contents($dir . '/' . $dom . '.Admin')));
- $conf = preg_split('/(text\=|\%0a)/', array_shift($conf), -1, PREG_SPLIT_NO_EMPTY);
- $wiz = new PlWizard('Tour d\'horizon', 'core/plwizard.tpl', true);
+ $wp = new PlWikiPage($dom . '.Admin');
+ $conf = explode('%0a', $wp->getField('text'));
+ $wiz = new PlWizard('Tour d\'horizon', PlPage::getCoreTpl('plwizard.tpl'), true);
foreach ($conf as $line) {
$list = preg_split('/\s*[*|]\s*/', $line, -1, PREG_SPLIT_NO_EMPTY);
$wiz->addPage('ReviewPage', $list[0], $list[1]);
foreach ($conf as $line) {
$list = preg_split('/\s*[*|]\s*/', $line, -1, PREG_SPLIT_NO_EMPTY);
$wiz->addPage('ReviewPage', $list[0], $list[1]);