|
@@ -60,6 +60,7 @@ function validateSession($type = 'admin')
|
|
if ($good_password || $_POST[$type . '_hash_pass'] == sha1($user_info['passwd'] . $sc))
|
|
if ($good_password || $_POST[$type . '_hash_pass'] == sha1($user_info['passwd'] . $sc))
|
|
{
|
|
{
|
|
$_SESSION[$type . '_time'] = time();
|
|
$_SESSION[$type . '_time'] = time();
|
|
|
|
+ unset($_SESSION['request_referer']);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -74,6 +75,7 @@ function validateSession($type = 'admin')
|
|
if ($good_password || sha1(strtolower($user_info['username']) . $_POST[$type . '_pass']) == $user_info['passwd'])
|
|
if ($good_password || sha1(strtolower($user_info['username']) . $_POST[$type . '_pass']) == $user_info['passwd'])
|
|
{
|
|
{
|
|
$_SESSION[$type . '_time'] = time();
|
|
$_SESSION[$type . '_time'] = time();
|
|
|
|
+ unset($_SESSION['request_referer']);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -84,9 +86,17 @@ function validateSession($type = 'admin')
|
|
smf_openID_revalidate();
|
|
smf_openID_revalidate();
|
|
|
|
|
|
$_SESSION[$type . '_time'] = time();
|
|
$_SESSION[$type . '_time'] = time();
|
|
|
|
+ unset($_SESSION['request_referer']);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ // Better be sure to remember the real referer
|
|
|
|
+ if (empty($_SESSION['request_referer']))
|
|
|
|
+ $_SESSION['request_referer'] = isset($_SERVER['HTTP_REFERER']) ? @parse_url($_SERVER['HTTP_REFERER']) : array();
|
|
|
|
+ elseif (empty($_POST))
|
|
|
|
+ unset($_SESSION['request_referer']);
|
|
|
|
+
|
|
// Need to type in a password for that, man.
|
|
// Need to type in a password for that, man.
|
|
if (!isset($_GET['xml']))
|
|
if (!isset($_GET['xml']))
|
|
adminLogin($type);
|
|
adminLogin($type);
|
|
@@ -647,7 +657,10 @@ function checkSession($type = 'post', $from_action = '', $is_fatal = true)
|
|
}
|
|
}
|
|
|
|
|
|
// Check the referring site - it should be the same server at least!
|
|
// Check the referring site - it should be the same server at least!
|
|
- $referrer = isset($_SERVER['HTTP_REFERER']) ? @parse_url($_SERVER['HTTP_REFERER']) : array();
|
|
|
|
|
|
+ if (isset($_SESSION['request_referer']))
|
|
|
|
+ $referrer = $_SESSION['request_referer'];
|
|
|
|
+ else
|
|
|
|
+ $referrer = isset($_SERVER['HTTP_REFERER']) ? @parse_url($_SERVER['HTTP_REFERER']) : array();
|
|
if (!empty($referrer['host']))
|
|
if (!empty($referrer['host']))
|
|
{
|
|
{
|
|
if (strpos($_SERVER['HTTP_HOST'], ':') !== false)
|
|
if (strpos($_SERVER['HTTP_HOST'], ':') !== false)
|