You are here

function customerror_user in Customerror 6

Same name and namespace in other branches
  1. 5 customerror.module \customerror_user()

Implements hook_user().

File

./customerror.module, line 261
Enables custom 404 (not found) and 403 (access denied) pages in Drupal.

Code

function customerror_user($op, $edit, $user) {
  switch ($op) {
    case 'login':

      // Check if we have a destination saved in the session.
      if (!empty($_SESSION['destination'])) {

        // If there is one, then set the REQUEST destination to it.
        $_REQUEST['destination'] = $_SESSION['destination'];

        // And clear the one in the session.
        unset($_SESSION['destination']);

        // User module then does a drupal_goto() after we return from here.
      }
  }
}