--- loncom/interface/loncreateuser.pm 2003/03/23 09:06:08 1.51
+++ 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.51 2003/03/23 09:06:08 albertel 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.51 2003/03/23 09:06:08 albertel 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;
@@ -149,6 +150,7 @@ sub print_user_modification_page {
$ccuname=~s/\W//g;
$ccdomain=~s/\W//g;
+ my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();
my $dochead =<<"ENDDOCHEAD";
@@ -161,14 +163,7 @@ sub print_user_modification_page {
parmwin.close();
}
- function pjump(type,dis,value,marker,ret,call) {
- parmwin=window.open("/adm/rat/parameter.html?type="+escape(type)
- +"&value="+escape(value)+"&marker="+escape(marker)
- +"&return="+escape(ret)
- +"&call="+escape(call)+"&name="+escape(dis),"LONCAPAparms",
- "height=350,width=350,scrollbars=no,menubar=no");
-
- }
+ $pjump_def
function dateset() {
eval("document.cu."+document.cu.pres_marker.value+
@@ -260,7 +255,7 @@ END
foreach ('firstname','middlename','lastname','generation') {
if (&Apache::lonnet::allowed('mau',$ccdomain)) {
$r->print(<<"END");
-
+
END
} else {
$r->print('
'.$userenv{$_}.'
');
@@ -278,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/);
@@ -289,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;
@@ -313,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;
@@ -339,6 +347,12 @@ END
} else {
$row.=' ';
}
+ $row.='