--- loncom/interface/lonsupportreq.pm 2016/08/12 18:23:32 1.79.2.1
+++ loncom/interface/lonsupportreq.pm 2015/06/18 20:19:06 1.80
@@ -1,5 +1,5 @@
#
-# $Id: lonsupportreq.pm,v 1.79.2.1 2016/08/12 18:23:32 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.80 2015/06/18 20:19:06 musolffc Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -84,8 +84,7 @@ sub print_request_form {
my ($r,$origurl,$function) = @_;
my ($os,$browser,$bversion,$uhost,$uname,$udom,$uhome,$urole,$usec,$email,$cid,
$cdom,$cnum,$ctitle,$ccode,$sectionlist,$lastname,$firstname,$server,
- $formname,$public,$homeserver,$knownuser,$captcha_form,$captcha_error,
- $captcha,$recaptcha_version);
+ $formname,$public,$homeserver);
$function = &Apache::loncommon::get_users_function() if (!$function);
$ccode = '';
$os = $env{'browser.os'};
@@ -106,14 +105,6 @@ sub print_request_form {
}
}
}
- if (($env{'user.name'} =~ /^$match_username$/) &&
- ($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) {
- $knownuser = 1;
- } else {
- my $lonhost = $r->dir_config('lonHostID');
- ($captcha_form,$captcha_error,$captcha,$recaptcha_version) =
- &Apache::loncommon::captcha_display('login',$lonhost);
- }
if ($homeserver) {
$uhome = $env{'user.home'};
$urole = $env{'request.role'};
@@ -154,7 +145,7 @@ sub print_request_form {
subj => 'Subject',
detd => 'Detailed Description',
opfi => 'Optional file upload',
- uplf => 'Upload a file (e.g., a screenshot) relevant to your help request (128 KB max.)',
+ uplf => 'Upload a file (e.g., a screenshot) relevant to your help request (1 MB max.)',
fini => 'Finish',
clfm => 'Clear Form',
);
@@ -284,10 +275,8 @@ $jscript
$loaditems
// ]]>
+
ENDJS
- if ($recaptcha_version >=2) {
- $js.= "\n".''."\n";
- }
my %add_entries = (
style => "margin-top:0px;margin-bottom:0px;",
onload => "initialize_codes();",
@@ -341,7 +330,7 @@ ENDJS
&Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
- if ($knownuser) {
+ if (($env{'user.name'} =~ /^$match_username$/) && (!$public)) {
if ($homeserver) {
$output .= &Apache::lonhtmlcommon::row_title($html_lt{'emac'},undef,$css[$i]).
'
'."\n".
@@ -355,7 +344,8 @@ ENDJS
&HTML::Entities::encode($udom,'"<>&').'" />'."\n";
my $uname_input = '&').'" />'."\n";
- if ($knownuser) {
+ if (($env{'user.name'} =~ /^$match_username$/) &&
+ ($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) {
$output .= ''.$html_lt{'unme'}.': '.$uname.' '.$html_lt{'doma'}.': '.$udom.$udom_input.$uname_input;
} else {
my $udomform = '';
@@ -515,23 +505,27 @@ ENDJS
&Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
- if ($knownuser) {
+ if (($env{'user.name'} =~ /^$match_username$/) && (!$public)) {
if ($homeserver) {
- $output .= &Apache::lonhtmlcommon::row_title($html_lt{'opfi'},undef,$css[$i]).
- '
'.
- "\n".$html_lt{'uplf'}."\n".
- &Apache::lonhtmlcommon::row_closure();
+ $output .= &Apache::lonhtmlcommon::row_title($html_lt{'opfi'},undef,$css[$i])
+ .' '
+ .''
+ .'
'."\n".$html_lt{'uplf'}."\n"
+ .&Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
}
} else {
- if ($captcha_form) {
+ 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]).
- $captcha_form."\n".
+ $captchaform."\n".
&Apache::lonhtmlcommon::row_closure();
$num ++;
$i = $num%2;
@@ -851,9 +845,9 @@ END
if ((defined($env{'user.name'})) && (!$public)) {
if ($homeserver && $env{'form.screenshot.filename'}) {
$attachmentsize = length($env{'form.screenshot'});
- if ($attachmentsize > 131072) {
+ if ($attachmentsize > 1048576) {
$displaymsg .= '
'.
- &mt('The uploaded screenshot file ([_1] bytes) included with your request exceeded the maximum allowed size - 128 KB, and has therefore been discarded.',$attachmentsize).'';
+ &mt('The uploaded screenshot file ([_1] bytes) included with your request exceeded the maximum allowed size - 1 MB, and has therefore been discarded.',$attachmentsize).'';
} else {
$attachmentpath=&Apache::lonnet::userfileupload('screenshot',undef,'helprequests');
}