You are here

function customerror_user in Customerror 5

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

File

./customerror.module, line 192
Enables custom 404 (not found) and 403 (access denied) pages in Drupal with no need for creating real nodes under taxonomies

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() for us after we return from here
      }
  }
}