Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Combine two LDAP fields and some text in Perl

  • 24-04-2009 02:16PM
    #1
    Closed Accounts Posts: 188 ✭✭


    Hello : )

    Okay... any suggestions welcome.... I'm trying to combine two fields and some text to give a resulting email address and I can't figure out how to do it... any suggestions...???


    I want givenname.sn@myplaceofwork.com...

    so something in the code like

    I know that is completely wrong, but i'm not a programmer so..

    (below is excerpt from config.pm file of OTRS trouble ticket system..)


    # customer unique id
    CustomerKey => 'sAMAccountName',
    # customer #
    CustomerID => 'sAMAccountName',
    CustomerUserListFields => ,
    CustomerUserSearchFields => ,
    CustomerUserSearchPrefix => '',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 250,
    CustomerUserPostMasterSearchFields => ,
    #CustomerUserPostMasterSearchFields =>
    CustomerUserNameFields => ,
    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' ],
    # note: Changed Email to non mandatory by entering zero instead of one
    [ 'UserEmail', 'Email', 'mail', 1, 0, 'var' ],
    [ 'UserCustomerID', 'CustomerID', 'sAMAccountName', 0, 1, 'var' ],
    #[ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
    #[ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
    #[ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],

    Muchas muchas!


Comments

  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    In perl you can concatenate strings using the dot operator:

    $myFinalString = $str1.$str2.$str3; #etc....


Advertisement