--- loncom/interface/loncreateuser.pm 2002/02/11 15:37:58 1.25
+++ loncom/interface/loncreateuser.pm 2002/02/12 21:42:18 1.27
@@ -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.27 2002/02/12 21:42:18 matthew 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.27 2002/02/12 21:42:18 matthew Exp $
###
package Apache::loncreateuser;
@@ -70,7 +70,7 @@ BEGIN {
$krbdefdom=~tr/a-z/A-Z/;
$authformnop=(<
Revoke | Role | Extent | '. - 'Start | End | '); + 'Start | End | '); foreach (split(/&/,$rolesdump)) { if ($_!~/^rolesdef\&/) { my ($area,$role)=split(/=/,$_); @@ -338,10 +335,7 @@ ENDCHUSER 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.. + # Compute the background color based on $area $bgcol=$1.'_'.$2; $bgcol=~s/[^8-9b-e]//g; $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',0,6); @@ -350,6 +344,7 @@ ENDCHUSER } $area=$carea; } else { + # Determine if current user is able to revoke privileges if ($area=~/^\/(\w+)\//) { if (&Apache::lonnet::allowed('c'.$role_code,$1)) { $allows=1; @@ -361,11 +356,12 @@ ENDCHUSER } } + $r->print('
---|---|---|---|---|---|---|
'); my $active=1; if (($role_end_time) && ($now>$role_end_time)) { $active=0; } - $r->print(' | ||||||
');
- if (!($active) && ($allows)) {
- $r->print('');
+ if (($active) && ($allows)) {
+ $r->print('');
} else {
$r->print(' ');
}
@@ -387,16 +383,14 @@ ENDCHUSER
my $krbdefdom2=$1;
$loginscript=~s/vf\.krbdom\.value='.*?';/vf.krbdom.value='$krbdefdom2';/;
}
- # Here is where we'll have to check against the permissions of the
- # user attempting to modify this users data. Only users with
- # MAU (Modify Authentication User) permissions should be able to
- # make these changes. I think a subroutine would be in order here.
+ # Check for a bad authentication type
unless ($currentauth=~/^krb4:/ or
$currentauth=~/^unix:/ or
$currentauth=~/^internal:/ or
$currentauth=~/^localauth:/
- ) {
- $r->print(< +ENDBADAUTH + } + } else { # Authentication type is valid my $authformcurrent=''; - my $authformother=''; + my $authform_other=''; if ($currentauth=~/^krb4:/) { $authformcurrent=$authformkrb; - $authformother=$authformint.$authformfsys.$authformloc; + $authform_other=$authformint.$authformfsys.$authformloc; # embarrassing script hack here $loginscript=~s/login\[3\]/login\[4\]/; # loc $loginscript=~s/login\[2\]/login\[3\]/; # fsys @@ -424,7 +429,7 @@ END } elsif ($currentauth=~/^internal:/) { $authformcurrent=$authformint; - $authformother=$authformkrb.$authformfsys.$authformloc; + $authform_other=$authformkrb.$authformfsys.$authformloc; # embarrassing script hack here $loginscript=~s/login\[3\]/login\[4\]/; # loc $loginscript=~s/login\[2\]/login\[3\]/; # fsys @@ -433,7 +438,7 @@ END } elsif ($currentauth=~/^unix:/) { $authformcurrent=$authformfsys; - $authformother=$authformkrb.$authformint.$authformloc; + $authform_other=$authformkrb.$authformint.$authformloc; # embarrassing script hack here $loginscript=~s/login\[3\]/login\[4\]/; # loc $loginscript=~s/login\[1\]/login\[3\]/; # int @@ -442,7 +447,7 @@ END } elsif ($currentauth=~/^localauth:/) { $authformcurrent=$authformloc; - $authformother=$authformkrb.$authformint.$authformfsys; + $authform_other=$authformkrb.$authformint.$authformfsys; # embarrassing script hack here $loginscript=~s/login\[3\]/login\[loc\]/; # loc $loginscript=~s/login\[2\]/login\[4\]/; # fsys @@ -450,7 +455,7 @@ END $loginscript=~s/login\[0\]/login\[2\]/; # krb4 $loginscript=~s/login\[loc\]/login\[1\]/; # loc } - $authformcurrent=< * * * WARNING * * * |
@@ -459,8 +464,10 @@ END
$authformcurrent |
Changing this value will overwrite existing authentication for the user; you should notify the user of this change. | |
Activate | Role | Extent | '. - 'Group/Section | Start | End |
---|---|---|---|---|---|
- | $plrole | -$area | -");
- if ($_ ne 'cc') {
- $r->print("");
- } else { $r->print(" "); }
- $r->print(< |
--Set End Date | -