
		krynhells
		
		(usa Debian)
		
		Enviado em 02/10/2012 - 18:10h 
		Pessoal, 
Sou iniciante em OTRS e pretendo configura-lo para sincronizar com o AD via LDAP. Pretendo utilizar o exemplo abaixo, onde utilizarei a sincronização e autenticação de segundo nível, além de restringir por grupo.
Por enquanto, a dúvida é: Com os parâmetros abaixo eu corro o risco de sobrescrever alguma informação do AD ou o acesso que farei via LDAP é somente leitura, nenhuma informação será inserida ou alterada no AD?
Obrigado galera,
######################### Customers Users #######################
# CustomerUser    # (customer user ldap backend and settings)
    $Self->{CustomerUser} = {
        Name => 'Empresa AD Users',
        Module => 'Kernel::System::CustomerUser::LDAP',
        Params => {
            # Maquina AD
            Host => 'dc01.empresa.com.br',
            # ldap base dn
            BaseDN => 'DC=empresa,DC=com,DC=br',
            # 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
          # Usuário com direito de acesso no de leitura no AD   
            UserDN => 'CN=user,OU=Usuarios,DC=empresa,DC=com,DC=br',
            UserPw => 'senha_do_user',
            # 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 your frontend is e. g. iso-8859-1 and the charset of your
            # ldap server is utf-8, use these options.
#            SourceCharset => 'utf-8',
#            DestCharset => 'iso-8859-1',
            # 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 => 3268,
                timeout => 120,
                async => 0,
                version => 3,
            },
        },
                ReadOnly => 1,
                # customer unique id
        CustomerKey => 'sAMAccountName',
        # customer #
        CustomerID => 'mail',
        CustomerUserListFields => ['cn', 'mail'],
        CustomerUserSearchFields => ['cn', 'givenname', 'mail'],
        CustomerUserSearchPrefix => '',
        CustomerUserSearchSuffix => '*',
        CustomerUserSearchListLimit => 500,
        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 => 120,
        Map => [
            # note: Login, Email and CustomerID are mandatory!
            # if you need additional attributes from AD, just map them here.
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
#            [ 'UserSalutation', 'Title',      'title',           1, 0, 'var', '', 0 ],
            [ '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 ],
#            [ '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 ],
            [ 'UserMobile',     'Mobile',      'mobile', 1, 0, 'var', '', 0 ],
            [ 'UserRoom',       'Room',        'physicalDeliveryOfficeName', 1, 0, 'var', '', 0 ],
        ],
    };
#################################################################
######################### END Customers Users ###################
#################################################################
######################### Agents Users #######################
# This is an example configuration for using an MS AD backend
    $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
    $Self->{'AuthModule::LDAP::Host'} = 'dc01.empresa.com.br';
    $Self->{'AuthModule::LDAP::BaseDN'} = 'DC=empresa,DC=com,DC=br';
    $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
    # Check if the user is allowed to auth in a posixGroup
    # (e. g. user needs to be in a group OTRS_Agents to use otrs)
   # Aqui vai o Grupo de usuários que poderao logar como agentes
    $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=otrs_agents,OU=Tecnologia,OU=Usuarios,DC=empresa,DC=com,DC=br';
    $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
    $Self->{'AuthModule::LDAP::UserAttr'} = 'DN';
    # Bind credentials to log into AD
    $Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=user,OU=Usuarios,DC=empresa,DC=com,DC=br';
    $Self->{'AuthModule::LDAP::SearchUserPw'} = 'senha_do_user';
    # 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'} = '';
    # 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'} = '';
    # 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,
    };
   # Now sync data with OTRS DB
    $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = 'dc01.empresa.com.br';
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'DC=empresa,DC=com,DC=br';
    $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';
    $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'CN=user,OU=Usuarios,DC=empresa,DC=com,DC=br';
    $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'senha_do_user';
    $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
        # DB -> LDAP
        UserFirstname => 'givenName',
        UserLastname  => 'sn',
        UserEmail     => 'mail',
    };
    # AuthSyncModule::LDAP::UserSyncInitialGroups
    # (sync following group with rw permission after initial create of first agent
    # login)
    $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [
        'users',
    ];
#################################################################
######################### END Agents Users ######################
#################################################################
# Autenticacion Multple: Segundo Nivel
$Self->{'AuthModule2'} = 'Kernel::System::Auth::DB';
$Self->{'AuthModule::DB::CryptType2'} = 'crypt';