File:  [LON-CAPA] / loncom / publisher / lonupload.pm
Revision 1.53.2.1: download - view: text, annotated - select for diffs
Mon Nov 7 13:38:45 2011 UTC (12 years, 5 months ago) by raeburn
Branches: version_2_10_X
CVS tags: version_2_10_1, loncapaMITrelate_1
Diff to branchpoint 1.53: preferred, unified
- Fix Construction breadcrumb trails for /adm/cfile, /adm/publish,
  /adm/retrieve, /adm/upload.

    1: 
    2: # The LearningOnline Network with CAPA
    3: # Handler to upload files into construction space
    4: #
    5: # $Id: lonupload.pm,v 1.53.2.1 2011/11/07 13:38:45 raeburn Exp $
    6: #
    7: # Copyright Michigan State University Board of Trustees
    8: #
    9: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
   10: #
   11: # LON-CAPA is free software; you can redistribute it and/or modify
   12: # it under the terms of the GNU General Public License as published by
   13: # the Free Software Foundation; either version 2 of the License, or
   14: # (at your option) any later version.
   15: #
   16: # LON-CAPA is distributed in the hope that it will be useful,
   17: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   18: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   19: # GNU General Public License for more details.
   20: #
   21: # You should have received a copy of the GNU General Public License
   22: # along with LON-CAPA; if not, write to the Free Software
   23: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   24: #
   25: # /home/httpd/html/adm/gpl.txt
   26: #
   27: # http://www.lon-capa.org/
   28: #
   29: ###
   30: 
   31: =head1 NAME
   32: 
   33: Apache::lonupload - upload files into construction space
   34: 
   35: =head1 SYNOPSIS
   36: 
   37: Invoked by /etc/httpd/conf/srm.conf:
   38: 
   39:  <Location /adm/upload>
   40:  PerlAccessHandler       Apache::lonacc
   41:  SetHandler perl-script
   42:  PerlHandler Apache::lonupload
   43:  ErrorDocument     403 /adm/login
   44:  ErrorDocument     404 /adm/notfound.html
   45:  ErrorDocument     406 /adm/unauthorized.html
   46:  ErrorDocument	  500 /adm/errorhandler
   47:  </Location>
   48: 
   49: =head1 INTRODUCTION
   50: 
   51: This module uploads a file sitting on a client computer into 
   52: library server construction space.
   53: 
   54: This is part of the LearningOnline Network with CAPA project
   55: described at http://www.lon-capa.org.
   56: 
   57: =head1 HANDLER SUBROUTINE
   58: 
   59: This routine is called by Apache and mod_perl.
   60: 
   61: =over 4
   62: 
   63: =item *
   64: 
   65: Initialize variables
   66: 
   67: =item *
   68: 
   69: Start page output
   70: 
   71: =item *
   72: 
   73: output relevant interface phase (phaseone, phasetwo, phasethree or phasefour)
   74: 
   75: =item *
   76: 
   77: (phase one is to specify upload file; phase two is to handle conditions
   78: subsequent to specification--like overwriting an existing file; phase three
   79: is to handle processing of secondary uploads - of embedded objects in an
   80: html file).
   81: 
   82: =back
   83: 
   84: =head1 OTHER SUBROUTINES
   85: 
   86: =over
   87: 
   88: =item phaseone()
   89: 
   90: Interface for specifying file to upload.
   91: 
   92: =item phasetwo()
   93: 
   94: Interface for handling post-conditions about uploading (such
   95: as overwriting an existing file).
   96: 
   97: =item phasethree()
   98: 
   99: Interface for handling secondary uploads of embedded objects
  100: in an html file.
  101: 
  102: =item phasefour()
  103: 
  104: Interface for handling optional renaming of links to embedded
  105: objects. 
  106: 
  107: =item upfile_store()
  108: 
  109: Store contents of uploaded file into temporary space.  Invoked
  110: by phaseone subroutine.
  111: 
  112: =item check_extension()
  113: 
  114: Checks if filename extension is permitted and checks type
  115:  of file - if html file, calls parser to check for embedded objects.
  116:  Invoked by phasetwo subroutine.
  117: 
  118: =back
  119: 
  120: =cut
  121: 
  122: package Apache::lonupload;
  123: 
  124: use strict;
  125: use Apache::File;
  126: use File::Copy;
  127: use File::Basename;
  128: use Apache::Constants qw(:common :http :methods);
  129: use Apache::loncacc;
  130: use Apache::loncommon();
  131: use Apache::lonnet;
  132: use HTML::Entities();
  133: use Apache::lonlocal;
  134: use Apache::lonnet;
  135: use LONCAPA();
  136: 
  137: my $DEBUG=0;
  138: 
  139: sub Debug {
  140:     # Put out the indicated message but only if DEBUG is true.
  141:     if ($DEBUG) {
  142: 	my ($r,$message) = @_;
  143: 	$r->log_reason($message);
  144:     }
  145: }
  146: 
  147: sub upfile_store {
  148:     my $r=shift;
  149: 	
  150:     my $fname=$env{'form.upfile.filename'};
  151:     $fname=~s/\W//g;
  152:     
  153:     chomp($env{'form.upfile'});
  154:   
  155:     my $datatoken=$env{'user.name'}.'_'.$env{'user.domain'}.
  156: 		  '_upload_'.$fname.'_'.time.'_'.$$;
  157:     {
  158:        my $fh=Apache::File->new('>'.$r->dir_config('lonDaemons').
  159:                                    '/tmp/'.$datatoken.'.tmp');
  160:        print $fh $env{'form.upfile'};
  161:     }
  162:     return $datatoken;
  163: }
  164: 
  165: sub phaseone {
  166:     my ($r,$fn,$uname,$udom,$mode)=@_;
  167:     my $action = '/adm/upload';
  168:     if ($mode eq 'testbank') {
  169:         $action = '/adm/testbank';
  170:     } elsif ($mode eq 'imsimport') {
  171:         $action = '/adm/imsimport';
  172:     }
  173: 
  174:     # Check for file to be uploaded
  175:     $env{'form.upfile.filename'}=~s/\\/\//g;
  176:     $env{'form.upfile.filename'}=~s/^.*\/([^\/]+)$/$1/;
  177:     if (!$env{'form.upfile.filename'}) {
  178:         $r->print('<p class="LC_warning">'.&mt('No upload file specified.').'</p>');
  179:         return;
  180:     }
  181: 
  182:     $fn=~s/\/[^\/]+$//;
  183:     $fn=~s/([^\/])$/$1\//;
  184:     $fn.=$env{'form.upfile.filename'};
  185:     $fn=~s/^\///;
  186:     $fn=~s/(\/)+/\//g;
  187:     #    Fn is the full path to the destination filename.
  188: 
  189:     # Check for illegal filename
  190:     &Debug($r, "Filename for upload: $fn");
  191:     if (!(($fn) && ($fn!~/\/$/))) {
  192:         $r->print('<p class="LC_warning">'.&mt('Illegal filename.').'</p>');
  193:         return;
  194:     }
  195: 
  196:     # Display additional options for upload
  197:     # and upload button
  198:     $r->print(
  199:         '<form action="'.$action.'" method="post" name="fileupload">'
  200:        .'<input type="hidden" name="phase" value="two" />'
  201:        .'<input type="hidden" name="datatoken" value="'.&upfile_store.'" />'
  202:        .'<input type="hidden" name="uploaduname" value="'.$uname.'" />'
  203:     );
  204:     $r->print(
  205:         &Apache::lonhtmlcommon::start_pick_box()
  206:        .&Apache::lonhtmlcommon::row_title(&mt('Save uploaded file as'))
  207:        .'<span class="LC_filename">/priv/'.$uname.'/</span>'
  208:        .'<input type="text" size="50" name="filename" value="'.$fn.'" />'
  209:        .&Apache::lonhtmlcommon::row_closure()
  210:        .&Apache::lonhtmlcommon::row_title(&mt('File Type'))
  211:        .'<select name="filetype">'
  212:        .'<option value="standard" selected="selected">'.&mt('Regular file').'</option>'
  213:        .'<option value="testbank">'.&mt('Testbank file').'</option>'
  214:        .'<option value="imsimport">'.&mt('IMS package').'</option>'
  215:        .'</select>'.&Apache::loncommon::help_open_topic("Uploading_File_Options")
  216:        .&Apache::lonhtmlcommon::row_closure(1)
  217:        .&Apache::lonhtmlcommon::end_pick_box()
  218:     );
  219:     $r->print(
  220:         '<p>'
  221:        .'<input type="button" value="'.&mt('Upload').'" onclick="javascript:verifyForm()"/>'
  222:        .'</p>'
  223:        .'</form>'
  224:     );
  225: 
  226:    # Check for bad extension and warn user
  227:     if ($fn=~/\.(\w+)$/ && 
  228:         (&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
  229:                 $r->print('<p class="LC_error">'
  230:                           .&mt('The extension on this file, [_1], is reserved internally by LON-CAPA.',
  231:                                '<span class="LC_filename">'.$1.'</span>')
  232:                           .' <br />'.&mt('Please change the extension.')
  233:                           .'</p>');
  234:     } elsif($fn=~/\.(\w+)$/ && 
  235:                     !defined(&Apache::loncommon::fileembstyle($1))) {
  236:                 $r->print('<p class="LC_error">'
  237:                          .&mt('The extension on this file, [_1], is not recognized by LON-CAPA.',
  238:                               '<span class="LC_filename">'.$1.'</span>')
  239:                          .' <br />'.&mt('Please change the extension.')
  240:                          .'</p>');
  241:     }
  242: }
  243: 
  244: sub phasetwo {
  245:     my ($r,$tfn,$uname,$udom,$mode)=@_;
  246:     my $output;
  247:     my $action = '/adm/upload';
  248:     my $returnflag = '';
  249:     if ($mode eq 'testbank') {
  250:         $action = '/adm/testbank';
  251:     } elsif ($mode eq 'imsimport') {
  252:         $action = '/adm/imsimport';
  253:     }
  254:     my $fn='/priv/'.$uname.'/'.$tfn;
  255:     $fn=~s/\/+/\//g;
  256:     &Debug($r, "Filename is ".$tfn);
  257:     if ($tfn) {
  258: 	&Debug($r, "Filename for tfn = ".$tfn);
  259: 	my $target='/home/'.$uname.'/public_html'.$tfn;
  260: 	&Debug($r, "target -> ".$target);
  261: #     target is the full filesystem path of the destination file.
  262: 	my $base = &File::Basename::basename($fn);
  263: 	my $path = &File::Basename::dirname($fn);
  264: 	$base    = &HTML::Entities::encode($base,'<>&"');
  265: 	my $url  = $path."/".$base; 
  266: 	&Debug($r, "URL is now ".$url);
  267: 	my $datatoken=$env{'form.datatoken'};
  268: 	if (($fn) && ($datatoken)) {
  269:             if ($env{'form.cancel'}) {
  270:                 my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp';
  271:                 my $dirpath=$path.'/';
  272:                 $dirpath=~s/\/+/\//g;
  273:                 $output .= '<p class="LC_warning">'.&mt('Upload cancelled.').'</p>'
  274:                           .'<p><a href="'.$dirpath.'">'.
  275:                           &mt('Back to Directory').'</a></p>';
  276:             } elsif ((-e $target) && (!$env{'form.override'})) {
  277:                 $output .= '<form action="'.$action.'" method="post">'
  278:                           .'<p class="LC_warning">'
  279:                           .&mt('File [_1] already exists.',
  280:                                '<span class="LC_filename">'.$fn.'</span>')
  281:                          .'<input type="hidden" name="phase" value="two" />'
  282:                          .'<input type="hidden" name="filename" value="'.$url.'" />'
  283:                          .'<input type="hidden" name="datatoken" value="'.$datatoken.'" />'
  284:                          .'<p>'
  285:                          .'<input type="submit" name="cancel" value="'.&mt('Cancel').'" />'
  286:                          .' <input type="submit" name="override" value="'.&mt('Overwrite').'" />'
  287:                          .'</p>'
  288:                          .'</form>';
  289:             } else {
  290: 		my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp';
  291: 		my $dirpath=$path.'/';
  292: 		$dirpath=~s/\/+/\//g;
  293: 		# Check for bad extension and disallow upload
  294:                 my $result;
  295:                 ($result,$returnflag) = &check_extension($fn,$mode,$source,$target,$action,$dirpath,$url);
  296:                 $output .= $result;
  297: 	    }
  298: 	} else {
  299: 	    $output .= '<span class="LC_error">'.
  300: 		      &mt('Please use browser "Back" button and pick a filename').
  301: 		      '</span><br />';
  302: 	}
  303:     } else {
  304: 	$output .= '<span class="LC_error">'.
  305: 		   &mt('Please use browser "Back" button and pick a filename').
  306: 		   '</span><br />';
  307:     }
  308:     return ($output,$returnflag);
  309: }
  310: 
  311: sub check_extension {
  312:     my ($fn,$mode,$source,$target,$action,$dirpath,$url) = @_;
  313:     my ($result,$returnflag);
  314:     # Check for bad extension and disallow upload
  315:     if ($fn=~/\.(\w+)$/ &&
  316:         (&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
  317:         $result .= '<p class="LC_warning">'.
  318:                    &mt('File [_1] could not be copied.',
  319:                        '<span class="LC_filename">'.$fn.'</span> ').
  320:                    '<br />'.
  321:                    &mt('The extension on this file is reserved internally by LON-CAPA.').
  322:                    '</p>';
  323:     } elsif ($fn=~/\.(\w+)$/ &&
  324:              !defined(&Apache::loncommon::fileembstyle($1))) {
  325:         $result .= '<p class="LC_warning">'.
  326:                    &mt('File [_1] could not be copied.',
  327:                        '<span class="LC_filename">'.$fn.'</span> ').
  328:                    '<br />'.
  329:                    &mt('The extension on this file is not recognized by LON-CAPA.').
  330:                    '</p>';
  331:     } elsif (-d $target) {
  332:         $result .= '<p class="LC_warning">'.
  333:                    &mt('File [_1] could not be copied.',
  334:                        '<span class="LC_filename">'.$fn.'</span>').
  335:                    '<br />'.
  336:                    &mt('The target is an existing directory.').
  337:                    '</p>';
  338:     } elsif (copy($source,$target)) {
  339:         chmod(0660, $target); # Set permissions to rw-rw---.
  340:         if ($mode eq 'testbank' || $mode eq 'imsimport') {
  341:             $returnflag = 'ok';
  342:             $result .= '<p class="LC_success">'
  343:                       .&mt('Your file - [_1] - was uploaded successfully.',
  344:                            '<span class="LC_filename">'.$fn.'<span>')
  345:                       .'</p>';
  346:         } else {
  347:             $result .= '<p class="LC_success">'
  348:                       .&mt('File copied.')  
  349:                       .'</p>';
  350:         }
  351:         # Check for embedded objects.
  352:         my (%allfiles,%codebase);
  353:         my ($text,$header,$css,$js);
  354:         if (($mode ne 'imsimport') && ($target =~ /\.(htm|html|shtml)$/i)) {
  355:             my (%allfiles,%codebase);
  356:             &Apache::lonnet::extract_embedded_items($target,\%allfiles,\%codebase);
  357:             if (keys(%allfiles) > 0) {
  358:                 my ($currentpath) = ($url =~ m{^(.+)/[^/]+$});
  359:                 my $state = &embedded_form_elems('upload_embedded',$url,$mode);
  360:                 my ($embedded,$num,$pathchg) = 
  361:                     &Apache::loncommon::ask_for_embedded_content($action,$state,\%allfiles,
  362:                                                                  \%codebase,
  363:                                                                  {'error_on_invalid_names'   => 1,
  364:                                                                   'ignore_remote_references' => 1,
  365:                                                                   'current_path'             => $currentpath});
  366:                 if ($embedded) {
  367:                     $result .= '<h3>'.&mt('Reference Warning').'</h3>';
  368:                     if ($num) {
  369:                         $result .= '<p>'.&mt('Completed upload of the file.').' '.&mt('This file contained references to other files.').'</p>'.
  370:                                    '<p>'.&mt('Please select the locations from which the referenced files are to be uploaded.').'</p>'.
  371:                                    $embedded;
  372:                         if ($mode eq 'testbank') {
  373:                             $returnflag = 'embedded';
  374:                             $result .=  '<p>'.&mt('Or [_1]continue[_2] the testbank import without these files.','<a href="javascript:document.testbankForm.submit();">','</a>').'</p>';
  375:                         }
  376:                     } else {
  377:                         $result .= '<p>'.&mt('Completed upload of the file.').'</p>'.$embedded;
  378:                         if ($pathchg) {
  379:                             if ($mode eq 'testbank') {
  380:                                 $returnflag = 'embedded';
  381:                                 $result .=  '<p>'.&mt('Or [_1]continue[_2] the testbank import without modifying the references(s).','<a href="javascript:document.testbankForm.submit();">','</a>').'</p>';
  382:                             }
  383:                         }
  384:                     }
  385:                 }
  386:             }
  387:         }
  388:         if (($mode ne 'imsimport') && ($mode ne 'testbank')) {
  389:             $result .= '<br /><a href="'.$url.'">'.
  390:                         &mt('View file').'</a>';
  391:         }
  392:     } else {
  393:         $result .= &mt('Failed to copy: [_1].',$!);
  394:     }
  395:     if ($mode ne 'imsimport' && $mode ne 'testbank') {
  396:         $result .= '<br /><a href="'.$dirpath.'">'.
  397:                    &mt('Back to Directory').'</a><br />';
  398:     }
  399:     return ($result,$returnflag);
  400: }
  401: 
  402: sub phasethree {
  403:     my ($r,$fn,$uname,$udom,$mode) = @_;
  404:     my $action = '/adm/upload'; 
  405:     if ($mode eq 'testbank') {
  406:         $action = '/adm/testbank';
  407:     } elsif ($mode eq 'imsimport') {
  408:         $action = '/adm/imsimport';
  409:     }
  410:     my $dir_root = '/home/'.$uname.'/public_html';
  411:     my $url_root = '/priv/'.$uname;
  412:     my $path = &File::Basename::dirname($fn);
  413:     my $filename = &HTML::Entities::encode($env{'form.filename'},'<>&"');
  414:     my $state = &embedded_form_elems('modify_orightml',$filename,$mode).
  415:                 '<input type="hidden" name="phase" value="four" />';
  416:     my ($result,$returnflag) = 
  417:         &Apache::loncommon::upload_embedded($mode,$path,$uname,$udom,
  418:                                             $dir_root,$url_root,undef,
  419:                                             undef,undef,$state,$action);
  420:     if ($mode ne 'imsimport' && $mode ne 'testbank') {
  421:         $result .= '<br /><h3><a href="'.$url_root.$fn.'">'.
  422:                   &mt('View main file').'</a></h3>'.
  423:                   '<h3><a href="'.$url_root.$path.'">'.
  424:                   &mt('Back to Directory').'</a></h3><br />';
  425:     }
  426:     return ($result,$returnflag);
  427: }
  428: 
  429: sub embedded_form_elems {
  430:     my ($action,$filename,$mode) = @_;
  431:     return <<STATE;
  432:     <input type="hidden" name="action" value="$action" />
  433:     <input type="hidden" name="mode" value="$mode" />
  434:     <input type="hidden" name="filename" value="$filename" />
  435: STATE
  436: }
  437: 
  438: sub phasefour {
  439:     my ($r,$fn,$uname,$udom,$mode) = @_;
  440:     my $action = '/adm/upload';
  441:     if ($mode eq 'testbank') {
  442:         $action = '/adm/testbank';
  443:     } elsif ($mode eq 'imsimport') {
  444:         $action = '/adm/imsimport';
  445:     }
  446:     my $result;
  447:     my $dir_root = '/home/'.$uname.'/public_html';
  448:     my $url_root = '/priv/'.$uname;
  449:     my $path = &File::Basename::dirname($fn);
  450:     $result .= &Apache::loncommon::modify_html_refs($mode,$path,
  451:                               $uname,$udom,$dir_root);
  452:     if ($mode ne 'imsimport' && $mode ne 'testbank') {
  453:         $result .= '<br /><h3><a href="'.$url_root.$fn.'">'.
  454:                   &mt('View main file').'</a></h3>'.
  455:                   '<h3><a href="'.$url_root.$path.'">'.
  456:                   &mt('Back to Directory').'</a></h3><br />';
  457:     }
  458:     return $result;
  459: }
  460: 
  461: # ---------------------------------------------------------------- Main Handler
  462: sub handler {
  463: 
  464:     my $r=shift;
  465: 
  466:     my $uname;
  467:     my $udom;
  468:     my $javascript = '';
  469: #
  470: # phase two: re-attach user
  471: #
  472:     if ($env{'form.uploaduname'}) {
  473: 	$env{'form.filename'}='/priv/'.$env{'form.uploaduname'}.'/'.
  474: 	    $env{'form.filename'};
  475:     }
  476: 
  477:     unless ($env{'form.phase'} eq 'two') {
  478:         $javascript = qq|
  479: function verifyForm() {
  480:     var mode = document.fileupload.filetype.options[document.fileupload.filetype.selectedIndex].value
  481:     if (mode == "testbank") {
  482:         document.fileupload.action = "/adm/testbank";
  483:     }
  484:     if (mode == "imsimport") {
  485:         document.fileupload.action = "/adm/imsimport";
  486:     }
  487:     if (mode == "standard") {
  488:         document.fileupload.action = "/adm/upload";
  489:     }
  490:     document.fileupload.submit();
  491: }
  492: 	|;
  493:     }
  494:     ($uname,$udom)=
  495: 	&Apache::loncacc::constructaccess($env{'form.filename'},
  496: 					  $r->dir_config('lonDefDomain'));
  497: 
  498:     unless (($uname) && ($udom)) {
  499: 	$r->log_reason($uname.' at '.$udom.
  500: 		       ' trying to publish file '.$env{'form.filename'}.
  501: 		       ' - not authorized', 
  502: 		       $r->filename); 
  503: 	return HTTP_NOT_ACCEPTABLE;
  504:     }
  505:     
  506:     my ($fn,$trailfile);
  507:     if ($env{'form.filename'}) {
  508: 	$fn=$env{'form.filename'};
  509: 	$fn=~s/^https?\:\/\/[^\/]+\///;
  510: 	$fn=~s/^\///;
  511: 	$fn=~s{(~|priv/)($LONCAPA::username_re)}{};
  512: 	$fn=~s/\/+/\//g;
  513:         $trailfile = "/home/$uname/public_html/".$trailfile;
  514:         $trailfile=~s{//+}{/}g;
  515:     } else {
  516: 	$r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
  517: 		       ' unspecified filename for upload', $r->filename); 
  518: 	return HTTP_NOT_FOUND;
  519:     }
  520: 
  521: # ----------------------------------------------------------- Start page output
  522: 
  523: 
  524:     &Apache::loncommon::content_type($r,'text/html');
  525:     $r->send_http_header;
  526: 
  527:    $javascript = "<script type=\"text/javascript\">\n//<!--\n".
  528: 	$javascript."\n// --></script>\n";
  529: 
  530:     # Breadcrumbs
  531:     my $brcrum = [{'href' => &Apache::loncommon::authorspace(),
  532:                    'text' => 'Construction Space'},
  533:                   {'href' => '/adm/upload',
  534:                    'text' => 'Upload file to Construction Space'}];
  535:     $r->print(&Apache::loncommon::start_page('Upload file to Construction Space',
  536:                                              $javascript,
  537:                                              {'bread_crumbs' => $brcrum,})
  538:              .&Apache::loncommon::head_subbox(
  539:                 &Apache::loncommon::CSTR_pageheader($trailfile))
  540:     );
  541:   
  542:     if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
  543:         $r->print('<p class="LC_info">'
  544:                  .&mt('Co-Author [_1]',$uname.':'.$udom)
  545:                  .'</p>'
  546:         );
  547:     }
  548:     if ($env{'form.phase'} eq 'four') {
  549:         my $output = &phasefour($r,$fn,$uname,$udom,'author');
  550:         $r->print($output);
  551:     } elsif ($env{'form.phase'} eq 'three') {
  552:         my ($output,$rtnflag) = &phasethree($r,$fn,$uname,$udom,'author');
  553:         $r->print($output);
  554:     } elsif ($env{'form.phase'} eq 'two') {
  555: 	my ($output,$returnflag) = &phasetwo($r,$fn,$uname,$udom);
  556:         $r->print($output);
  557:     } else {
  558: 	&phaseone($r,$fn,$uname,$udom);
  559:     }
  560: 
  561:     $r->print(&Apache::loncommon::end_page());
  562:     return OK;  
  563: }
  564: 
  565: 1;
  566: __END__
  567: 
  568: 

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