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'} = 'host';
# Database
# (The database name.)
$Self->{'Database'} = 'otrs';
# DatabaseUser
# (The database user.)
$Self->{'DatabaseUser'} = 'user';
# DatabasePw
# (The password of database user. You also can use bin/otrs.CryptPassword.pl
# for crypted passwords.)
$Self->{'DatabasePw'} = 'password';
# 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';
# Meine Daten
my $LDAP_Host = 'ldap';
my $LDAP_BaseDN = 'ou=***, o=***, c=***';
# my $LDAP_UID = 'uid';
my $LDAP_UID = 'sAMAccountName';
my $LDAP_SearchUserDN= 'LDAPNM';
my $LDAP_SearchUserPw = 'LDAPPW';
####
#### my $adfilter = '(&(objectCategory=person)(objectclass=user)(mail=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))';
####
# --------------------------------------------------- #
# --------------------------------------------------- #
# #
# LDAP Authentifizierung Agent #
# #
# --------------------------------------------------- #
# --------------------------------------------------- #
# This is the auth. module againt the otrs db
# $Self->{AuthModule} = 'Kernel::System::Auth::DB';
$Self->{'AuthModule1'} = 'Kernel::System::Auth::DB';
# This is an configuration for an LDAP auth. backend.
# (take care that Net::LDAP is installed!)
$Self->{AuthModule} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = $LDAP_Host;
$Self->{'AuthModule::LDAP::BaseDN'} = $LDAP_BaseDN;
$Self->{'AuthModule::LDAP::UID'} = $LDAP_UID;
$Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
# The following is valid but would only be necessary if the
# anonymous user do NOT have permission to read from the LDAP tree
$Self->{'AuthModule::LDAP::SearchUserDN'} = $LDAP_SearchUserDN;
$Self->{'AuthModule::LDAP::SearchUserPw'} = $LDAP_SearchUserPw;
# 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->{'AuthModule::LDAP::AlwaysFilter'} = $adfilter;
$Self->{'AuthModule::LDAP::Charset'} = 'utf-8';
# Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
$Self->{'AuthModule::LDAP::Params'} =
{
# port => 389,
port => 3268,
timeout => 120,
async => 0,
version => 3,
};
# --------------------------------------------------- #
# --------------------------------------------------- #
# #
# LDAP Sync #
# #
# --------------------------------------------------- #
# --------------------------------------------------- #
# This is an configuration for an LDAP auth sync. backend.
# (take care that Net::LDAP is installed!)
$Self->{AuthSyncModule} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host'} = $LDAP_Host;
$Self->{'AuthSyncModule::LDAP::BaseDN'} = $LDAP_BaseDN;
$Self->{'AuthSyncModule::LDAP::UID'} = $LDAP_UID;
# The following is valid but would only be necessary if the
# anonymous user do NOT have permission to read from the LDAP tree
$Self->{'AuthSyncModule::LDAP::SearchUserDN'} = $LDAP_SearchUserDN;
$Self->{'AuthSyncModule::LDAP::SearchUserPw'} = $LDAP_SearchUserPw;
# 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->{'AuthSyncModule::LDAP::AlwaysFilter'} = $adfilter;
# AuthSyncModule::LDAP::UserSyncMap
# (map if agent should create/synced from LDAP to DB after successful login)
$Self->{'AuthSyncModule::LDAP::UserSyncMap'} =
$Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
Username => 'sAMAccountName',
};
$Self->{'AuthModule::LDAP::Die'} = 0;
# AuthSyncModule::LDAP::UserSyncInitialGroups
# (sync following group with rw permission after initial create of first agent
# login)
$Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} =
[
'users',
];
$Self->{UserSyncLDAPMap} = {
# DB -> LDAP
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
};
$Self->{UserSyncLDAPGroups} = ['user',];
# UserTable
$Self->{DatabaseUserTable} = 'users';
$Self->{DatabaseUserTableUserID} = 'id';
$Self->{DatabaseUserTableUserPW} = 'pw';
$Self->{DatabaseUserTableUser} = 'login';
# --------------------------------------------------- #
# --------------------------------------------------- #
# #
# LDAP Authentifizierung Kunde #
# #
# --------------------------------------------------- #
# --------------------------------------------------- #
# CustomerUser
# (customer user database backend and settings)
$Self->{CustomerUser} =
{
Name => 'Database Backend',
Module => 'Kernel::System::CustomerUser::DB',
Params =>
{
Table => 'customer_user',
DestCharset => 'utf-8',
SourceCharset => 'utf-8',
},
# customer uniq id
CustomerKey => 'login',
# customer #
CustomerID => 'customer_id',
CustomerValid => 'valid_id',
CustomerUserListFields => [ 'first_name', 'last_name', 'email' ],
CustomerUserListFields => ['login', 'first_name', 'last_name', 'customer_id', 'email'],
CustomerUserSearchFields => [ 'login', 'first_name', 'last_name', 'customer_id' ],
CustomerUserSearchPrefix => '',
CustomerUserSearchSuffix => '*',
CustomerUserSearchListLimit => 1000,
CustomerUserPostMasterSearchFields => ['email'],
CustomerUserNameFields => [ 'first_name', 'last_name' ],
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
# [ 'UserSalutation', 'Salutation', 'salutation', 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', 1, 1, 'var', '', 0 ],
[ 'UserEmail', 'Email', 'email', 1, 1, 'var', '', 0 ],
[ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],
[ 'UserPhone','Phone', 'phone', 1, 0,'var', '', 0 ],
[ 'UserMobile', 'Mobile', 'mobile', 1, 0,'var', '', 0 ],
# [ 'UserEmail', 'Email', 'email',1, 1, 'var', '$Env{"CGIHandle"}?Action=AgentTicketCompose&ResponseID=1&TicketID=$Data{"TicketID"}&ArticleID=$Data{"ArticleID"}', 0 ],
# [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 0, 'var', '', 0 ],
# [ 'UserComment', 'Comment', 'comments', 1, 0, 'var', '', 0 ],
# [ 'ValidID', 'Valid', 'valid_id', 0, 1, 'int', '', 0 ],
],
};
$Self->{CustomerUser1} =
{
Name => 'LDAP Backend',
Module => 'Kernel::System::CustomerUser::LDAP',
Params => {
Host => $LDAP_Host,
BaseDN => $LDAP_BaseDN,
SSCOPE => 'sub',
UserDN => $LDAP_SearchUserDN,
UserPw => $LDAP_SearchUserPw,
# AlwaysFilter => '(uid=*)',
AlwaysFilter => $adfilter,
DestCharset => 'utf-8',
SourceCharset => 'utf-8',
Params => {
# port =>398,
port =>3268,
timeout => 10,
async => 0,
version => 3,
},
},
CustomerID => 'mail',
CustomerKey => $LDAP_UID,
CustomerUserListFields => ['cn', 'mail'],
CustomerUserSearchFields => [$LDAP_UID, 'cn', 'name', 'mail'],
CustomerUserSearchListLimit => 1000,
CustomerUserPostMasterSearchFields => ['mail'],
CustomerUserNameFields => ['givenname', 'sn'],
CustomerUserExcludePrimaryCustomerID => 0,
AdminSetPreferences => 0,
Map => [
[ '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', 'mail', 0, 1,'var', '', 0 ],
[ 'UserPhone', 'Phone', 'telephoneNumber', 1, 0,'var', '', 0 ],
[ 'UserMobile', 'Mobile', 'mobile', 1, 0,'var', '', 0 ].
],
};
$Self->{'AuthModule::LDAP::UID'} = $LDAP_UID,
$Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
# This is the auth. module against the otrs db
$Self->{'Customer::AuthModule1'} = 'Kernel::System::CustomerAuth::DB';
$Self->{'Customer::AuthModule::DB::Table1'} = 'customer_user';
$Self->{'Customer::AuthModule::DB::CustomerKey1'} = 'login';
$Self->{'Customer::AuthModule::DB::CustomerPassword1'} = 'pw';
# This is the auth. module against LDAP
$Self->{'Customer::AuthModule2'} = 'Kernel::System::CustomerAuth::LDAP';
$Self->{'Customer::AuthModule::LDAP::Host2'} = $LDAP_Host;
$Self->{'Customer::AuthModule::LDAP::BaseDN2'} = $LDAP_BaseDN;
$Self->{'Customer::AuthModule::LDAP::UID2'} = $LDAP_UID;
$Self->{'Customer::AuthModule::LDAP::SearchUserDN2'} = $LDAP_SearchUserDN;
$Self->{'Customer::AuthModule::LDAP::SearchUserPw2'} = $LDAP_SearchUserPw;
$Self->{'Customer::AuthModule::LDAP::AlwaysFilter2'} = $adfilter;
$Self->{'Customer::AuthModule::LDAP::Params2'} = {
port => 3268,
timeout => 10,
async => 0,
version => 3,
};
#<--
# The following is valid but would only be necessary if the
# anonymous user do NOT have permission to read from the LDAP tree
# -------------------------------------------------------------------------------------------------------------------------
# we have our own search-user defined for LDAP sync. functionality
# -------------------------------------------------------------------------------------------------------------------------
# -->
$Self->{'AuthModule::LDAP::SearchUserDN'} = $LDAP_SearchUserDN,
$Self->{'AuthModule::LDAP::SearchUserPw'} = $LDAP_SearchUserPw,
#<--
# -------------------------------------------------------------------------------------------------------------------------
# in case you want to add always one filter to each ldap query, use
# this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
# -->
# <--
# -------------------------------------------------------------------------------------------------------------------------
# in case you want to add a suffix to each 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->{'AuthModule::LDAP::UserSuffix'} = '@domain.com';
# In case you want to convert all given usernames to lower letters you
# should activate this option. It might be helpfull if databases are
# in use that do not distinguish selects for upper and lower case letters
# (Oracle, postgresql). User might be synched twice, if this option
# is not in use.
# $Self->{'AuthModule::LDAP::UserLowerCase'} = 0;
# In case you need to use OTRS in iso-charset, you can define this
# by using this option (converts utf-8 data from LDAP to iso).
$Self->{'AuthModule::LDAP::Charset'} = 'utf-8';
# --> activate LDAP
# # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
$Self->{'AuthModule::LDAP::Params'} = {
port => 389,
timeout => 10,
async => 0,
version => 3,
};
};
# ---------------------------------------------------- #
# ---------------------------------------------------- #
# #
# 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;