You are here

function logintoboggan_denied in LoginToboggan 7

Same name and namespace in other branches
  1. 5 logintoboggan.module \logintoboggan_denied()
  2. 6 logintoboggan.module \logintoboggan_denied()
1 string reference to 'logintoboggan_denied'
logintoboggan_menu in ./logintoboggan.module
Implement hook_menu()

File

./logintoboggan.module, line 952
LoginToboggan module

Code

function logintoboggan_denied() {
  $original_path = $_GET['destination'];
  unset($_GET['destination']);
  if ($GLOBALS['user']->uid == 0 && ($path = drupal_get_normal_path(variable_get('logintoboggan_anon_403', ''))) && $path != $original_path) {
    drupal_goto($path, array(
      'query' => array(
        'destination' => $original_path,
      ),
    ));
  }
  elseif (($path = drupal_get_normal_path(variable_get('logintoboggan_auth_403', ''))) && $path != $original_path) {
    drupal_goto($path, array(
      'query' => array(
        'destination' => $original_path,
      ),
    ));
  }
  else {

    // Standard 403 handler.
    drupal_set_title(t('Access denied'));
    $return = t('You are not authorized to access this page.');
  }
}