2003-05-09 14:42:42 +02:00
|
|
|
<?php
|
2004-02-07 20:36:44 +01:00
|
|
|
// +-----------------------------------------------------------------------+
|
2011-01-18 01:02:52 +01:00
|
|
|
// | Piwigo - a PHP based photo gallery |
|
2008-04-05 00:57:23 +02:00
|
|
|
// +-----------------------------------------------------------------------+
|
2016-01-14 12:17:58 +01:00
|
|
|
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
|
2008-04-05 00:57:23 +02:00
|
|
|
// | 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 |
|
2004-02-07 20:36:44 +01:00
|
|
|
// | 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. |
|
|
|
|
// +-----------------------------------------------------------------------+
|
2003-05-09 14:42:42 +02:00
|
|
|
|
2004-03-30 00:40:21 +02:00
|
|
|
//--------------------------------------------------------------------- include
|
2004-02-19 01:31:09 +01:00
|
|
|
define('PHPWG_ROOT_PATH','./');
|
|
|
|
include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
|
2004-02-02 01:55:18 +01:00
|
|
|
|
2007-02-22 21:20:30 +01:00
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | Check Access and exit when user status is not ok |
|
|
|
|
// +-----------------------------------------------------------------------+
|
2008-05-02 23:56:21 +02:00
|
|
|
check_status(ACCESS_FREE);
|
2007-02-22 21:20:30 +01:00
|
|
|
|
2014-06-02 09:55:46 +02:00
|
|
|
trigger_notify('loc_begin_identification');
|
2012-09-20 14:16:45 +02:00
|
|
|
|
2003-05-09 14:42:42 +02:00
|
|
|
//-------------------------------------------------------------- identification
|
2006-02-23 06:12:32 +01:00
|
|
|
$redirect_to = '';
|
|
|
|
if ( !empty($_GET['redirect']) )
|
|
|
|
{
|
2006-03-01 05:33:52 +01:00
|
|
|
$redirect_to = urldecode($_GET['redirect']);
|
2007-06-06 00:01:15 +02:00
|
|
|
if ( is_a_guest() )
|
2006-02-23 06:12:32 +01:00
|
|
|
{
|
2013-10-19 19:43:04 +02:00
|
|
|
$page['errors'][] = l10n('You are not authorized to access the requested page');
|
2006-02-23 06:12:32 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-03 01:12:50 +02:00
|
|
|
if (isset($_POST['login']))
|
2003-05-09 14:42:42 +02:00
|
|
|
{
|
2010-02-23 16:52:32 +01:00
|
|
|
if (!isset($_COOKIE[session_name()]))
|
2003-05-09 14:42:42 +02:00
|
|
|
{
|
2013-10-19 19:43:04 +02:00
|
|
|
$page['errors'][] = l10n('Cookies are blocked or not supported by your browser. You must enable cookies to connect.');
|
2003-05-09 14:42:42 +02:00
|
|
|
}
|
|
|
|
else
|
2016-05-30 14:35:24 +02:00
|
|
|
{
|
2011-08-23 21:01:32 +02:00
|
|
|
if ($conf['insensitive_case_logon'] == true)
|
|
|
|
{
|
|
|
|
$_POST['username'] = search_case_username($_POST['username']);
|
|
|
|
}
|
|
|
|
|
|
|
|
$redirect_to = isset($_POST['redirect']) ? urldecode($_POST['redirect']) : '';
|
2010-02-23 16:52:32 +01:00
|
|
|
$remember_me = isset($_POST['remember_me']) and $_POST['remember_me']==1;
|
2016-05-30 14:35:24 +02:00
|
|
|
|
2010-02-23 16:52:32 +01:00
|
|
|
if ( try_log_user($_POST['username'], $_POST['password'], $remember_me) )
|
|
|
|
{
|
2011-06-14 14:14:29 +02:00
|
|
|
redirect(empty($redirect_to) ? get_gallery_home_url() : $redirect_to);
|
2010-02-23 16:52:32 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-05-30 14:35:24 +02:00
|
|
|
$page['errors'][] = l10n('Invalid username or password!');
|
2010-02-23 16:52:32 +01:00
|
|
|
}
|
2003-05-09 14:42:42 +02:00
|
|
|
}
|
|
|
|
}
|
2006-10-20 04:17:53 +02:00
|
|
|
|
2003-05-09 14:42:42 +02:00
|
|
|
//----------------------------------------------------- template initialization
|
2004-02-02 01:55:18 +01:00
|
|
|
//
|
|
|
|
// Start output of page
|
|
|
|
//
|
2010-03-02 15:54:22 +01:00
|
|
|
$title = l10n('Identification');
|
- new : HTML BODY identifier to let CSS stylesheets manage specific
behaviour.
- deletion : admin/search useless
- improvement : in admin/user_list, special behaviour for true/false fields
(expand, show_comments)
- new : gallery_title and gallery_description are displayed at the top of
each page.
- improvement : simplification in HTML for categories menu.
- improvement : standardization of presentation in all public pages
(identification, registration, search, profile, notification, comments,
etc.)
(not in ChangeLog, below this line)
- add forgotten notification.php (should have been added in a previous
commit)
- [template cclear] deletion of useless class .bouton
- [template cclear] for test purpose, new presentation of register page
(using FORM.filter)
- [template cclear] adaptation of admin/group_list from template default
- [template cclear] deletion of obsolete admin/infos_images
- [template cclear] deletion of obsolete admin/search_username
- [template cclear] new icon register.png
git-svn-id: http://piwigo.org/svn/trunk@850 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-08-26 00:43:47 +02:00
|
|
|
$page['body_id'] = 'theIdentificationPage';
|
2004-02-02 01:55:18 +01:00
|
|
|
|
2004-02-19 21:21:56 +01:00
|
|
|
$template->set_filenames( array('identification'=>'identification.tpl') );
|
|
|
|
|
2008-02-28 03:41:48 +01:00
|
|
|
$template->assign(
|
2004-03-30 00:40:21 +02:00
|
|
|
array(
|
2006-02-23 06:12:32 +01:00
|
|
|
'U_REDIRECT' => $redirect_to,
|
2006-03-01 05:33:52 +01:00
|
|
|
|
2008-02-28 03:41:48 +01:00
|
|
|
'F_LOGIN_ACTION' => get_root_url().'identification.php',
|
|
|
|
'authorize_remembering' => $conf['authorize_remembering'],
|
2004-03-30 00:40:21 +02:00
|
|
|
));
|
2004-10-07 00:48:48 +02:00
|
|
|
|
2012-01-12 21:50:46 +01:00
|
|
|
if (!$conf['gallery_locked'] && $conf['allow_user_registration'])
|
2006-12-13 02:05:38 +01:00
|
|
|
{
|
2008-02-28 03:41:48 +01:00
|
|
|
$template->assign('U_REGISTER', get_root_url().'register.php' );
|
2006-12-13 02:05:38 +01:00
|
|
|
}
|
|
|
|
|
2012-01-12 21:50:46 +01:00
|
|
|
if (!$conf['gallery_locked'])
|
|
|
|
{
|
|
|
|
$template->assign('U_LOST_PASSWORD', get_root_url().'password.php' );
|
|
|
|
}
|
|
|
|
|
2011-05-07 17:55:10 +02:00
|
|
|
// include menubar
|
|
|
|
$themeconf = $template->get_template_vars('themeconf');
|
2012-01-12 21:50:46 +01:00
|
|
|
if (!$conf['gallery_locked'] && (!isset($themeconf['hide_menu_on']) OR !in_array('theIdentificationPage', $themeconf['hide_menu_on'])))
|
2011-05-07 17:55:10 +02:00
|
|
|
{
|
|
|
|
include( PHPWG_ROOT_PATH.'include/menubar.inc.php');
|
|
|
|
}
|
|
|
|
|
2003-05-09 14:42:42 +02:00
|
|
|
//----------------------------------------------------------- html code display
|
2011-05-07 17:55:10 +02:00
|
|
|
include(PHPWG_ROOT_PATH.'include/page_header.php');
|
2014-06-02 09:55:46 +02:00
|
|
|
trigger_notify('loc_end_identification');
|
2013-02-07 22:17:08 +01:00
|
|
|
flush_page_messages();
|
2008-02-28 03:41:48 +01:00
|
|
|
$template->pparse('identification');
|
2004-02-22 03:43:13 +01:00
|
|
|
include(PHPWG_ROOT_PATH.'include/page_tail.php');
|
2004-02-12 00:20:38 +01:00
|
|
|
?>
|