source: trunk/identification.php @ 2297

Last change on this file since 2297 was 2297, checked in by plg, 16 years ago

Modification: new header on PHP files, PhpWebGallery renamed Piwigo.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 5.3 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Piwigo - a PHP based picture gallery                                  |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2008      Piwigo Team                  http://piwigo.org |
6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
8// +-----------------------------------------------------------------------+
9// | This program is free software; you can redistribute it and/or modify  |
10// | it under the terms of the GNU General Public License as published by  |
11// | the Free Software Foundation                                          |
12// |                                                                       |
13// | This program is distributed in the hope that it will be useful, but   |
14// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
15// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
16// | General Public License for more details.                              |
17// |                                                                       |
18// | You should have received a copy of the GNU General Public License     |
19// | along with this program; if not, write to the Free Software           |
20// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
21// | USA.                                                                  |
22// +-----------------------------------------------------------------------+
23// +-----------------------------------------------------------------------+
24// | PhpWebGallery - a PHP based picture gallery                           |
25// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
26// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
27// +-----------------------------------------------------------------------+
28// | file          : $Id: identification.php 2297 2008-04-04 22:57:23Z plg $
29// | last update   : $Date: 2008-04-04 22:57:23 +0000 (Fri, 04 Apr 2008) $
30// | last modifier : $Author: plg $
31// | revision      : $Revision: 2297 $
32// +-----------------------------------------------------------------------+
33// | This program is free software; you can redistribute it and/or modify  |
34// | it under the terms of the GNU General Public License as published by  |
35// | the Free Software Foundation                                          |
36// |                                                                       |
37// | This program is distributed in the hope that it will be useful, but   |
38// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
39// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
40// | General Public License for more details.                              |
41// |                                                                       |
42// | You should have received a copy of the GNU General Public License     |
43// | along with this program; if not, write to the Free Software           |
44// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
45// | USA.                                                                  |
46// +-----------------------------------------------------------------------+
47
48//--------------------------------------------------------------------- include
49define('PHPWG_ROOT_PATH','./');
50include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
51
52// +-----------------------------------------------------------------------+
53// | Check Access and exit when user status is not ok                      |
54// +-----------------------------------------------------------------------+
55check_status(ACCESS_NONE);
56
57//-------------------------------------------------------------- identification
58$errors = array();
59
60$redirect_to = '';
61if ( !empty($_GET['redirect']) )
62{
63  $redirect_to = urldecode($_GET['redirect']);
64  if ( is_a_guest() )
65  {
66    array_push($errors, l10n('access_forbiden'));
67  }
68}
69
70if (isset($_POST['login']))
71{
72  $redirect_to = isset($_POST['redirect']) ? $_POST['redirect'] : '';
73  $remember_me = isset($_POST['remember_me']) and $_POST['remember_me']==1;
74  if ( try_log_user($_POST['username'], $_POST['password'], $remember_me) )
75  {
76    redirect(empty($redirect_to) ? make_index_url() : $redirect_to);
77  }
78  else
79  {
80    array_push( $errors, l10n('invalid_pwd') );
81  }
82}
83
84//----------------------------------------------------- template initialization
85//
86// Start output of page
87//
88$title = l10n('identification');
89$page['body_id'] = 'theIdentificationPage';
90include(PHPWG_ROOT_PATH.'include/page_header.php');
91
92$template->set_filenames( array('identification'=>'identification.tpl') );
93
94$template->assign(
95  array(
96    'U_LOST_PASSWORD' => get_root_url().'password.php',
97    'U_REDIRECT' => $redirect_to,
98
99    'F_LOGIN_ACTION' => get_root_url().'identification.php',
100    'authorize_remembering' => $conf['authorize_remembering'],
101    ));
102
103if ($conf['allow_user_registration'])
104{
105  $template->assign('U_REGISTER', get_root_url().'register.php' );
106}
107
108//-------------------------------------------------------------- errors display
109if ( sizeof( $errors ) != 0 )
110{
111  $template->assign('errors', $errors);
112}
113
114//----------------------------------------------------------- html code display
115$template->pparse('identification');
116include(PHPWG_ROOT_PATH.'include/page_tail.php');
117?>
Note: See TracBrowser for help on using the repository browser.