I have a problem with the following subroutine(s).. my problem is that default.config is being returned even though a config file for the site exists
I have other sites that don't exhibit this behaviour and I am puzzled as to why this one account has a problem,
of course its the one I need to modify. This is a support portal and services something like 30 different accounts
, some of these accounts have livechat some do not, the config file controls whether or not the live chat displays.
the xml itself exists in SQL as well as statically on the site and gets recreated if deleted by the sql, yes it has been changed on the sql right now the data push from the sql is not working either

ex subroutine 1..

sub getConfig { #This is for site/account specific options my $str = ""; my $xml = xmlFileData("Config",$Session->{'usrSystem'}.".config.xm +l","getConfig()"); if (!$xml) { $xml = xmlFileData<br>("Config","_default.config.xml","getConfig( +)"); } { $xml =~ /<system>(.*?)<\/system>/s; $str .= $1; } { $xml =~ /<account id="$Session->{'usrAccount'}"> (.*?)<\/account>/s; $str .= $1; } return $str; }

My other subroutine..

sub config { my $str = "<config>"; my $browser = $Request->ServerVariables("HTTP_USER_AGENT")->item() +; SWITCH: { if ($browser =~ /MSIE/) { $browser = "MSIE"; last SWITCH; } if ($browser =~ /Firefox/) { $browser = "FireFox"; last SWITCH; } } $str .= "<system>$Session->{'usrSystem'}</system>"; $str .= "<account>$Session->{'usrAccount'}</account>"; $str .= "<password>$Session->{'usrPassword'}</password>"; $str .= "<browser>$browser</browser>"; $str .= "<mode>$Session->{'mode'}</mode>"; $str .= "<codeBase>$Session->{'version'}</codeBase>"; $str .= "<usersOnline>".$Application->{'currentUserCount'}."</user +sOnline>"; # if($Session->{'trainingDelegate'}) # { # $str .= "<trainingDelegate>True</trainingDelegate>"; # } if ($Session->{'acrobatVersion'} >= $Session->{'minAcrobatVersion' +} || $Request->ServerVariables("HTTP_USER_AGENT")->item() =~ /Mac/) { $str .= "<acrobatReaderFound version=\"".$Session->{'acrobatVers +ion'}."\"/>\n"; } else { $str .= "<acrobatReaderNotFound/>"; ### chat pulls from here #### } if (getConfig() =~ /(<includeLiveHelp.*?)\/>/s) { $str .= $1." system=\"".$Session->{'usrSystem'}."\" account=\"".$Session->{'usrAccount'}."\" username=\"".$Session->{'usrID'}."\" password=\"".$Session->{'usrP +assword'}."\"/>"; } $str .= "</config>"; return $str; }

Sorry if the format is a little messy I am new here :)


In reply to problems with xml data being returned 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.