Source for file login.php
Documentation is available at login.php
* LODEL - Logiciel d'Edition ELectronique.
* Copyright (c) 2001-2002, Ghislain Picard, Marin Dacos
* Copyright (c) 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
* Copyright (c) 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
* Copyright (c) 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
* Copyright (c) 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
* Copyright (c) 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
* Home page: http://www.lodel.org
* E-Mail: lodel@lodel.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., 675 Mass Ave, Cambridge, MA 02139, USA.
* @author Ghislain Picard
* @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
* @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
* @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
* @licence http://www.gnu.org/copyleft/gpl.html
* @package lodel/source/lodel/admin
require_once 'siteconfig.php';
if($_POST['passwd'] && $_POST['passwd2'] && $_POST['login']) {
require_once 'connect.php';
require_once 'loginfunc.php';
$retour = change_passwd($_POST['datab'], $_POST['login'], $_POST['old_passwd'], $_POST['passwd'], $_POST['passwd2']);
if($retour === "error_passwd") {
$context['suspended'] = 1;
} elseif($retour === false) {
$context['error_login'] = 1;
} elseif($retour === true) {
// on relance la procédure d'identification
if (!check_auth($_POST['login'], $_POST['passwd'], $site)) {
$context['error_login'] = 1;
// et on ouvre une session
header ("Location: http://". $_SERVER['SERVER_NAME']. ($_SERVER['SERVER_PORT'] != 80 ? ':'. $_SERVER['SERVER_PORT'] : ''). $context['url_retour']);
} elseif ($_POST['login']) {
require_once 'connect.php';
require_once 'loginfunc.php';
if (!check_auth($context['login'], $context['passwd'], $site)) {
$context['error_login'] = 1;
//Vérifie que le site est bloqué si l'utilisateur est pas lodeladmin
if($context['lodeluser']['rights'] < LEVEL_LODELADMIN) {
$context['site_bloque'] = $db->getOne(lq("SELECT 1 FROM #_MTP_sites WHERE name='$site' AND status >= 32"));
if($context['site_bloque'] == 1) {
$context['error_site_bloque'] = 1;
//vérifie que le compte n'est pas en suspend. Si c'est le cas, on amène l'utilisateur à modifier son mdp, sinon on l'identifie
$context['suspended'] = 1;
header ("Location: http://". $_SERVER['SERVER_NAME']. ($_SERVER['SERVER_PORT'] != 80 ? ':'. $_SERVER['SERVER_PORT'] : ''). $url_retour);
require_once 'connect.php';
$context['passwd'] = $passwd = 0;
/*if ($context['error_sitebloque']) { // on a deja verifie que la site est bloque.
$context['site_bloque'] = 1;
} else { // test si le site est bloque dans la DB.
$context['site_bloque'] = $db->getOne(lq("SELECT 1 FROM #_MTP_sites WHERE name='$site' AND status >= 32"));
$context['url_retour'] = $url_retour;
$context['error_timeout'] = $error_timeout;
$context['error_privilege'] = $error_privilege;
$view->render($context, 'login');
|