Now user is redirected to user profile page after login via CSNA link, My question is that is it possible to redirect user to previous page after login via CSNA link?

Comments

leetom’s picture

可以这样实现:

csna_callback中增加如下代码:

if(isset($_GET['dest']) && !url_is_external($_GET['dest'])){
    drupal_goto(url($_GET['dest']));
  }else{
    drupal_goto('user');
  }

然后,在跳转的时候带一个dest的query 参数(不要叫destination,否则drupal直接跳过去了)。
我这代码改得比较乱,就不上patch了,实现起来不难。