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)

In reply to Hide Data based on account by grashoper

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.