Project

General

Profile

« Previous | Next » 

Revision 1529

Added by Dietmar almost 13 years ago

add new backend theme handling (Tks to Stefek)

View differences:

login.php
48 48
define('PAGE_CONTENT', WB_PATH.'/account/login_form.php');
49 49

  
50 50
require_once(WB_PATH.'/framework/class.login.php');
51
require_once(WB_PATH.'/framework/class.frontend.php');
51 52

  
53
// Create new frontend object
54
$wb = new frontend();
55

  
52 56
// Create new login app
53 57
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
54
$redirect = strip_tags(isset(${$requestMethod}['redirect']) ? ${$requestMethod}['redirect'] : '');
58
$redirect  = strip_tags(isset(${$requestMethod}['redirect']) ? ${$requestMethod}['redirect'] : '');
59
$redirect = ((isset($_SERVER['HTTP_REFERER']) && empty($redirect)) ?  $_SERVER['HTTP_REFERER'] : $redirect);
60
$_SESSION['HTTP_REFERER'] = str_replace(WB_URL,'',$redirect);
61

  
62
$loginUrl  = WB_URL.'/account/login.php';
63
$loginUrl .= (!empty($redirect) ? '?redirect=' .$_SESSION['HTTP_REFERER'] : '');
64

  
65
$ThemeUrl  = WB_URL.$wb->correct_theme_source('warning.html');
66
// Setup template object, parse vars to it, then parse it
67
$ThemePath = realpath(WB_PATH.$wb->correct_theme_source('login.htt'));
68

  
55 69
$thisApp = new Login(
56 70
				array(
57 71
						"MAX_ATTEMPS" => "3",
58
						"WARNING_URL" => THEME_URL."/templates/warning.html",
72
						"WARNING_URL" => $ThemeUrl."/warning.html",
59 73
						"USERNAME_FIELDNAME" => 'username',
60 74
						"PASSWORD_FIELDNAME" => 'password',
61 75
						"REMEMBER_ME_OPTION" => SMART_LOGIN,
......
63 77
						"MIN_PASSWORD_LEN" => "2",
64 78
						"MAX_USERNAME_LEN" => "30",
65 79
						"MAX_PASSWORD_LEN" => "30",
66
						"LOGIN_URL" => WB_URL."/account/login.php?redirect=" .$redirect,
80
						"LOGIN_URL" => $loginUrl,
67 81
						"DEFAULT_URL" => WB_URL.PAGES_DIRECTORY."/index.php",
68
						"TEMPLATE_DIR" => THEME_PATH."/templates",
82
						"TEMPLATE_DIR" => $ThemePath,
69 83
						"TEMPLATE_FILE" => "login.htt",
70 84
						"FRONTEND" => true,
71 85
						"FORGOTTEN_DETAILS_APP" => WB_URL."/account/forgot.php",

Also available in: Unified diff