J'ai (a priori) trouvé mieux : j'ai créé et placé dans le même répertoire que
identification.php (à la racine), un fichier
auto_id.php permettant de fournir l'URL suivante :
xxxx.fai.com/piwigo/auto_id.php?username=lsdkjf
Si le compte
lsdkjf sans mot de passe (inutile en l'occurrence) a été créé dans cette galerie, le visiteur est redirigé vers la galerie, et voit ce qu'on lui permet de voir, identifié en tant que
lsdkjf. S'il n'existe pas, il voit le message d'identification erronée. Si
auto_id.php est appellé sans argument, le visiteur voit le message "Accès refusé".
Voici la totalité de
auto_id.php (c'est effectivement tout bête, y'a rien d'extraordinaire) :
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based picture gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | 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 |
// | |
// | 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. |
// +-----------------------------------------------------------------------+
//--------------------------------------------------------------------- include
define('PHPWG_ROOT_PATH','./');
include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
// +-----------------------------------------------------------------------+
check_status(ACCESS_FREE);
//-------------------------------------------------------------- identification
$errors = array();
if ( isset($_GET['username']) )
{
$redirect_to = '';
$remember_me = false;
if ( try_log_user($_GET['username'], '', $remember_me) )
{
redirect(make_index_url());
}
else
{
array_push($errors, l10n('access_forbiden'));
}
}
//----------------------------------------------------- template initialization
//
// Start output of page
//
$title = l10n('identification');
$page['body_id'] = 'theIdentificationPage';
include(PHPWG_ROOT_PATH.'include/page_header.php');
$template->set_filenames( array('identification'=>'identification.tpl') );
$template->assign(
array(
'U_LOST_PASSWORD' => get_root_url().'password.php',
'U_REDIRECT' => $redirect_to,
'F_LOGIN_ACTION' => get_root_url().'identification.php',
'authorize_remembering' => $conf['authorize_remembering'],
));
if ($conf['allow_user_registration'])
{
$template->assign('U_REGISTER', get_root_url().'register.php' );
}
//-------------------------------------------------------------- errors display
if ( sizeof( $errors ) != 0 )
{
$template->assign('errors', $errors);
}
//----------------------------------------------------------- html code display
$template->pparse('identification');
include(PHPWG_ROOT_PATH.'include/page_tail.php');
?>
J'ai l'intention, si on ne me corrige pas, de faire un petit tutoriel en images (petit à petit, hein, y me faut du temps...), qui sera en même temps une démonstration de la chose.
Allez je continue !
Luc