Revision 1473
Added by Luisehahne over 14 years ago
| login.php | ||
|---|---|---|
| 1 |
<?php |
|
| 2 |
/** |
|
| 3 |
* |
|
| 4 |
* @category frontend |
|
| 5 |
* @package account |
|
| 6 |
* @author WebsiteBaker Project |
|
| 7 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
| 9 |
* @link http://www.websitebaker2.org/ |
|
| 10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
| 11 |
* @platform WebsiteBaker 2.8.x |
|
| 12 |
* @requirements PHP 5.2.2 and higher |
|
| 13 |
* @version $Id$ |
|
| 14 |
* @filesource $HeadURL$ |
|
| 15 |
* @lastmodified $Date$ |
|
| 16 |
* |
|
| 17 |
*/ |
|
| 18 |
|
|
| 19 |
require_once("../config.php");
|
|
| 20 |
|
|
| 21 |
// Make sure the login is enabled |
|
| 22 |
if(!FRONTEND_LOGIN) {
|
|
| 23 |
if(INTRO_PAGE) {
|
|
| 24 |
header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
|
|
| 25 |
exit(0); |
|
| 26 |
} else {
|
|
| 27 |
header('Location: '.WB_URL.'/index.php');
|
|
| 28 |
exit(0); |
|
| 29 |
} |
|
| 30 |
} |
|
| 31 |
|
|
| 32 |
// Required page details |
|
| 33 |
$page_id = 0; |
|
| 34 |
$page_description = ''; |
|
| 35 |
$page_keywords = ''; |
|
| 36 |
define('PAGE_ID', 0);
|
|
| 37 |
define('ROOT_PARENT', 0);
|
|
| 38 |
define('PARENT', 0);
|
|
| 39 |
define('LEVEL', 0);
|
|
| 40 |
define('PAGE_TITLE', $TEXT['PLEASE_LOGIN']);
|
|
| 41 |
define('MENU_TITLE', $TEXT['PLEASE_LOGIN']);
|
|
| 42 |
define('VISIBILITY', 'public');
|
|
| 43 |
// Set the page content include file |
|
| 44 |
define('PAGE_CONTENT', WB_PATH.'/account/login_form.php');
|
|
| 45 |
|
|
| 46 |
require_once(WB_PATH.'/framework/class.login.php'); |
|
| 47 |
|
|
| 48 |
// Create new login app |
|
| 49 |
$redirect = strip_tags((isset($_POST['redirect'])) ? $_POST['redirect'] : ''); |
|
| 50 |
$thisApp = new Login( |
|
| 51 |
array( |
|
| 52 |
"MAX_ATTEMPS" => "3", |
|
| 53 |
"WARNING_URL" => THEME_URL."/templates/warning.html", |
|
| 54 |
"USERNAME_FIELDNAME" => 'username', |
|
| 55 |
"PASSWORD_FIELDNAME" => 'password', |
|
| 56 |
"REMEMBER_ME_OPTION" => SMART_LOGIN, |
|
| 57 |
"MIN_USERNAME_LEN" => "2", |
|
| 58 |
"MIN_PASSWORD_LEN" => "2", |
|
| 59 |
"MAX_USERNAME_LEN" => "30", |
|
| 60 |
"MAX_PASSWORD_LEN" => "30", |
|
| 61 |
"LOGIN_URL" => WB_URL."/account/login.php?redirect=" .$redirect, |
|
| 62 |
"DEFAULT_URL" => WB_URL.PAGES_DIRECTORY."/index.php", |
|
| 63 |
"TEMPLATE_DIR" => THEME_PATH."/templates", |
|
| 64 |
"TEMPLATE_FILE" => "login.htt", |
|
| 65 |
"FRONTEND" => true, |
|
| 66 |
"FORGOTTEN_DETAILS_APP" => WB_URL."/account/forgot.php", |
|
| 67 |
"USERS_TABLE" => TABLE_PREFIX."users", |
|
| 68 |
"GROUPS_TABLE" => TABLE_PREFIX."groups", |
|
| 69 |
"REDIRECT_URL" => $redirect |
|
| 70 |
) |
|
| 71 |
); |
|
| 72 |
|
|
| 73 |
// Set extra outsider var |
|
| 74 |
$globals[] = 'thisApp'; |
|
| 75 |
|
|
| 76 |
// Include the index (wrapper) file |
|
| 77 |
require(WB_PATH.'/index.php'); |
|
| 78 |
|
|
| 79 |
|
|
| 80 |
?> |
|
| 1 |
<?php |
|
| 2 |
/** |
|
| 3 |
* |
|
| 4 |
* @category frontend |
|
| 5 |
* @package account |
|
| 6 |
* @author WebsiteBaker Project |
|
| 7 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
| 9 |
* @link http://www.websitebaker2.org/ |
|
| 10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
| 11 |
* @platform WebsiteBaker 2.8.x |
|
| 12 |
* @requirements PHP 5.2.2 and higher |
|
| 13 |
* @version $Id$ |
|
| 14 |
* @filesource $HeadURL$ |
|
| 15 |
* @lastmodified $Date$ |
|
| 16 |
* |
|
| 17 |
*/ |
|
| 18 |
|
|
| 19 |
require_once("../config.php");
|
|
| 20 |
|
|
| 21 |
// Make sure the login is enabled |
|
| 22 |
if(!FRONTEND_LOGIN) {
|
|
| 23 |
if(INTRO_PAGE) {
|
|
| 24 |
header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
|
|
| 25 |
exit(0); |
|
| 26 |
} else {
|
|
| 27 |
header('Location: '.WB_URL.'/index.php');
|
|
| 28 |
exit(0); |
|
| 29 |
} |
|
| 30 |
} |
|
| 31 |
|
|
| 32 |
// Required page details |
|
| 33 |
$page_id = 0; |
|
| 34 |
$page_description = ''; |
|
| 35 |
$page_keywords = ''; |
|
| 36 |
define('PAGE_ID', 0);
|
|
| 37 |
define('ROOT_PARENT', 0);
|
|
| 38 |
define('PARENT', 0);
|
|
| 39 |
define('LEVEL', 0);
|
|
| 40 |
define('PAGE_TITLE', $TEXT['PLEASE_LOGIN']);
|
|
| 41 |
define('MENU_TITLE', $TEXT['PLEASE_LOGIN']);
|
|
| 42 |
define('VISIBILITY', 'public');
|
|
| 43 |
// Set the page content include file |
|
| 44 |
define('PAGE_CONTENT', WB_PATH.'/account/login_form.php');
|
|
| 45 |
|
|
| 46 |
require_once(WB_PATH.'/framework/class.login.php'); |
|
| 47 |
|
|
| 48 |
// Create new login app |
|
| 49 |
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']); |
|
| 50 |
$redirect = strip_tags(isset(${$requestMethod}['redirect']) ? ${$requestMethod}['redirect'] : '');
|
|
| 51 |
$thisApp = new Login( |
|
| 52 |
array( |
|
| 53 |
"MAX_ATTEMPS" => "3", |
|
| 54 |
"WARNING_URL" => THEME_URL."/templates/warning.html", |
|
| 55 |
"USERNAME_FIELDNAME" => 'username', |
|
| 56 |
"PASSWORD_FIELDNAME" => 'password', |
|
| 57 |
"REMEMBER_ME_OPTION" => SMART_LOGIN, |
|
| 58 |
"MIN_USERNAME_LEN" => "2", |
|
| 59 |
"MIN_PASSWORD_LEN" => "2", |
|
| 60 |
"MAX_USERNAME_LEN" => "30", |
|
| 61 |
"MAX_PASSWORD_LEN" => "30", |
|
| 62 |
"LOGIN_URL" => WB_URL."/account/login.php?redirect=" .$redirect, |
|
| 63 |
"DEFAULT_URL" => WB_URL.PAGES_DIRECTORY."/index.php", |
|
| 64 |
"TEMPLATE_DIR" => THEME_PATH."/templates", |
|
| 65 |
"TEMPLATE_FILE" => "login.htt", |
|
| 66 |
"FRONTEND" => true, |
|
| 67 |
"FORGOTTEN_DETAILS_APP" => WB_URL."/account/forgot.php", |
|
| 68 |
"USERS_TABLE" => TABLE_PREFIX."users", |
|
| 69 |
"GROUPS_TABLE" => TABLE_PREFIX."groups", |
|
| 70 |
"REDIRECT_URL" => $redirect |
|
| 71 |
) |
|
| 72 |
); |
|
| 73 |
|
|
| 74 |
// Set extra outsider var |
|
| 75 |
$globals[] = 'thisApp'; |
|
| 76 |
|
|
| 77 |
// Include the index (wrapper) file |
|
| 78 |
require(WB_PATH.'/index.php'); |
|
| 79 |
|
|
Also available in: Unified diff
found more backlinks to fix
remove not working ftan in frontend
fixed redirect in login procedure (Tks to mr-fan)
update droplet LoginBox, additional parameter $redirect
remove double config call in media (Tks to Testör)