--- loncom/interface/loncreateuser.pm 2001/03/03 00:50:11 1.6
+++ loncom/interface/loncreateuser.pm 2001/04/12 19:43:49 1.12
@@ -16,7 +16,7 @@
#
# 2/14 Gerd Kortemeyer)
#
-# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2 Gerd Kortemeyer
+# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17,3/24,04/12 Gerd Kortemeyer
#
package Apache::loncreateuser;
@@ -182,7 +182,7 @@ ENDNUSER
my %coursedata=&Apache::lonnet::coursedescription($1.'_'.$2);
my $carea='Course: '.$coursedata{'description'};
$inccourses{$1.'_'.$2}=1;
- if (&Apache::lonnet::allowed('c'.$trole,$1.'_'.$2)) {
+ if (&Apache::lonnet::allowed('c'.$trole,$1.'/'.$2)) {
$allows=1;
}
$bgcol=$1.'_'.$2;
@@ -193,11 +193,15 @@ ENDNUSER
}
$area=$carea;
} else {
- if ($1) {
+ if ($area=~/^\/(\w+)\//) {
$incdomains{$1}=1;
if (&Apache::lonnet::allowed('c'.$trole,$1)) {
$allows=1;
}
+ } else {
+ if (&Apache::lonnet::allowed('c'.$trole,'/')) {
+ $allows=1;
+ }
}
}
@@ -225,20 +229,43 @@ ENDNUSER
}
}
$r->print('
Add Roles
System Level
');
- $r->print('Domain Level
');
+#
+# Domain level
+#
+ $r->print('Domain Level
'.
+ '');
+#
+# Course level
+#
$r->print('Course Level
'.
'Activate | Role | Extent | '.
'Group/Section | Start | End |
');
map {
my $thiscourse=$_;
+ $thiscourse=~s/\_/\//g;
my %coursedata=&Apache::lonnet::coursedescription($thiscourse);
my $area=$coursedata{'description'};
my $bgcol=$thiscourse;
@@ -263,7 +290,7 @@ ENDNUSER
ENDROW
}
- } ('st','ta','ep','ad','in');
+ } ('st','ta','ep','ad','in','cc');
} sort keys %inccourses;
$r->print('
');
$r->print('');
@@ -320,6 +347,17 @@ ENDTHREEHEAD
$r->print('Revoking '.$2.' in '.$1.': '.
&Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'},
$1,$2,$now).'
');
+ if ($2 eq 'st') {
+ $1=~/^\/(\w+)\/(\w+)/;
+ my $cid=$1.'_'.$2;
+ $r->print('Drop from classlist: '.
+ &Apache::lonnet::critical('put:'.$ENV{'course.'.$cid.'.domain'}.':'.
+ $ENV{'course.'.$cid.'.num'}.':classlist:'.
+ &Apache::lonnet::escape($ENV{'form.cuname'}.':'.
+ $ENV{'form.cdomain'}).'='.
+ &Apache::lonnet::escape($now.':'),
+ $ENV{'course.'.$cid.'.home'}).'
');
+ }
}
} keys %ENV;
map {
@@ -339,7 +377,31 @@ ENDTHREEHEAD
$r->print('Assigning: '.$3.' in '.$url.': '.
&Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'},
$url,$3,$end,$start).'
');
- }
+ if ($3 eq 'st') {
+ $url=~/^\/(\w+)\/(\w+)/;
+ my $cid=$1.'_'.$2;
+ $r->print('Add to classlist: '.
+ &Apache::lonnet::critical('put:'.$ENV{'course.'.$cid.'.domain'}.':'.
+ $ENV{'course.'.$cid.'.num'}.':classlist:'.
+ &Apache::lonnet::escape($ENV{'form.cuname'}.':'.
+ $ENV{'form.cdomain'}).'='.
+ &Apache::lonnet::escape($end.':'.$start),
+ $ENV{'course.'.$cid.'.home'}).'
');
+ }
+ } elsif (($_=~/^form\.act\_([^\_]+)\_([^\_]+)$/) && ($ENV{$_})) {
+ my $url='/'.$1.'/';
+ my $start=$now;
+ if ($ENV{'form.start_'.$1.'_'.$2}) {
+ $start=$ENV{'form.start_'.$1.'_'.$2};
+ }
+ my $end=0;
+ if ($ENV{'form.end_'.$1.'_'.$2}) {
+ $end=$ENV{'form.end_'.$1.'_'.$2};
+ }
+ $r->print('Assigning: '.$2.' in '.$url.': '.
+ &Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'},
+ $url,$2,$end,$start).'
');
+ }
} keys %ENV;
$r->print('