2003-04-21 23:37:11 +02:00
|
|
|
<?php
|
|
|
|
|
2003-06-13 00:47:45 +02:00
|
|
|
require_once('../wp-config.php');
|
2003-04-21 23:37:11 +02:00
|
|
|
|
2004-02-09 10:56:57 +01:00
|
|
|
/* Checking login & pass in the database */
|
2003-04-21 23:37:11 +02:00
|
|
|
function veriflog() {
|
2004-02-26 17:15:48 +01:00
|
|
|
global $cookiehash;
|
2003-12-05 02:27:00 +01:00
|
|
|
global $tableusers, $wpdb;
|
2003-04-21 23:37:11 +02:00
|
|
|
|
2004-02-26 17:15:48 +01:00
|
|
|
if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) {
|
|
|
|
$user_login = $_COOKIE['wordpressuser_' . $cookiehash];
|
|
|
|
$user_pass_md5 = $_COOKIE['wordpresspass_' . $cookiehash];
|
2003-04-21 23:37:11 +02:00
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2003-06-01 07:16:53 +02:00
|
|
|
if (!($user_login != ''))
|
2003-04-21 23:37:11 +02:00
|
|
|
return false;
|
|
|
|
if (!$user_pass_md5)
|
|
|
|
return false;
|
|
|
|
|
2003-06-01 07:16:53 +02:00
|
|
|
$login = $wpdb->get_row("SELECT user_login, user_pass FROM $tableusers WHERE user_login = '$user_login'");
|
2003-04-21 23:37:11 +02:00
|
|
|
|
2003-06-01 07:16:53 +02:00
|
|
|
if (!$login) {
|
2003-04-21 23:37:11 +02:00
|
|
|
return false;
|
|
|
|
} else {
|
2003-06-01 07:16:53 +02:00
|
|
|
if ($login->user_login == $user_login && md5($login->user_pass) == $user_pass_md5) {
|
2003-04-21 23:37:11 +02:00
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-02-09 10:56:57 +01:00
|
|
|
|
|
|
|
if ( !veriflog() ) {
|
|
|
|
header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
|
|
|
|
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
|
|
|
header('Cache-Control: no-cache, must-revalidate');
|
|
|
|
header('Pragma: no-cache');
|
2004-02-26 17:15:48 +01:00
|
|
|
if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) {
|
2004-04-23 08:46:53 +02:00
|
|
|
$error= __("<strong>Error</strong>: wrong login or password.");
|
2003-04-21 23:37:11 +02:00
|
|
|
}
|
2004-02-26 17:15:48 +01:00
|
|
|
$redir = 'Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']);
|
2004-02-09 10:56:57 +01:00
|
|
|
header($redir);
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2003-11-25 01:46:52 +01:00
|
|
|
?>
|