--- loncom/interface/lonsupportreq.pm 2007/12/04 04:43:21 1.45 +++ loncom/interface/lonsupportreq.pm 2010/12/02 22:05:17 1.60 @@ -1,5 +1,5 @@ # -# $Id: lonsupportreq.pm,v 1.45 2007/12/04 04:43:21 raeburn Exp $ +# $Id: lonsupportreq.pm,v 1.60 2010/12/02 22:05:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,7 +37,7 @@ use Apache::lonnet; use Apache::lonlocal; use Apache::lonacc(); use Apache::courseclassifier; -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); sub handler { @@ -57,7 +57,7 @@ sub handler { &Apache::lonacc::get_posted_cgi($r); } my $function = $env{'form.function'}; - my $origurl = &unescape($env{'form.origurl'}); + my $origurl = $env{'form.origurl'}; my $command = $env{'form.command'}; if ($command eq 'process') { @@ -77,8 +77,13 @@ sub print_request_form { $browser = $env{'browser.type'}; $bversion = $env{'browser.version'}; $uhost = $env{'request.host'}; - $uname = $env{'user.name'}; - $udom = $env{'user.domain'}; + my ($uname,$udom,$public); + if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) { + $public = 1; + } else { + $uname = $env{'user.name'}; + $udom = $env{'user.domain'}; + } $uhome = $env{'user.home'}; $urole = $env{'request.role'}; $usec = $env{'request.course.sec'}; @@ -99,7 +104,8 @@ sub print_request_form { rdes => 'You must include a description', name => 'Name', subm => 'Submit Request', - emad => 'E-mail address', + emad => 'Your e-mail address', + emac => 'Cc', unme => 'username', doma => 'domain', entu => 'Enter the username you use to log-in to LON-CAPA', @@ -171,7 +177,20 @@ END my ($sec,$grp) = split(/:/,$section); $groupid{$sec} = $grp; } - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom']); + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom', + 'useremail','useraccount']); + if ($env{'form.origurl'} eq '/adm/createaccount') { + if ($email eq '') { + if ($env{'form.useremail'} =~ /^[^\@]+\@[^\@]+$/) { + $email = &HTML::Entities::encode($env{'form.useremail'},'"<>&'); + } + } + if ($uname eq '') { + if ($env{'form.useraccount'} =~ /^$match_username$/) { + $uname = &HTML::Entities::encode($env{'form.useraccount'},'"<>&'); + } + } + } my $codedom = &get_domain(); my $details_title; if ($codedom) { @@ -237,9 +256,12 @@ function initialize_codes() { if ($r->uri eq '/adm/helpdesk') { &print_header($r,$origurl); } + my @css = ('LC_evenrow_value','LC_oddrow_value'); + my $num = 1; + my $i = $num%2; $r->print('