Project

General

Profile

1
<?php
2

    
3
// $Id: login.php 944 2009-02-22 09:39:58Z Ruebenwurzel $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, Ryan Djurovich
9

    
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

    
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

    
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

    
24
*/
25

    
26
require_once("../config.php");
27

    
28
// Make sure the login is enabled
29
if(!FRONTEND_LOGIN) {
30
	if(INTRO_PAGE) {
31
		header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
32
		exit(0);
33
	} else {
34
		header('Location: '.WB_URL.'/index.php');
35
		exit(0);
36
	}
37
}
38

    
39
// Required page details
40
$page_id = 0;
41
$page_description = '';
42
$page_keywords = '';
43
define('PAGE_ID', 0);
44
define('ROOT_PARENT', 0);
45
define('PARENT', 0);
46
define('LEVEL', 0);
47
define('PAGE_TITLE', $TEXT['PLEASE_LOGIN']);
48
define('MENU_TITLE', $TEXT['PLEASE_LOGIN']);
49
define('VISIBILITY', 'public');
50
// Set the page content include file
51
define('PAGE_CONTENT', WB_PATH.'/account/login_form.php');
52

    
53
require_once(WB_PATH.'/framework/class.login.php');
54

    
55
// Create new login app
56
$redirect = strip_tags((isset($_REQUEST['redirect'])) ? $_REQUEST['redirect'] : '');
57
$thisApp = new Login(
58
							array(
59
									"MAX_ATTEMPS" => "3",
60
									"WARNING_URL" => THEME_URL."/templates/warning.htt",
61
									"USERNAME_FIELDNAME" => 'username',
62
									"PASSWORD_FIELDNAME" => 'password',
63
									"REMEMBER_ME_OPTION" => SMART_LOGIN,
64
									"MIN_USERNAME_LEN" => "2",
65
									"MIN_PASSWORD_LEN" => "2",
66
									"MAX_USERNAME_LEN" => "30",
67
									"MAX_PASSWORD_LEN" => "30",
68
									"LOGIN_URL" => WB_URL."/account/login.php?redirect=" .$redirect,
69
									"DEFAULT_URL" => WB_URL.PAGES_DIRECTORY."/index.php",
70
									"TEMPLATE_DIR" => THEME_PATH."/templates",
71
									"TEMPLATE_FILE" => "login.htt",
72
									"FRONTEND" => true,
73
									"FORGOTTEN_DETAILS_APP" => WB_URL."/account/forgot.php",
74
									"USERS_TABLE" => TABLE_PREFIX."users",
75
									"GROUPS_TABLE" => TABLE_PREFIX."groups",
76
									"REDIRECT_URL" => $redirect
77
							)
78
					);
79

    
80
// Set extra outsider var
81
$globals[] = 'thisApp';
82

    
83
// Include the index (wrapper) file
84
require(WB_PATH.'/index.php');
85

    
86

    
87
?>
(6-6/15)