--- loncom/interface/loncreateuser.pm 2003/04/30 15:49:45 1.52
+++ loncom/interface/loncreateuser.pm 2003/06/19 21:46:38 1.55
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.52 2003/04/30 15:49:45 matthew Exp $
+# $Id: loncreateuser.pm,v 1.55 2003/06/19 21:46:38 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -46,7 +46,7 @@
# 05/10,10/16 Gerd Kortemeyer
# 02/11/02 Matthew Hall
#
-# $Id: loncreateuser.pm,v 1.52 2003/04/30 15:49:45 matthew Exp $
+# $Id: loncreateuser.pm,v 1.55 2003/06/19 21:46:38 www Exp $
###
package Apache::loncreateuser;
@@ -54,6 +54,7 @@ package Apache::loncreateuser;
use strict;
use Apache::Constants qw(:common :http);
use Apache::lonnet;
+use Apache::loncommon;
my $loginscript; # piece of javascript used in two separate instances
my $generalrule;
@@ -254,7 +255,7 @@ END
foreach ('firstname','middlename','lastname','generation') {
if (&Apache::lonnet::allowed('mau',$ccdomain)) {
$r->print(<<"END");
-
+
END
} else {
$r->print('
'.$userenv{$_}.'
');
@@ -272,7 +273,7 @@ END
Revoke Existing Roles
-
Revoke
Role
Extent
Start
End
+
Revoke
Delete
Role
Extent
Start
End
END
foreach my $area (keys(%rolesdump)) {
next if ($area =~ /^rolesdef/);
@@ -283,19 +284,26 @@ END
split(/_/,$role);
my $bgcol='ffffff';
my $allowed=0;
+ my $delallowed=0;
if ($area =~ /^\/(\w+)\/(\d\w+)/ ) {
my %coursedata=
&Apache::lonnet::coursedescription($1.'_'.$2);
my $carea;
if (defined($coursedata{'description'})) {
- $carea='Course: '.$coursedata{'description'};
+ $carea='Course: '.$coursedata{'description'}.
+ ' Domain: '.$1;
} else {
$carea='Unavailable course: '.$area;
}
$inccourses{$1.'_'.$2}=1;
- if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) {
+ if ((&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) ||
+ (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) {
$allowed=1;
}
+ if ((&Apache::lonnet::allowed('dro',$1)) ||
+ (&Apache::lonnet::allowed('dro',$ccdomain))) {
+ $delallowed=1;
+ }
# Compute the background color based on $area
$bgcol=$1.'_'.$2;
$bgcol=~s/[^8-9b-e]//g;
@@ -307,9 +315,15 @@ END
} else {
# Determine if current user is able to revoke privileges
if ($area=~ /^\/(\w+)\//) {
- if (&Apache::lonnet::allowed('c'.$role_code,$1)) {
+ if ((&Apache::lonnet::allowed('c'.$role_code,$1)) ||
+ (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) {
$allowed=1;
}
+ if (((&Apache::lonnet::allowed('dro',$1)) ||
+ (&Apache::lonnet::allowed('dro',$ccdomain))) &&
+ ($role_code ne 'dc')) {
+ $delallowed=1;
+ }
} else {
if (&Apache::lonnet::allowed('c'.$role_code,'/')) {
$allowed=1;
@@ -333,6 +347,12 @@ END
} else {
$row.=' ';
}
+ $row.='