version 1.58, 2010/11/10 14:44:50
|
version 1.62, 2010/12/03 04:28:36
|
Line 37 use Apache::lonnet;
|
Line 37 use Apache::lonnet;
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonacc(); |
use Apache::lonacc(); |
use Apache::courseclassifier; |
use Apache::courseclassifier; |
use LONCAPA; |
use LONCAPA qw(:DEFAULT :match); |
|
|
|
|
sub handler { |
sub handler { |
Line 57 sub handler {
|
Line 57 sub handler {
|
&Apache::lonacc::get_posted_cgi($r); |
&Apache::lonacc::get_posted_cgi($r); |
} |
} |
my $function = $env{'form.function'}; |
my $function = $env{'form.function'}; |
my $origurl = &unescape($env{'form.origurl'}); |
my $origurl = $env{'form.origurl'}; |
my $command = $env{'form.command'}; |
my $command = $env{'form.command'}; |
|
|
if ($command eq 'process') { |
if ($command eq 'process') { |
Line 70 sub handler {
|
Line 70 sub handler {
|
|
|
sub print_request_form { |
sub print_request_form { |
my ($r,$origurl,$function) = @_; |
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); |
my ($os,$browser,$bversion,$uhost,$uname,$udom,$uhome,$urole,$usec,$email,$cid, |
|
$cdom,$cnum,$ctitle,$ccode,$sectionlist,$lastname,$firstname,$server, |
|
$formname,$public); |
$function = &Apache::loncommon::get_users_function() if (!$function); |
$function = &Apache::loncommon::get_users_function() if (!$function); |
$ccode = ''; |
$ccode = ''; |
$os = $env{'browser.os'}; |
$os = $env{'browser.os'}; |
$browser = $env{'browser.type'}; |
$browser = $env{'browser.type'}; |
$bversion = $env{'browser.version'}; |
$bversion = $env{'browser.version'}; |
$uhost = $env{'request.host'}; |
$uhost = $env{'request.host'}; |
my ($uname,$udom); |
if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) { |
if (($env{'user.name'} ne 'public') && ($env{'user.domain'} ne 'public')) { |
$public = 1; |
|
} else { |
$uname = $env{'user.name'}; |
$uname = $env{'user.name'}; |
$udom = $env{'user.domain'}; |
$udom = $env{'user.domain'}; |
} |
} |
Line 175 END
|
Line 178 END
|
my ($sec,$grp) = split(/:/,$section); |
my ($sec,$grp) = split(/:/,$section); |
$groupid{$sec} = $grp; |
$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 $codedom = &get_domain(); |
my $details_title; |
my $details_title; |
if ($codedom) { |
if ($codedom) { |
Line 228 function initialize_codes() {
|
Line 244 function initialize_codes() {
|
} |
} |
|
|
my $js = '<script type="text/javascript">'."\n$scripttag\n$jscript\n". |
my $js = '<script type="text/javascript">'."\n$scripttag\n$jscript\n". |
'</script>'; |
$loaditems.'</script>'; |
my %add_entries = (topmargin => "0", |
my %add_entries = (topmargin => "0", |
marginheight => "0", |
marginheight => "0", |
onLoad =>"initialize_codes()",); |
onLoad =>"initialize_codes()",); |
Line 269 function initialize_codes() {
|
Line 285 function initialize_codes() {
|
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
$num ++; |
$num ++; |
$i = $num%2; |
$i = $num%2; |
if (defined($uname)) { |
if (($env{'user.name'} =~ /^$match_username$/) && (!$public)) { |
$output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]). |
$output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]). |
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
Line 281 function initialize_codes() {
|
Line 297 function initialize_codes() {
|
&HTML::Entities::encode($udom,'"<>&').'" />'; |
&HTML::Entities::encode($udom,'"<>&').'" />'; |
my $uname_input = '<input type="hidden" name="uname" value="'. |
my $uname_input = '<input type="hidden" name="uname" value="'. |
&HTML::Entities::encode($uname,'"<>&').'" />'; |
&HTML::Entities::encode($uname,'"<>&').'" />'; |
if (defined($uname) && defined($udom)) { |
if (($env{'user.name'} =~ /^$match_username$/) && |
|
($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) { |
$output .= '<i>'.$lt{'unme'}.'</i>: '.$uname.' <i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input.$uname_input; |
$output .= '<i>'.$lt{'unme'}.'</i>: '.$uname.' <i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input.$uname_input; |
} else { |
} else { |
my $udomform = ''; |
my $udomform = ''; |
my $unameform = ''; |
my $unameform = ''; |
if (defined($udom)) { |
if (($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) { |
$output .= $lt{'entu'}; |
$output .= $lt{'entu'}; |
} elsif (defined($uname)) { |
} elsif (($env{'user.name'} =~ /^$match_username$/) && (!$public)) { |
$output .= $lt{'chdo'}; |
$output .= $lt{'chdo'}; |
} else { |
} else { |
$output .= $lt{'entr'}; |
$output .= $lt{'entr'}; |
} |
} |
$output .= '<br />'; |
$output .= '<br />'; |
if (defined($udom)) { |
if (!$public) { |
$udomform = '<i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input; |
if ($env{'user.domain'} =~ /^$match_domain$/) { |
} elsif (defined($uname)) { |
$udomform = '<i>'.$lt{'doma'}.'</i>: '.$udom.$udom_input; |
$unameform = '<i>'.$lt{'unme'}.'</i>: '.$uname.' '.$uname_input; |
} elsif ($env{'user.name'} =~ /^$match_username$/) { |
|
$unameform = '<i>'.$lt{'unme'}.'</i>: '.$uname.' '.$uname_input; |
|
} |
} |
} |
if ($udomform eq '') { |
if ($udomform eq '') { |
$udomform = '<i>'.$lt{'doma'}.'</i>: '; |
$udomform = '<i>'.$lt{'doma'}.'</i>: '; |
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom'); |
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom'); |
} |
} |
if ($unameform eq '') { |
if ($unameform eq '') { |
$unameform= '<i>'.$lt{'unme'}.'</i>: <input type="text" size="12" name="uname" value="'.$uname.'" /> '; |
$unameform= '<i>'.$lt{'unme'}.'</i>: <input type="text" size="20" name="uname" value="'.$uname.'" /> '; |
} |
} |
$output .= $unameform.$udomform; |
$output .= $unameform.$udomform; |
} |
} |
Line 432 function initialize_codes() {
|
Line 451 function initialize_codes() {
|
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
$num ++; |
$num ++; |
$i = $num%2; |
$i = $num%2; |
if (defined($uname)) { |
if (($env{'user.name'} =~ /^$match_username$/) && (!$public)) { |
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]). |
$output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]). |
' <input type="file" name="screenshot" size="20" /><br />'.$lt{'uplf'}."\n". |
' <input type="file" name="screenshot" size="20" /><br />'.$lt{'uplf'}."\n". |
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
Line 842 sub print_header {
|
Line 861 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.'); |
} |
} |
|
if ($origurl eq '') { |
|
$origurl = 'javascript:history.go(-1)'; |
|
} |
$r->print(<<END); |
$r->print(<<END); |
<table width="620" border="0" cellspacing="0" cellpadding="0" height="55"> <tr height="50"> <td width='5'> </td> |
<table width="620" border="0" cellspacing="0" cellpadding="0" height="55"> <tr height="50"> <td width='5'> </td> |
<td> |
<td> |