uid>0) {
if(!function_exists(‘is_cron’)){ //don’t re-declare functions
/**
* function is_cron()
* Tests for cron using best known practices
*/
function is_cron() {
if (php_sapi_name() == ‘cli’) {
// This may mean cron via Drush
return TRUE;
}
if(preg_match(‘/\/cron.php$/’, $_SERVER[‘SCRIPT_NAME’])) {
//check for cron.php in the url. *preg_match accommodates sites in sub-directories
return TRUE;
}
if (arg(0) == ‘admin’ && arg(1) == ‘reports’ && arg(2) == ‘status’ && arg(3) == ‘run-cron’) {
return TRUE;
}
return FALSE;
}//end function is_cron()
}//end if(!function_exists(‘is_cron’)
//Don’t redirect if cron
if ($user->uid>1) {
if(!is_cron()){
drupal_goto(“member-welcome”);
}//end if(!is_cron())
} else {
print “admin doesn’t automatically redirect”;
}
} else {
print ‘‘;
}
?>
uid>0) {
if(!function_exists(‘is_cron’)){ //don’t re-declare functions
/**
* function is_cron()
* Tests for cron using best known practices
*/
function is_cron() {
if (php_sapi_name() == ‘cli’) {
// This may mean cron via Drush
return TRUE;
}
if(preg_match(‘/\/cron.php$/’, $_SERVER[‘SCRIPT_NAME’])) {
//check for cron.php in the url. *preg_match accommodates sites in sub-directories
return TRUE;
}
if (arg(0) == ‘admin’ && arg(1) == ‘reports’ && arg(2) == ‘status’ && arg(3) == ‘run-cron’) {
return TRUE;
}
return FALSE;
}//end function is_cron()
}//end if(!function_exists(‘is_cron’)
//Don’t redirect if cron
if ($user->uid>1) {
if(!is_cron()){
drupal_goto(“member-welcome”);
}//end if(!is_cron())
} else {
print “admin doesn’t automatically redirect”;
}
} else {
print ‘‘;
}
?>