version 1.78, 2004/02/01 20:42:01
|
version 1.79, 2004/02/26 19:43:13
|
Line 250 ENDFORMINFO
|
Line 250 ENDFORMINFO
|
'<option value="default" selected>default</option>'."\n". |
'<option value="default" selected>default</option>'."\n". |
&Apache::loncommon::home_server_option_list($ccdomain); |
&Apache::loncommon::home_server_option_list($ccdomain); |
|
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'cnu' => "Create New User", |
'cnu' => "Create New User", |
'nu' => "New User", |
'nu' => "New User", |
'id' => "in domain", |
'id' => "in domain", |
Line 296 $lt{'hs'}: <select name="hserver" size="
|
Line 296 $lt{'hs'}: <select name="hserver" size="
|
<p>$authformloc </p> |
<p>$authformloc </p> |
ENDNEWUSER |
ENDNEWUSER |
} else { # user already exists |
} else { # user already exists |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'cup' => "Change User Privileges", |
'cup' => "Change User Privileges", |
'usr' => "User", |
'usr' => "User", |
'id' => "in domain", |
'id' => "in domain", |
Line 353 END
|
Line 353 END
|
$r->print(<<END); |
$r->print(<<END); |
<hr /> |
<hr /> |
<h3>$lt{'rer'}</h3> |
<h3>$lt{'rer'}</h3> |
<table border=2> |
<table> |
<tr><th>$lt{'rev'}</th><th>$lt{'del'}</th><th>$lt{'rol'}</th><th>$lt{'ext'}</th><th>$lt{'sta'}</th><th>$lt{'end'}</th> |
<tr><th>$lt{'rev'}</th><th>$lt{'del'}</th><th>$lt{'rol'}</th><th>$lt{'ext'}</th><th>$lt{'sta'}</th><th>$lt{'end'}</th> |
END |
END |
|
my (%roletext,%sortrole,%roleclass); |
foreach my $area (sort { my $a1=join('_',(split('_',$a))[1,0]); |
foreach my $area (sort { my $a1=join('_',(split('_',$a))[1,0]); |
my $b1=join('_',(split('_',$b))[1,0]); |
my $b1=join('_',(split('_',$b))[1,0]); |
return $a1 cmp $b1; |
return $a1 cmp $b1; |
} keys(%rolesdump)) { |
} keys(%rolesdump)) { |
next if ($area =~ /^rolesdef/); |
next if ($area =~ /^rolesdef/); |
|
my $envkey=$area; |
my $role = $rolesdump{$area}; |
my $role = $rolesdump{$area}; |
my $thisrole=$area; |
my $thisrole=$area; |
$area =~ s/\_\w\w$//; |
$area =~ s/\_\w\w$//; |
Line 372 END
|
Line 374 END
|
my $bgcol='ffffff'; |
my $bgcol='ffffff'; |
my $allowed=0; |
my $allowed=0; |
my $delallowed=0; |
my $delallowed=0; |
|
my $sortkey=$role_code; |
|
my $class='Unknown'; |
if ($area =~ /^\/(\w+)\/(\d\w+)/ ) { |
if ($area =~ /^\/(\w+)\/(\d\w+)/ ) { |
|
$class='Course'; |
my ($coursedom,$coursedir) = ($1,$2); |
my ($coursedom,$coursedir) = ($1,$2); |
|
$sortkey.="\0$1"; |
# $1.'_'.$2 is the course id (eg. 103_12345abcef103l3). |
# $1.'_'.$2 is the course id (eg. 103_12345abcef103l3). |
my %coursedata= |
my %coursedata= |
&Apache::lonnet::coursedescription($1.'_'.$2); |
&Apache::lonnet::coursedescription($1.'_'.$2); |
my $carea; |
my $carea; |
if (defined($coursedata{'description'})) { |
if (defined($coursedata{'description'})) { |
$carea=&mt('Course').': '.$coursedata{'description'}. |
$carea=$coursedata{'description'}. |
'<br />'.&mt('Domain').': '.$coursedom.(' 'x8). |
'<br />'.&mt('Domain').': '.$coursedom.(' 'x8). |
&Apache::loncommon::syllabuswrapper('Syllabus',$coursedir,$coursedom); |
&Apache::loncommon::syllabuswrapper('Syllabus',$coursedir,$coursedom); |
|
$sortkey.="\0".$coursedata{'description'}; |
} else { |
} else { |
$carea=&mt('Unavailable course').': '.$area; |
$carea=&mt('Unavailable course').': '.$area; |
|
$sortkey.="\0".&mt('Unavailable course'); |
} |
} |
$inccourses{$1.'_'.$2}=1; |
$inccourses{$1.'_'.$2}=1; |
if ((&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) || |
if ((&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) || |
Line 410 END
|
Line 418 END
|
} |
} |
$area=$carea; |
$area=$carea; |
} else { |
} else { |
|
$sortkey.="\0".$area; |
# Determine if current user is able to revoke privileges |
# Determine if current user is able to revoke privileges |
if ($area=~ /^\/(\w+)\//) { |
if ($area=~ /^\/(\w+)\//) { |
if ((&Apache::lonnet::allowed('c'.$role_code,$1)) || |
if ((&Apache::lonnet::allowed('c'.$role_code,$1)) || |
Line 426 END
|
Line 435 END
|
$allowed=1; |
$allowed=1; |
} |
} |
} |
} |
|
if ($role_code eq 'ca' || $role_code eq 'au') { |
|
$class='Construction Space'; |
|
} elsif ($role_code eq 'su') { |
|
$class='System'; |
|
} else { |
|
$class='Domain'; |
|
} |
} |
} |
if ($role_code eq 'ca') { |
if ($role_code eq 'ca') { |
$area=~/\/(\w+)\/(\w+)/; |
$area=~/\/(\w+)\/(\w+)/; |
Line 435 END
|
Line 451 END
|
$allowed=0; |
$allowed=0; |
} |
} |
} |
} |
|
$bgcol='77FF77'; |
my $row = ''; |
my $row = ''; |
$row.='<tr bgcolor="#'.$bgcol.'"><td>'; |
$row.='<tr bgcolor="#'.$bgcol.'"><td>'; |
my $active=1; |
my $active=1; |
Line 468 END
|
Line 485 END
|
'</td><td>'.($role_end_time ?localtime($role_end_time) |
'</td><td>'.($role_end_time ?localtime($role_end_time) |
: ' ' ) |
: ' ' ) |
."</td></tr>\n"; |
."</td></tr>\n"; |
$r->print($row); |
$sortrole{$sortkey}=$envkey; |
|
$roletext{$envkey}=$row; |
|
$roleclass{$envkey}=$class; |
|
#$r->print($row); |
} # end of foreach (table building loop) |
} # end of foreach (table building loop) |
|
foreach my $type ('Construction Space','Course','Domain','System','Unknown') { |
|
my $output; |
|
foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { |
|
if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { |
|
$output.=$roletext{$sortrole{$which}}; |
|
} |
|
} |
|
if (defined($output)) { |
|
$r->print("<tr bgcolor='#BBffBB'>". |
|
"<td align='center' colspan='7'>".&mt($type)."</td>"); |
|
} |
|
$r->print($output); |
|
} |
$r->print('</table>'); |
$r->print('</table>'); |
} # End of unless |
} # End of unless |
my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain); |
my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain); |