version 1.9, 2005/04/07 06:56:23
|
version 1.11, 2006/03/15 22:11:04
|
Line 42 sub handler {
|
Line 42 sub handler {
|
return OK if $r->header_only; |
return OK if $r->header_only; |
|
|
# ------------------------------------------------------------ Print the screen |
# ------------------------------------------------------------ Print the screen |
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(&Apache::loncommon::start_page("Selecting a User")); |
$r->print(<<ENDDOCUMENT); |
|
$html |
|
<head> |
|
<title>The LearningOnline Network with CAPA</title> |
|
</head> |
|
ENDDOCUMENT |
|
|
|
|
|
|
|
|
|
&Apache::loncommon::get_unprocessed_cgi |
&Apache::loncommon::get_unprocessed_cgi |
($ENV{'QUERY_STRING'},['filter','form','unameelement','udomelement', |
($ENV{'QUERY_STRING'},['filter','form','unameelement','udomelement', |
'roles']); |
'roles']); |
# Allowed? |
# Allowed? |
|
my $allowed; |
|
my $scope = $env{'request.course.id'}; |
|
if (!($allowed = &Apache::lonnet::allowed('srm',$scope))) { |
|
$scope .= '/'.$env{'request.course.sec'}; |
|
$allowed = &Apache::lonnet::allowed('srm',$scope); |
|
if ($allowed) { $allowed = 'section'; } |
|
} |
|
|
unless (($env{'form.roles'}) || |
unless (($env{'form.roles'}) || |
(($env{'request.course.id'}) && |
(($env{'request.course.id'}) && ($allowed))) { |
(&Apache::lonnet::allowed('srm',$env{'request.course.id'})))) { |
$r->print(&mt('No context.'). |
$r->print('<body>No context.</body>'); |
&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
|
Line 75 ENDDOCUMENT
|
Line 74 ENDDOCUMENT
|
|
|
# --------------------------------------- There is such a user, get environment |
# --------------------------------------- There is such a user, get environment |
|
|
$r->print(&Apache::loncommon::bodytag("Selecting a User")); |
|
$r->print(<<ENDSCRIPT); |
$r->print(<<ENDSCRIPT); |
<script> |
<script> |
function gochoose(uname,udom) { |
function gochoose(uname,udom) { |
Line 91 function gochoose(uname,udom) {
|
Line 89 function gochoose(uname,udom) {
|
ENDSCRIPT |
ENDSCRIPT |
|
|
$r->print('<form>'); |
$r->print('<form>'); |
if ((&Apache::lonnet::allowed('srm',$env{'request.course.id'})) && |
if ($allowed && (!$env{'form.roles'})) { |
(!$env{'form.roles'})) { |
|
# -------------------------------------------------------- Get course personnel |
# -------------------------------------------------------- Get course personnel |
$r->print('<h3>'.$env{'course.'.$env{'request.course.id'}.'.description'}. |
$r->print('<h3>'.$env{'course.'.$env{'request.course.id'}.'.description'}. |
'</h3>'); |
'</h3>'); |
Line 120 ENDSCRIPT
|
Line 117 ENDSCRIPT
|
# the following undefs are for 'domain', and 'username' respectively. |
# the following undefs are for 'domain', and 'username' respectively. |
my (undef,undef,$end,$start,$id,$section,$fullname,$status)= |
my (undef,undef,$end,$start,$id,$section,$fullname,$status)= |
@{$classlist->{$_}}; |
@{$classlist->{$_}}; |
|
if ($allowed eq 'section' && $section ne $env{'request.course.sec'}) { |
|
next; |
|
} |
if ($_=~/^(\w+)\:(\w+)$/) { |
if ($_=~/^(\w+)\:(\w+)$/) { |
my ($uname,$udom)=($1,$2); |
my ($uname,$udom)=($1,$2); |
if (($uname=~/^$filter/) || |
if (($uname=~/^$filter/) || |
Line 168 ENDSCRIPT
|
Line 168 ENDSCRIPT
|
} |
} |
$r->print('</table></p>'); |
$r->print('</table></p>'); |
} |
} |
$r->print('</form></body></html>'); |
$r->print('</form>'.&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
|