Diff for /loncom/enrollment/Enrollment.pm between versions 1.24 and 1.26

version 1.24, 2005/08/31 06:21:58 version 1.26, 2006/01/02 20:19:37
Line 43  sub update_LC { Line 43  sub update_LC {
 # Get current LON-CAPA student enrollment for this class  # Get current LON-CAPA student enrollment for this class
     my $configvars = &LONCAPA::Configuration::read_conf('loncapa.conf');      my $configvars = &LONCAPA::Configuration::read_conf('loncapa.conf');
     my $cid = $dom."_".$crs;      my $cid = $dom."_".$crs;
     my $roster = &Apache::loncoursedata::get_classlist($cid,$dom,$crs);      my $roster = &Apache::loncoursedata::get_classlist($dom,$crs);
     my $cend = &Apache::loncoursedata::CL_END;      my $cend = &Apache::loncoursedata::CL_END;
     my $cstart = &Apache::loncoursedata::CL_START;       my $cstart = &Apache::loncoursedata::CL_START; 
     my $stuid=&Apache::loncoursedata::CL_ID;      my $stuid=&Apache::loncoursedata::CL_ID;
Line 779  sub create_password { Line 779  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 get_courseinfo {  sub get_courseinfo {
     my ($dom,$crs,$courseinfo) = @_;      my ($dom,$crs,$courseinfo) = @_;
     my $owner;      my $owner;

Removed from v.1.24  
changed lines
  Added in v.1.26


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>