Need CustomerID!

Moderator: crythias

Locked
blastik
Znuny newbie
Posts: 49
Joined: 24 Feb 2012, 09:59
Znuny Version: 5.0.16
Location: Barcelona, Spain
Contact:

Need CustomerID!

Post by blastik »

Hi lads,

I've been facing the same problem for a while. I can't get rid of the error Need CustomerID! from my SysLog. I guess, that it has to do with my Customer Database configuration but after searching the forum as well as tweaking my Config.pm... i'm unable to fix it. I have a setup with both LDAP and Database customer sources. Here is my config:

Code: Select all

# 1. Customer user backend: DB
# (customer database backend and settings)
$Self->{CustomerUser1} = {
    Name => 'Customer Database',
    Module => 'Kernel::System::CustomerUser::DB',
    Params => {
        # if you want to use an external database, add the
        # required settings
#        DSN => 'DBI:odbc:yourdsn',
#        Type => 'mssql', # only for ODBC connections
#        DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
#        User => '',
#        Password => '',
        Table => 'customer_user',
    },
    # customer unique id
    CustomerKey => 'login',
    # customer #
    CustomerID => 'customer_id',
    CustomerValid => 'valid_id',
    CustomerUserListFields => ['first_name', 'last_name', 'email'],
    CustomerUserSearchFields => ['login', 'last_name', 'customer_id'],
    CustomerUserSearchPrefix => '',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 250,
    CustomerUserPostMasterSearchFields => ['email'],
    CustomerUserNameFields => ['title','first_name','last_name'],
    CustomerUserEmailUniqCheck => 1,
#    # show not own tickets in customer panel, CompanyTickets
#    CustomerUserExcludePrimaryCustomerID => 0,
#    # generate auto logins
#    AutoLoginCreation => 0,
#    AutoLoginCreationPrefix => 'auto',
#    # admin can change customer preferences
#    AdminSetPreferences => 1,
#    # cache time to live in sec. - cache any database queries
#    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, ht$
#        [ 'UserTitle',      'Title',      'title',        1, 0, 'var', '', 0 ],
        [ 'UserFirstname',  'Firstname',  'first_name',   1, 1, 'var', '', 0 ],
        [ 'UserLastname',   'Lastname',   'last_name',    1, 1, 'var', '', 0 ],
        [ 'UserLogin',      'Username',   'login',        0, 1, 'var', '', 0 ],
#        [ 'UserPassword',   'Password',   'pw',           0, 0, 'var', '', 0 ],
        [ 'UserEmail',      'Email',      'email',        1, 1, 'var', '', 0 ],
        [ 'UserCustomerID', 'CustomerID', 'customer_id',  0, 0, 'var', '', 0 ],
        [ 'UserPhone',      'Phone',      'phone',        1, 0, 'var', '', 0 ],
#        [ 'UserFax',        'Fax',        'fax',          1, 0, 'var', '', 0 ],
#        [ 'UserMobile',     'Mobile',     'mobile',       1, 0, 'var', '', 0 ],
#        [ 'UserStreet',     'Street',     'street',       1, 0, 'var', '', 0 ],
#        [ 'UserZip',        'Zip',        'zip',          1, 0, 'var', '', 0 ],
#        [ 'UserCity',       'City',       'city',         1, 0, 'var', '', 0 ],
#        [ 'UserCountry',    'Country',    'country',      1, 0, 'var', '', 0 ],
        [ 'UserComment',    'Comment',    'comments',     1, 0, 'var', '', 0 ],
        [ 'ValidID',        'Valid',      'valid_id',     0, 1, 'int', '', 0 ],
    ],
    # default selections
    Selections => {
        UserTitle => {
            'Mr.' => 'Mr.',
            'Mrs.' => 'Mrs.',
        },
    },
};

# 2. Customer user backend: LDAP
$Self->{CustomerUser2} = {
    Name => 'LDAP Data Source',
    Module => 'Kernel::System::CustomerUser::LDAP',
    Params => {
        # ldap host
        Host => '',
        # ldap base dn
        BaseDN => '',
        # search scope (one|sub)
        SSCOPE => 'sub',
        # The following is valid but would only be necessary if the
        # anonymous user does NOT have permission to read from the LDAP tree
        UserDN => 
        UserPw => ',
        # in case you want to add always one filter to each ldap query, use
        # this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
        AlwaysFilter => '(mail=*)',
            # if both your frontend and your LDAP are unicode, use this:
            SourceCharset => 'utf-8',
            DestCharset   => 'utf-8',
            # if your frontend is unicode and the charset of your
            # ldap server is iso-8859-1, use these options.
            # SourceCharset => 'iso-8859-1',
            # DestCharset => 'utf-8',
            # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
            Params => {
                port => 389,
                timeout => 120,
                async => 0,
                version => 3,
            },
    },
    # customer unique id
    CustomerKey => 'sAMAccountName',
    # customer #
    CustomerID => 'mail',
    CustomerUserListFields => ['cn', 'mail'],
    CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'],
    CustomerUserSearchPrefix => '',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 250,
    CustomerUserPostMasterSearchFields => ['mail'],
    CustomerUserNameFields => ['givenname', 'sn'],
    # show not own tickets in customer panel, CompanyTickets
    CustomerUserExcludePrimaryCustomerID => 0,
    # add an ldap filter for valid users (expert setting)
#    CustomerUserValidFilter => '(!(description=locked))',
    # administrator can't change customer preferences
    AdminSetPreferences => 0,
#    # cache time to live in sec. - cache any database queries
#    CacheTTL => 0,
    Map => [
        # note: Login, Email and CustomerID are mandatory!
   Map => [
        # note: Login, Email and CustomerID are mandatory!
        # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
        [ 'UserTitle',      'Title',      'title',           1, 0, 'var', '', 0 ],
        [ 'UserFirstname',  'Firstname',  'givenname',       1, 1, 'var', '', 0 ],
        [ 'UserLastname',   'Lastname',   'sn',              1, 1, 'var', '', 0 ],
        [ 'UserLogin',      'Username',   'sAMAccountName',  1, 1, 'var', '', 0 ],
        [ 'UserEmail',      'Email',      'mail',            1, 1, 'var', '', 0 ],
        [ 'UserCustomerID', 'CustomerID', 'PhysicalDeliveryOfficeName', 1, 0, 'var', '', 0 ],
        [ 'UserCustomerIDs', 'CustomerIDs', 'sAMAccountName', 1, 0, 'var', '', 0 ],
        #[ 'UserOU', 'LDAP OU', 'dn', 1, 0, 'var', '', 0 ],
        [ 'UserPhone',      'Phone',      'telephonenumber', 1, 0, 'var', '', 0 ],
        [ 'UserAddress',    'Address',    'postaladdress',   1, 0, 'var', '', 0 ],
        [ 'UserComment',    'Comment',    'description',     1, 0, 'var', '', 0 ],
    ],
};
Thoughts?

Thanks!
D.
OTRS 5
Ubuntu with MySQL
Authenticating users & agents via LDAP
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Need CustomerID!

Post by reneeb »

Your apache log should show you a stacktrace (wich method has called which method that led to the error). Can you post that stacktrace?
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
blastik
Znuny newbie
Posts: 49
Joined: 24 Feb 2012, 09:59
Znuny Version: 5.0.16
Location: Barcelona, Spain
Contact:

Re: Need CustomerID!

Post by blastik »

Nice one!

Got it:

Code: Select all

ERROR: OTRS-CGI-10 Perl: 5.18.2 OS: linux Time: Fri Mar  4 11:19:18 2016

 Message: Need CustomerID!

 RemoteAddress: 10.130.0.106
 RequestURI: /otrs/index.pl?Action=AgentTicketLockedView

 Traceback (31706):
   Module: Kernel::System::CustomerCompany::CustomerCompanyGet Line: 173
   Module: Kernel::System::CustomerUser::CustomerUserDataGet Line: 344
   Module: Kernel::System::Ticket::TicketACL::_GetChecks Line: 1248
   Module: Kernel::System::Ticket::TicketACL::TicketAcl Line: 248
   Module: Kernel::System::Ticket::TicketMoveList Line: 1802
   Module: Kernel::System::Ticket::MoveList Line: 7189
   Module: Kernel::Output::HTML::TicketMenu::Move::Run Line: 128
   Module: Kernel::Output::HTML::TicketOverview::Small::Run Line: 507
   Module: Kernel::Output::HTML::Layout::Ticket::TicketListShow Line: 1121
   Module: Kernel::Modules::AgentTicketLockedView::Run Line: 372
   Module: Kernel::System::Web::InterfaceAgent::Run Line: 1042
   Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
   Module: (eval) (v1.99) Line: 206
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 206
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 172
   Module: ModPerl::Registry::handler (v1.99) Line: 31
Looks like fails when an Agent displays his Locked tickets view (a lot of agents do this obviously). I think it has to do with the CustomerID mapping i do in my config. In the past i enabled Company tickets but now i dont need it any more...
OTRS 5
Ubuntu with MySQL
Authenticating users & agents via LDAP
blastik
Znuny newbie
Posts: 49
Joined: 24 Feb 2012, 09:59
Znuny Version: 5.0.16
Location: Barcelona, Spain
Contact:

Re: Need CustomerID!

Post by blastik »

up? :(
OTRS 5
Ubuntu with MySQL
Authenticating users & agents via LDAP
blastik
Znuny newbie
Posts: 49
Joined: 24 Feb 2012, 09:59
Znuny Version: 5.0.16
Location: Barcelona, Spain
Contact:

Re: Need CustomerID!

Post by blastik »

nooone ? :?
OTRS 5
Ubuntu with MySQL
Authenticating users & agents via LDAP
Locked