customer_users is not written

Moderator: crythias

Post Reply
pc-coholic
Znuny newbie
Posts: 18
Joined: 04 Jan 2011, 20:55
Znuny Version: 3.2.12

customer_users is not written

Post by pc-coholic »

Hi everyone!

I'm currently exploring possible ways of integration OTRS in our company and get quite far... But there is one thing where I realy could use some help...

I have an LDAP-server here, that serves me all kind of information of our customers - except information concerning authentification.

So I added the following block to my configuration:

Code: Select all

# CustomerUser
# (customer ldap backend and settings)
$Self->{CustomerUser} = {
    Name => 'SCD',
    Module => 'Kernel::System::CustomerUser::LDAP',
    Params => {
        # ldap host
        Host => 'ldapserver.company.net',
        # ldap base dn
        BaseDN => 'c=DE',
        # 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 => '',
        # if your frontend is e. g. iso-8859-1 and the charset of your
        # ldap server is utf-8, use these options.
#            SourceCharset => 'utf-8',
#            DestCharset => 'iso-8859-1',
            # if both your frontend and your LDAP are unicode, use this:
#            SourceCharset => 'utf-8',
#            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 => 'scdId',
    # customer #
    CustomerID => 'scdId',
    CustomerUserListFields => ['cn',  'ou', 'department', 'mail'],
    CustomerUserSearchFields => ['cn', 'mail', 'phoneNumbers'],
    CustomerUserSearchPrefix => '*',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 10,
    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 => 1,
#    # cache time to live in sec. - cache any database queries
    CacheTTL => 86400,
    ReadOnly => 1,
    Map => [
        # note: Login, Email and CustomerID are mandatory!
        # var,				frontend,		storage,			shown (1=always,2=lite), required, storage-type, http-link, readonly
        [ 'UserTitle',		'Title',		'gender',			1, 0, 'var', '', 0 ],
        [ 'UserFirstname',	'Firstname',	'givenname',		1, 1, 'var', '', 0 ],
        [ 'UserLastname', 	'Lastname',	'sn',				1, 1, 'var', '', 0 ],
        [ 'UserLogin', 		'Username',	'tcgid',			1, 1, 'var', '', 0 ],
        [ 'UserEmail',		'Email',		'mail',			1, 1, 'var', 'mailto:$Data{"UserEmail"}', 0 ],
        [ 'UserCustomerID',	'CustomerID',	'scdId',				0, 1, 'var', '', 0 ],
#        [ 'UserCustomerIDs',	'CustomerIDs',	'second_customer_ids',	1, 0, 'var', '', 0 ],
        [ 'UserPhone',		'Phone',		'telephoneNumber',	1, 0, 'var', '', 0 ],
	[ 'UserFax',		'Fax',		'faxNumber',		1, 0, 'var', '', 0 ],
	[ 'UserMobile',		'Mobile',		'mobile',			1, 0, 'var', '', 0 ],
        [ 'UserAddress',	'Address',		'l',				1, 0, 'var', '', 0 ],
	[ 'UserBuilding',	'Building',	'building',		1, 0, 'var', '', 0 ],
	[ 'UserRoom',		'Room',		'roomNumber',		1, 0, 'var', '', 0 ],
#        [ 'UserComment',		'Comment',		'description',			1, 0, 'var', '', 0 ],
    ],
    
    # default selections
    Selections => {
        UserTitle => {
            'M' => 'Herr',
            'F' => 'Frau',
        },
    },
};
OK, when creating a new ticket I can now successfully select the calling customer from the LDAP - fine :)

But now I was noticing something strange - at least I think so...

When looking at a ticket from any customer, OTRS tells me that there are multiple open tickets for that customer. In fact: it shows me *all* open tickets from *all* customers.

So I was thinking, perhaps there is something wrong with my map-part in the configuration posted above, and looked into the "customer_user"-Table in my database. So I found out, that it's empty.

As far as I can tell from looking at the mysqld-log, I think OTRS isn't even trying to insert the selected customers into the database for later use.

So I would like to ask you, if you can tell me what I'm doing wrong here and/or what part of my configuration I should change so OTRS writes selected customers on ticket creation into customer_user.

Thank you very much for your help.

Martin
OTRS 3.2.8
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: customer_users is not written

Post by jojo »

LDAP Customer Data is not copied to OTRS Database!
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
pc-coholic
Znuny newbie
Posts: 18
Joined: 04 Jan 2011, 20:55
Znuny Version: 3.2.12

Re: customer_users is not written

Post by pc-coholic »

Hi jojo!
jojo wrote:LDAP Customer Data is not copied to OTRS Database!
Ah, ok... I see...

So this probably also means, that if I ever use CustomerAuth:LDAP there will be nothing written into the OTRS-database. And as my LDAP-server won't provide any passwords, this wouldn't work...

For the other problem (multiple open tickets for a user): this has been solved - I always tried with old, cached entries that were wrong... My bad..

Thanks for your help.

Martin
OTRS 3.2.8
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: customer_users is not written

Post by jojo »

pc-coholic wrote: So this probably also means, that if I ever use CustomerAuth:LDAP there will be nothing written into the OTRS-database. And as my LDAP-server won't provide any passwords, this wouldn't work...
CustomerData is independent from CustomerAuth, so you can have LDAP for providing information on customers and Database Table for giving access to the customer frontend
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Post Reply