--- loncom/interface/loncreateuser.pm 2002/02/11 15:37:58 1.25
+++ loncom/interface/loncreateuser.pm 2002/09/03 20:46:04 1.39.4.2
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.25 2002/02/11 15:37:58 matthew Exp $
+# $Id: loncreateuser.pm,v 1.39.4.2 2002/09/03 20:46:04 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -47,7 +47,7 @@
# 11/12,11/13,11/15 Scott Harrison
# 02/11/02 Matthew Hall
#
-# $Id: loncreateuser.pm,v 1.25 2002/02/11 15:37:58 matthew Exp $
+# $Id: loncreateuser.pm,v 1.39.4.2 2002/09/03 20:46:04 albertel Exp $
###
package Apache::loncreateuser;
@@ -68,138 +68,39 @@ BEGIN {
$ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/;
my $krbdefdom=$1;
$krbdefdom=~tr/a-z/A-Z/;
- $authformnop=(<
@@ -298,159 +204,198 @@ $loginscript
$generalrule
+$authformkrb
+$authformint
+$authformfsys
+$authformloc
+ENDNEWUSER } else { # user already exists - $r->print(<first name | middle name | last name | generation | +
---|---|---|---|
+END + } else { + $r->print(' | '.$userenv{$_}.' | '); + } + } + $r->print(<
Revoke | Role | Extent | '. - 'Start | End | '); - foreach (split(/&/,$rolesdump)) { - if ($_!~/^rolesdef\&/) { - my ($area,$role)=split(/=/,$_); - my $thisrole=$area; - $area=~s/\_\w\w$//; - my ($role_code,$role_end_time,$role_start_time)=split(/_/,$role); - my $bgcol='ffffff'; - my $allows=0; - if ($area=~/^\/(\w+)\/(\d\w+)/) { - my %coursedata=&Apache::lonnet::coursedescription($1.'_'.$2); - my $carea='Course: '.$coursedata{'description'}; - $inccourses{$1.'_'.$2}=1; - if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) { - $allows=1; - } - # What follows is an odd computation. It seems the value - # of the $area variable above is used to compute the - # background color. This makes sense, but I can't make - # heads or tail of the computation at this point.. - $bgcol=$1.'_'.$2; - $bgcol=~s/[^8-9b-e]//g; - $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',0,6); - if ($area=~/^\/(\w+)\/(\d\w+)\/(\w+)/) { - $carea.='
---|---|---|---|---|
'); - if (!($active) && ($allows)) { - $r->print(''); - } else { - $r->print(' '); - } - $r->print(' | '.&Apache::lonnet::plaintext($role_code). - ' | '.$area.' | '. - ($role_start_time ? localtime($role_start_time) - : ' ' ) - .' | '. - ($role_end_time ? localtime($role_end_time) - : ' ' ) - ." |
Revoke | Role | Extent | Start | End | +END + foreach my $area (keys(%rolesdump)) { + next if ($area =~ /^rolesdef/); + my $role = $rolesdump{$area}; + my $thisrole=$area; + $area =~ s/\_\w\w$//; + my ($role_code,$role_end_time,$role_start_time) = + split(/_/,$role); + my $bgcol='ffffff'; + my $allowed=0; + if ($area =~ /^\/(\w+)\/(\d\w+)/ ) { + my %coursedata= + &Apache::lonnet::coursedescription($1.'_'.$2); + my $carea='Course: '.$coursedata{'description'}; + $inccourses{$1.'_'.$2}=1; + if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) { + $allowed=1; + } + # Compute the background color based on $area + $bgcol=$1.'_'.$2; + $bgcol=~s/[^8-9b-e]//g; + $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',0,6); + if ($area=~/^\/(\w+)\/(\d\w+)\/(\w+)/) { + $carea.='
---|---|---|---|---|
'; + my $active=1; + $active=0 if (($role_end_time) && ($now>$role_end_time)); + if (($active) && ($allowed)) { + $row.= ''; + } else { + $row.=' '; + } + $row.= ' | '.&Apache::lonnet::plaintext($role_code). + ' | '.$area. + ' | '.($role_start_time?localtime($role_start_time) + : ' ' ). + ' | '.($role_end_time ?localtime($role_end_time) + : ' ' ) + ." |
$generalrule
+$authformkrb
+$authformint
+$authformfsys
+$authformloc
+ENDBADAUTH + } else { + # This user is not allowed to modify the users + # authentication scheme, so just notify them of the problem + $r->print(<$authformint
\n". + "$authformfsys
$authformloc
"; } elsif ($currentauth=~/^internal:/) { $authformcurrent=$authformint; - $authformother=$authformkrb.$authformfsys.$authformloc; - # embarrassing script hack here - $loginscript=~s/login\[3\]/login\[4\]/; # loc - $loginscript=~s/login\[2\]/login\[3\]/; # fsys - $loginscript=~s/login\[1\]/login\[1\]/; # int - $loginscript=~s/login\[0\]/login\[2\]/; # krb4 + $authform_other="$authformkrb
". + "$authformfsys
$authformloc
"; } elsif ($currentauth=~/^unix:/) { $authformcurrent=$authformfsys; - $authformother=$authformkrb.$authformint.$authformloc; - # embarrassing script hack here - $loginscript=~s/login\[3\]/login\[4\]/; # loc - $loginscript=~s/login\[1\]/login\[3\]/; # int - $loginscript=~s/login\[2\]/login\[1\]/; # fsys - $loginscript=~s/login\[0\]/login\[2\]/; # krb4 + $authform_other="$authformkrb
". + "$authformint
$authformloc;
"; } elsif ($currentauth=~/^localauth:/) { $authformcurrent=$authformloc; - $authformother=$authformkrb.$authformint.$authformfsys; - # embarrassing script hack here - $loginscript=~s/login\[3\]/login\[loc\]/; # loc - $loginscript=~s/login\[2\]/login\[4\]/; # fsys - $loginscript=~s/login\[1\]/login\[3\]/; # int - $loginscript=~s/login\[0\]/login\[2\]/; # krb4 - $loginscript=~s/login\[loc\]/login\[1\]/; # loc + $authform_other="$authformkrb
". + "$authformint
$authformfsys
"; } - $authformcurrent=<$generalrule
+$authformnop
+$authformcurrent
Activate | Role | Extent | @@ -529,195 +478,288 @@ ENDDROW # # Course level # - $r->print('
---|
Activate | Role | Extent | '. - 'Group/Section | Start | End |
---|---|---|---|---|---|
- | $plrole | -$area | -");
- if ($_ ne 'cc') {
- $r->print("");
- } else { $r->print(" "); }
- $r->print(< |
--Set End Date | -