Diff for /loncom/enrollment/Enrollment.pm between versions 1.21 and 1.23

version 1.21, 2005/01/30 01:07:35 version 1.23, 2005/04/27 19:11:33
Line 194  sub update_LC { Line 194  sub update_LC {
     }      }
 # Explicitly allow access to creation/modification of students if called as an automated process.  # Explicitly allow access to creation/modification of students if called as an automated process.
     if ($context eq 'automated') {      if ($context eq 'automated') {
         $ENV{'allowed.cst'}='F';          $env{'allowed.cst'}='F';
     }      }
   
 # Compare IDs with existing LON-CAPA enrollment for this class  # Compare IDs with existing LON-CAPA enrollment for this class
Line 355  sub update_LC { Line 355  sub update_LC {
   
 # Terminated explictly allowed access to student creation/modification  # Terminated explictly allowed access to student creation/modification
     if ($context eq 'automated') {      if ($context eq 'automated') {
         delete($ENV{'allowed.cst'});          delete($env{'allowed.cst'});
     }      }
     if ($enrollcount > 0) {      if ($enrollcount > 0) {
         if ($context eq "updatenow") {          if ($context eq "updatenow") {
Line 482  sub create_newuser { Line 482  sub create_newuser {
                 my %emailHash;                  my %emailHash;
                 $emailHash{'critnotification'}  = $emailenc;                  $emailHash{'critnotification'}  = $emailenc;
                 $emailHash{'notification'} = $emailenc;                  $emailHash{'notification'} = $emailenc;
                   $emailHash{'permanentemail'} = $emailenc;
                 my $putresult = &Apache::lonnet::put('environment',\%emailHash,$udom,$uname);                  my $putresult = &Apache::lonnet::put('environment',\%emailHash,$udom,$uname);
             }              }
             if ($create_passwd) {              if ($create_passwd) {
Line 564  sub prepare_add { Line 565  sub prepare_add {
 sub execute_add {  sub execute_add {
     my ($context,$caller,$uname,$dom,$auth,$authparam,$first,$middle,$last,$gene,$pid,$usec,$end,$start,$emailenc,$cid,$addresult,$enrollcount,$linefeed,$logmsg) = @_;      my ($context,$caller,$uname,$dom,$auth,$authparam,$first,$middle,$last,$gene,$pid,$usec,$end,$start,$emailenc,$cid,$addresult,$enrollcount,$linefeed,$logmsg) = @_;
 # Get the user's information and authentication  # Get the user's information and authentication
     my %userenv = &Apache::lonnet::get('environment',['firstname','middlename','lastname','generation','id','critnotification','notification'],$dom,$uname);      my %userenv = &Apache::lonnet::get('environment',['firstname','middlename','lastname','generation','id','critnotification','notification','permanentemail'],$dom,$uname);
     my ($tmp) = keys(%userenv);      my ($tmp) = keys(%userenv);
     if ($tmp =~ /^(con_lost|error)/i) {      if ($tmp =~ /^(con_lost|error)/i) {
         %userenv = ();          %userenv = ();
Line 577  sub execute_add { Line 578  sub execute_add {
         }          }
     }      }
     if ($userenv{notification} =~ m/%40/) {      if ($userenv{notification} =~ m/%40/) {
         unless ($emailenc eq $userenv{critnotification}) {          unless ($emailenc eq $userenv{notification}) {
             $$logmsg .= "Current standard notification e-mail              $$logmsg .= "Current standard notification e-mail
 - ".$userenv{notification}." for $uname is different to e-mail address in institutional classlist - ".$emailenc.$linefeed;  - ".$userenv{notification}." for $uname is different to e-mail address in institutional classlist - ".$emailenc.$linefeed;
         }          }
     }      }
       if ($userenv{permanentemail} =~ m/%40/) {
           unless ($emailenc eq $userenv{permanentemail}) {
               $$logmsg .= "Current permanent e-mail
   - ".$userenv{permanentemail}." for $uname is different to e-mail address in institutional classlist - ".$emailenc.$linefeed;
           }
       }
     my $krbdefdom = '';      my $krbdefdom = '';
     my $currentauth=&Apache::lonnet::queryauthenticate($uname,$dom);      my $currentauth=&Apache::lonnet::queryauthenticate($uname,$dom);
     if ($currentauth=~/^(krb[45]):(.*)/) {      if ($currentauth=~/^(krb[45]):(.*)/) {
Line 606  sub execute_add { Line 613  sub execute_add {
         $middle ne $userenv{'middlename'} ||          $middle ne $userenv{'middlename'} ||
         $last   ne $userenv{'lastname'}   ||          $last   ne $userenv{'lastname'}   ||
         $gene   ne $userenv{'generation'} ||          $gene   ne $userenv{'generation'} ||
         $pid    ne $userenv{'id'} ) {          $pid    ne $userenv{'id'} ||
           $emailenc ne $userenv{'permanentemail'} ) {
 # Make the change(s)  # Make the change(s)
         my %changeHash;          my %changeHash;
         $changeHash{'firstname'}  = $first;          $changeHash{'firstname'}  = $first;
Line 614  sub execute_add { Line 622  sub execute_add {
         $changeHash{'lastname'}   = $last;          $changeHash{'lastname'}   = $last;
         $changeHash{'generation'} = $gene;          $changeHash{'generation'} = $gene;
         $changeHash{'id'} = $pid;          $changeHash{'id'} = $pid;
           $changeHash{'permanentemail'} = $emailenc;
         my $putresult = &Apache::lonnet::put('environment',\%changeHash,$dom,$uname);          my $putresult = &Apache::lonnet::put('environment',\%changeHash,$dom,$uname);
         if ($putresult eq 'ok') {          if ($putresult eq 'ok') {
             $$logmsg .= "User information updated for user: $uname prior to enrollment.".$linefeed;              $$logmsg .= "User information updated for user: $uname prior to enrollment.".$linefeed;

Removed from v.1.21  
changed lines
  Added in v.1.23


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