+++ /dev/null
-<?php
-/***************************************************************************
- * 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 *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-new_skinned_page('acces_smtp.tpl', AUTH_MDP);
-$page->assign('xorg_title','Polytechnique.org - Acces SMTP/NNTP');
-
-$uid = Session::getInt('uid');
-$pass = Env::get('smtppass1');
-$log = Session::getMixed('log');
-
-if ( Env::get('op') == "Valider" && Env::get('smtppass1') == Env::get('smtppass2') && strlen($pass) >= 6 ) {
-
- $globals->xdb->execute('update auth_user_md5 set smtppass = {?} where user_id = {?}', $pass, $uid);
- $page->trig('Mot de passe enregistré');
- $log->log("passwd_ssl");
-
-} elseif (Env::get('op') == "Supprimer") {
-
- $globals->xdb->execute('update auth_user_md5 set smtppass = "" where user_id = {?}', $uid);
- $page->trig('Compte SMTP et NNTP supprimé');
- $log->log("passwd_del");
-
-}
-
-$res = $globals->xdb->query("select IF(smtppass != '', 'actif', '') from auth_user_md5 where user_id = {?}", $uid);
-$page->assign('actif', $res->fetchOneCell());
-$page->run();
-
-// vim:et:sw=4:
-?>
{
return array(
// Preferences thingies
- 'prefs' => $this->make_hook('prefs', AUTH_COOKIE),
- 'prefs/rss' => $this->make_hook('prefs_rss', AUTH_COOKIE),
- 'skin' => $this->make_hook('skin', AUTH_COOKIE),
+ 'prefs' => $this->make_hook('prefs', AUTH_COOKIE),
+ 'prefs/rss' => $this->make_hook('prefs_rss', AUTH_COOKIE),
+ 'skin' => $this->make_hook('skin', AUTH_COOKIE),
// password related thingies
- 'password' => $this->make_hook('password', AUTH_MDP),
- 'tmpPWD' => $this->make_hook('tmpPWD', AUTH_PUBLIC),
+ 'password' => $this->make_hook('password', AUTH_MDP),
+ 'tmpPWD' => $this->make_hook('tmpPWD', AUTH_PUBLIC),
+ 'password/smtp' => $this->make_hook('smtppass', AUTH_MDP),
// happenings related thingies
'rss' => $this->make_hook('rss', AUTH_PUBLIC),
return PL_OK;
}
+ function handler_smtppass(&$page)
+ {
+ global $globals;
+
+ $page->changeTpl('acces_smtp.tpl');
+ $page->assign('xorg_title','Polytechnique.org - Acces SMTP/NNTP');
+
+ $uid = Session::getInt('uid');
+ $pass = Env::get('smtppass1');
+ $log = Session::getMixed('log');
+
+ if (Env::get('op') == "Valider" && strlen($pass) >= 6
+ && Env::get('smtppass1') == Env::get('smtppass2'))
+ {
+ $globals->xdb->execute('UPDATE auth_user_md5 SET smtppass = {?}
+ WHERE user_id = {?}', $pass, $uid);
+ $page->trig('Mot de passe enregistré');
+ $log->log("passwd_ssl");
+ } elseif (Env::get('op') == "Supprimer") {
+ $globals->xdb->execute('UPDATE auth_user_md5 SET smtppass = ""
+ WHERE user_id = {?}', $uid);
+ $page->trig('Compte SMTP et NNTP supprimé');
+ $log->log("passwd_del");
+ }
+
+ $res = $globals->xdb->query("SELECT IF(smtppass != '', 'actif', '')
+ FROM auth_user_md5
+ WHERE user_id = {?}", $uid);
+ $page->assign('actif', $res->fetchOneCell());
+
+ return PL_OK;
+ }
+
function handler_tmpPWD(&$page, $certif = null)
{
global $globals;
{/literal}
<p>
- <a href="docs/doc_smtp.php">Pourquoi et comment</a> utiliser le serveur SMTP de Polytechnique.org. <br />
- <a href="docs/doc_nntp.php">Pourquoi et comment</a> utiliser le serveur NNTP de Polytechnique.org. <br />
+ <a href="{rel}/Docs/SMTPSécurisé">Pourquoi et comment</a> utiliser le serveur SMTP de Polytechnique.org.<br />
+ <a href="{rel}/Docs/NNTPSécurisé">Pourquoi et comment</a> utiliser le serveur NNTP de Polytechnique.org.<br />
</p>
<p>
{if $actif}
Pour activer un compte SMTP/NNTP sur <strong>ssl.polytechnique.org</strong>, tape un mot de passe ci-dessous.
{/if}
</p>
-<form action="{$smarty.server.REQUEST_URI}" method="post" id="smtppass_form">
+<form action="{rel}/password/smtp" method="post" id="smtppass_form">
<table class="tinybicol" cellpadding="3" summary="Définition du mot de passe">
<tr>
<th colspan="2">
</tr>
<tr class="pair">
<td>
- <h3><a href="{"acces_smtp.php"|url}">Activer l'accès SMTP et NNTP</a></h3>
+ <h3><a href="{rel}/password/smtp">Activer l'accès SMTP et NNTP</a></h3>
<div class='explication'>
Pour activer ton compte sur le serveur SMTP et NNTP de Polytechnique.org.
Cela te permet d'envoyer tes mails plus souplement (SMTP), et de consulter