1 (edited by tezozomoc 12/01/2009 08:27:38 am)

Topic: Wrong company is selected when login ... (FA 2.2)

I have 0_ company = Training company
I have 1_ company = our working company.

when I try to login i select Training Co.  I have defined a new administrator account.

I have enabled the sql logging...

Instead of validating against 0_ company FA selects company 1_ company, which is incorrect...

SQL..

SELECT * FROM 1_users WHERE user_id = 'tezo' AND password='XXXXXXXXXXX'



Incorrect Password

The user and password combination is not valid for the system.

If you are not an authorized user, please contact your system administrator to obtain an account to enable you to use the system.

Does any body have a fix for this...

Re: Wrong company is selected when login ... (FA 2.2)

Please check the connection data in config_db.php. Surely there is a mistake in it regarding database prefix. When first company is created by install then next one in Create/Update Companies all should be right in this file.

Janusz

Re: Wrong company is selected when login ... (FA 2.2)

Here is the config_db.php

$db_connections = array (
    0 => array ('name' => 'Training Co.',
        'host' => 'localhost',
        'dbuser' => 'user',
        'dbpassword' => 'pwd',
        'dbname' => 'db',
        'tbpref' => '0_'),

    1 => array ('name' => 'SCF Coop',
        'host' => 'localhost',
        'dbuser' => 'user',
        'dbpassword' => 'pwd',
        'dbname' => 'db',
        'tbpref' => '1_')

    );

Re: Wrong company is selected when login ... (FA 2.2)

Check that these variables are there too:

$def_coy = 0;

$tb_pref_counter = 2;

The $def_coy tells which company should be presented as default when logging in. The $tb_pref_counter is the next prefix to use in front of the tables.

/Joe

5 (edited by tezozomoc 12/01/2009 11:54:05 pm)

Re: Wrong company is selected when login ... (FA 2.2)

$def_coy = 1;

$tb_pref_counter = 2;

I went in and programmatically changed it to a $def_coy = 0;  this seems to fix the problem.

Nevertheless, it appears that this is a bug because there is the possibility to have the user get into a situation where they may not be able log in. 

There is an option to select which is your start up company and when this is set other than 0 it will create this problem. (BUG)

Re: Wrong company is selected when login ... (FA 2.2)

Unfortunately I cannot confirm this bug. I have tried multiply times with different setups, using def_coy  1 or 0, setting different passwords - always all works right.
Maybe this was fixed in stable CVS as today.

Janusz