source: trunk/identification.php @ 2675

Last change on this file since 2675 was 2325, checked in by rub, 17 years ago

Resolved issue 0000823: Enhance upload functionalities

First commit, others will be follow.
Not hesitate to change my translations.

Add upload configuration tabsheet (move and add configuration)
Change and add define for access level
Can show upload link every time
Can restrict access upload.class.php
Can choice category on upload page
Add upload class not use for the moment
Review quickly and temporary style of upload.tpl

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 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//--------------------------------------------------------------------- include
25define('PHPWG_ROOT_PATH','./');
26include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
27
28// +-----------------------------------------------------------------------+
29// | Check Access and exit when user status is not ok                      |
30// +-----------------------------------------------------------------------+
31check_status(ACCESS_FREE);
32
33//-------------------------------------------------------------- identification
34$errors = array();
35
36$redirect_to = '';
37if ( !empty($_GET['redirect']) )
38{
39  $redirect_to = urldecode($_GET['redirect']);
40  if ( is_a_guest() )
41  {
42    array_push($errors, l10n('access_forbiden'));
43  }
44}
45
46if (isset($_POST['login']))
47{
48  $redirect_to = isset($_POST['redirect']) ? $_POST['redirect'] : '';
49  $remember_me = isset($_POST['remember_me']) and $_POST['remember_me']==1;
50  if ( try_log_user($_POST['username'], $_POST['password'], $remember_me) )
51  {
52    redirect(empty($redirect_to) ? make_index_url() : $redirect_to);
53  }
54  else
55  {
56    array_push( $errors, l10n('invalid_pwd') );
57  }
58}
59
60//----------------------------------------------------- template initialization
61//
62// Start output of page
63//
64$title = l10n('identification');
65$page['body_id'] = 'theIdentificationPage';
66include(PHPWG_ROOT_PATH.'include/page_header.php');
67
68$template->set_filenames( array('identification'=>'identification.tpl') );
69
70$template->assign(
71  array(
72    'U_LOST_PASSWORD' => get_root_url().'password.php',
73    'U_REDIRECT' => $redirect_to,
74
75    'F_LOGIN_ACTION' => get_root_url().'identification.php',
76    'authorize_remembering' => $conf['authorize_remembering'],
77    ));
78
79if ($conf['allow_user_registration'])
80{
81  $template->assign('U_REGISTER', get_root_url().'register.php' );
82}
83
84//-------------------------------------------------------------- errors display
85if ( sizeof( $errors ) != 0 )
86{
87  $template->assign('errors', $errors);
88}
89
90//----------------------------------------------------------- html code display
91$template->pparse('identification');
92include(PHPWG_ROOT_PATH.'include/page_tail.php');
93?>
Note: See TracBrowser for help on using the repository browser.