- #1389: Do not require validation for private names modifications -JAC
- #1401: Main addresses are displayed before secondary addresses -JAC
+ * Xnet:
+ - #1211: Adds login page for xnet users -JAC
+
* XnetGrp:
- #907: Adds more info about groups (address, phones, positions) -JAC
}
}
+ if (!S::logged() && Post::has('auth_type') && Post::v('auth_type') == 'xnet') {
+ $type = XDB::fetchOneCell('SELECT type
+ FROM accounts
+ WHERE hruid = {?}',
+ Post::v('username'));
+ if (!is_null($type) && $type != 'xnet') {
+ Platal::page()->trigErrorRedirect('Ce formulaire d\'authentification est réservé aux extérieurs à la communauté polytechnicienne.', '');
+ }
+
+ $user = parent::doAuth(AUTH_MDP);
+ if (is_null($user)) {
+ return false;
+ }
+ if (!parent::checkAuth(AUTH_MDP) || !parent::startSessionAs($user, AUTH_MDP)) {
+ $this->destroy();
+ return false;
+ }
+ }
+
global $globals;
if (!S::logged() && $globals->xnet->auth_baseurl) {
// prevent connection to be linked to disconnection
define('PL_PAGE_CLASS', 'XnetPage');
require_once dirname(dirname(__FILE__)) . '/core/include/platal.inc.php';
+require_once 'security.inc.php';
require_once 'common.inc.php';
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
'plan' => $this->make_hook('plan', AUTH_PUBLIC),
'photo' => $this->make_hook('photo', AUTH_MDP),
'autologin' => $this->make_hook('autologin', AUTH_MDP),
+ 'login/ext' => $this->make_hook('login_ext', AUTH_PUBLIC),
'edit' => $this->make_hook('edit', AUTH_MDP, 'user'),
'Xnet' => $this->make_wiki_hook(),
exit;
}
+ function handler_login_ext($page)
+ {
+ if (!S::logged()) {
+ $page->changeTpl('xnet/login.tpl');
+ } else {
+ pl_redirect('');
+ }
+ }
+
function handler_edit(&$page)
{
global $globals;
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2011 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 *}
+{* *}
+{**************************************************************************}
+
+<h1>Identification</h1>
+
+<form action="{$smarty.server.REQUEST_URI}" method="post" id="login" onsubmit='doChallengeResponse(); return false;'>
+ <table class="bicol">
+ <tr>
+ <td class="titre">Identifiant :</td>
+ <td>
+ <input type="text" name="username" />
+ <input type="hidden" name="domain" value="ax" />
+ </td>
+ </tr>
+ <tr>
+ <td class="titre">Mot de passe :</td>
+ <td><input type="password" name="password" size="10" maxlength="256" /></td>
+ </tr>
+ <tr>
+ <td {popup caption='Connexion permanente' width='300' text='Décocher cette case pour que le site oublie ce navigateur.<br />
+ Il est conseillé de décocher la case si cette machine n\'est pas <b>strictement</b> personnelle'} colspan="2">
+ <label><input type="checkbox" name="remember" checked="checked" />
+ Garder l'accès aux services après déconnexion.
+ </label>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" class="center"><input type="submit" name="submitbtn" value="Envoyer" /></td>
+ </tr>
+ </table>
+</form>
+
+<form action="{$smarty.server.REQUEST_URI}" method="post" id="loginsub">
+ <div>
+ <input type="hidden" name="challenge" value="{$smarty.session.challenge}" />
+ <input type="hidden" name="username" value="" />
+ <input type="hidden" name="remember" value="" />
+ <input type="hidden" name="response" value="" />
+ <input type="hidden" name="xorpass" value="" />
+ <input type="hidden" name="domain" value="" />
+ <input type="hidden" name="auth_type" value="xnet" />
+ </div>
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{list_all_my_groups}
{if !$smarty.session.auth}
<div>Me connecter :</div>
- <a class='gp' href="login/{if $platal->pl_self() eq 'exit'}index{else}{$platal->pl_self()}{/if}">polytechnicien</a>
- {if $platal->pl_self() neq 'exit'}
- <!-- <script type="text/javascript" src="login/autologin/{$platal->pl_self()}?forceXml=1"></script> -->
- {/if}
+ <table style="margin-left: 1em">
+ <tr>
+ <td>
+ <a class="gp" href="login/{if $platal->pl_self() eq 'exit'}index{else}{$platal->pl_self()}{/if}">X, masters, doctorants…</a>
+ </td>
+ </tr>
+ <tr>
+ <td><a class="gp" href="login/ext">Extérieurs</a></td>
+ </tr>
+ </table>
{/if}
</td>
<td class="right" style="vertical-align: middle">