source: trunk/identification.php @ 2223

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