Diff for /loncom/interface/Attic/londropadd.pm between versions 1.4 and 1.5

version 1.4, 2000/12/27 21:57:10 version 1.5, 2000/12/28 16:32:10
Line 14 Line 14
 # 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28,  # 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28,
 # 12/08,12/12 Gerd Kortemeyer)  # 12/08,12/12 Gerd Kortemeyer)
 #  #
 # 12/26, 12/27 Gerd Kortemeyer  # 12/26,12/27,12/28 Gerd Kortemeyer
   
 package Apache::londropadd;  package Apache::londropadd;
   
Line 330  Kerberos authenticated with domain Line 330  Kerberos authenticated with domain
 <input type=text size=10 name=krbdom onChange="setkrb(this.form);"><p>  <input type=text size=10 name=krbdom onChange="setkrb(this.form);"><p>
 <input type=radio name=login value=int onClick="clickint(this.form);">   <input type=radio name=login value=int onClick="clickint(this.form);"> 
 Internally authenticated (with initial password   Internally authenticated (with initial password 
 <input type=text size=10 name=intpwd onChange="setint(this.form);">)<p>  <input type=text size=10 name=intpwd onChange="setint(this.form);">)
   <h3>LON-CAPA Domain for Students</h3>
 LON-CAPA domain: <input type=text size=10 value=$defdom name=lcdomain><p>  LON-CAPA domain: <input type=text size=10 value=$defdom name=lcdomain><p>
   <h3>Starting and Ending Dates</h3>
 <input type="hidden" value='' name="pres_value">  <input type="hidden" value='' name="pres_value">
 <input type="hidden" value='' name="pres_type">  <input type="hidden" value='' name="pres_type">
 <input type="hidden" value='' name="pres_marker">  <input type="hidden" value='' name="pres_marker">
Line 345  LON-CAPA domain: <input type=text size=1 Line 346  LON-CAPA domain: <input type=text size=1
 <a   <a 
  href="javascript:pjump('date_end','Enrollment Ending Date',document.studentform.enddate.value,'end','studentform.pres','dateset');"   href="javascript:pjump('date_end','Enrollment Ending Date',document.studentform.enddate.value,'end','studentform.pres','dateset');"
 >Set Ending Date</a><p>  >Set Ending Date</a><p>
   <h3>Full Update</h3>
   <input type=checkbox name=fullup value=yes> Full update 
   (also dropping students)<p>
 <input type=button onClick="verify(this.form)" value="Submit Selection">  <input type=button onClick="verify(this.form)" value="Submit Selection">
 ENDPICK  ENDPICK
          } elsif ($ENV{'form.enroll'}) {           } elsif ($ENV{'form.enroll'}) {
Line 374  ENDPICK Line 377  ENDPICK
              my $enddate=$ENV{'form.enddate'};               my $enddate=$ENV{'form.enddate'};
              if ($startdate=~/\D/) { $startdate=''; }               if ($startdate=~/\D/) { $startdate=''; }
              if ($enddate=~/\D/) { $enddate=''; }               if ($enddate=~/\D/) { $enddate=''; }
              my $count=1;               my $domain=$ENV{'form.lcdomain'};
              my @studentdata=();               my $amode='';
                my $genpwd='';
                if ($ENV{'form.login'} eq 'krb') {
                    $amode='krb4';
                    $genpwd=$ENV{'form.krbdom'};
                } elsif ($ENV{'form.login'} eq 'int') {
                    $amode='internal';
                    if ((defined($ENV{'form.intpwd'})) && ($ENV{'form.intpwd'})) {
        $genpwd=$ENV{'form.intpwd'};
                    }
                }
                unless (($domain=~/\W/) || ($amode eq '')) {
                 $r->print('<h3>Enrolling Students</h3>');
                 my $count=1;
   # ----------------------------------------------------------- Get new classlist
                 my @studentdata=();
              {               {
                 my $fh;                  my $fh;
                 if ($fh=Apache::File->new($r->dir_config('lonDaemons').                  if ($fh=Apache::File->new($r->dir_config('lonDaemons').
Line 383  ENDPICK Line 401  ENDPICK
     @studentdata=<$fh>;      @studentdata=<$fh>;
                 }                  }
      }       }
   # --------------------------------------------------------- Enroll new students
       map {        map {
                 my $line=$_;                  my $line=$_;
                 chomp($line);                  chomp($line);
Line 413  ENDPICK Line 432  ENDPICK
                      $r->print('<p><b>Unacceptable username: '.                       $r->print('<p><b>Unacceptable username: '.
                               $entries[$fields{'username'}].' for user '.                                $entries[$fields{'username'}].' for user '.
                               $fname.' '.$mname.' '.$lname.' '.$gen.'</b><p>');                                $fname.' '.$mname.' '.$lname.' '.$gen.'</b><p>');
   } else {       } else {
 $r->print($count.': '.$fname.' - '.$mname.' - '.$lname.' - '.$gen.'<br>'); $count++;                        my $sec='';
                         my $username=$entries[$fields{'username'}];
                         if (defined($fields{'sec'})) {
                            if (defined($entries[$fields{'sec'}])) {
        $sec=$entries[$fields{'sec'}];
                            }
                         }
                         my $id='';
                         if (defined($fields{'id'})) {
                            if (defined($entries[$fields{'id'}])) {
        $id=$entries[$fields{'id'}];
                            }
                            $id=~tr/A-Z/a-z/;
                         }
                         my $password='';
                         if ($genpwd) { 
                            $password=$genpwd; 
         } else {
                            if (defined($fields{'ipwd'})) {
        if ($entries[$fields{'ipwd'}]) {
    $password=$entries[$fields{'ipwd'}];
                                }
                            }
                         }
                         if ($password) { 
                            my $reply=&Apache::lonnet::modifystudent(
                             $domain,$username,$id,$amode,$password,
      $fname,$mname,$lname,$gen,$sec,$enddate,$startdate);
                            unless ($reply eq 'ok') {
                               $r->print(
                                "<p><b>Error enrolling $username: $reply</b><p>");
    }
                        } else {
                               $r->print(
                                "<p><b>No password for $username</b><p>");
                        }
                   }                    }
                  }                                    }                 
               } @studentdata;                } @studentdata;
   # --------------------------------------------------------------- Drop students
                 if ($ENV{'form.fullup'} eq 'yes') {
    $r->print('<h3>Dropping Students</h3>');
   # ------------------------------------------------------- Get current classlist
                    my $cid=$ENV{'request.course.id'};
                    my $classlst=&Apache::lonnet::reply
                    ('dump:'.$ENV{'course.'.$cid.'.domain'}.':'.
                     $ENV{'course.'.$cid.'.num'}.':classlist',
                     $ENV{'course.'.$cid.'.home'});
                    my %currentlist=();
                    my $now=time;
                    unless ($classlst=~/^error\:/) {
            } else {
                        $r->print(
                     '<font color=red><h3>Could not access classlist: '.$classlst.
                     '</h3></font>');
                    }
        }
   # ------------------------------------------------------------------------ Done
           }            }
           }
       }        }
 # ------------------------------------------------------------------------- End  # ------------------------------------------------------------------------- End
       $r->print('</form></body></html>');        $r->print('</form></body></html>');

Removed from v.1.4  
changed lines
  Added in v.1.5


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