Not logged in. · Lost password · Register
Forum: General Help and Support Features and Functionality RSS
Custom auth backend
Problem getting groups
Avatar
jossif #1
Member since Apr 2007 · 10 posts
Group memberships: Members
Show profile · Link to this post
Subject: Custom auth backend
I have implemented a custom auth backend using the basic.class.php

I am using the trustExternal function, and everyuthing works well, except that groups are not recognized.

This is what I am doing, after fetching the user's record from  my database:


$fname              = "$row[fname]";
$lname              = "$row[lname]";
$email             = "$row[email]";   
#Groups are stored in my database as a comma separated list:       
# such as "user,admin,team"
$grps             = explode (",","$row[grps]");       

#set the globals for dokuwiki

$USERINFO['name'] = $fname . " ". $lname;
$USERINFO['mail'] = $email;
$USERINFO['grps'] = $grps;           
$_SERVER['REMOTE_USER'] = $user;
$_SESSION[DOKU_COOKIE]['auth']['user'] = $user;
$_SESSION[DOKU_COOKIE]['auth']['pass'] = $pass;
$_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO;


What is happening is that I can login OK, but then any page I try to access, it gives me an access denied. If I  go back to plain auth, and the user has same groups, it works OK.

What I am doing wrong?

-- Jossi
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
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, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-05-23, 05:35:20 (UTC +02:00)