[pmwiki-users] Integrating password systems

Patrick R. Michaud pmichaud at pobox.com
Wed Jan 25 17:43:43 CST 2006


On Wed, Jan 25, 2006 at 11:16:19PM +0200, Andrius Kulikauskas wrote:
> My Drupal and PmWiki are on the same server.  They are both built on 
> PHP.  I imagine that from PmWiki I can call the $user array and get the 
> user ID  $user->uid, then I can query the Drupal MySQL database and get 
> the user role, and then I can return the password that corresponds to 
> that user role.  That doesn't sound too complicated.  Where then (in 
> authuser.php ?) should I do the checking ?  Thank you for helping me!  
> Andrius, http://www.ms.lt

If I'm understanding the meaning of "user role" correctly, then
you might not need authuser.php at all for this.  If you can write
a module that is able to obtain the correct user role from
Drupal's MySQL database, then you can call SessionAuth to
authorize the user into that role.

For example, suppose the current user has a role called "editor",
stored in the $user_role variable (obtained from a script that
queries the Drupal MySQL database).  You can put the user into a
group called "@editor" by doing:

    SessionAuth($pagename, 'authlist' => array("@$user_role" => 1)));

Then you can simply set page or site permissions to "@editor" to 
allow this person and others with the "editor" role into the group.

If I'm misunderstanding how Drupal roles work, then give us a few
more details and we can get there.

Pm





More information about the pmwiki-users mailing list