Topic: Admin login shows SQL error

I get a nasty error on my screen including the password hash:


Databasefout : could not get validate user login for admin
error code : 1146
error message : Table 'db1.1_users' doesn't exist
sql that failed was : SELECT * FROM 1_users WHERE user_id = 'admin' AND password='rf8b354e1fb8cc2fb87c9cf6b27f6b14'

I also managed to correct, but still not sure about the root cause.

I have two companies setup. One on db1 with prefix 0_ and one on db2 with prefix 1_. Now I have the root admin account durint setup and I made an admin account for the new company. I also changed the default login to be the new company. And I also changed the passwords for both admin accounts.

When I login with admin for the first company THEN I get the error. While the error tries to open db1.1_user it should have opened db1.0_user.

Now when I open the table db2.1_user and rename the admin account into admin2 then I don't get this nasty error anymore when trying to login. So if I don't see other side effects then I will leave it like this. Only 1 admin for the whole application.

Re: Admin login shows SQL error

This is definitely a bug, to be fixed ASAP.
AJnusz

Re: Admin login shows SQL error

The bug was selected in CVS unstable. Affected file session.inc. Thank you very much for reporting.

Janusz

PS When you are sure you have found real bug please report it on mantis instead of this forum. Mantis is constantly monitored by devel team while forum is not.
J.

Re: Admin login shows SQL error

I can confirm this problem. It seems to have something to do with the way new companies are created.

I currently have a new company it allowed me to create without a table prefix on the same database, and set it to be the default company, and  then I get the above mentioned sql error. If I go back to delete that company by logging in to the practice company, I get the following error:

"You cannot have table set without prefix together with prefixed sets in the same database."

There is a sanity check of some sort missing, along with dumping an admin password in plain view is very not good.

Re: Admin login shows SQL error

I have confirmed this is 2.1 and 2.2, when sharing the same database. With a new database it works fine.

It also seems that with a shared database between companies, that it does not produce a company directory. So if one of these broken directories is created, it will produce an error about the company/1 could not be removed and stop the company deletion process.

Re: Admin login shows SQL error

If you try to use exactly the same database (with the same prefix) for 2.1 and 2.2 it will not work. The database structure of the two versions of FA differs, and after proper upgrade to 2.2, the database will not be available for 2.1 sources.

Janusz

NB Some fixes has been just introduced to craete_coy.inc and maintanance_db.inc to make adding/removal of companies more safe. You can download the files from CVS main trunk.
J.