Revision 1792
Added by Dietmar about 12 years ago
login.php | ||
---|---|---|
15 | 15 |
* |
16 | 16 |
*/ |
17 | 17 |
|
18 |
require_once("../config.php"); |
|
18 |
// Include config file |
|
19 |
$config_file = realpath('../config.php'); |
|
20 |
if(file_exists($config_file) && !defined('WB_URL')) |
|
21 |
{ |
|
22 |
require_once($config_file); |
|
23 |
} |
|
19 | 24 |
|
25 |
if(!class_exists('login', false)){ include(WB_PATH.'/framework/class.login.php'); } |
|
26 |
if(!class_exists('frontend', false)){ include(WB_PATH.'/framework/class.frontend.php'); } |
|
27 |
|
|
28 |
require_once(WB_PATH.'/framework/functions.php'); |
|
29 |
|
|
30 |
$wb = new frontend(false); |
|
31 |
|
|
20 | 32 |
// Make sure the login is enabled |
21 | 33 |
if(!FRONTEND_LOGIN) { |
22 |
header('Location: '.WB_URL.'/index.php');
|
|
34 |
header('Location: '.WB_URL.'/'); |
|
23 | 35 |
exit(0); |
24 | 36 |
// if(INTRO_PAGE) { |
25 | 37 |
// header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php'); |
... | ... | |
28 | 40 |
// } |
29 | 41 |
} |
30 | 42 |
|
31 |
$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
|
|
43 |
$page_id = defined('REFERRER_ID') ? REFERRER_ID : isset($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
|
|
32 | 44 |
|
33 | 45 |
// Required page details |
34 |
// $page_id = 0; |
|
35 | 46 |
$page_description = ''; |
36 | 47 |
$page_keywords = ''; |
48 |
// Work out level |
|
49 |
$level = ($page_id > 0 )? level_count($page_id): $page_id; |
|
50 |
// Work out root parent |
|
51 |
$root_parent = ($page_id > 0 )? root_parent($page_id): $page_id; |
|
52 |
|
|
37 | 53 |
define('PAGE_ID', $page_id); |
38 |
define('ROOT_PARENT', 0);
|
|
54 |
define('ROOT_PARENT', $root_parent);
|
|
39 | 55 |
define('PARENT', 0); |
40 |
define('LEVEL', 0); |
|
56 |
define('LEVEL', $level); |
|
57 |
|
|
41 | 58 |
define('PAGE_TITLE', $TEXT['PLEASE_LOGIN']); |
42 | 59 |
define('MENU_TITLE', $TEXT['PLEASE_LOGIN']); |
43 | 60 |
define('VISIBILITY', 'public'); |
44 | 61 |
// Set the page content include file |
45 | 62 |
define('PAGE_CONTENT', WB_PATH.'/account/login_form.php'); |
46 | 63 |
|
47 |
require_once(WB_PATH.'/framework/class.login.php'); |
|
48 |
require_once(WB_PATH.'/framework/class.frontend.php'); |
|
49 |
|
|
50 |
// Create new frontend object |
|
51 |
$wb = new frontend(); |
|
52 |
|
|
53 | 64 |
// Create new login app |
54 | 65 |
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']); |
55 | 66 |
$redirect = strip_tags(isset(${$requestMethod}['redirect']) ? ${$requestMethod}['redirect'] : ''); |
... | ... | |
59 | 70 |
$loginUrl = WB_URL.'/account/login.php'; |
60 | 71 |
$loginUrl .= (!empty($redirect) ? '?redirect=' .$_SESSION['HTTP_REFERER'] : ''); |
61 | 72 |
|
62 |
//print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong> basename: '.basename(__FILE__).' line: '.__LINE__.' -> <br />'; |
|
63 |
//print_r( $redirect ); print '</pre>'; |
|
64 |
|
|
65 | 73 |
$ThemeUrl = WB_URL.$wb->correct_theme_source('warning.html'); |
66 | 74 |
// Setup template object, parse vars to it, then parse it |
67 | 75 |
$ThemePath = realpath(WB_PATH.$wb->correct_theme_source('loginBox.htt')); |
... | ... | |
86 | 94 |
"USERS_TABLE" => TABLE_PREFIX."users", |
87 | 95 |
"GROUPS_TABLE" => TABLE_PREFIX."groups", |
88 | 96 |
"REDIRECT_URL" => $redirect |
89 |
)
|
|
97 |
)
|
|
90 | 98 |
); |
91 | 99 |
|
92 | 100 |
// Set extra outsider var |
Also available in: Unified diff
! all changes in folder account, Signup with confirmation Mail
! frontend.css now included by account script