欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

drupal6 drupal7 登录后跳转 有大用

function shicustom_init()
{
   global $user;

   //这是命令行 wget 执行的话 就返回  为的是drupal 能够顺利执行
   if (!empty($_SERVER["REMOTE_ADDR"]) && '211.149.205.29' == $_SERVER["REMOTE_ADDR"])
   {
       return;
   }

   $q=$_GET['q'];

   empty($q) && $q='';
//
   if((empty($user) || empty($user->uid)) && $q!='user/login' && !_startWith($q,'image_captcha')){

       //header("location: /user/login");
       drupal_goto('user/login');
   }
   else if( (!empty($user) && !empty($user->uid)) && $q=='user/login'){

       drupal_goto('<front>');
   }
}


普通分类: