--- loncom/interface/lonsupportreq.pm 2013/01/04 19:07:17 1.67.2.1 +++ loncom/interface/lonsupportreq.pm 2013/01/04 17:46:00 1.71 @@ -1,5 +1,5 @@ # -# $Id: lonsupportreq.pm,v 1.67.2.1 2013/01/04 19:07:17 raeburn Exp $ +# $Id: lonsupportreq.pm,v 1.71 2013/01/04 17:46:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,7 @@ use Apache::lonhtmlcommon; use Apache::lonnet; use Apache::lonlocal; use Apache::lonacc(); +use Apache::lonauth(); use Apache::courseclassifier; use LONCAPA qw(:DEFAULT :match); use HTML::Entities; @@ -494,6 +495,18 @@ ENDJS $num ++; $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 .= <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('

'.&mt('Support request failed').'

'. + ''. + &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 = ('browser.os','browser.type','browser.version','user.home','request.role'); my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id'); @@ -929,6 +968,10 @@ sub print_header { } else { $linkback = &HTML::Entities::encode($origurl,'"<>&'); } + my $loginhelp = &Apache::lonauth::loginhelpdisplay(); + if ($loginhelp eq '') { + $loginhelp = '/adm/loginproblems.html'; + } $r->print(<<"END"); @@ -941,7 +984,7 @@ sub print_header {
- + $getstartlink