I am using hook_init to check if a variable is set, and then redirect if not...
function quickstart_init() {
if (variable_get('quickstart_admin', 0) != 1 && $_SERVER['REQUEST_URI'] != '/welcome/admin') {
drupal_goto('welcome/admin');
}
}
This works for logged out users, but when you are logged in, it redirects - but the whole page displays twice!
I have traced this down to admin menu, as the second version of the page only appears once that JS runs. Does anyone know if admin_menu bootstraps onload? In which case, probably run hook_init again?
Anyway, main question....
What can i do to only run this once, is there something other than hook init that would work?