+
@@ -1747,6 +1771,7 @@ sub handler {
}
}
}
+ my $inhibit_menu;
my %mystyle;
my $result = '';
my $filecontents=&Apache::lonnet::getfile($file);
@@ -1804,8 +1829,15 @@ ENDNOTFOUND
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['rawmode']);
if ($env{'form.rawmode'}) { $result = $filecontents; }
+ if (($env{'request.state'} eq 'construct') &&
+ (($filetype eq 'css') || ($filetype eq 'js')) && ($ENV{'HTTP_REFERER'})) {
+ if ($ENV{'HTTP_REFERER'} =~ m{^https?\://[^\/]+/priv/$LONCAPA::match_domain/$LONCAPA::match_username/[^\?]+\.(x?html?|swf)(|\?)[^\?]*$}) {
+ $inhibit_menu = 1;
+ }
+ }
if (($filetype ne 'html') &&
- (!$env{'form.return_only_error_and_warning_counts'})) {
+ (!$env{'form.return_only_error_and_warning_counts'}) &&
+ (!$inhibit_menu)) {
my $nochgview = 1;
my $controls = '';
if ($env{'request.state'} eq 'construct') {
@@ -1843,7 +1875,7 @@ ENDNOTFOUND
#
# Edit action? Insert editing commands
#
- unless ($env{'request.state'} eq 'published') {
+ unless (($env{'request.state'} eq 'published') || ($inhibit_menu)) {
if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'})))
{
my ($displayfile,$url,$symb,$itemtitle,$action);
@@ -2042,7 +2074,7 @@ sub error {
my $declutter=&Apache::lonnet::declutter($env{'request.filename'});
my $baseurl = &Apache::lonnet::clutter($declutter);
my @userlist;
- foreach (keys %users) {
+ foreach (keys(%users)) {
my ($user,$domain) = split(/:/, $_);
push(@userlist,"$user:$domain");
my $key=$declutter.'_'.$user.'_'.$domain;