grashoper has asked for the wisdom of the Perl Monks concerning the following question:
I need to add some logic to my existing production site so that it will filter what is displayed dependent on which account customers are logging in from.
My problem is that I cannot figure out where to put my "filter" as I am not that versed in perl.
here is my example code..
sub tResources { my $str = ""; my $xmlResources = xmlFileData("Content/SSResources", $Session->{' +usrSystem'}.".xml", "mResources()"); $xmlResources .= xmlFileData("Content/SSResources", $Session->{'us +rSystem'}.$Session->{'usrAccount'}.".xml", "mResources()"); if (!$Request->item("ResourceID")->item()) { $str .= mLeftIndex(); } if ($Request->item("Resource")->item()) { my $res = $Request->item("Resource")->item(); my $resid = $Request->item("ResourceID")->item(); if ($xmlResources =~ /(<resource id=\"$res\".*?<\/resource>)/s) { my $selectedResource = $1; my $title = ""; my $site=$curr; $Response->Write("Site is $site!"); if ($selectedResource =~ /title=\"(.*?)\"/s) { $title = $1; } if ($Request->item("ResourceID")->item()) { if($selectedResource =~ /(<element type=\"(?:pdf|image|html| +dl|xls|ppt|doc)\" resid=\"$resid\">.*?<\/element>)/s) { $str .= "<resource>$1</resource>"; } } else { $str .= shadowBox($title, $selectedResource, ($g_docWidth/5* +4-(2*$g_docSpace))); } } } my $Site=$Request->Item("Site"); if ($Site eq "INR") { $str.=$xmlResources; return $str; exit(); } else { $str .= mTipOfTheDay(); $str .= mAlerts(); $str .= $xmlResources; } return $str; } $str.=mTipOfTheDay(); $str.=mAlerts(); I don't want these 2 to display how do I hide them? I would also like to output what site they selected (so I can verify i +ts there, as its ignoring my code, not sure how to do that either..I +am really new to this. Thanks)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Hide Data based on account
by snopal (Pilgrim) on Sep 18, 2007 at 18:10 UTC | |
by grashoper (Monk) on Sep 18, 2007 at 21:22 UTC | |
by snopal (Pilgrim) on Sep 19, 2007 at 02:28 UTC | |
by grashoper (Monk) on Sep 19, 2007 at 17:42 UTC | |
by snopal (Pilgrim) on Sep 20, 2007 at 14:44 UTC | |
by grashoper (Monk) on Oct 02, 2007 at 10:11 UTC | |
by snopal (Pilgrim) on Oct 02, 2007 at 15:35 UTC | |
Re: Hide Data based on account
by scorpio17 (Canon) on Sep 18, 2007 at 18:53 UTC |
Back to
Seekers of Perl Wisdom