--- loncom/interface/loncreateuser.pm 2001/03/17 15:42:24 1.8
+++ loncom/interface/loncreateuser.pm 2001/08/24 21:09:53 1.18
@@ -16,7 +16,9 @@
#
# 2/14 Gerd Kortemeyer)
#
-# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17 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
+# April Guy Albertelli
+# 05/10 Gerd Kortemeyer
#
package Apache::loncreateuser;
@@ -108,7 +110,9 @@ ENDENHEAD
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain);
my %incdomains;
my %inccourses;
- $incdomains{$ENV{'user.domain'}}=1;
+ map {
+ $incdomains{$_}=1;
+ } values %Apache::lonnet::hostdom;
map {
if ($_=~/^user\.priv\.cm\.\/(\w+)\/(\w+)/) {
$inccourses{$1.'_'.$2}=1;
@@ -123,6 +127,7 @@ function setkrb(vf) {
vf.login[0].checked=true;
vf.krbdom.value=vf.krbdom.value.toUpperCase();
vf.intpwd.value='';
+ vf.locarg.value='';
}
}
@@ -130,16 +135,32 @@ function setint(vf) {
if (vf.intpwd.value!='') {
vf.login[1].checked=true;
vf.krbdom.value='';
+ vf.locarg.value='';
+ }
+}
+
+function setloc(vf) {
+ if (vf.locarg.value!='') {
+ vf.login[2].checked=true;
+ vf.krbdom.value='';
+ vf.intpwd.value='';
}
}
function clickkrb(vf) {
vf.krbdom.value='$krbdefdom';
vf.intpwd.value='';
+ vf.locarg.value='';
}
function clickint(vf) {
vf.krbdom.value='';
+ vf.locarg.value='';
+}
+
+function clickloc(vf) {
+ vf.krbdom.value='';
+ vf.intpwd.value='';
}
@@ -158,6 +179,11 @@ Kerberos authenticated with domain
Internally authenticated (with initial password
)
+
+
+Local Authentication with argument
+
+
ENDNUSER
} else {
$r->print('Existing user '.$ccuname.' at '.$ccdomain.' ');
@@ -194,7 +220,6 @@ ENDNUSER
$area=$carea;
} else {
if ($area=~/^\/(\w+)\//) {
- $incdomains{$1}=1;
if (&Apache::lonnet::allowed('c'.$trole,$1)) {
$allows=1;
}
@@ -228,7 +253,32 @@ ENDNUSER
$r->print('');
}
}
- $r->print('Add Roles System Level ');
+ $r->print('Add Roles ');
+#
+# Co-Author
+#
+
+ if (&Apache::lonnet::allowed('cca',$ENV{'user.domain'})) {
+ my $cuname=$ENV{'user.name'};
+ my $cudom=$ENV{'user.domain'};
+ $r->print(<Construction Space
+
+ENDCOAUTH
+ }
#
# Domain level
#
@@ -254,7 +304,7 @@ ENDNUSER
ENDDROW
}
- } ('dc','cc','li','dg','au');
+ } ('dc','li','dg','au');
} sort keys %incdomains;
$r->print('');
#
@@ -265,6 +315,8 @@ ENDDROW
'Group/Section Start End ');
map {
my $thiscourse=$_;
+ my $protectedcourse=$_;
+ $thiscourse=~s:_:/:g;
my %coursedata=&Apache::lonnet::coursedescription($thiscourse);
my $area=$coursedata{'description'};
my $bgcol=$thiscourse;
@@ -273,23 +325,26 @@ ENDDROW
map {
if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) {
my $plrole=&Apache::lonnet::plaintext($_);
- $r->print(<print("
-
+
$plrole
$area
-
-
+");
+ if ($_ ne 'cc') {
+ $r->print(" ");
+ } else { $r->print(" "); }
+ $r->print(<
Set Start Date
-
+"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$_.value,'start_$protectedcourse\_$_','cu.pres','dateset')">Set Start Date
+
Set End Date
+"javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$_.value,'end_$protectedcourse\_$_','cu.pres','dateset')">Set End Date
ENDROW
-
}
- } ('st','ta','ep','ad','in');
+ } ('st','ta','ep','ad','in','cc');
} sort keys %inccourses;
$r->print('');
$r->print(' ');
@@ -322,7 +377,11 @@ ENDTHREEHEAD
} elsif ($ENV{'form.login'} eq 'int') {
$amode='internal';
$genpwd=$ENV{'form.intpwd'};
- }
+ } elsif ($ENV{'form.login'} eq 'loc') {
+ $amode='localauth';
+ $genpwd=$ENV{'form.locarg'};
+ if (!$genpwd) { $genpwd=" "; }
+ }
if (($amode) && ($genpwd)) {
$r->print('Generating user: '.&Apache::lonnet::modifyuser(
$ENV{'form.cdomain'},$ENV{'form.cuname'},
@@ -346,6 +405,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 {
@@ -365,6 +435,17 @@ 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;
@@ -410,7 +491,7 @@ sub handler {
}
} else {
$ENV{'user.error.msg'}=
- "/adm/createcourse:mau:0:0:Cannot modify user data";
+ "/adm/createuser:mau:0:0:Cannot modify user data";
return HTTP_NOT_ACCEPTABLE;
}
return OK;