--- loncom/interface/lonsupportreq.pm 2012/08/27 06:28:06 1.69
+++ loncom/interface/lonsupportreq.pm 2013/07/15 16:13:21 1.73
@@ -1,5 +1,5 @@
#
-# $Id: lonsupportreq.pm,v 1.69 2012/08/27 06:28:06 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.73 2013/07/15 16:13:21 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -39,7 +39,7 @@ use Apache::lonacc();
use Apache::lonauth();
use Apache::courseclassifier;
use LONCAPA qw(:DEFAULT :match);
-
+use HTML::Entities;
sub handler {
my ($r) = @_;
@@ -57,8 +57,19 @@ sub handler {
if ($r->uri eq '/adm/helpdesk') {
&Apache::lonacc::get_posted_cgi($r);
}
- my $function = $env{'form.function'};
+ my $function;
+ if ($env{'form.function'}) {
+ if (($env{'form.function'} eq 'norole') ||
+ ($env{'form.function'} eq 'student') ||
+ ($env{'form.function'} eq 'admin') ||
+ ($env{'form.function'} eq 'author')) {
+ $function = $env{'form.function'};
+ }
+ }
my $origurl = $env{'form.origurl'};
+ $origurl =~ s{^https?://}{};
+ $origurl =~ s/(`)//g;
+ $origurl =~ s/\$/\(\$\)/g;
my $command = $env{'form.command'};
if ($command eq 'process') {
@@ -102,13 +113,9 @@ sub print_request_form {
}
$formname = 'logproblem';
my $machine = &Apache::lonnet::absolute_url();
- if ($origurl =~ m-^https?://-) {
- $server = $origurl;
- } else {
- $server = $machine.$origurl;
- }
- my $showserver = $server;
- $showserver =~ s/\?.*$//;
+ my $sourceurl = $machine.$origurl;
+ $server = $machine.&cleanup_html($origurl);
+ $server =~ s/\?.*$//;
my %lt = &Apache::lonlocal::texthash (
email => 'The e-mail address you entered',
notv => 'is not a valid e-mail address',
@@ -358,8 +365,8 @@ ENDJS
$num ++;
$i = $num%2;
$output .= &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,$css[$i]).
- $showserver."\n".'&').'" />'."\n".
+ $server."\n".'&').'" />'."\n".
&Apache::lonhtmlcommon::row_closure().
&Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,'LC_evenrow_value').
'
'."\n".
@@ -634,10 +641,8 @@ sub print_request_receipt {
adin => 'Additional information recorded',
);
- my (@ok_ccs,@bad_ccs,$badccmsg,$okcclist,$public,$homeserver);
- if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) {
- $public = 1;
- } else {
+ my (@ok_ccs,@bad_ccs,$badccmsg,$okcclist,$homeserver);
+ unless ($public) {
if (($env{'user.name'} ne '') && ($env{'user.domain'} ne '')) {
$homeserver = &Apache::lonnet::homeserver($env{'user.name'},
$env{'user.domain'});
@@ -670,10 +675,11 @@ sub print_request_receipt {
$okcclist = join(', ',@ok_ccs);
}
if (@bad_ccs == 1) {
- $badccmsg .= '
'.&mt('The following Cc e-mail address is invalid: ').$bad_ccs[0];
+ if ($bad_ccs[0] ne '') {
+ $badccmsg .= '
'.&mt('The following Cc e-mail address is invalid: ').&cleanup_html($bad_ccs[0]);
+ }
} elsif (@bad_ccs > 1) {
- my $bad_cc_string = join(', ',@bad_ccs);
- $badccmsg .= '
'.&mt('The following Cc e-mail addresses are invalid: ').$bad_cc_string;
+ $badccmsg .= '
'.&mt('The following Cc e-mail addresses are invalid: '). &cleanup_html(join(', ',@bad_ccs));
}
}
$env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'";
@@ -709,9 +715,12 @@ END
''.
"$lt{$item}: $showurl
\n";
} elsif ($item eq 'cc') {
- $displaymsg .=
- ''.
- "$lt{$item}: $okcclist
\n";
+ if ($okcclist) {
+ my $showcclist = &cleanup_html($okcclist);
+ $displaymsg .=
+ ''.
+ "$lt{$item}: $showcclist
\n";
+ }
} else {
my $showitem = $env{'form.'.$item};
$showitem = &cleanup_html($showitem);
@@ -735,7 +744,7 @@ END
$r->print(<<"END");
$start_page
-