| 11 | | define("JLOG_ADMIN", true); |
|---|
| 12 | | define("JLOG_LOGIN", true); |
|---|
| 13 | | require_once('..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php'); |
|---|
| 14 | | require(JLOG_BASEPATH.'admin'.DIRECTORY_SEPARATOR.'blog.func.php'); |
|---|
| | 11 | define("JLOG_ADMIN", true); |
|---|
| | 12 | define("JLOG_LOGIN", true); |
|---|
| | 13 | require_once('..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php'); |
|---|
| | 14 | require(JLOG_BASEPATH.'admin'.DIRECTORY_SEPARATOR.'blog.func.php'); |
|---|
| 20 | | ### Plugin Hook |
|---|
| 21 | | $dispatch_login = $plugins->callHook('dispatchLogin', true); |
|---|
| 22 | | |
|---|
| 23 | | if ($_SERVER['REQUEST_METHOD'] == 'POST' AND $dispatch_login) { |
|---|
| 24 | | session_start(); |
|---|
| 25 | | $passwort = $post['password']; |
|---|
| 26 | | $url = !empty($post['url']) ? $post['url'] : ""; |
|---|
| 27 | | $hostname = $_SERVER['HTTP_HOST']; |
|---|
| 28 | | $path = dirname($_SERVER['SCRIPT_NAME']) . "/"; |
|---|
| | 20 | ### Plugin Hook |
|---|
| | 21 | $dispatch_login = $plugins->callHook('dispatchLogin', true); |
|---|
| | 22 | |
|---|
| | 23 | if ($_SERVER['REQUEST_METHOD'] == 'POST' AND $dispatch_login) { |
|---|
| | 24 | session_start(); |
|---|
| | 25 | $passwort = $post['password']; |
|---|
| | 26 | $url = !empty($post['url']) ? $post['url'] : ''; |
|---|
| | 27 | $hostname = $_SERVER['HTTP_HOST']; |
|---|
| | 28 | $path = dirname($_SERVER['SCRIPT_NAME']) . '/'; |
|---|
| | 29 | |
|---|
| | 30 | if (strpos($url, "\n") !== false or strpos($url, "\r") !== false) { |
|---|
| | 31 | die('Somebody tried to hack Jlog with Response-Splitting.'); |
|---|
| | 32 | } |
|---|
| | 33 | |
|---|
| | 34 | if (md5($passwort) == JLOG_ADMIN_PASSWORD) { |
|---|
| | 35 | $_SESSION['logged_in'] = true; |
|---|
| | 36 | session_regenerate_id(); // neue SID |
|---|
| | 37 | |
|---|
| | 38 | if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') { |
|---|
| | 39 | if (php_sapi_name() == 'cgi') header('Status: 303 See Other'); |
|---|
| | 40 | else header('HTTP/1.1 303 See Other'); |
|---|
| | 41 | } |
|---|
| | 42 | |
|---|
| | 43 | if ($path == $url) $url = $path . 'new.php'; |
|---|
| | 44 | if (!empty($url)) $path = $url; |
|---|
| 30 | | if ( md5( $passwort ) == JLOG_ADMIN_PASSWORD) { |
|---|
| 31 | | $_SESSION['logged_in'] = true; |
|---|
| 32 | | session_regenerate_id(); // neue SID |
|---|
| 33 | | |
|---|
| 34 | | if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') { |
|---|
| 35 | | if (php_sapi_name() == 'cgi') header('Status: 303 See Other'); |
|---|
| 36 | | else header('HTTP/1.1 303 See Other'); |
|---|
| 37 | | } |
|---|
| 38 | | |
|---|
| 39 | | if($path == $url) $url = $path."new.php"; |
|---|
| 40 | | if(!empty($url)) $path = $url; |
|---|
| 41 | | |
|---|
| 42 | | header('Location: ' . add_session_id_to_url("http://".$hostname.$path)); |
|---|
| 43 | | exit; |
|---|
| 44 | | } |
|---|
| 45 | | else { |
|---|
| 46 | | $false_password = " <p class='error'>".$l['admin']['login_false_pw']."</p>\n"; |
|---|
| 47 | | } |
|---|
| 48 | | } |
|---|
| 49 | | else { |
|---|
| 50 | | setcookie("cookieallowed", "true", time() + 180); |
|---|
| 51 | | } |
|---|
| 52 | | |
|---|
| 53 | | $c['meta']['title'] = $l['admin']['login_headline']; |
|---|
| 54 | | $c['main'] = ' |
|---|
| | 46 | header('Location: ' . add_session_id_to_url("http://".$hostname.$path)); |
|---|
| | 47 | exit; |
|---|
| | 48 | } |
|---|
| | 49 | else { |
|---|
| | 50 | $false_password = " <p class='error'>".$l['admin']['login_false_pw']."</p>\n"; |
|---|
| | 51 | } |
|---|
| | 52 | } |
|---|
| | 53 | else { |
|---|
| | 54 | setcookie("cookieallowed", "true", time() + 180); |
|---|
| | 55 | } |
|---|
| | 56 | |
|---|
| | 57 | $c['meta']['title'] = $l['admin']['login_headline']; |
|---|
| | 58 | $c['main'] = ' |
|---|