cosmocode / virtualgroup

Create virtual user groups in DokuWiki
http://www.dokuwiki.org/plugin:virtualgroup
GNU General Public License v2.0
10 stars 5 forks source link

$INFO isn't updated completely #5

Closed einhirn closed 14 years ago

einhirn commented 14 years ago

Hello, $INFO contains the field "perm" - this is dependend on the group membership of the current user - it should also be updated when adding virtual groups to a user. Failing to do that leads to the current behaviour: On my site you need to be a member of a special group so you can view the start page. When I add a user to this group via virtualgroup and log in as that user I still get "permission denied". I first have to manually change the URL to "do=show" or something, so that $INFO reflects the permissions I got when virtualgroup added a membership.

The following patch should correct this behaviour. It also removes changing variables that imho are (or should be) private to the auth-backend.

    --- action.php.orig    2010-01-25 05:57:04.000000000 +0100
    +++ action.php  2010-01-25 18:14:44.000000000 +0100
    @@ -29,10 +29,8 @@
            }
            $grps = array_unique(array_merge($USERINFO['grps'],$this->users[$_SERVER['REMOTE_USER']]));
            $USERINFO['grps']               = $grps;
    -               $auth->info['grps']     = $grps;
    -               $auth->users[$_SERVER['REMOTE_USER']]['grps'] = $grps;
    -               $INFO['userinfo']['grps'] = $grps;
            $_SESSION[DOKU_COOKIE]['auth']['info']['grps'] = $grps;
    +               $INFO=pageinfo();
        }

        /**
dom-mel commented 14 years ago

thanks i'll add it. 174008b6f334d571131ca7e12bb7736fd106a26b