[SOLVED] Panic! No UserData!!! when customers login

Moderator: crythias

Locked
Muad_Dib
Znuny newbie
Posts: 20
Joined: 20 Jul 2010, 11:28
Znuny Version: 2.4.7

[SOLVED] Panic! No UserData!!! when customers login

Post by Muad_Dib »

Hi all,

the customers that are defined in OTRS are trying to login on the portal (customer.pl) but they always got the message "Panic! No UserData!!!".

What's the meaning of this?

The customers are not defined in OTRS but in another DB so I made some changes in Config.pm to connect to it. Here's the interesting part:

Code: Select all

    $Self->{'Customer::AuthModule'}                       = 'Kernel::System::CustomerAuth::DB';
    $Self->{'Customer::AuthModule::DB::Table'}            = 'v_Address_OTRS';
    $Self->{'Customer::AuthModule::DB::CustomerKey'}      = 'Address_ID';
    $Self->{'Customer::AuthModule::DB::CustomerPassword'} = 'Pwd';

    $Self->{'Customer::AuthModule::DB::DSN'} = "DBI:ODBC:DSN=ERP";
    $Self->{'Customer::AuthModule::DB::User'} = "xxx";
    $Self->{'Customer::AuthModule::DB::Password'} = "xxx";


    # password crypt type (md5|crypt|plain)
    $Self->{'Customer::AuthModule::DB::CryptType'} = 'plain';
In this part of config.pm I set "plain" for the CryptType because the passwords in the DB are not crypted (not secure, I know...)

Code: Select all

    $Self->{CustomerUser} = {
        Name   => 'Arizona',
        Module => 'Kernel::System::CustomerUser::DB',
        Params => {
            DSN => 'DBI:ODBC:DSN=ERP,
            User => 'xxx',
            Password => 'xxx',
            Table => 'v_Address_OTRS',
        },
        # customer uniq id
        CustomerKey => 'ADK_Key_2',

        # customer #
        CustomerID             => 'Customer_ID',
        CustomerValid          => 'AD_Status',
        CustomerUserListFields => ['Email'],	

		# List of fields used in the where clause searching in backend DB
        CustomerUserSearchFields           => ['AD_Name', 'ADK_Key_2'],
        CustomerUserSearchPrefix           => '',
        CustomerUserSearchSuffix           => '*',
        CustomerUserSearchListLimit        => 250,
        CustomerUserPostMasterSearchFields => ['Email'],
        CustomerUserNameFields     => ['AD_First_Name', 'AD_Last_Name'],
        CustomerUserEmailUniqCheck => 1,

        # show not own tickets in customer panel, CompanyTickets
        #CustomerUserExcludePrimaryCustomerID => 0,
        # generate auto logins
        AutoLoginCreation => 0,
        # generate auto login prefix
        #AutoLoginCreationPrefix => 'auto',
        # admin can change customer preferences
        AdminSetPreferences => 1,
        # use customer company support (reference to company, See CustomerCompany settings)
        CustomerCompanySupport => 0,
        # cache time to life in sec. - cache any database queris
        CacheTTL => 0,
        # just a read only source
        ReadOnly => 1,
		
        Map => [
            # note: Login, Email and CustomerID needed!
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly, http-link-target
            [ 'UserFirstname',  'Firstname',  'AD_First_Name', 1, 1, 'var', '', 0 ],
            [ 'UserLastname',   'Lastname',   'AD_Last_Name',  1, 1, 'var', '', 0 ],
            [ 'UserLogin',      'Username',   'ADK_Key_2',     1, 1, 'var', '', 0 ],
            [ 'UserPassword',   'Password',   'Pwd',           0, 0, 'var', '', 0 ],
            [ 'UserEmail',      'Email',      'Email',         1, 1, 'var', '', 0 ],
            [ 'UserCustomerID', 'CustomerID', 'Customer_id',   0, 1, 'var', '', 0 ],
            [ 'UserPhone',      'Phone',      'TEL_number',    1, 0, 'var', '', 0 ],
            [ 'UserFax',        'Fax',        'FAX_number',    1, 0, 'var', '', 0 ],
            [ 'UserStreet',     'Street',     'AD_Address_1',  1, 0, 'var', '', 0 ],
            [ 'UserZip',        'Zip',        'AD_Zip_Code',   1, 0, 'var', '', 0 ],
            [ 'UserCity',       'City',       'AD_City',       1, 0, 'var', '', 0 ],
            [ 'UserCountry',    'Country',    'CTY_ISO_Code',  1, 0, 'var', '', 0 ],
            [ 'UserComment',    'Comment',    'AD_Remark',     1, 0, 'var', '', 0 ],
            [ 'ValidID',        'Valid',      'AD_Status',     0, 1, 'int', '', 0 ],
        ],
    };
If someone can help me, i'll be happy :-)

Bye
Last edited by Muad_Dib on 13 Sep 2010, 12:59, edited 1 time in total.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Panic! No UserData!!! when customers login

Post by crythias »

Code: Select all

            # note: Login, Email and CustomerID needed!
(You're missing a Map to Login, perhaps?)
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Muad_Dib
Znuny newbie
Posts: 20
Joined: 20 Jul 2010, 11:28
Znuny Version: 2.4.7

Re: Panic! No UserData!!! when customers login

Post by Muad_Dib »

crythias wrote:

Code: Select all

            # note: Login, Email and CustomerID needed!
(You're missing a Map to Login, perhaps?)
Hmmm I think I don't miss it because I got the mapping for "UserLogin" in my Config.pm.
And in Defaults.pm there's no mapping for a field called "Login".

If it can help someone, I see that in table customer_preferences I have a record of this kind each time:

Code: Select all

user_id     preferences_key     preferences_value
---------------------------------------------------
188702      UserAuthBackend                                                                                                                                        
1500000631  UserAuthBackend
198189      UserAuthBackend
263145      UserAuthBackend
But nothing more...

And I have no errors in error log and here's what I see in OTRS log:

Code: Select all

[Mon Sep 13 11:33:10 2010][Notice][Kernel::System::CustomerAuth::DB::Auth] CustomerUser: 188702 authentication ok (REMOTE_ADDR: fe80::cd6b:8fc5:c133:d85%12).
So, anyone got an idea?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Panic! No UserData!!! when customers login

Post by crythias »

In the CustomerAuth your CustomerKey is Address_ID
In the CustomerUser your CustomerKey is ADK_Key_2

It appears they should match. What do you think?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Muad_Dib
Znuny newbie
Posts: 20
Joined: 20 Jul 2010, 11:28
Znuny Version: 2.4.7

Re: Panic! No UserData!!! when customers login

Post by Muad_Dib »

crythias wrote:In the CustomerAuth your CustomerKey is Address_ID
In the CustomerUser your CustomerKey is ADK_Key_2

It appears they should match. What do you think?
Sorry It was obvious I didn't find it!

Sorry for disturbing :-)

Bye
Locked