--- loncom/interface/lonsupportreq.pm 2013/01/04 19:07:17 1.67.2.1 +++ loncom/interface/lonsupportreq.pm 2013/07/15 16:13:21 1.73 @@ -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.73 2013/07/15 16:13:21 bisitz 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'); @@ -602,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'}); @@ -707,7 +744,7 @@ END $r->print(<<"END"); $start_page -
+
END @@ -777,8 +814,7 @@ END my $attachmentpath = ''; my $attachmentsize = ''; - if ((defined($env{'user.name'})) && ($env{'user.name'} ne 'public') - && ($env{'user.domain'} ne 'public')) { + if ((defined($env{'user.name'})) && (!$public)) { if ($homeserver && $env{'form.screenshot.filename'}) { $attachmentsize = length($env{'form.screenshot'}); if ($attachmentsize > 131072) { @@ -929,6 +965,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 +981,7 @@ sub print_header {
- + $getstartlink