[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Phpgroupware-developers] Re: two simple bugfixes (NIS auto_add user
From: |
Miles Lott |
Subject: |
Re: [Phpgroupware-developers] Re: two simple bugfixes (NIS auto_add user and Unsupported operandtypes in addressbook) |
Date: |
Sat, 24 Aug 2002 12:13:14 -0500 |
Just thinking out loud here, but the auto_add should have created the
account
in SQL. Auth vs. Repository.
Stefan Heimers wrote:
>
> >>/ 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
>
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
--
Miles Lott
http://milosch.net