version 1.70, 2013/01/04 16:57:38
|
version 1.77, 2014/01/17 17:17:42
|
Line 114 sub print_request_form {
|
Line 114 sub print_request_form {
|
$formname = 'logproblem'; |
$formname = 'logproblem'; |
my $machine = &Apache::lonnet::absolute_url(); |
my $machine = &Apache::lonnet::absolute_url(); |
my $sourceurl = $machine.$origurl; |
my $sourceurl = $machine.$origurl; |
$server = $machine.&cleanup_html($origurl); |
$server = $machine.&Apache::loncommon::cleanup_html($origurl); |
$server =~ s/\?.*$//; |
$server =~ s/\?.*$//; |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
email => 'The e-mail address you entered', |
email => 'The e-mail address you entered', |
Line 294 ENDJS
|
Line 294 ENDJS
|
} |
} |
$r->print('<form method="post" action="" name="logproblem"'.$formtype.'>'."\n"); |
$r->print('<form method="post" action="" name="logproblem"'.$formtype.'>'."\n"); |
my $output = &Apache::lonhtmlcommon::start_pick_box(). |
my $output = &Apache::lonhtmlcommon::start_pick_box(). |
|
# &Apache::lonhtmlcommon::row_headline(). |
|
# '<span class="LC_info">'. |
|
# &mt('(All fields marked with * are required.)'). |
|
# '</span>'. |
|
# &Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title($lt{'name'},undef,$css[$num])."\n"; |
&Apache::lonhtmlcommon::row_title($lt{'name'},undef,$css[$num])."\n"; |
my $fullname = ''; |
my $fullname = ''; |
if ((defined($lastname) && $lastname ne '') && (defined($firstname) && $firstname ne '')) { |
if ((defined($lastname) && $lastname ne '') && (defined($firstname) && $firstname ne '')) { |
Line 555 sub print_request_receipt {
|
Line 560 sub print_request_receipt {
|
if ($r->uri eq '/adm/helpdesk') { |
if ($r->uri eq '/adm/helpdesk') { |
&print_header($r,$url,'process'); |
&print_header($r,$url,'process'); |
} |
} |
$r->print('<h3>'.&mt('Support request failed').'</h3>'. |
$r->print( |
'<span class="LC_error">'. |
'<h2>'.&mt('Support request failed').'</h2>'. |
&mt('Validation of the code you entered failed.'). |
&Apache::lonhtmlcommon::confirm_success( |
|
&mt('Validation of the code you entered failed.'),1). |
|
'<br /><br />'. |
|
&Apache::lonhtmlcommon::actionbox([ |
|
&mt('[_1]Go back[_2] and try again', |
|
'<a href="javascript:history.go(-1)">','</a>')]). |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
Line 641 sub print_request_receipt {
|
Line 651 sub print_request_receipt {
|
adin => 'Additional information recorded', |
adin => 'Additional information recorded', |
); |
); |
|
|
my (@ok_ccs,@bad_ccs,$badccmsg,$okcclist,$public,$homeserver); |
my (@ok_ccs,@bad_ccs,$badccmsg,$okcclist,$homeserver); |
if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) { |
unless ($public) { |
$public = 1; |
|
} else { |
|
if (($env{'user.name'} ne '') && ($env{'user.domain'} ne '')) { |
if (($env{'user.name'} ne '') && ($env{'user.domain'} ne '')) { |
$homeserver = &Apache::lonnet::homeserver($env{'user.name'}, |
$homeserver = &Apache::lonnet::homeserver($env{'user.name'}, |
$env{'user.domain'}); |
$env{'user.domain'}); |
Line 677 sub print_request_receipt {
|
Line 685 sub print_request_receipt {
|
$okcclist = join(', ',@ok_ccs); |
$okcclist = join(', ',@ok_ccs); |
} |
} |
if (@bad_ccs == 1) { |
if (@bad_ccs == 1) { |
$badccmsg .= '<br />'.&mt('The following Cc e-mail address is invalid: ').$bad_ccs[0]; |
if ($bad_ccs[0] ne '') { |
|
$badccmsg .= '<br />'.&mt('The following Cc e-mail address is invalid: ').&Apache::loncommon::cleanup_html($bad_ccs[0]); |
|
} |
} elsif (@bad_ccs > 1) { |
} elsif (@bad_ccs > 1) { |
my $bad_cc_string = join(', ',@bad_ccs); |
$badccmsg .= '<br />'.&mt('The following Cc e-mail addresses are invalid: '). &Apache::loncommon::cleanup_html(join(', ',@bad_ccs)); |
$badccmsg .= '<br />'.&mt('The following Cc e-mail addresses are invalid: ').$bad_cc_string; |
|
} |
} |
} |
} |
$env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'"; |
$env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'"; |
Line 703 END
|
Line 712 END
|
if ($env{'form.'.$item} ne '') { |
if ($env{'form.'.$item} ne '') { |
if ($item eq 'description') { |
if ($item eq 'description') { |
my $descrip = $env{'form.description'}; |
my $descrip = $env{'form.description'}; |
$descrip = &cleanup_html($descrip); |
$descrip = &Apache::loncommon::cleanup_html($descrip); |
$descrip =~ s|[\n\r\f]|<br />|g; |
$descrip =~ s|[\n\r\f]|<br />|g; |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
Line 711 END
|
Line 720 END
|
} elsif ($item eq 'sourceurl') { |
} elsif ($item eq 'sourceurl') { |
my $showurl = $env{'form.sourceurl'}; |
my $showurl = $env{'form.sourceurl'}; |
$showurl =~ s/\?.*$//; |
$showurl =~ s/\?.*$//; |
$showurl = &cleanup_html($showurl); |
$showurl = &Apache::loncommon::cleanup_html($showurl); |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $showurl<br />\n"; |
"$lt{$item}</span>: $showurl<br />\n"; |
} elsif ($item eq 'cc') { |
} elsif ($item eq 'cc') { |
$displaymsg .= |
if ($okcclist) { |
'<span class="LC_helpform_receipt_cat">'. |
my $showcclist = &Apache::loncommon::cleanup_html($okcclist); |
"$lt{$item}</span>: $okcclist<br />\n"; |
$displaymsg .= |
|
'<span class="LC_helpform_receipt_cat">'. |
|
"$lt{$item}</span>: $showcclist<br />\n"; |
|
} |
} else { |
} else { |
my $showitem = $env{'form.'.$item}; |
my $showitem = $env{'form.'.$item}; |
$showitem = &cleanup_html($showitem); |
$showitem = &Apache::loncommon::cleanup_html($showitem); |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $showitem<br />\n"; |
"$lt{$item}</span>: $showitem<br />\n"; |
Line 742 END
|
Line 754 END
|
|
|
$r->print(<<"END"); |
$r->print(<<"END"); |
$start_page |
$start_page |
<form name="logproblem"> |
<form name="logproblem" action=""> |
<input type="hidden" name="command" value="result" /> |
<input type="hidden" name="command" value="result" /> |
</form> |
</form> |
END |
END |
Line 812 END
|
Line 824 END
|
|
|
my $attachmentpath = ''; |
my $attachmentpath = ''; |
my $attachmentsize = ''; |
my $attachmentsize = ''; |
if ((defined($env{'user.name'})) && ($env{'user.name'} ne 'public') |
if ((defined($env{'user.name'})) && (!$public)) { |
&& ($env{'user.domain'} ne 'public')) { |
|
if ($homeserver && $env{'form.screenshot.filename'}) { |
if ($homeserver && $env{'form.screenshot.filename'}) { |
$attachmentsize = length($env{'form.screenshot'}); |
$attachmentsize = length($env{'form.screenshot'}); |
if ($attachmentsize > 131072) { |
if ($attachmentsize > 131072) { |
Line 999 END
|
Line 1010 END
|
$r->print(<<"END"); |
$r->print(<<"END"); |
<tr> |
<tr> |
<td colspan="3">$reviewtext |
<td colspan="3">$reviewtext |
$lt{'ifyo'}<br /> |
$lt{'ifyo'} |
<span style="font-size:90%;"><b>$lt{'stud'}</b>: |
<p class="LC_info"> |
$stuwarn $lt{'cont'}</span> |
<b>$lt{'stud'}:</b> |
<br /><br /> |
$stuwarn $lt{'cont'} |
|
</p><br /> |
</td> |
</td> |
</tr> |
</tr> |
END |
END |
Line 1029 sub get_domain {
|
Line 1041 sub get_domain {
|
return $codedom; |
return $codedom; |
} |
} |
|
|
sub cleanup_html { |
|
my ($incoming) = @_; |
|
my $outgoing; |
|
if ($incoming ne '') { |
|
$outgoing = $incoming; |
|
$outgoing =~ s/;/;/g; |
|
$outgoing =~ s/\#/#/g; |
|
$outgoing =~ s/\&/&/g; |
|
$outgoing =~ s/</</g; |
|
$outgoing =~ s/>/>/g; |
|
$outgoing =~ s/\(/(/g; |
|
$outgoing =~ s/\)/)/g; |
|
$outgoing =~ s/"/"/g; |
|
$outgoing =~ s/'/'/g; |
|
$outgoing =~ s/\$/$/g; |
|
$outgoing =~ s{/}{/}g; |
|
$outgoing =~ s/=/=/g; |
|
$outgoing =~ s/\\/\/g |
|
} |
|
return $outgoing; |
|
} |
|
|
|
1; |
1; |