Patch for compatibility with Bakery module if it exists
This commit is contained in:
parent
2733718e0f
commit
136ce6a70c
1 changed files with 10 additions and 5 deletions
|
@ -22,14 +22,19 @@ function securepages_prevent_hijack_init() {
|
|||
if ($user->uid > 0 && $page_match && securepages_is_secure() && variable_get('securepages_enable', FALSE)) {
|
||||
if (! isset($_COOKIE[SECUREPAGES_SESSID]) ||
|
||||
! drupal_valid_token($_COOKIE[SECUREPAGES_SESSID], 'securepages_prevent_hijack')) {
|
||||
watchdog('security',
|
||||
t('Session hijack attempt detected for user %user!',
|
||||
array('%user' => $user->name)));
|
||||
|
||||
$username = $user->name;
|
||||
session_destroy();
|
||||
$user = drupal_anonymous_user();
|
||||
sess_regenerate();
|
||||
drupal_access_denied();
|
||||
if (! isset($_COOKIE[CHOCOLATECHIP])) {
|
||||
watchdog('security',
|
||||
t('Session hijack attempt detected for user %user!',
|
||||
array('%user' => $user->name)));
|
||||
drupal_access_denied();
|
||||
} else {
|
||||
# drupal_goto('user', 'destination=' . $_GET['q']);
|
||||
drupal_goto($_GET['q']);
|
||||
}
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue