Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Getting Teamsite Userid in DCR
System
Hi,
How can I get the userid in my DCR so I can send it as an argument in my perl script.
Here is an example of what I am trying to do:
<item name="MARKET">
<select required="t">
<inline command="/opt/interwoven/iw-home/iw-
perl/bin/iwperl /opt/interwoven/iw-
home/local/xyz/test.ipl IW_USER"/>
</select>
</item>"
I was hoping IW_USER would contain the userid.
Please tell me what I am doing wrong.
Thanks in advance!
Find more posts tagged with
Comments
MattP
The user id is part of the environment variables $ENV{IW_USER};
you could do a callout to this file...
#!c:/iw-home/iw-perl/bin/iwperl.exe
$user = $ENV{IW_USER};
print qq(
<substitution>
<default>$user</default>
</substitution>
);
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
Migrateduser
Hi Matt,
Thanks for your reply. Forgive me for I am new to this. I took your suggestion and added this line to my perl script:
$market_user = $ENV(IW_USER);
and I get this error...
Bareword "IW_USER" not allowed while "strict subs" in use a
Execution of ./test.ipl aborted due to compilation errors.
Thanks.
P.S. I also new to perl.
jbonifaci
That error is caused by this line:
$market_user = $ENV(IW_USER);
It should be:
my $market_user = $ENV{IW_USER};
with {}'s and not ()'s. And if you're using strict, you'll need to use 'my $market_user' rather than '$market_user'.
Jeff Bonifaci
MattP
OK, in your template you should have an item that looks like this...
<item name="Author" colspan="3">
<label>Author</label>
<description>Please enter the name of the current page Author.</description>
<text required="t" size="50" maxlength="75"><inline command="/iw-home/iw-perl/bin/iwperl.exe /iw-home/local/bin/user.ipl"/></text>
</item>
(If your iw-home directory is different or your perl directory is different, you will need to change the paths)
Then, in the user.ipl file, paste that code in from the first response.
Let me know how you make out.
BTW What os and version...?
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
Migrateduser
Hi,
Thanks...Changing the brackets to curly brackets
worked.
market_user = $ENV{IW_USER};
I appreciate everybody's help.
OS is : SunOS (5.8)
Version: 5.5.2 Build 14136 Interwoven 20021127.
Thanks again!
MattP
nice catch.
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA