Not logged in. · Lost password · Register
Forum: General Discussion General Stuff RSS
is there something wrong with the grps array?
running in problems with the vanilla-forum integration
mumpitz #1
Member for 2 weeks · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: is there something wrong with the grps array?
Hey

I am trying to integrate dokuwiki into the Vanilla-Forum with installed MultiRoles-Addon. I started with the "official" HowTo, but it seems to be quite outdated and of course not MultiRoles ready.

So I started upgrading and run into trouble :(

Somehow DokuWiki does not want to recognize the groups :( My superuser-group ist Administrator.

The info-Array of the _getUserInfo-Funktion within the mysql-auth-class looks like this:
Array
(
    [pass] => MD5Hash
    [name] => Administrative User
    [mail] => invalid@invalid.invalid
    [id] => 1
    [grps] => Array
        (
            [0] => Administrator
            [1] => Fileserver
            [2] => Bewohner
            [3] => Admin
        )

)
When it looks like this it does not work.
But if it look like that it does:
Array
(
    [pass] => MD5Hash
    [name] => Administrative User
    [mail] => invalid@invalid.invalid
    [id] => 1
    [group] => Administrator
    [grps] => Array
        (
            [0] => Administrator
            [1] => Fileserver
            [2] => Bewohner
            [3] => Admin
        )

)
When I look that the auth-classes of other integrations, I dont see them having that "group" index.


my vanilla.class.php.

It'd be nice if someone could help me.

P.S. I am using the DokuWiki from 11. April 2008 and Vanilla 1.1.4

EDIT: MultiRoles is an Addon which allows you to add a user to several roles (aka groups) instead of just one (how its in Vanilla, when its plain vanilla).
Avatar
andi (Administrator) #2
Member since May 2006 · 654 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
What exactly does not work?

I'd recommend to set up the SQL statements with the default MySQL backend first. When those work you can predefine them in your derived class' constructor.

But my guess is that there's something wrong in your trustExternal method. This looks very fishy:

  1. if($userInfoArr = $this->_getUserInfo($Context->Session->User->Name))
  2.                 {
  3.                 $USERINFO['pass'] = $userInfoArr['pass'];
  4.                 $USERINFO['name'] = $userInfoArr['name'];
  5.                 $USERINFO['mail'] = $userInfoArr['mail'];
  6.                 $USERINFO['grps'][] = $userInfoArr['group'];

The _getUserInfo() method does not return a key named 'group'.  Shouldn't the whole thing just look like this?

  1. if($userInfoArr = $this->_getUserInfo($Context->Session->User->Name))
  2.                 {
  3.                 $USERINFO = $userInfoArr;

Andi
Read this if you don't get any useful answers.
mumpitz #3
Member for 2 weeks · 2 posts
Group memberships: Members
Show profile · Link to this post
thanks mate. it works now... hopefully flawless.

I didn't put any attention to the trustExternal-function.

changed $USERINFO['grps'][] = $userInfoArr['group']; to $USERINFO['grps'] = $userInfoArr['grps'];
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please note the verification code from the picture into the text field next to it.
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 1.6.4, © 2003-7 by Yves Goergen
Current time: 2008-05-17, 06:30:16 (UTC +02:00)
WikiForumIRCBugsTranslate