-1

Anonymus should only have access to home page and see all content there. When anonymus click any link, he should be redirected to login page.

function template_preprocess(&$variables, $hook) {
  $access_pages = array('dp/admin', 'user/login', 'user/password');
  if (!$variables['is_front'] && !$variables['logged_in'] && !in_array($_GET['q'], $access_pages)) {
    drupal_goto('dp/admin');
  }
}

Is this right? Is there better way?

1 Answer 1

1

If your permissions are set perfectly, then installing this module may prove helpful in this case

Redirect 403 to User Login (r4032login)

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.