Unable to load Customer Portal

Moderator: crythias

Locked
retro2707
Znuny advanced
Posts: 131
Joined: 16 Apr 2014, 17:06
Znuny Version: 6.0.12

Unable to load Customer Portal

Post by retro2707 »

Hi,

On loading the customer portal, i get a 500 Server error. "The server encountered an internal error or misconfiguration and was unable to complete your request."

Looking at the HTTP error logs on my CENTOS server, I get:

[error] Can't call method "GetOption" on an undefined value at /opt/otrs//Kernel/System/CustomerAuth.pm line 120.\n

See below for the contents of the Config.pm file. I have implemented LDAP lookup which is working ok.

I am a newbie with OTRS so any help would be much appreciated. This is a fairly new install and this is the first time I have tried to use the customer portal.

Code: Select all

# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2013 xxx, http://otrs.org/
# --
# 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'} = '10.36.162.28';

    # 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'} = 'blah';

    # 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};";
    # if you have PostgresSQL 8.1 or earlier, activate the legacy driver with this line:
#    $Self->{DatabasePostgresqlBefore82} = 1;

    # 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"
#    $ENV{ORACLE_HOME} = '/u01/app/oracle/product/10.2.0/client_1';
#    $ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD HH24:MI:SS';
#    $ENV{NLS_LANG} = "american_america.utf8";

#    $Self->{DatabaseDSN} = "DBI:Oracle:sid=OTRS;host=$Self->{DatabaseHost};port=1522;";

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

#CustomerUser
#(customer user database backend and settings)

    $Self->{CustomerUser} = {
      Module => 'Kernel::System::CustomerUser::LDAP',
      Params => {
        Host => 'server1.dal.local',
        BaseDN => 'dc=dal,dc=local',
        SSCOPE => 'sub',
        UserDN =>'otrs',
        UserPw => 'blah',
      },
        # customer unique id
        CustomerKey => 'sAMAccountName',

        # customer #
        CustomerID => 'mail',
        CustomerUserListFields => ['sAMAccountName', 'cn', 'mail'],
        CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'],
        CustomerUserSearchPrefix => '',
        CustomerUserSearchSuffix => '*',
        CustomerUserSearchListLimit => 250,
        CustomerUserPostMasterSearchFields => ['mail'],
        CustomerUserNameFields => ['givenname', 'sn'],

        Map => [
                # note: Login, Email and CustomerID needed!
                # var, frontend, storage, shown, required, storage-type
                #[ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
                [ 'UserFirstname', 'Firstname', 'givenname', 1, 1, 'var' ],
                [ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var' ],
                [ 'UserLogin', 'Login', 'sAMAccountName', 1, 1, 'var' ],
                [ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
                [ 'UserCustomerID', 'CustomerID', 'mail', 0, 1, 'var' ],
                [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
                #[ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
                #[ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
        ],
  };


    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    # end of your own config options!!!                    #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
Setup:
OTRS 6.0.12
Hosted on CentOS 7.4/ MySQL - MariaDB (5.5.60)
skullz
Znuny superhero
Posts: 658
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: Unable to load Customer Portal

Post by skullz »

Here mine..

Code: Select all


     $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
     $Self->{'Customer::AuthModule::LDAP::Host'} = 'xxxxxxxxxxxxxx';
     $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'dc=xxxxxxx,dc=xxxx,dc=xxxxx';
     $Self->{'Customer::AuthModule::LDAP::UID'} = 'xxxxxxx';

     #The following is valid but would only be necessary if the
     #anonymous user do NOT have permission to read from the LDAP tree
     $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'CN=OTRS LDAP Searcher,ou=OTRS,OU=xxxxxxxxxxx,OU=xxxxx,dc=xxxx,dc=xxxx,dc=xxxxx';
     $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = 'xxxxxxxxxx';

$Self->{CustomerUser} = {
    Name => 'LDAP Datasource',
    Module => 'Kernel::System::CustomerUser::LDAP',
    Params => {
        # ldap host
        Host => 'xxxxxx',
        # ldap base dn
        BaseDN => 'dc=xxxx,dc=xxxx,dc=xxxx',
        # 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 => 'CN=OTRS LDAP Searcher,ou=OTRS,OU=xxxxx,OU=xxxx,dc=xxxxx,dc=xxx,dc=xxxxx',
        UserPw => 'xxxxxx',
        # 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 => '(objectclass=user)',
# if both your frontend and your LDAP are unicode, use this:
#        SourceCharset => 'utf-8',
#        DestCharset   => 'utf-8',
        # if your frontend is e. g. iso-8859-1 and the character set of your
        # ldap server is utf-8, use these options:
#        SourceCharset => 'utf-8',
#        DestCharset => '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 => 'sAMAccountName',
    # customer #
    CustomerID => 'mail',
    CustomerUserListFields => ['cn', 'mail'],
    CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'],
    CustomerUserSearchPrefix => '',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 1000,
    CustomerUserPostMasterSearchFields => ['mail'],
    CustomerUserNameFields => ['sn', 'givenName'],
    # 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',  'sn',                     1, 1, 'var', '', 0 ],
		[ 'UserLastname',   'Lastname',   'givenname',              1, 1, 'var', '', 0 ],
        [ 'UserLogin',      'Username',   'sAMAccountName',         1, 1, 'var', '', 0 ],
#       [ 'UserPassword',   'Password',   'pw',         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',    'Info',    'info',           1, 0, 'var', '', 0 ],
    ],
};

My Github
OTRS CE/LTS Discord Channel
Cant Update Package Anymore ? Check This

Professional OTRS, Znuny & OTOBO services: efflux.de/en
Free and premium add-ons: English
Locked