source: trunk/identification.php @ 1844

Last change on this file since 1844 was 1744, checked in by rvelices, 18 years ago
  • revert feature 564: log the login of each user; but add the possibility to be

done by a plugin

  • create a "standard" way to define PHP functions that we use but might not be

available in the current php version

  • when a comment is rejected (spam, anti-flood etc), put the content back to the

browser in case there is a real user behind it

  • now a comment can be entered only if the page was retrieved between 2 seconds

ago and 1 hour ago

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 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-2005 PhpWebGallery Team - http://phpwebgallery.net |
6// +-----------------------------------------------------------------------+
7// | branch        : BSF (Best So Far)
8// | file          : $RCSfile$
9// | last update   : $Date: 2007-01-23 01:22:52 +0000 (Tue, 23 Jan 2007) $
10// | last modifier : $Author: rvelices $
11// | revision      : $Revision: 1744 $
12// +-----------------------------------------------------------------------+
13// | This program is free software; you can redistribute it and/or modify  |
14// | it under the terms of the GNU General Public License as published by  |
15// | the Free Software Foundation                                          |
16// |                                                                       |
17// | This program is distributed in the hope that it will be useful, but   |
18// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
19// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
20// | General Public License for more details.                              |
21// |                                                                       |
22// | You should have received a copy of the GNU General Public License     |
23// | along with this program; if not, write to the Free Software           |
24// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
25// | USA.                                                                  |
26// +-----------------------------------------------------------------------+
27
28//--------------------------------------------------------------------- include
29define('PHPWG_ROOT_PATH','./');
30include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
31
32//-------------------------------------------------------------- identification
33$errors = array();
34
35$redirect_to = '';
36if ( !empty($_GET['redirect']) )
37{
38  $redirect_to = urldecode($_GET['redirect']);
39  if ( $user['is_the_guest'] )
40  {
41    array_push($errors, $lang['access_forbiden']);
42  }
43}
44
45if (isset($_POST['login']))
46{
47  $redirect_to = isset($_POST['redirect']) ? $_POST['redirect'] : '';
48  $remember_me = isset($_POST['remember_me']) and $_POST['remember_me']==1;
49  if ( try_log_user($_POST['username'], $_POST['password'], $remember_me) )
50  {
51    redirect(empty($redirect_to) ? make_index_url() : $redirect_to);
52  }
53  else
54  {
55    array_push( $errors, $lang['invalid_pwd'] );
56  }
57}
58
59//----------------------------------------------------- template initialization
60//
61// Start output of page
62//
63$title = $lang['identification'];
64$page['body_id'] = 'theIdentificationPage';
65include(PHPWG_ROOT_PATH.'include/page_header.php');
66
67$template->set_filenames( array('identification'=>'identification.tpl') );
68
69$template->assign_vars(
70  array(
71    'U_REGISTER' => PHPWG_ROOT_PATH.'register.php',
72    'U_LOST_PASSWORD' => PHPWG_ROOT_PATH.'password.php',
73    'U_HOME' => make_index_url(),
74    'U_REDIRECT' => $redirect_to,
75
76    'F_LOGIN_ACTION' => PHPWG_ROOT_PATH.'identification.php'
77    ));
78
79if ($conf['authorize_remembering'])
80{
81  $template->assign_block_vars('remember_me',array());
82}
83if ($conf['allow_user_registration'])
84{
85  $template->assign_block_vars('register',array());
86}
87
88//-------------------------------------------------------------- errors display
89if ( sizeof( $errors ) != 0 )
90{
91  $template->assign_block_vars('errors',array());
92  for ( $i = 0; $i < sizeof( $errors ); $i++ )
93  {
94    $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i]));
95  }
96}
97//-------------------------------------------------------------- visit as guest
98$template->assign_block_vars('free_access',array());
99//----------------------------------------------------------- html code display
100$template->parse('identification');
101include(PHPWG_ROOT_PATH.'include/page_tail.php');
102?>
Note: See TracBrowser for help on using the repository browser.