version 1.67, 2012/04/18 17:30:24
|
version 1.70, 2013/01/04 16:57:38
|
Line 36 use Apache::lonhtmlcommon;
|
Line 36 use Apache::lonhtmlcommon;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonacc(); |
use Apache::lonacc(); |
|
use Apache::lonauth(); |
use Apache::courseclassifier; |
use Apache::courseclassifier; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
use HTML::Entities; |
|
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
Line 56 sub handler {
|
Line 57 sub handler {
|
if ($r->uri eq '/adm/helpdesk') { |
if ($r->uri eq '/adm/helpdesk') { |
&Apache::lonacc::get_posted_cgi($r); |
&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'}; |
my $origurl = $env{'form.origurl'}; |
|
$origurl =~ s{^https?://}{}; |
|
$origurl =~ s/(`)//g; |
|
$origurl =~ s/\$/\(\$\)/g; |
my $command = $env{'form.command'}; |
my $command = $env{'form.command'}; |
|
|
if ($command eq 'process') { |
if ($command eq 'process') { |
Line 101 sub print_request_form {
|
Line 113 sub print_request_form {
|
} |
} |
$formname = 'logproblem'; |
$formname = 'logproblem'; |
my $machine = &Apache::lonnet::absolute_url(); |
my $machine = &Apache::lonnet::absolute_url(); |
if ($origurl =~ m-^https?://-) { |
my $sourceurl = $machine.$origurl; |
$server = $origurl; |
$server = $machine.&cleanup_html($origurl); |
} else { |
$server =~ s/\?.*$//; |
$server = $machine.$origurl; |
|
} |
|
my $showserver = $server; |
|
$showserver =~ 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', |
notv => 'is not a valid e-mail address', |
notv => 'is not a valid e-mail address', |
Line 357 ENDJS
|
Line 365 ENDJS
|
$num ++; |
$num ++; |
$i = $num%2; |
$i = $num%2; |
$output .= &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,$css[$i]). |
$output .= &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,$css[$i]). |
$showserver."\n".'<input type="hidden" name="sourceurl" value="'. |
$server."\n".'<input type="hidden" name="sourceurl" value="'. |
&HTML::Entities::encode($server,'"<>&').'" />'."\n". |
&HTML::Entities::encode($sourceurl,'"<>&').'" />'."\n". |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,'LC_evenrow_value'). |
&Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,'LC_evenrow_value'). |
'<input type="text" size="15" name="phone" /><br />'."\n". |
'<input type="text" size="15" name="phone" /><br />'."\n". |
Line 487 ENDJS
|
Line 495 ENDJS
|
$num ++; |
$num ++; |
$i = $num%2; |
$i = $num%2; |
} |
} |
|
} else { |
|
my $lonhost = $r->dir_config('lonHostID'); |
|
my ($captchaform,$error) = |
|
&Apache::loncommon::captcha_display('login',$lonhost); |
|
if ($captchaform) { |
|
$output .= &Apache::lonhtmlcommon::row_title(&mt('Validation'),undef, |
|
$css[$i])."\n". |
|
$captchaform."\n". |
|
&Apache::lonhtmlcommon::row_closure(); |
|
$num ++; |
|
$i = $num%2; |
|
} |
} |
} |
$output .= &Apache::lonhtmlcommon::row_title($lt{'fini'},undef,$css[$i]); |
$output .= &Apache::lonhtmlcommon::row_title($lt{'fini'},undef,$css[$i]); |
$output .= <<END; |
$output .= <<END; |
Line 516 END
|
Line 536 END
|
|
|
sub print_request_receipt { |
sub print_request_receipt { |
my ($r,$url,$function) = @_; |
my ($r,$url,$function) = @_; |
|
my $public; |
|
if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) { |
|
$public = 1; |
|
} |
|
unless (($env{'user.name'} =~ /^$match_username$/) && (!$public)) { |
|
my $lonhost = $r->dir_config('lonHostID'); |
|
my ($captcha_chk,$captcha_error) = |
|
&Apache::loncommon::captcha_response('login',$lonhost); |
|
if ($captcha_chk != 1) { |
|
$r->print(&Apache::loncommon::start_page('Support request failed',undef, |
|
{'function' => $function, |
|
'add_entries' => { |
|
topmargin => "0", |
|
marginheight => "0", |
|
}, |
|
'only_body' => 1,})); |
|
if ($r->uri eq '/adm/helpdesk') { |
|
&print_header($r,$url,'process'); |
|
} |
|
$r->print('<h3>'.&mt('Support request failed').'</h3>'. |
|
'<span class="LC_error">'. |
|
&mt('Validation of the code you entered failed.'). |
|
&Apache::loncommon::end_page()); |
|
return; |
|
} |
|
} |
my @ENVvars = ('HTTP_HOST','HTTP_USER_AGENT','REMOTE_ADDR','SERVER_ADDR','SERVER_NAME'); |
my @ENVvars = ('HTTP_HOST','HTTP_USER_AGENT','REMOTE_ADDR','SERVER_ADDR','SERVER_NAME'); |
my @envvars = ('browser.os','browser.type','browser.version','user.home','request.role'); |
my @envvars = ('browser.os','browser.type','browser.version','user.home','request.role'); |
my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id'); |
my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id'); |
Line 912 sub print_header {
|
Line 958 sub print_header {
|
} else { |
} else { |
$reviewtext = &mt('Please review the information in "Log-in help" if you are unable to log-in.'); |
$reviewtext = &mt('Please review the information in "Log-in help" if you are unable to log-in.'); |
} |
} |
|
my $linkback; |
if ($origurl eq '') { |
if ($origurl eq '') { |
$origurl = 'javascript:history.go(-1)'; |
$linkback = 'javascript:history.go(-1)'; |
|
} else { |
|
$linkback = &HTML::Entities::encode($origurl,'"<>&'); |
|
} |
|
my $loginhelp = &Apache::lonauth::loginhelpdisplay(); |
|
if ($loginhelp eq '') { |
|
$loginhelp = '/adm/loginproblems.html'; |
} |
} |
$r->print(<<"END"); |
$r->print(<<"END"); |
<table width="620" border="0" cellspacing="0" cellpadding="0" style="height: 55px;"> |
<table width="620" border="0" cellspacing="0" cellpadding="0" style="height: 55px;"> |
Line 927 sub print_header {
|
Line 980 sub print_header {
|
</legend> |
</legend> |
<table id="LC_helpmenu_links"> |
<table id="LC_helpmenu_links"> |
<tr> |
<tr> |
<td align="center"><span class="LC_nobreak"><img src="$location/help/help.png" border="0" alt="($lt{'login'})" style="vertical-align:middle" /> <b><a href="/adm/loginproblems.html">$lt{'login'}</a></b> </span></td> |
<td align="center"><span class="LC_nobreak"><img src="$location/help/help.png" border="0" alt="($lt{'login'})" style="vertical-align:middle" /> <b><a href="$loginhelp">$lt{'login'}</a></b> </span></td> |
<td align="center"><span class="LC_nobreak"> <b>$helpdesk_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="($lt{'ask'})" style="vertical-align:middle" /> $lt{'ask'}</a></b> </span></td>$getstartlink |
<td align="center"><span class="LC_nobreak"> <b>$helpdesk_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="($lt{'ask'})" style="vertical-align:middle" /> $lt{'ask'}</a></b> </span></td>$getstartlink |
<td align="center"><span class="LC_nobreak"> <b><a href="$origurl" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="($lt{'back'})" style="vertical-align:middle" /> $lt{'back'}</a></b> </span></td> |
<td align="center"><span class="LC_nobreak"> <b><a href="$linkback" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="($lt{'back'})" style="vertical-align:middle" /> $lt{'back'}</a></b> </span></td> |
</tr> |
</tr> |
</table> |
</table> |
</fieldset> |
</fieldset> |
Line 962 END
|
Line 1015 END
|
sub get_domain { |
sub get_domain { |
my $codedom; |
my $codedom; |
if (exists($env{'form.codedom'})) { |
if (exists($env{'form.codedom'})) { |
$codedom = $env{'form.codedom'}; |
if (&Apache::lonnet::domain($env{'form.codedom'}) ne '') { |
} elsif ($env{'request.course.id'}) { |
return $env{'form.codedom'}; |
|
} |
|
} |
|
if ($env{'request.course.id'}) { |
$codedom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
$codedom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
} elsif ($env{'request.role.domain'}) { |
} elsif ($env{'request.role.domain'}) { |
$codedom = $env{'request.role.domain'}; |
$codedom = $env{'request.role.domain'}; |
Line 978 sub cleanup_html {
|
Line 1034 sub cleanup_html {
|
my $outgoing; |
my $outgoing; |
if ($incoming ne '') { |
if ($incoming ne '') { |
$outgoing = $incoming; |
$outgoing = $incoming; |
|
$outgoing =~ s/;/;/g; |
$outgoing =~ s/\#/#/g; |
$outgoing =~ s/\#/#/g; |
$outgoing =~ s/\&/&/g; |
$outgoing =~ s/\&/&/g; |
$outgoing =~ s/</</g; |
$outgoing =~ s/</</g; |
Line 987 sub cleanup_html {
|
Line 1044 sub cleanup_html {
|
$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; |
return $outgoing; |
} |
} |