Erledigt: Kundendaten aus lokaler DB/ zusätzliche Felder

Hilfe zu OTRS Problemen aller Art
Post Reply
boris
Znuny wizard
Posts: 554
Joined: 22 Feb 2010, 18:27
Znuny Version: 3.0.4

Erledigt: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by boris »

Hi,

ich habe in meiner customer_user Tabelle zusätzliche Felder hinzugefügt.
Die werden mit sync_ldap2db befüllt. Das klappt auch soweit.
Die Kunden Authentifizieren sich gegen LDAP aber die Daten wollen wir aus der lokalen DB holen.

So sieht die Config.pm aus:

Code: Select all



#--------------------------------------------------------------------------------------------
#                                            firma                                        #
#--------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------
#                                   Agenten Authentifizeirung                               #
#--------------------------------------------------------------------------------------------
$Self->{'AuthModule1'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host1'} = 'dc.firma.local'; 
$Self->{'AuthModule::LDAP::BaseDN1'} = 'dc=firma,dc=local';
$Self->{'AuthModule::LDAP::UID1'} = 'sAMAccountName';
$Self->{'AuthModule::LDAP::SearchUserDN1'} = 'otrsldap@firma.local';
$Self->{'AuthModule::LDAP::SearchUserPw1'} = 'Passwort123';
#--------------------------------------------------------------------------------------------
#                                  Kunden Authentifizeirung                                 #
#--------------------------------------------------------------------------------------------
  $Self->{'Customer::AuthModule1'} = 'Kernel::System::CustomerAuth::LDAP';
  $Self->{'Customer::AuthModule::LDAP::Host1'} = 'dc.firma.local';
  $Self->{'Customer::AuthModule::LDAP::BaseDN1'} = 'DC=firma, DC=local';
  $Self->{'Customer::AuthModule::LDAP::UID1'} = 'sAMAccountName';
  $Self->{'Customer::AuthModule::LDAP::SearchUserDN1'} = 'otrsldap@firma.local';
  $Self->{'Customer::AuthModule::LDAP::SearchUserPw1'} = 'Passwort123';
#-------------------------------------------------------------------------------------------- 
#                                     Kundendaten                                           #
#--------------------------------------------------------------------------------------------

 
 #--------------------------------------------------------------------------------------------
# CustomerUser (customer database backend and settings)
$Self->{CustomerUser1} = {
    Name => 'Database Datasource',
    Module => 'Kernel::System::CustomerUser::DB',
    Params => {
        # if you want to use an external database, add the required settings
#            DSN => 'DBI:odbc:yourdsn',
#            DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
#            User => '',
#            Password => '',
            Table => 'customer_user',
            # if your frontend is unicode and the charset of your
            # customer database server is iso-8859-1, use these options.
#           SourceCharset => 'iso-8859-1',
#           DestCharset => 'utf-8',

            # CaseSensitive will control if the SQL statements need LOWER()
            #   function calls to work case insensitively. Setting this to
            #   1 will improve performance dramatically on large databases.
            CaseSensitive => 0,
        },
# 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 => 500,
    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, http-link-target
        [ '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',      1, 1, 'var', '', 0 ],
        [ 'UserPassword',   'Password',   'pw',         0, 0, 'var', '', 0 ],
        [ 'UserEmail',      'Email',      'email',      1, 1, 'var', '', 0 ],

    [ 'Firma',            'firma',          'company',      1, 0, 'var', '', 0],
    [ 'Abteilung',           'abteilung',      'department',      1, 0, 'var', '', 0 ],
    [ 'Vorgesetzter',     'vorgesetzter','manager',      1, 0, 'var', '', 0 ],
    [ 'Buero',           'buero', 'physicalDeliveryOfficeName', 1, 0, 'var', '', 0 ],

#        [ 'UserEmail',      'Email', 'email',           1, 1, 'var', '$Env{"CGIHandle"}?Action=AgentTicketCompose&ResponseID=1&TicketID=$Data{"TicketID"}&ArticleID=$Data{"ArticleID"}', 0 ],
        [ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],

#        [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 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 ],

        
    ],
    
    

};


 #--------------------------------------------------------------------------------------------
 #                                      firma Ende                                         #
 #--------------------------------------------------------------------------------------------
 
 
Authetifizierung geht.
Aber die Daten (die zusätzlichen Felder) werden beim Kunden nicht angezeigt.

Kann mir jemand sagen woran das liegt?

Boris
Last edited by boris on 04 May 2012, 10:54, edited 1 time in total.
Produktiv:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL

Test:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL
boris
Znuny wizard
Posts: 554
Joined: 22 Feb 2010, 18:27
Znuny Version: 3.0.4

Re: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by boris »

Jetzt bin ich völlig verwirrt. Wenn in der Config.pm

Code: Select all

$Self->{CustomerUser1} = {
steht gehts

Aber ich hab ja nur eine Datenbank also müsste es ja

Code: Select all

$Self->{CustomerUser} = {
heissen.

Ich hab in der Kundenübersicht einen Kunden angezeigt. Wenn ich das in der Config.pm ändere und die Seite neu lade verschwindet zwar der Kunde aber die neuen Felder erscheinen.
Kunden werden aber danach auch garkeine mehr angezeigt.

Weiss jemand wo ich da den Wurm drin habe?


EDIT:

Hier mal die ganze Config.pm
das verhalten ist aber gleich. Wenn ich hinter $Self->{CustomerUser (Zeile 185 was einfüge 1 oder x)einfüge bekomme ich alle Kunden angezeigt aber die zusätzlich engelegten Felder nicht.

Code: Select all

# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2010 xxx, http://otrs.org/
# --
# $Id: Config.pm.dist,v 1.23 2010/01/13 22:25:00 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
#  Note:
#
#  -->> OTRS does have a lot of config settings. For more settings
#       (Notifications, Ticket::ViewAccelerator, Ticket::NumberGenerator,
#       LDAP, PostMaster, Session, Preferences, ...) see
#       Kernel/Config/Defaults.pm and copy your wanted lines into "this"
#       config file. This file will not be changed on update!
#
# --

package Kernel::Config;

sub Load {
    my $Self = shift;
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #         Start of your own config options!!!          #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # database settings                                    #
    # ---------------------------------------------------- #
    # DatabaseHost
    # (The database host.)
    $Self->{'DatabaseHost'} = 'localhost';
    # Database
    # (The database name.)
    $Self->{'Database'} = 'otrs';
    # DatabaseUser
    # (The database user.)
    $Self->{'DatabaseUser'} = 'otrs';
    # DatabasePw
    # (The password of database user. You also can use bin/otrs.CryptPassword.pl
    # for crypted passwords.)
    $Self->{'DatabasePw'} = 'hot';
    # DatabaseDSN
    # (The database DSN for MySQL ==> more: "man DBD::mysql")
    $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

    # (The database DSN for PostgreSQL ==> more: "man DBD::Pg")
    # if you want to use a local socket connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";
    # if you want to use a tcpip connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};host=$Self->{DatabaseHost};";

    # ---------------------------------------------------- #
    # fs root directory
    # ---------------------------------------------------- #
    $Self->{Home} = '/opt/otrs';

    # ---------------------------------------------------- #
    # insert your own config settings "here"               #
    # config settings taken from Kernel/Config/Defaults.pm #
    # ---------------------------------------------------- #
    # $Self->{SessionUseCookie} = 0;
    # $Self->{CheckMXRecord} = 0;

    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # data inserted by installer                           #
    # ---------------------------------------------------- #
    # $DIBI$
    $Self->{'DefaultCharset'} = 'utf-8';




################################################################################################################################
                                #----------------------------------------------------------#
                                #                                                          #
                                #                   Company Tickets                        #
                                #             in der customer.pl ausblenden                #
                                #                                                          #
                                #----------------------------------------------------------#
    
$Self->{'CustomerFrontend::Module'}->{'CustomerTicketOverview'} =  {
  'NavBar' => [
    {
      'Prio' => '110',
      'Block' => '',
      'Image' => 'ticket.png',
      'NavBar' => '',
      'Type' => '',
      'AccessKey' => 'm',
      'Description' => 'MyTickets',
      'Name' => 'MyTickets',
      'Link' => 'Action=CustomerTicketOverview&Type=MyTickets'
    },
  ],
  'NavBarName' => 'Ticket',
  'Description' => 'Overview of customer tickets',
  'Title' => 'Overview'
};

################################################################################################################################
################################################################################################################################

################################################################################################################################
                                #----------------------------------------------------------#
                                #                                                          #
                                #                         Sprachen                         #
                                #                                                          #
                                #----------------------------------------------------------#
  # used languages
    # (short name = long name and file)
    $Self->{DefaultUsedLanguages} = {

        de      => 'Deutsch',
    koe     => 'Kölsch',
        en      => 'English (United States)',
        en_GB   => 'English (United Kingdom)',        

    };
################################################################################################################################
################################################################################################################################

################################################################################################################################
                                #----------------------------------------------------------#
                                #                                                          #
                                #                   Ticket- Prioritäten                    #
                                #                                                          #
                                #----------------------------------------------------------#
                                
        # PostmasterDefaultPriority
        # (The default priority of new tickets.) [default: '5 nicht definiert']
        $Self->{'PostmasterDefaultPriority'} = '5 nicht definiert';
       
        # Ticket::Frontend::EmailPriority
        # default priority for email tickets [default: '5 nicht definiert']
        $Self->{'Ticket::Frontend::AgentTicketEmail'}->{'Priority'} = '5 nicht definiert';
       
        # default phone priority [default: 3 normal]
        $Self->{'Ticket::Frontend::AgentTicketPhone'}->{'Priority'} = '5 nicht definiert';
       
        # CustomerDefaultPriority
        # (default priority of new customer tickets)
        $Self->{'Ticket::Frontend::CustomerTicketMessage'}->{'PriorityDefault'} = '5 nicht definiert';
       
################################################################################################################################
################################################################################################################################    


#--------------------------------------------------------------------------------------------
#                                            firma                                        #
#--------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------
#                                   Agenten Authentifizeirung                               #
#--------------------------------------------------------------------------------------------
$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = 'dc.firma.local'; 
$Self->{'AuthModule::LDAP::BaseDN'} = 'dc=firma,dc=local';
$Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
$Self->{'AuthModule::LDAP::SearchUserDN'} = 'otrsldap@firma.local';
$Self->{'AuthModule::LDAP::SearchUserPw'} = 'Passwort123';
#--------------------------------------------------------------------------------------------
#                                  Kunden Authentifizeirung                                 #
#--------------------------------------------------------------------------------------------
  $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
  $Self->{'Customer::AuthModule::LDAP::Host'} = 'dc.firma.local';
  $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'DC=firma, DC=local';
  $Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
  $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'otrsldap@firma.local';
  $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = 'Passwort123';

#-------------------------------------------------------------------------------------------- 
#                                     Kundendaten                                           #
#--------------------------------------------------------------------------------------------

 #--------------------------------------------------------------------------------------------
# CustomerUser (customer database backend and settings)
$Self->{CustomerUser} = {
    Name => 'Database Datasource',
    Module => 'Kernel::System::CustomerUser::DB',
    Params => {
        # if you want to use an external database, add the required settings
#            DSN => 'DBI:odbc:yourdsn',
#            DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
#            User => '',
#            Password => '',
            Table => 'customer_user',
            # if your frontend is unicode and the charset of your
            # customer database server is iso-8859-1, use these options.
#           SourceCharset => 'iso-8859-1',
#           DestCharset => 'utf-8',

            # CaseSensitive will control if the SQL statements need LOWER()
            #   function calls to work case insensitively. Setting this to
            #   1 will improve performance dramatically on large databases.
            CaseSensitive => 0,
        },
# 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, http-link-target
        [ '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',      1, 1, 'var', '', 0 ],
        [ 'UserPassword',   'Password',   'pw',         0, 0, 'var', '', 0 ],
        [ 'UserEmail',      'Email',      'email',      1, 1, 'var', '', 0 ],
    [ 'Firma',            'Firma',          'company',      1, 0, 'var', '', 0],
    [ 'Abteilung',           'Abteilung',      'department',      1, 0, 'var', '', 0 ],
    [ 'Vorgesetzter',     'Vorgesetzter',      'manager',      1, 0, 'var', '', 0 ],
    [ 'Buero',           'Buero',          'physicalDeliveryOfficeName', 1, 0, 'var', '', 0 ],
#        [ 'UserEmail',      'Email', 'email',           1, 1, 'var', '$Env{"CGIHandle"}?Action=AgentTicketCompose&ResponseID=1&TicketID=$Data{"TicketID"}&ArticleID=$Data{"ArticleID"}', 0 ],
        [ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 0, 'var', '', 0 ],

#        [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 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.' => 'Herr',
#            'Mrs.' => 'Frau',
#        },
#    },
};
 
 

 #--------------------------------------------------------------------------------------------
 #                                      firma Ende                                         #
 #--------------------------------------------------------------------------------------------
 
 
 
#    [ 'Firma',            'Firma',          'company',      1, 0, 'var', '', 0],
#    [ 'Abteilung',           'Abteilung',      'department',      1, 0, 'var', '', 0 ],
#    [ 'Vorgesetzter',     'Vorgesetzter',      'manager',      1, 0, 'var', '', 0 ],
#    [ 'Buero',           'Buero',          'physicalDeliveryOfficeName', 1, 0, 'var', '', 0 ],


 

    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #           End of your own config options!!!          #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
}

# ---------------------------------------------------- #
# needed system stuff (don't edit this)                #
# ---------------------------------------------------- #
use strict;
use warnings;

use vars qw(@ISA $VERSION);
$VERSION = qw($Revision: 1.23 $)[1];

use Kernel::Config::Defaults;
push (@ISA, 'Kernel::Config::Defaults');

# -----------------------------------------------------#

1;
Produktiv:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL

Test:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL
boris
Znuny wizard
Posts: 554
Joined: 22 Feb 2010, 18:27
Znuny Version: 3.0.4

Re: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by boris »

Hat keiner eine Idee?
Das schränkt meine Updatepläne etwas ein :? :lol:
Produktiv:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL

Test:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL
boris
Znuny wizard
Posts: 554
Joined: 22 Feb 2010, 18:27
Znuny Version: 3.0.4

Re: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by boris »

Ich habs gerade nochmal getestet.
Ich hab den die ganze eigene Config aus der Config.pm gelöscht und nur diesen Teil reinkopiert:

Code: Select all

# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2010 xxx, http://otrs.org/
# --
# $Id: Config.pm.dist,v 1.23 2010/01/13 22:25:00 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
#  Note:
#
#  -->> OTRS does have a lot of config settings. For more settings
#       (Notifications, Ticket::ViewAccelerator, Ticket::NumberGenerator,
#       LDAP, PostMaster, Session, Preferences, ...) see
#       Kernel/Config/Defaults.pm and copy your wanted lines into "this"
#       config file. This file will not be changed on update!
#
# --

package Kernel::Config;

sub Load {
    my $Self = shift;
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #         Start of your own config options!!!          #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # database settings                                    #
    # ---------------------------------------------------- #
    # DatabaseHost
    # (The database host.)
    $Self->{'DatabaseHost'} = 'localhost';
    # Database
    # (The database name.)
    $Self->{'Database'} = 'otrs';
    # DatabaseUser
    # (The database user.)
    $Self->{'DatabaseUser'} = 'otrs';
    # DatabasePw
    # (The password of database user. You also can use bin/otrs.CryptPassword.pl
    # for crypted passwords.)
    $Self->{'DatabasePw'} = 'hot';
    # DatabaseDSN
    # (The database DSN for MySQL ==> more: "man DBD::mysql")
    $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

    # (The database DSN for PostgreSQL ==> more: "man DBD::Pg")
    # if you want to use a local socket connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";
    # if you want to use a tcpip connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};host=$Self->{DatabaseHost};";

    # ---------------------------------------------------- #
    # fs root directory
    # ---------------------------------------------------- #
    $Self->{Home} = '/opt/otrs';

    # ---------------------------------------------------- #
    # insert your own config settings "here"               #
    # config settings taken from Kernel/Config/Defaults.pm #
    # ---------------------------------------------------- #
    # $Self->{SessionUseCookie} = 0;
    # $Self->{CheckMXRecord} = 0;

    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # data inserted by installer                           #
    # ---------------------------------------------------- #
    # $DIBI$
    $Self->{'DefaultCharset'} = 'utf-8';




# CustomerUser (customer database backend and settings)
$Self->{CustomerUser1} = {
    Name => 'Database Datasource',
    Module => 'Kernel::System::CustomerUser::DB',
    Params => {
        # if you want to use an external database, add the required settings
#            DSN => 'DBI:odbc:yourdsn',
#            DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
#            User => '',
#            Password => '',
            Table => 'customer_user',
            # if your frontend is unicode and the charset of your
            # customer database server is iso-8859-1, use these options.
#           SourceCharset => 'iso-8859-1',
#           DestCharset => 'utf-8',

            # CaseSensitive will control if the SQL statements need LOWER()
            #   function calls to work case insensitively. Setting this to
            #   1 will improve performance dramatically on large databases.
            CaseSensitive => 0,
        },
# customer unique id
CustomerKey => 'sAMAccountname',

# 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, http-link-target
        [ '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',      1, 1, 'var', '', 0 ],
        [ 'UserPassword',   'Password',   'pw',         0, 0, 'var', '', 0 ],
        [ 'UserEmail',      'Email',      'email',      1, 1, 'var', '', 0 ],

#        [ 'UserEmail',      'Email', 'email',           1, 1, 'var', '$Env{"CGIHandle"}?Action=AgentTicketCompose&ResponseID=1&TicketID=$Data{"TicketID"}&ArticleID=$Data{"ArticleID"}', 0 ],
        [ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],

#        [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 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.',
        },
    },
};





    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    #           End of your own config options!!!          #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
}

# ---------------------------------------------------- #
# needed system stuff (don't edit this)                #
# ---------------------------------------------------- #
use strict;
use warnings;

use vars qw(@ISA $VERSION);
$VERSION = qw($Revision: 1.23 $)[1];

use Kernel::Config::Defaults;
push (@ISA, 'Kernel::Config::Defaults');

# -----------------------------------------------------#

1;
So hab ich keine Kunden in der Kundenübersicht. Wenn ich aber

Code: Select all

$Self->{CustomerUser1} = {
anstatt

Code: Select all

$Self->{CustomerUser} = {
reinschreibe gehts. Dann bekomme ich die Daten aber nicht in der Kundeninfo angezeigt.
Produktiv:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL

Test:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL
boris
Znuny wizard
Posts: 554
Joined: 22 Feb 2010, 18:27
Znuny Version: 3.0.4

Re: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by boris »

Also langsam verliere ich den Glauben....

Kann man überhaupt Customer gegen LDAP Authentifizieren und die Daten aus der DB holen?
Produktiv:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL

Test:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by jojo »

ja
"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
boris
Znuny wizard
Posts: 554
Joined: 22 Feb 2010, 18:27
Znuny Version: 3.0.4

Re: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by boris »

Aber warum das nicht geht weisst du nicht zufällig?
Produktiv:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL

Test:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by jojo »

schau mal ob für Customer Auth ggf. in der Sysconfig was falsches drin steht
"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
boris
Znuny wizard
Posts: 554
Joined: 22 Feb 2010, 18:27
Znuny Version: 3.0.4

Re: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by boris »

da sieht alles richtig aus.

Ich kann mir keinen Reim drauf machen dass mir die Kunden angezeigt werden wenn ich
$Self->{CustomerUser1} = {
anstatt
$Self->{CustomerUser} = {
schreibe.
Dann werden mir allerdings die zusätzlichen Felder nicht mit angezeigt.

Wenn ich dann
$Self->{CustomerUser} = {
nehme sehe ich die zusätzlichen Felder aber keine Kunden mehr.
Produktiv:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL

Test:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL
boris
Znuny wizard
Posts: 554
Joined: 22 Feb 2010, 18:27
Znuny Version: 3.0.4

Re: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by boris »

Jetzt kommen wir der Sache langsam näher...
ich wollte gerade einen Benutzer anlegen und bekam diese Fehlermeldung:


Unknown column 'company' in 'field list', SQL: 'INSERT INTO customer_user ( title, first_name, last_name, login, email, company, department, manager, physicalDeliveryOfficeName, customer_id, phone, comments, create_time, create_by, change_time, change_by) VALUES ( '', 'Boris', 'Wagener', 'b.wagener', 'boris.wagener@xy.de', 'Compass Private Pflegeberatung', 'IT', 'T.test, 'Koeln', 'boris.wagener@xy.de', '022112345', 'Kommentar', '2012-05-03 15:33:39' , 2, '2012-05-03 15:33:39' , 2)'

Das hat mich zu der bahnbrechenden Erkenntnios gebracht das ich Trottel Versuche LDAP Felder aus der DB zu mappen... :?
Also mal ganz klarer Fall von Betriebsblind...

Das mapping hab ich jetzt entsprechend der DB angepasst:

Code: Select all

        Map => [

            # note: Login, Email and CustomerID needed!
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly, http-link-target
            [ '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',      1, 1, 'var', '', 0 ],
            [ 'UserPassword',   'Password',   'pw',         0, 0, 'var', '', 0 ],
            [ 'UserEmail',      'Email',      'email',      1, 1, 'var', '', 0 ],
	    [ 'Firma',            'Firma', 		 'firma', 	 1, 0, 'var', '', 0],
	    [ 'Abteilung', 	      'Abteilung', 	 'abteilung', 	 1, 0, 'var', '', 0 ],
	    [ 'Vorgesetzter',     'Vorgesetzter', 'manager', 	 1, 0, 'var', '', 0 ],
	    [ 'Buero', 	      'Buero', 		 'buero', 1, 0, 'var', '', 0 ],
      #      [ 'UserEmail',      'Email', 'email',           1, 1, 'var', '$Env{"CGIHandle"}?Action=AgentTicketCompose&ResponseID=1&TicketID=$Data{"TicketID"}&ArticleID=$Data{"ArticleID"}', 0, 'OTRSPopup_TicketAction' ],
          [ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],

            [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 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 ],
        ],
Jetzt kann ich auch User anlegen.
Aber das Phänomen mit der 1 bleibt.
Lasse ich es so wie im Handbuch ohne 1 sehe ich die zusätzlichen Felder und kann sie auch befüllen, aber sehe dann keine Kunden in der Übersicht und kann auhc keinen für ein neues Ticket auswählen.
Im Dropdown in der Kundenüberischt steht "Database Backend".

Schreib ich die 1 dabei sehe ich die Kunden ohne Felder. In der Datenbank sind die aber richtig befüllt.
Produktiv:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL

Test:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL
boris
Znuny wizard
Posts: 554
Joined: 22 Feb 2010, 18:27
Znuny Version: 3.0.4

Re: Kundendaten aus lokaler DB/ zusätzliche Felder

Post by boris »

Hat isch erledigt.
Ein Blick ins Log wirkt wunder.

Warum es mir der 1 ging und ohne nicht hat sich mir zwar noch nicht ganz erschlossen aber jetzt gehts.
Ich wollte Felder mappen die es nicht gibt. Wer lesen kann ist klar im Vorteil
Produktiv:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL

Test:
OTRS 3.1.7
CentOS 6.3
Apache2/MySQL
Post Reply