phpgroupware-developers
[Top][All Lists]
Advanced

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

[Phpgroupware-developers] Re: two simple bugfixes (NIS auto_add user and


From: Stefan Heimers
Subject: [Phpgroupware-developers] Re: two simple bugfixes (NIS auto_add user and Unsupported operand types in addressbook)
Date: Sat, 24 Aug 2002 17:36:43 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.0.0) Gecko/20020615 Debian/1.0.0-3

/ auto_add problem (With NIS on our system, others seem to have the same
/>>/ problem with email-auth):
/>>/ Database error: Invalid SQL: SELECT account_type FROM phpgw_accounts
/>>/ WHERE account_id=
/
That is a general untrapped failure when the account_id is not
determined,
but when authentication did work (I think).  Will need to look at these
more.  But I guess not too many of us are using NIS, so it is hard to
test.

Exactly. It happens when NIS/Email authentication works but there is no user of the same name in the SQL database. It will not find his userid and then produce the above SQL error on following queries.

If you add users of the same names as the NIS users manually to phpgw NIS logins work fine.

The problem is in class.sessions_db.inc.php <https://savannah.gnu.org/bugs/download.php?group_id=509&bug_id=800&bug_file_id=74>.


if (! $GLOBALS['phpgw']->auth->authenticate($this->account_lid, $this->passwd, $this->passwd_type) || $GLOBALS['phpgw']->accounts->get_type($this->account_lid) == 'g')
{
return False;
exit;
}

authenticate() works if there is an NIS user, even if there is no user of the same name in the SQL database. Second get_type() looks for the same user in the SQL database which does not exist.

After the above statement is an auto_add() statement which should create the user in the SQL database but which is never reached.

You should do the get_type($this->account_lid) == 'g' check after the auto_add() statement, then login works perfectly.

I attached a working class.sessions_db.inc.php <https://savannah.gnu.org/bugs/download.php?group_id=509&bug_id=800&bug_file_id=74> to the bugreport #800.



Stefan Heimers





reply via email to

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