source: trunk/identification.php @ 2231

Last change on this file since 2231 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
RevLine 
[2]1<?php
[354]2// +-----------------------------------------------------------------------+
[593]3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
[2014]5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
[354]6// +-----------------------------------------------------------------------+
[2014]7// | file          : $Id: identification.php 2223 2008-02-28 02:41:48Z rvelices $
[354]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// +-----------------------------------------------------------------------+
[2]26
[402]27//--------------------------------------------------------------------- include
[364]28define('PHPWG_ROOT_PATH','./');
29include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
[345]30
[1851]31// +-----------------------------------------------------------------------+
32// | Check Access and exit when user status is not ok                      |
33// +-----------------------------------------------------------------------+
34check_status(ACCESS_NONE);
35
[2]36//-------------------------------------------------------------- identification
[45]37$errors = array();
[1052]38
39$redirect_to = '';
40if ( !empty($_GET['redirect']) )
41{
[1061]42  $redirect_to = urldecode($_GET['redirect']);
[2029]43  if ( is_a_guest() )
[1052]44  {
[2014]45    array_push($errors, l10n('access_forbiden'));
[1052]46  }
47}
48
[541]49if (isset($_POST['login']))
[2]50{
[1056]51  $redirect_to = isset($_POST['redirect']) ? $_POST['redirect'] : '';
[1744]52  $remember_me = isset($_POST['remember_me']) and $_POST['remember_me']==1;
53  if ( try_log_user($_POST['username'], $_POST['password'], $remember_me) )
[2]54  {
[1082]55    redirect(empty($redirect_to) ? make_index_url() : $redirect_to);
[2]56  }
57  else
58  {
[2014]59    array_push( $errors, l10n('invalid_pwd') );
[2]60  }
61}
[1568]62
[2]63//----------------------------------------------------- template initialization
[345]64//
65// Start output of page
66//
[2014]67$title = l10n('identification');
[850]68$page['body_id'] = 'theIdentificationPage';
[369]69include(PHPWG_ROOT_PATH.'include/page_header.php');
[345]70
[365]71$template->set_filenames( array('identification'=>'identification.tpl') );
72
[2223]73$template->assign(
[402]74  array(
[2223]75    'U_LOST_PASSWORD' => get_root_url().'password.php',
[1052]76    'U_REDIRECT' => $redirect_to,
[1061]77
[2223]78    'F_LOGIN_ACTION' => get_root_url().'identification.php',
79    'authorize_remembering' => $conf['authorize_remembering'],
[402]80    ));
[555]81
[1652]82if ($conf['allow_user_registration'])
83{
[2223]84  $template->assign('U_REGISTER', get_root_url().'register.php' );
[1652]85}
86
[2]87//-------------------------------------------------------------- errors display
[87]88if ( sizeof( $errors ) != 0 )
[2]89{
[2223]90  $template->assign('errors', $errors);
[2]91}
[2223]92
[2]93//----------------------------------------------------------- html code display
[2223]94$template->pparse('identification');
[369]95include(PHPWG_ROOT_PATH.'include/page_tail.php');
[362]96?>
Note: See TracBrowser for help on using the repository browser.