OTRSは、ユーザー名、メール・アドレス、電話番号などのような多くの顧客情報属性で動作しています。これらの属性は担当者および顧客フロント・エンドの両方に表示され、顧客の認証に使用されます。
OTRSの内に使用されるか表示された顧客情報は高度にカスタマイズ可能です。しかし次の情報は、顧客認証に常に必要とされます:
User login(ユーザーログイン)
Email address(Eメールアドレス)
Customer ID(顧客ID)
担当者インターフェースの顧客情報を表示したければ、次のSysConfigパラメタを使用して下さい。
# Ticket::Frontend::CustomerInfo* # (作成(電話とEメール)、ズーム、キュービュー時に顧客情報を表示) $Self->{'Ticket::Frontend::CustomerInfoCompose'} = 1; $Self->{'Ticket::Frontend::CustomerInfoZoom'} = 1;
スクリプト:SysConfig構成パラメタ
2つのタイプの顧客バックエンド、DBおよびLDAPを使用することができます。あなたが別の顧客バックエンド(例えばSAP)を既に持っていれば、それを使用するモジュールを書くことはもちろん可能です。
例11-1は、DB顧客バックエンドの構成を示します。それは、OTRSデータベースに保存された顧客情報を使用します。
例4.6 DB顧客バックエンドの構成
# 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', # Type => 'mssql', # only for ODBC connections # DSN => 'DBI:mysql:database=customerdb;host=customerdbhost', # User => '', # Password => '', Table => 'customer_user', # 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 ], # [ '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.', }, }, };
顧客情報をカスタマイズしたい場合は、カラム・ヘッダーを変更するか、あるいは新規ものをOTRSデータベース中のcustomer_userテーブルに加えてください。例として、下記のスクリプトは、room番号用の新規フィールドを加える方法を教えます。
linux:~# mysql -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 116 to server version: 5.0.18-Debian_7-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use otrs; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> ALTER TABLE customer_user ADD room VARCHAR (250); Query OK, 1 rows affected (0.01 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> quit Bye linux:~#
スクリプト: roomフィールドのcustomer_userテーブルへの追加。
次のスクリプトで示されるように、さて、新規カラムをKernel/Config.pm
中のMAP配列に追加してください。
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly [...] [ 'UserRoom', 'Room', 'room', 0, 1, 'var', '', 0 ],
スクリプト:roomフィールドのKernel/Config.pmファイルへの追加。
担当者インターフェースの顧客リンクによってこの顧客情報をすべて編集することも可能です。
顧客に1つを超える顧客IDを割り当てることは可能です。顧客が他の顧客のチケットへアクセスしなければならないならばこれは役立ちます。(例えば、スーパーバイザはアシスタントのチケットを見たい。)顧客が他の顧客のチケットへアクセスできるならば、OTRSの会社チケット機能が使われます。会社チケットは、顧客パネル中の「会社チケット」リンクによってアクセスすることができます。
会社チケットを使用するために、顧客にとってアクセス可能であるべきIDを備えた新規カラムをOTRSデータベース中のcustomer_userテーブルに加えなければなりません(下記のスクリプトを参照)。
linux:~# mysql -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 124 to server version: 5.0.18-Debian_7-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use otrs; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> ALTER TABLE customer_user ADD customer_ids VARCHAR (250); Query OK, 1 rows affected (0.02 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> quit Bye linux:~#
スクリプト: customer_idsフィールドのcustomer_userテーブルへの追加。
スクリプトの中で下に示されるように、新規カラムをKernel/Config.pm
中のMAP配列に加えなければなりません。
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly [...] [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 0, 'var', '', 0 ],
スクリプト: UserCustomerIDsフィールドの Kernel/Config.pmファイル への追加。
ここで、多数の顧客IDのための新規カラムは、顧客管理のためのセクションの中で担当者・インターフェース経由で編集することができます。
顧客が他の顧客のチケットにアクセスすることを確実にするために、多数の顧客IDのための新規フィールドの中へのこれらの他のユーザのIDを追加します。セミコロンによって各IDを区切って下さい(下記の例11-2を参照)。
例4.7 DBバックエンドを備えた会社チケットの使用
顧客A、BおよびCはあなたのシステムに存在します。また、Aは顧客パネルからBとCのチケットにアクセスしたい。BとCは他のユーザのチケットにアクセスするべきではありません。
このセットアップを実現するためには、上に記述されるようなKernel/Config.pm
中のcustomer_userテーブルおよびMappingを変更してください。次に、担当者インターフェースあるいは管理者ページの顧客リンクから、顧客Aのための設定をロードしてください。設定が表示される場合、CustomerIDsのためのフィールドへ値「B;C;」を追加して下さい。
顧客情報を備えたLDAPディレクトリーを持っているならば、例11-3において示されるように、OTRSを備えた顧客バックエンドとしてそれを使用することができます。
例4.8 LDAP顧客バックエンドの構成
# CustomerUser # (customer ldap backend and settings) $Self->{CustomerUser} = { Name => 'LDAP Data Source', Module => 'Kernel::System::CustomerUser::LDAP', Params => { # ldap host Host => 'bay.csuhayward.edu', # ldap base dn BaseDN => 'ou=seas,o=csuh', # 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 the charset of your ldap server is iso-8859-1, use this: # SourceCharset => 'iso-8859-1', # 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 => 'uid', # customer # CustomerID => 'mail', CustomerUserListFields => ['cn', 'mail'], CustomerUserSearchFields => ['uid', '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! # 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', 'uid', 1, 1, 'var', '', 0 ], [ 'UserEmail', 'Email', 'mail', 1, 1, 'var', '', 0 ], [ 'UserCustomerID', 'CustomerID', 'mail', 0, 1, 'var', '', 0 ], # [ 'UserCustomerIDs', 'CustomerIDs', 'second_customer_ids', 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 ], ], };
追加の顧客属性(マネージャーの名前、携帯電話番号あるいは部署のような)が、あなたのLDAPディレクトリーに格納されていて、この情報をOTRSに表示したいならば、次のスクリプトの中で示されるように、これらの属性へのエントリーを備えたKernel/Config.pm
中のMAP配列をただ拡張してください。
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly [...] [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var', '', 0 ],
スクリプト:新規フィールドのKernel/Config.pmファイルへの追加
LDAPバックエンドを使用する場合、顧客にひとつ以上の顧客IDを割り当てることが可能です。会社チケットを使用するために、新規フィールドを顧客によってアクセス可能なIDを含んでいるLDAPディレクトリーに加えなければなりません。
LDAPディレクトリーの新規フィールドが作成されている場合、スクリプトの中で下に示されるように、新規エントリーをKernel/Config.pm
中のMAP配列に加えなければなりません。
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly [...] [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 0, 'var', '', 0 ],
スクリプト: 新規フィールドのKernel/Config.pmファイルへのMaping
複数の顧客IDのためのフィールドをLDAPディレクトリーで直接編集しなければなりません。OTRSはLDAPから単に読み込むだけで書き込むことはできません。
顧客によって他の顧客のチケットにアクセスを保証するためには、そのチケットがあなたのLDAPディレクトリーの新規フィールドにアクセスされるべき顧客の顧客IDを加えてください。各IDはセミコロンで区切って下さい(下記の例11-4を参照)。
例4.9 LDAPバックエンドを備えた会社チケットの使用
顧客A、BおよびCはあなたのシステムに存在します。また、Aは顧客パネルからBとCのチケットにアクセスしたい。BとCは他のユーザのチケットにアクセスするべきではありません。
このセットアップを実現するためには、上に記述されるようなKernel/Config.pm
中のLDAPディレクトリーおよびMappingを変更してください。その後、CustomerIDsのためのフィールドへ値「B;
C;」をあなたのLDAPディレクトリーの顧客Aのために追加して下さい。
あなたがOTRS(例えばLDAPおよびデータベース・バックエンド)と共に使用されるひとつ以上の顧客情報ソースを利用したければ、CustomerUser構成パラメタを「数」で(例えば「CustomerUser1」、「CustomerUser2」)拡張するべきです。(下記の例11-5を参照)。
例4.10 OTRSでひとつ以上の顧客バックエンドを使用する
以下は、OTRSでLDAPとデータベース顧客バックエンドの両方を使用する構成例です。
# 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, 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 ], [ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, '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 # (customer ldap backend and settings) $Self->{CustomerUser2} = { Name => 'LDAP Datasource', Module => 'Kernel::System::CustomerUser::LDAP', Params => { # ldap host Host => 'bay.csuhayward.edu', # ldap base dn BaseDN => 'ou=seas,o=csuh', # 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 the charset of your ldap server is iso-8859-1, use this: # SourceCharset => 'iso-8859-1', # 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 => 'uid', # customer # CustomerID => 'mail', CustomerUserListFields => ['cn', 'mail'], CustomerUserSearchFields => ['uid', 'cn', 'mail'], CustomerUserSearchPrefix => '', CustomerUserSearchSuffix => '*', CustomerUserSearchListLimit => 250, CustomerUserPostMasterSearchFields => ['mail'], CustomerUserNameFields => ['givenname', 'sn'], # show not own tickets in customer panel, CompanyTickets CustomerUserExcludePrimaryCustomerID => 0, # add a ldap filter for valid users (expert setting) # CustomerUserValidFilter => '(!(description=locked))', # admin can't change customer preferences AdminSetPreferences => 0, Map => [ # note: Login, Email and CustomerID needed! # 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', 'uid', 1, 1, 'var', '', 0 ], [ 'UserEmail', 'Email', 'mail', 1, 1, 'var', '', 0 ], [ 'UserCustomerID', 'CustomerID', 'mail', 0, 1, 'var', '', 0 ], # [ 'UserCustomerIDs', 'CustomerIDs', 'second_customer_ids', 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 ], ], };
10までの異なる顧客バックエンドを統合することは可能です。全ての顧客情報を見るか編集する(書き込みアクセス権限が可能と仮定して)ためにOTRSの中で顧客管理インターフェースを使用してください。
顧客データを直接チケットの動的フィールドに格納することも時には役立つかもしれません。(例えばこのデータで特別な統計を作成するような目的で)
チケットが作成される場合、あるいはチケットの顧客が変更される場合、動的フィールド値がセットされます。動的フィールドの値は顧客データから得られます。これはすべてのバックエンドのために働きますが、特にLDAPバックエンドに役立ちます。
OTRSのこのオプション機能を活性化するために、以下の二つの設定を活性化して下さい。「Ticket::EventModulePost###930-DynamicFieldFromCustomerUser」および「DynamicFieldFromCustomerUser::Mapping」。後の設定では、CustomerUserフィールド入力がチケットのどの動的フィールドに格納しなければならないかの構成を含んでいます。フィールドはシステムの中にあるに違いありませんし、AgentTicketFreeTextのために可能になるに違いありません。そのゆえ、それらは手動でセットすることができます。それらはAgentTicketPhone、AgentTicketEmailおよびAgentTicketCustomerのために可能になってはなりません。もしそれらが可能ならば、それらは自動設定値に対して先行するでしょう。
OTRSは、異なるバックエンドに対する、担当者および顧客を認証するオプションを提示します。
デフォルトで使用される担当者を認証するバックエンドは、OTRSデータベースです。担当者は、管理者ページの担当者管理インターフェイス経由で 追加・編集されます(下のサンプル11-6参照)。
LDAPディレクトリが担当者データをすべて保存する場合、OTRSの中のユーザを認証するためにLDAPモジュールを使用することができます(下記の例11-7を参照)。このモジュールはLDAPツリーに対して単に読み込みアクセスを有しています。それは、担当者管理インターフェース経由で利用者データを編集することができないことを意味します。
例4.12 LDAPバックエンドに対する認証エージェント
# これはLDAP認証バックエンド用サンプル構成です。 # (Net::LDAPがインストール済であることを確認下さい。) $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP'; $Self->{'AuthModule::LDAP::Host'} = 'ldap.example.com'; $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=example,dc=com'; $Self->{'AuthModule::LDAP::UID'} = 'uid'; # ユーザがposixGroupで認証を許可されていることを確認します。 # (例えばユーザはOTRSを利用するグループ xyz に属する必要があります。) $Self->{'AuthModule::LDAP::GroupDN'} = 'cn=otrsallow,ou=posixGroups,dc=example,dc=com'; $Self->{'AuthModule::LDAP::AccessAttr'} = 'memberUid'; # for ldap posixGroups objectclass (just uid) # $Self->{'AuthModule::LDAP::UserAttr'} = 'UID'; # for non ldap posixGroups objectclass (with full user dn) # $Self->{'AuthModule::LDAP::UserAttr'} = 'DN'; # 次は有効です。しかし 匿名ユーザがLDAPツリーから # 読み込み許可を持たない場合のみ必要です。 $Self->{'AuthModule::LDAP::SearchUserDN'} = ''; $Self->{'AuthModule::LDAP::SearchUserPw'} = ''; # 常にあるフィルタを各LDAPクエリに追加したい場合このオプションを使います。 # たとえば AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)' $Self->{'AuthModule::LDAP::AlwaysFilter'} = ''; # ログイン名のに接頭辞を追加したければ、このオプションを使います。 # たとえばユーザがuserを使いたいが、LDAPにuser@domainが存在する場合。 # $Self->{'AuthModule::LDAP::UserSuffix'} = '@domain.com'; # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP) $Self->{'AuthModule::LDAP::Params'} = { port => 389, timeout => 120, async => 0, version => 3, };
スクリプトの中で下に示される構成パラメータは、ローカルのOTRSデータベースの中へのLDAPディレクトリーからの利用者データを同期させるために使用することができます。これは、LDAPサーバーにリクエストの数を減らし、OTRSでの認証の速度を向上させます。担当者が最初に認証する場合、データ同期は終っています。ローカルのOTRSデータベースへデータを同期することができますが、LDAPディレクトリーは認証のための最後の実体(インスタンス)です、したがって、LDAPツリー内の活性化されていないユーザは認証することができません。アカウント・データがOTRSデータベースに既に保存されている場合さえ。LDAPディレクトリーの担当者データは、OTRSのウェブインターフェース経由で編集することができません。したがって、LDAPツリーにデータを直接管理しなければなりません。
# AuthModule用にAuthSyncBackend (AuthSyncModule)定義します。 # キーが存在しそれが空ならば、Syncにならないでしょう。 # サンプル値: AuthSyncBackend, AuthSyncBackend2 $Self->{'AuthModule::UseSyncBackend'} = 'AuthSyncBackend'; # LDAPに対する担当者データ sync $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP'; $Self->{'AuthSyncModule::LDAP::Host'} = 'ldap://ldap.example.com/'; $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=otrs, dc=org'; $Self->{'AuthSyncModule::LDAP::UID'} = 'uid'; $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'uid=sys, ou=user, dc=otrs, dc=org'; $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'some_pass'; $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = { # DB -> LDAP UserFirstname => 'givenName', UserLastname => 'sn', UserEmail => 'mail', }; [...] # AuthSyncModule::LDAP::UserSyncInitialGroups # (最初の担当者のログインの初期の作成後に、rw許可を持つsync followingグループ) $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [ 'users', ];
スクリプト:OTRSデータベースの中へのLDAPディレクトリーからの利用者データを同期させること。
Alternatively, you can use LDAP groups to determine group memberships or roles in OTRS. For more information and examples, see Kernel/Config/Defaults.pm. Here is an example for synchronizing from LDAP into OTRS groups.
# Attributes needed for group syncs # (attribute name for group value key) $Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'memberUid'; # (select the attribute for type of group content UID/DN for full ldap name) # $Self->{'AuthSyncModule::LDAP::UserAttr'} = 'UID'; # $Self->{'AuthSyncModule::LDAP::UserAttr'} = 'DN'; AuthSyncModule::LDAP::UserSyncGroupsDefinition # (If "LDAP" was selected for AuthModule and you want to sync LDAP # groups to otrs groups, define the following.) $Self->{'AuthSyncModule::LDAP::UserSyncGroupsDefinition'} = { # your ldap group 'cn=agent,o=otrs' => { # otrs group(s) 'admin' => { # permission rw => 1, ro => 1, }, 'faq' => { rw => 0, ro => 1, }, }, 'cn=agent2,o=otrs' => { 'users' => { rw => 1, ro => 1, }, } };
すべての担当者のための「シングル・サインオン」解決を実行したければ、OTRSのためにHTTP基本認証(すべてのシステム用の)およびHTTPBasicAuthモジュールを使用することができます(下記の例11-8を参照)。
例4.13 HTTPBasicを使用して、担当者を認証します。
# これはapache ($ENV{REMOTE_USER})認証バックエンド用のサンプル構成です。 # apache http-basic-authのシングル・サインオンを持ちたければそれを使います。 $Self->{'AuthModule'} = 'Kernel::System::Auth::HTTPBasicAuth'; # Note: # # このモジュールを使うなら、代替手段として次の構成設定を使うべきです。 #(もしユーザがapache ($ENV{REMOTE_USER})として認証されていないならば) $Self->{LoginURL} = 'http://host.example.com/not-authorised-for-otrs.html'; $Self->{LogoutURL} = 'http://host.example.com/thanks-for-using-otrs.html';
例11-9において示される構成パラメータは、Radiusサーバーに対する担当者を認証するために使用することができます。
例4.14 Radiusバックエンドに対する担当者を認証します。
# これは、radiusサーバに対するauth. agentsへのサンプル構成です。 $Self->{'AuthModule'} = 'Kernel::System::Auth::Radius'; $Self->{'AuthModule::Radius::Host'} = 'radiushost'; $Self->{'AuthModule::Radius::Password'} = 'radiussecret';
OTRSの中の顧客のための既定のユーザー認証バックエンドはOTRSデータベースです。このバックエンドで、顧客情報はすべて、OTRSのウェブインターフェース経由で編集することができます(下記の例11-10を参照)。
例4.15 DBバックエンドに対する顧客ユーザ認証
# これはthe otrs 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=customerdb;host=customerdbhost"; #$Self->{'Customer::AuthModule::DB::User'} = "some_user"; #$Self->{'Customer::AuthModule::DB::Password'} = "some_password";
すべての顧客データを備えたLDAPディレクトリーを持っていれば、OTRSへの顧客を認証するためにLDAPモジュールを使用することができます(下記の例11-11を参照)。このモジュールがLDAPバックエンドに対して単に読み取り専用アクセスをしているので、OTRSウェブインターフェース経由で顧客情報を編集することはできません。
例4.16 LDAPバックエンドに対する顧客ユーザ認証
# これはLDAP認証バックエンド用サンプル構成です。 # Net::LDAPがインストールされていることを確認下さい。) $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP'; $Self->{'Customer::AuthModule::LDAP::Host'} = 'ldap.example.com'; $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'dc=example,dc=com'; $Self->{'Customer::AuthModule::LDAP::UID'} = 'uid'; # ユーザがposixGroupで認証することが可能かどうか確認します。 #(例えばユーザはOTRSを使うにはグループ xyzに属する必要があります。) $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'; # 次は有効です。しかし 匿名ユーザがLDAPツリーから # 読み込み許可を持たない場合のみ必要です。 $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = ''; $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = ''; # 常にあるフィルタを各LDAPクエリに追加したい場合このオプションを使います # このオプションは例えば # AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'です。 $Self->{'Customer::AuthModule::LDAP::AlwaysFilter'} = ''; # ログイン名のに接頭辞を追加したければ、このオプションを使います。 # たとえばユーザがuserを使いたいが、LDAPに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 => 389, timeout => 120, async => 0, version => 3, };
全顧客ユーザに「シングル・サイン・オン」ソリューションを実行したければ、HTTPBasic認証(あなたの全てのシステムに対して)を使い、そしてOTRSのHTTPBasicAuthモジュールを使う(OTRSでログインが必要なくなります)。下記の例11-12を参照してください。
例4.17 HTTPBasicを備えた顧客ユーザ認証
# apache ($ENV{REMOTE_USER})認証バックエンド用のサンプル構成です。 # apache http-basic-authのシングル・サインオンを # 持ちたければそれを使います。 $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::HTTPBasicAuth'; # ノート: # このモジュールを使うなら、代替手段として次の構成設定を使うべきです。 # もしユーザが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';
例11-13において示される設定はRadiusサーバーに対するあなたの顧客を認証するために使用することができます。
例4.18 Radiasのバックエンドに対する顧客ユーザ認証
# これはRaduisサーバへの認証顧客へのサンプル構成です。 $Self->{'Customer::AuthModule'} = 'Kernel::System::Auth::Radius'; $Self->{'Customer::AuthModule::Radius::Host'} = 'radiushost'; $Self->{'Customer::AuthModule::Radius::Password'} = 'radiussecret';
新規顧客(customer.plパネルによってアクセス可能)のための自己登録をカスタマイズすることは可能です。新規の任意または必須フィールド(room番号、アドレスあるいは状態のような)を追加することができます。
次の例は、顧客のroom番号を格納するためには、この場合どのように顧客データベースの中であなたが必須フィールドを指定することができるか示します。
customer.plウェブインターフェースのroom番号用の新規フィールドを表示するために、このインターフェースのレイアウトの責任者である.dtlファイルを修正しなければなりません。80行目のまわりの新規フィールドを加えて、Kernel/Output/HTML/Standard/CustomerLogin.dtl
ファイルを編集してください。(下記のスクリプトを参照)。
[...] <div class="NewLine"> <label for="Room">[% Translate("Room{CustomerUser}") | html %]</label> <input title="[% Translate("Room Number") | html %]" name="Room" type="text" id="UserRoom" maxlength="50" /> </div> [...]
スクリプト:ウェブインターフェースでの新規フィールドの表示
次のステップで、顧客マッピングはroom番号への新規エントリーで拡張しなければなりません。変更がアップデート後に失われないことを確実にするためには、Kernel/Config.pm
に
Kernel/Config/Defaults.pm
からの「CustomerUser」設定を入れてください。スクリプト中で下に示されるように、MAP配列を変更して、新規room番号フィールドを追加してください。
# CustomerUser # (顧客データベース・バックエンドと設定) $Self->{CustomerUser} = { Name => 'Database Backend', Module => 'Kernel::System::CustomerUser::DB', Params => { # 外部データベースを使いたければ、 # 必須設定を追加する必要があります。 # 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'], # CustomerUserListFields => ['login', 'first_name', 'last_name', 'customer_id', 'email'], CustomerUserSearchFields => ['login', 'last_name', 'customer_id'], CustomerUserSearchPrefix => '', CustomerUserSearchSuffix => '*', CustomerUserSearchListLimit => 250, CustomerUserPostMasterSearchFields => ['email'], CustomerUserNameFields => ['title', 'first_name', 'last_name'], CustomerUserEmailUniqCheck => 1, # # 顧客パネルで自身のチケットではなく顧客チケットを表示します。 # CustomerUserExcludePrimaryCustomerID => 0, # # 自動ログインを生成します。 # AutoLoginCreation => 0, # AutoLoginCreationPrefix => 'auto', # # 管理者は顧客の選択(選好)を変更できます。 # AdminSetPreferences => 1, # # キャッシュが生存する秒数 - キャッシュ・データベース必須 # CacheTTL => 0, # # 読み込み専用のソース # ReadOnly => 1, Map => [ # ノート:ログイン、Eメール、顧客IDは必要です! # 変数、フロントエンド、保存場所、表示(1=常時,2=軽度)、必須、 # 保存タイプ、httpリンク、読み込み専用、httpリンク・ターゲット。 [ '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 ], [ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ], [ 'UserPhone', 'Phone', 'phone', 1, 0, 'var', '', 0 ], [ 'UserFax', 'Fax', 'fax', 1, 0, 'var', '', 0 ], [ 'UserMobile', 'Mobile', 'mobile', 1, 0, 'var', '', 0 ], [ 'UserRoom', 'Room', 'room', 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.', }, }, };
スクリプト: マッピング配列の変更
最後のステップは、新しいroom番号カラムをOTRSデータベース中customer_userテーブルに追加することです(下記のスクリプトを参照)。このカラムでは、room番号へのエントリーは格納されます。
linux:~# mysql -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 to server version: 5.0.18-Debian_7-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use otrs; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> ALTER TABLE customer_user ADD room VARCHAR (200); Query OK, 3 rows affected (0.01 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> quit Bye linux:~#
スクリプト:新しいカラムをcustomer_userテーブルに追加
room用の新規フィールドに入力されたら、顧客情報パネルに表示され、顧客・ユーザ管理画面にも表示されます。さらに、新しいアカウントを登録する場合、新しい顧客はroom番号を挿入しなければなりません。マイクロソフトのIISの上でOTRSを使用する場合、Config.pm
の中で行なわれた変更を活性化するためにウェブサーバを再起動するべきです。