--- loncom/interface/Attic/londropadd.pm 2000/12/26 16:39:28 1.1 +++ loncom/interface/Attic/londropadd.pm 2000/12/27 17:58:45 1.3 @@ -14,7 +14,7 @@ # 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28, # 12/08,12/12 Gerd Kortemeyer) # -# 12/26 Gerd Kortemeyer +# 12/26, 12/27 Gerd Kortemeyer package Apache::londropadd; @@ -54,7 +54,267 @@ sub handler { action="/adm/dropadd" name="studentform">
+
+
+ENDUPFORM
+ }
+# ------------------------------------------------------------------- Phase two
+ if ($ENV{'form.phase'} eq 'two') {
+ if ($ENV{'form.fileupload'}) {
+ my $datatoken=Apache::lonnet::reply(
+ 'tmpput:'.Apache::lonnet::escape($ENV{'form.upfile'}),
+ $r->dir_config('lonHostID'));
+ my $separator='';
+ my $remove='';
+ if ($ENV{'form.upfiletype'} eq 'csv') {
+ $separator='\"\,\s*\"';
+ $remove='"';
+ } elsif ($ENV{'form.upfiletype'} eq 'space') {
+ $separator='\s+';
+ } elsif ($ENV{'form.upfiletype'} eq 'tab') {
+ $separator='\t+';
+ } elsif ($ENV{'form.upfiletype'} eq 'xml') {
+ }
+ my @lines=split(/\n/,$ENV{'form.upfile'});
+ my $total=$#lines+1;
+ $ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/;
+ my $krbdefdom=$1;
+ $krbdefdom=~tr/a-z/A-Z/;
+ $r->print(<
+
+Internally authenticated (with initial password
+)
+
+ENDPICK
+ } elsif ($ENV{'form.enroll'}) {
+ } elsif ($ENV{'form.drop'}) {
+ }
+ }
+# ----------------------------------------------------------------- Phase three
+ if ($ENV{'form.phase'} eq 'three') {
+ if ($ENV{'form.datatoken'}) {
+ my $separator='';
+ my $remove='';
+ if ($ENV{'form.upfiletype'} eq 'csv') {
+ $separator='\"\,\s*\"';
+ $remove='"';
+ } elsif ($ENV{'form.upfiletype'} eq 'space') {
+ $separator='\s+';
+ } elsif ($ENV{'form.upfiletype'} eq 'tab') {
+ $separator='\t+';
+ } elsif ($ENV{'form.upfiletype'} eq 'xml') {
+ }
+ map {
+ my $line=$_;
+ $line=~s/^$remove//;
+ $line=~s/$remove$//;
+ my @entries=split(/$separator/,$line);
+ $r->print($entries[8].'
+Identify fields
+Total number of students: $total
+
+
+ENDPICK
+ my @sone; my @stwo; my @sthree; my $nfields=0;
+ if ($#lines>=0) {
+ $lines[0]=~s/^$remove//;
+ $lines[0]=~s/$remove$//;
+ @sone=split(/$separator/,$lines[0]);
+ $nfields=$#sone;
+ if ($#lines>=1) {
+ $lines[1]=~s/^$remove//;
+ $lines[1]=~s/$remove$//;
+ @stwo=split(/$separator/,$lines[1]);
+ $nfields=$#stwo;
+ }
+ if ($#lines>=2) {
+ $lines[2]=~s/^$remove//;
+ $lines[2]=~s/$remove$//;
+ @sthree=split(/$separator/,$lines[2]);
+ $nfields=$#sthree;
+ }
+ my $i;
+ for ($i=0;$i<=$nfields;$i++) {
+ $r->print('Field Samples ');
+ }
+ }
+ $r->print(<');
+ if (defined($sone[$i])) {
+ $r->print($sone[$i]."\n");
+ }
+ if (defined($stwo[$i])) {
+ $r->print($stwo[$i]."\n");
+ }
+ if (defined($sthree[$i])) {
+ $r->print($sthree[$i]."\n");
+ }
+ $r->print(' Login Type
+
+Kerberos authenticated with domain
+
');
+ } split(/\n/,
+ &Apache::lonnet::unescape(Apache::lonnet::reply(
+ 'tmpget:'.$ENV{'form.datatoken'},$r->dir_config('lonHostID')))
+ );
+
+ }
+ }
+# ------------------------------------------------------------------------- End
$r->print('