Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all, we have some important news to share. Please follow the link here to find out more!

https://www.boards.ie/discussion/2058419143/important-news/p1?new=1

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