LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-05-2010, 12:30 PM   #1
VeeDubbs
Member
 
Registered: Feb 2006
Location: Wisconsin
Distribution: SuSe 10. Ubuntu
Posts: 47

Rep: Reputation: 15
Help with Perl


Hi all -

Using the open source help desk software Request Tracker 3.8.7 if that makes a difference to anyone.

One of the main files that drive RT is /opt/rt3/etc/RT_SiteConfig.pm. The comments at the top of the file state that it is a perl module and can include valid perl code.

I was working on getting authenticating our users via LDAP against Novell which I was able to do. RT can also map LDAP attributes to RT. Here is what that snippet of code looks like:

Code:
## RT ATTRIBUTE MATCHING SECTION
# The list of RT attributes that uniquely identify a user
# This example shows what you *can* specify.. I recommend reducing this
# to just the Name and EmailAddress to save encountering problems later.
'attr_match_list'           => [    'Name',
				    'EmailAddress',
				    'RealName',
			       ],

# The mapping of RT attributes on to LDAP attributes
'attr_map'                  =>  {   'Name' => 'uid',
				    'EmailAddress' => 'uid',
				    'RealName' => 'givenName',
				    'ExternalAuthId' => 'uid',
				    'Gecos' => 'uid',
				}
There is no problem with this code, the problem is with the ino that comes from LDAP. We use Novell eDirectory and do not fill in the EmailAddress field for any of our users.

So, what I'd like to do is maybe create EmailAddresses for anyone that authenticates via LDAP. As you can see, I am currently using the uid from LDAP to populate the EmailAddress of RT. If my uid is bsmith my e-mail address would be bsmith@school.edu. Is there any way to tack on the @school.edu to the LDAP value?

I'm hoping that since this is a perl file, there is some way of doing it in perl. I'm no expert in perl, in fact I no very little about it. But here is what I have tried thus far:


Code:
'EmailAddress' => 'uid'+'@school.edu',
'EmailAddress' => 'uid'&&'@school.edu',
'EmailAddress' => 'uid' . '@school.edu',
Those either crash RT or ignore everything except uid.

Can anyone point me in the right direction? Or tell me it's not possible so I stop wasting my time?

Thanks!!
 
Old 03-05-2010, 01:39 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by VeeDubbs View Post
Hi all -
...
Can anyone point me in the right direction? Or tell me it's not possible so I stop wasting my time?

Thanks!!
Of course ! The right direction is always to read the documentation first.

On a UNIXish box with Perl installed start from

perldoc perlop

and look there for, say, 'concatenation'.

At all, learn about single and double quotes in Perl - both can be used to represent strings.

In the same document look for 'Quote-like Operators'.
 
Old 03-06-2010, 06:18 AM   #3
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
we can't work out from the few clues given
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to find libmail-mbox-messageparser-perl and libmailtools-perl for Fedora 11 almac58 Linux - Software 4 11-18-2009 03:17 AM
LXer: Installing Eclipse, the Epic Perl plugin and my first Perl GUI program LXer Syndicated Linux News 0 05-08-2009 06:41 PM
RHEL4u2 perl localtime() call issues (perl & glibc) Brad.Scalio@noaa.gov Linux - Enterprise 3 01-23-2007 09:27 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM
chrooting apache v2 (php, ssl, perl support) ; perl configuration markus1982 Linux - Security 3 01-26-2003 06:15 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration