OTRS – пример конфига Config.pm

Пример конфигурационного файла Config.pm системы службы поддержки HELPDESK OTRS4 (Open Ticket Request System):

# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2014 OTRS AG, http://otrs.com/
# --
# 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:
#
#  -->> Most OTRS configuration should be done via the OTRS web interface
#       and the SysConfig. Only for some configuration, such as database
#       credentials and customer data source changes, you should edit this
#       file. For changes do customer data sources you can copy the definitions
#       from Kernel/Config/Defaults.pm and paste them in this file.
#       Config.pm will not be overwritten when updating OTRS.
# --

package Kernel::Config;

use strict;
use warnings;
use utf8;

sub Load {
    my $Self = shift;

    # ---------------------------------------------------- #
    # database settings                                    #
    # ---------------------------------------------------- #

    # The database host
    $Self->{'DatabaseHost'} = '127.0.0.1';

    # The database name
    $Self->{'Database'} = "otrs";

    # The database user
    $Self->{'DatabaseUser'} = "otrs";

    # The password of database user. You also can use bin/otrs.CryptPassword.pl
    # for crypted passwords
    $Self->{'DatabasePw'} = 'pass';

    # The database DSN for MySQL ==> more: "perldoc DBD::mysql"
    $Self->{'DatabaseDSN'} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost}";

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

    # The database DSN for Microsoft SQL Server - only supported if OTRS is
    # installed on Windows as well
#    $Self->{DatabaseDSN} = "DBI:ODBC:driver={SQL Server};Database=$Self->{Database};Server=$Self->{DatabaseHost},1433";

    # The database DSN for Oracle ==> more: "perldoc DBD::oracle"
#    $Self->{DatabaseDSN} = "DBI:Oracle://$Self->{DatabaseHost}:1521/$Self->{Database}";
#
#    $ENV{ORACLE_HOME}     = '/path/to/your/oracle';
#    $ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD HH24:MI:SS';
#    $ENV{NLS_LANG}        = 'AMERICAN_AMERICA.AL32UTF8';

    # ---------------------------------------------------- #
    # 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$

    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    # end of your own config options!!!                    #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #

###############################################################################################
# CustomerUser (customer local database backend and settings)
$Self->{CustomerUser1} = {
    Name => '00-Database Local Datasource',
    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',
            # 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 => 1,
#    AutoLoginCreationPrefix => 'auto',
#    # admin can change customer preferences
    AdminSetPreferences => 1,
#    # cache time to live in sec. - cache any database queries
    CacheTTL => 120,
#    # just a read only source
    ReadOnly => 0,
    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.',
        },
    },
};


# This is the auth. module against the MySQL userbackend db from EU
#$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::DB';
#$Self->{'Customer::AuthModule::DB::Table'} = 'au_user';
#$Self->{'Customer::AuthModule::DB::CustomerKey'} = 'login';
#$Self->{'Customer::AuthModule::DB::CustomerPassword'} = 'password';
#$Self->{'Customer::AuthModule::DB::DSN'} = "DBI:mysql:database=customerdb;host=customerdbhost";
#$Self->{'Customer::AuthModule::DB::DSN'} = "DBI:mysql:database=auth;host=192.168.03.59";
#$Self->{'Customer::AuthModule::DB::User'} = "MySQL_Admin";
#$Self->{'Customer::AuthModule::DB::Password'} = "pass";
# password crypt type (bcrypt|sha2|sha1|md5|apr1|crypt|plain)
#$Self->{'Customer::AuthModule::DB::CryptType'} = 'md5';
#$Self->{'AuthModule::DB::CryptType'} = 'md5';

# This is the auth. module against the otrs local db
##$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::DB';
##$Self->{'Customer::AuthModule::DB::Table'} = 'customer_user';
##$Self->{'Customer::AuthModule::DB::CustomerKey'} = 'login';
##$Self->{'Customer::AuthModule::DB::CustomerPassword'} = 'pw';
##$Self->{'Customer::AuthModule::DB::DSN'} = "DBI:mysql:database=otrs;host=localhost";
##$Self->{'Customer::AuthModule::DB::User'} = "otrs";
##$Self->{'Customer::AuthModule::DB::Password'} = "pass";


# This is configuration for an LDAP auth. backend. Communigate.
# (make sure Net::LDAP is installed!)
##$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
##$Self->{'Customer::AuthModule::LDAP::Host'} = 'ldaps://mail.yourdomain.ru';
##$Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'cn=yourdomain.ru';
##$Self->{'Customer::AuthModule::LDAP::UID'} = 'uid';

# Check if the user is allowed to auth in a posixGroup
# (e. g. user needs to be in a group xyz to use otrs)
##$Self->{'Customer::AuthModule::LDAP::GroupDN'} = 'cn=otrsallow,ou=posixGroups,dc=example,dc=com';
##$Self->{'Customer::AuthModule::LDAP::AccessAttr'} = 'memberUid';
# for ldap posixGroups objectclass (just uid)
##$Self->{'Customer::AuthModule::LDAP::UserAttr'} = 'UID';
# for non ldap posixGroups objectclass (full user dn)
#$Self->{'Customer::AuthModule::LDAP::UserAttr'} = 'DN';

# The following is valid but would only be necessary if the
# anonymous user does NOT have permission to read from the LDAP tree
##$Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'eu';
##$Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = 'pass';

# in case you want to add always one filter to each ldap query, use
# this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
##$Self->{'Customer::AuthModule::LDAP::AlwaysFilter'} = '';

# in case you want to add a suffix to each customer login name, then
# you can use this option. e. g. user just want to use user but
# in your ldap directory exists user@domain.
#$Self->{'Customer::AuthModule::LDAP::UserSuffix'} = '@domain.com';

# Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
##$Self->{'Customer::AuthModule::LDAP::Params'} = {
##  port => 636,
##  timeout => 120,
##  async => 0,
##  version => 3,
##};



# This is an example configuration for an apache ($ENV{REMOTE_USER})
# auth. backend. Use it if you want to have a singe login through
# apache http-basic-auth
#$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::HTTPBasicAuth';
# Note:
# If you use this module, you should use the following
# config settings as fallback, if user isn't login through
# apache ($ENV{REMOTE_USER})
#$Self->{CustomerPanelLoginURL} = 'http://host.example.com/not-authorised-for-otrs.html';
#$Self->{CustomerPanelLogoutURL} = 'http://host.example.com/thanks-for-using-otrs.html';

##### CAS ####

$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::CAS';
$Self->{'Customer::AuthModule::CAS::Gateway'} = 0;
$Self->{'Customer::AuthModule::CAS::ServiceUrl'} = 'http://helpdesk.eu.yourdomain.ru/otrs/customer.pl';
$Self->{'Customer::AuthModule::CAS::CASUrl'} = 'https://proxy.yourdomain.ru:8443/cas/';
$Self->{CustomerPanelLogoutURL} = 'https://proxy.yourdomain.ru:8443/cas/logout';

# 1. Customer user backend: DB from EU
# (customer database backend and settings)
$Self->{CustomerUser2} = {
Name => 'Customer Database MySQL EU',
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',
DSN => 'DBI:mysql:database=auth;host=192.168.03.59',
User => 'MySQL_Admin',
Password => 'pass',
Table => 'otrs',
# set this to 1 if your table does not have create_time, create_by, change_time and change_by fields
ForeignDB => 1,
# 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,
# if both your frontend and your LDAP are unicode, use this:
SourceCharset => 'utf-8',
DestCharset => 'utf-8',
},
# customer unique id
CustomerKey => 'id',
# customer #
CustomerID => 'login',
#CustomerValid => 'valid_id',
CustomerUserListFields => ['login', 'abbr', 'value', 'fio', 'phone', 'email'],
CustomerUserSearchFields => ['abbr', 'value', 'login', 'fio', 'id', 'phone', 'email'],
#CustomerUserListFields => ['fio', 'phone', 'email', 'value'],
#CustomerUserSearchFields => ['login', 'fio', 'id', 'phone', 'email', 'value'],
CustomerUserSearchPrefix => '',
CustomerUserSearchSuffix => '*',
CustomerUserSearchListLimit => 10000,
CustomerUserPostMasterSearchFields => ['email'],
CustomerUserNameFields => ['fio'],
#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 => 0,
# # cache time to live in sec. - cache any database queries
 CacheTTL => 120,
# # 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', 'fio', 1, 1, 'var','', 1 ],
#[ 'UserLastname', 'Lastname', 'last_name', 1, 1, 'var','', 0 ],
[ 'UserLogin', 'Username', 'login', 1, 1, 'var','', 1 ],
#[ 'UserPassword', 'Password', 'pw', 0, 0, 'var','', 0 ],
[ 'UserEmail', 'Email', 'email', 1, 1, 'var','', 1 ],
[ 'UserCustomerID', 'CustomerID', 'id', 1, 1, 'var','', 1 ],
[ '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 ],
[ 'UserComment', 'Comment', 'value', 1, 0, 'var','', 0 ],
[ 'UserZip', 'Zip', 'abbr', 1, 0, 'var','', 0 ],
#[ 'ValidID', 'Valid', 'valid_id', 0, 1, 'int','', 0 ],
],
# default selections
Selections => {
UserTitle => {
'Mr.' => 'Mr.',
'Mrs.' => 'Mrs.',
},
},
};


#LDAP
 $Self->{CustomerUser3} = {
  Name => 'LDAP EU',
  Module => 'Kernel::System::CustomerUser::LDAP',
  Params => {
  Host => 'ldap://ldap.eu.yourdomain.ru',
  BaseDN => 'dc=USR,dc=EU,dc=yourdomain,dc=RU',
  SSCOPE => 'sub',
  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 => '',
  AlwaysFilter => '(mail=*@*)',
  # 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,
            },
},
  CustomerKey => 'uid',
  CustomerID => 'cn',
  # Поля выводимы в поле "от клиента" при создании заявки
  #CustomerUserListFields => ['uid', 'cn', 'telephoneNumber'],
   CustomerUserListFields => ['cn', 'telephoneNumber', 'mail'],
  #CustomerUserListFields => ['cn', 'st', 'telephoneNumber'],
   CustomerUserSearchFields => ['uid', 'sn', 'cn', 'telephoneNumber', 'mail'],
  #CustomerUserSearchFields => ['uid', 'sn', 'cn', 'st', 'telephoneNumber'],
  CustomerUserSearchPrefix => '',
  CustomerUserSearchSuffix => '*',
  CustomerUserSearchListLimit => 10000,
  CustomerUserPostMasterSearchFields => ['mail'],
  #CustomerUserPostMasterSearchFields => ['st'],
  #CustomerUserNameFields => ['givenname', 'sn'],
  CustomerUserNameFields => ['sn', 'cn'],
  #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 => 120,
 Map => [
    # note: Login, Email and CustomerID are mandatory!
    # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
 [ 'UserPhone', 'Phone', 'telephoneNumber', 1, 0, 'var', '', 0 ],
 [ 'UserFirstname', 'Firstname', 'sn', 1, 1, 'var', '', 0  ],
 [ 'UserLastname', 'Lastname', 'cn', 1, 1, 'var', '', 0  ],
 [ 'UserLogin', 'Username', 'cn', 1, 1, 'var', '', 0  ],
 [ 'UserEmail', 'Email', 'mail', 1, 1, 'var', '', 0  ],
 [ 'UserCustomerID', 'CustomerID', 'uid', 1, 1, 'var', '', 0  ],
   ],
 };

#LDAP 2
 $Self->{CustomerUser4} = {
  Name => 'LDAP Communigate',
  Module => 'Kernel::System::CustomerUser::LDAP',
  Params => {
  Host => 'ldaps://mail.yourdomain.ru',
  BaseDN => 'cn=yourdomain.ru',
# search scope (one|sub)
  SSCOPE => 'sub',
  UserDN => 'eu',
  UserPw => 'pass',
# 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 => '',
#  AlwaysFilter => '(mail=*@*)',
  # 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 => 636,
  timeout => 120,
  async => 0,
  version => 3,
#            sslversion => 'sslv2/3',  # defaults to: 'tlsv1'
#            verify => 'require',
 
#            clientcert => '/path/to/cert.pem',
#            clientkey => '/path/to/key.pem',
#            keydecrypt => sub { 'secret'; },
#            capath => '/path/to/servercerts/',
            },
},
# customer unique id
  CustomerKey => 'uid',
  CustomerID => 'ou',
  # Поля выводимы в поле "от клиента" при создании заявки
  CustomerUserListFields => ['cn', 'telephoneNumber', 'ou', 'mail'],
  # CustomerUserListFields => ['cn', 'mail'],
  #CustomerUserListFields => ['cn', 'st', 'telephoneNumber'],
   CustomerUserSearchFields => ['uid', 'cn', 'telephoneNumber', 'mail'],
  #CustomerUserSearchFields => ['uid', 'sn', 'cn', 'st', 'telephoneNumber'],
  CustomerUserSearchPrefix => '',
  CustomerUserSearchSuffix => '*',
  CustomerUserSearchListLimit => 10000,
  CustomerUserPostMasterSearchFields => ['mail'],
  #CustomerUserPostMasterSearchFields => ['st'],
  CustomerUserNameFields => ['givenName', 'sn'],
  #CustomerUserNameFields => ['sn', 'cn'],
  #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 => 120,
 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 ],
 [ 'UserPhone', 'Phone', 'telephoneNumber', 1, 0, 'var', '', 0 ],
 [ 'UserFirstname', 'Firstname', 'givenName', 1, 1, 'var', '', 0  ],
 [ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var', '', 0  ],
 [ 'UserLogin', 'Username', 'uid', 1, 1, 'var', '', 0  ],
 [ 'UserEmail', 'Email', 'mail', 1, 1, 'var', '', 0  ],
 [ 'UserCustomerID', 'CustomerID', 'ou', 1, 1, 'var', '', 0  ],
   ],
 };


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

}

# ---------------------------------------------------- #
# needed system stuff (don't edit this)                #
# ---------------------------------------------------- #

use base qw(Kernel::Config::Defaults);

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

1;

 

Закладка Постоянная ссылка.

Добавить комментарий

Ваш e-mail не будет опубликован.

*