version 1.8, 2003/12/11 03:26:15
|
version 1.9, 2003/12/15 05:39:40
|
Line 545 sub create_password {
|
Line 545 sub create_password {
|
return ($passwd); |
return ($passwd); |
} |
} |
|
|
|
sub check_user_status { |
|
my ($udom,$uname,$cdom,$crs,$role,$secgrp) = @_; |
|
my %userinfo = &Apache::lonnet::dump('roles',$udom,$uname); |
|
my @uroles = keys %userinfo; |
|
my $srchstr; |
|
my $active_chk = 'none'; |
|
if (@uroles > 0) { |
|
if ( ($role eq 'cc') || ($secgrp eq '') || ( !defined($secgrp) ) ) { |
|
$srchstr = '/'.$cdom.'/'.$crs.'_'.$role; |
|
} else { |
|
$srchstr = '/'.$cdom.'/'.$crs.'/'.$secgrp.'_'.$role; |
|
} |
|
if (grep/^$srchstr$/,@uroles) { |
|
my $role_end = 0; |
|
my $role_start = 0; |
|
$active_chk = 'ok'; |
|
if ( $userinfo{$srchstr} =~ m/^($role)_(\d+)/ ) { |
|
$role_end = $2; |
|
if ( $userinfo{$srchstr} =~ m/^($role)_($role_end)_(\d+)$/ ) |
|
{ |
|
$role_start = $3; |
|
} |
|
} |
|
if ($role_start > 0) { |
|
if (time < $role_start) { |
|
$active_chk = 'expired'; |
|
} |
|
} |
|
if ($role_end > 0) { |
|
if (time > $role_end) { |
|
$active_chk = 'expired'; |
|
} |
|
} |
|
} |
|
} |
|
return $active_chk; |
|
} |
|
|
sub CL_autharg { return 0; } |
sub CL_autharg { return 0; } |
sub CL_authtype { return 1;} |
sub CL_authtype { return 1;} |
sub CL_email { return 2;} |
sub CL_email { return 2;} |