phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] Adapting authentication to my needs


From: Jason Wies
Subject: Re: [Phpgroupware-developers] Adapting authentication to my needs
Date: Mon, 3 Dec 2001 11:33:47 -0500
User-agent: Mutt/1.2.5i

On Mon, Dec 03, 2001 at 11:38:29AM -0300, Leandro Lucarella wrote:
> Hi! I want to know if phpgroupware uses some kind of standar function to
> check if a user is authenticated.
> The problem is I have a working intranet system writen mostly in perl (not
> by me) wich authentication is integrated with Windoor
> Networking/E-Mail/Proxy/etc. and I want to add to this system the excelent
> phpgroupware framework to use some of the applications...
> What I have to do is get a cookie from the user, check in a mysql database
> for the unique id in the cookie and if is present, check for some data
> stored in the DB (like username, etc)... If the user is logged in, I let
> it cotinue with phpgroupware, if not, I redirect him to the standar perl
> login of the intranet system I'm working in...
> 
> Well, I hope somebody can give me some help with this, at least telling me
> where can I read about the authentication in phpgroupware....

Have a look at the phpgwapi/inc/class.auth_*.inc.php files.  The easiest to 
understand is class.auth_http.inc.php.  You should be able to check the cookie 
and do the database call inside the authenticate () function.  If you want to 
bypass using phpgroupware accounts at all, and use only the account information 
stored using the current system, that takes a bit more work.  You would have to 
modify the phpgwapi/inc/class.accounts_*.inc.php files, and even then you might 
run into problems with the names of columns, etc.  An easier solution is to 
authenticate the user using the old system, and then create a new phpGroupWare 
account when they first log in.  The relevant functions for this are:

$phpgw->accounts->exists ();
$phpgw->accounts->auto_add ();

The logic being (pseudo-code obviously):

if ($phpgw->auth->authenticate (user))
{
        if (!$phpgw->accounts->exists (user))
        {
                $phpgw->accounts->auto_add (user);
        }
}

Integration into current systems is made a bit harder by phpGroupWare's 
reliance on a username/password combo, which is something existing 
authentication systems may not always have available due to encryption.  There 
are ways around this, but they vary from system to system.

Hope this helps,
Jason Wies aka Zone
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]