Drupal 7 注销在Drupal中不起作用

Drupal 7 注销在Drupal中不起作用,drupal-7,Drupal 7,我使用page.tpl.php中的以下代码将登录用户重定向到第一页: if($is_-front){if($user->uid!=0){header('Location:merchant mobile');} else{include(“page front.tpl.php”);return;} 但此函数与注销函数冲突,因为注销函数将用户重定向到首页,并执行注销操作。如何防止这种情况发生?您可以使用规则或更简单的函数代码: global $user; if($is_front){ if(

我使用page.tpl.php中的以下代码将登录用户重定向到第一页:

if($is_-front){if($user->uid!=0){header('Location:merchant mobile');}
else{include(“page front.tpl.php”);return;}

但此函数与注销函数冲突,因为注销函数将用户重定向到首页,并执行注销操作。如何防止这种情况发生?

您可以使用规则或更简单的函数代码:

global $user;

if($is_front){
  if($user->uid != 0){
    header('Location:merchant-mobile');
  } else {
    drupal_goto('<front>');
  }
}
global$user;
如果($在前面){
如果($user->uid!=0){
标题(“位置:商户移动”);
}否则{
drupal_goto(“”);
}
}
但是,如果用户在frontpage中,为什么要将其重定向到frontpage<代码>如果($is_front)表示当前页面是frontpage。如果(!$is_front),你是想写