Skip to content
Permalink
Browse files

adds code to redirect to group

  • Loading branch information...
turnermm committed Mar 21, 2019
1 parent 3748bb0 commit 4ed8a306ec594b2e0a00c0425a988f4afe847e8c
Showing with 20 additions and 1 deletion.
  1. +20 −1 action.php
@@ -19,8 +19,27 @@ function handle_act(Doku_Event $event, $param) {
}
$user = $_SERVER['REMOTE_USER'];
if(!$user) return;
$grps = $USERINFO['grps'];
$auto_login = $this->getConf('auto_login');
$redirect_target = "";
if($auto_login) {
$user_grps = $USERINFO['grps'];
$groups = $this->getConf('group');
$groups = preg_replace("/\s+/","",$groups);
$groups = explode(',',$groups);
$grp_opt = $this->getConf('group_options');
foreach($groups as $grp) {
if(in_array ($grp , $user_grps)) {
$redirect_target = "$grp:";
$redirect_target .= ($grp_opt == 'user_page' ? $user : $conf['start']);
break;
}
}
if($redirect_target) {
setcookie("GOTO_LOGIN", $redirect_target, time()+120, DOKU_BASE);
return;
}
}
//msg($redirect_target);
if($auto_login) {
$option = $this->getConf('auto_options');

0 comments on commit 4ed8a30

Please sign in to comment.
You can’t perform that action at this time.