Hi,
I want to know how to track the username (user who has logged in to teamsite) in an ipl file.
$ENV{'HTTP_COOKIE'} do not work when ipl is executed from the command prompt.
Scenario:
i am trying to send an email using an external task and i want to add the From field with the user who has logged in to teamsite.
i am using iwsend_mail.ipl which i am executing through an another script(ipl).. I am using TS6.5 on windows 2000.
code snippet is as follows:
#!E:\iw-home/iw-perl/bin/iwperl
use CGI;
use strict;
use TeamSite::Config;
use TeamSite::WFtask;
use TeamSite::CGI_lite;
my $item ="";
my $key="";
my $content ="";
my %fields="";
my
@cookies="";
my $var ="";
if ($ENV{'HTTP_COOKIE'})
{
@cookies=split(/; /,$ENV{'HTTP_COOKIE'});
}
foreach $item(
@cookies){
($key,$content) = split(/=/,$item,2);
if ($key eq "iw_user"){
if (!($content eq "Administrator")){
$var = $content;
}
}
}
my $creator = $var;
my ($jobid, $taskid, $area)=(shift, shift, shift);
# Create the task object and job object
my $task = new TeamSite::WFtask($taskid);
#Sending mail to the Administrators
my $user = "wcm\\$creator";
my $approver ="wcm\\john,wcm\\michael";
my $cmd = "E:/iw-home/iw-perl/bin/iwperl E:/iw-home/bin/iwsend_mail.ipl -f $user -t $approver -s TestSubject -m TestMain $jobid $taskid $area";
$cmd = `$cmd`;
$task->CallBack(0, "Approve Task");