| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
require('../includes/config/settings.php'); |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
function __autoload($class) { |
|---|
| 30 |
global $SETTINGS; |
|---|
| 31 |
if (is_file($SETTINGS['fspath'] . 'classes/pages/' . $class . '.php')) { |
|---|
| 32 |
require_once($SETTINGS['fspath'] . 'classes/pages/' . $class . '.php'); |
|---|
| 33 |
} elseif (is_file($SETTINGS['fspath'] . 'classes/misc/' . $class . '.php')) { |
|---|
| 34 |
require_once($SETTINGS['fspath'] . 'classes/misc/' . $class . '.php'); |
|---|
| 35 |
} else { die('Class ' . $class . ' not found.'); } |
|---|
| 36 |
} |
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
$WARNINGS = Array(); |
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
require_once($SETTINGS['fspath'] . 'includes/config/version.php'); |
|---|
| 43 |
|
|---|
| 44 |
require_once($SETTINGS['fspath'] . 'includes/config/bots.php'); |
|---|
| 45 |
|
|---|
| 46 |
require($SETTINGS['fspath'] . 'includes/config/crypt.php'); |
|---|
| 47 |
|
|---|
| 48 |
$F = new Format(); |
|---|
| 49 |
require($SETTINGS['fspath'] . 'includes/lang/' . $SETTINGS['language'] . '.php'); |
|---|
| 50 |
require($SETTINGS['fspath'] . 'includes/input.php'); |
|---|
| 51 |
|
|---|
| 52 |
$C = new Connection(); |
|---|
| 53 |
Member::session(); |
|---|
| 54 |
if (isset($_SESSION['lang']) && $_SESSION['lang'] != '') { |
|---|
| 55 |
|
|---|
| 56 |
include($SETTINGS['fspath'] . 'includes/lang/' . $_SESSION['lang'] . '.php'); |
|---|
| 57 |
} |
|---|
| 58 |
|
|---|
| 59 |
if (Page::checkLogins()) { |
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
if (Member::checkRights('Login', 'w')) { |
|---|
| 63 |
|
|---|
| 64 |
// try authenticating member |
|---|
| 65 |
if (Member::authenticate($INPUT['user'], $INPUT['password'])) { |
|---|
| 66 |
if (!isset($INPUT['remember'])) { |
|---|
| 67 |
$INPUT['remember'] = 'n'; |
|---|
| 68 |
} |
|---|
| 69 |
if (isset($INPUT['admin'])) { |
|---|
| 70 |
Member::login($INPUT['user'], $INPUT['remember'], $INPUT['admin']); |
|---|
| 71 |
} else { |
|---|
| 72 |
Member::login($INPUT['user'], $INPUT['remember']); |
|---|
| 73 |
} |
|---|
| 74 |
|
|---|
| 75 |
$C = NULL; |
|---|
| 76 |
|
|---|
| 77 |
if (strpos($_SESSION['page_ref2'], '?') === FALSE) { |
|---|
| 78 |
$ref = $_SESSION['page_ref2'] . '?'; |
|---|
| 79 |
} else { |
|---|
| 80 |
$ref = $_SESSION['page_ref2']; |
|---|
| 81 |
} |
|---|
| 82 |
|
|---|
| 83 |
header('Location: ' . $SETTINGS['webpath'] . $ref . '&' . strip_tags(SID)); |
|---|
| 84 |
|
|---|
| 85 |
print($LANG['login_success']); |
|---|
| 86 |
} else { |
|---|
| 87 |
|
|---|
| 88 |
print($LANG['error_userpassword']); |
|---|
| 89 |
} |
|---|
| 90 |
} else { |
|---|
| 91 |
print($LANG['error_permission_denied']); |
|---|
| 92 |
} |
|---|
| 93 |
|
|---|
| 94 |
} |
|---|
| 95 |
|
|---|
| 96 |
?> |
|---|