2003-04-21 23:37:11 +02:00
|
|
|
<?php
|
|
|
|
|
2003-05-23 18:29:12 +02:00
|
|
|
require_once('../b2config.php');
|
2003-04-21 23:37:11 +02:00
|
|
|
|
|
|
|
/* checking login & pass in the database */
|
|
|
|
function veriflog() {
|
|
|
|
global $HTTP_COOKIE_VARS;
|
2003-06-01 07:16:53 +02:00
|
|
|
global $tableusers, $wpdb;
|
2003-04-21 23:37:11 +02:00
|
|
|
|
2003-05-24 00:21:37 +02:00
|
|
|
if (!empty($HTTP_COOKIE_VARS["wordpressuser"])) {
|
|
|
|
$user_login = $HTTP_COOKIE_VARS["wordpressuser"];
|
|
|
|
$user_pass_md5 = $HTTP_COOKIE_VARS["wordpresspass"];
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-05-24 23:28:33 +02:00
|
|
|
//if ( $user_login!="" && $user_pass!="" && $id_session!="" && $adresse_ip==$REMOTE_ADDR) {
|
|
|
|
// if ( !(veriflog()) AND !(verifcookielog()) ) {
|
2003-04-21 23:37:11 +02:00
|
|
|
if (!(veriflog())) {
|
2003-06-01 07:16:53 +02:00
|
|
|
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');
|
2003-05-24 00:21:37 +02:00
|
|
|
if (!empty($HTTP_COOKIE_VARS["wordpressuser"])) {
|
2003-06-01 07:16:53 +02:00
|
|
|
$error="<strong>Error</strong>: wrong login or password";
|
2003-04-21 23:37:11 +02:00
|
|
|
}
|
2003-05-25 01:42:36 +02:00
|
|
|
header("Location: $path/b2login.php");
|
2003-04-21 23:37:11 +02:00
|
|
|
exit();
|
|
|
|
}
|
2003-05-24 23:28:33 +02:00
|
|
|
//}
|
2003-04-21 23:37:11 +02:00
|
|
|
?>
|