Annotation of loncom/publisher/lonupload.pm, revision 1.50

1.12      foxr        1: 
1.1       www         2: # The LearningOnline Network with CAPA
                      3: # Handler to upload files into construction space
                      4: #
1.50    ! raeburn     5: # $Id: lonupload.pm,v 1.49 2010/02/16 10:26:17 bisitz Exp $
1.8       matthew     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: #
1.10      harris41   29: ###
1.1       www        30: 
1.39      jms        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 or phasetwo or phasethree)
                     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: 
1.40      jms        86: =over
1.39      jms        87: 
1.40      jms        88: =item phaseone()
1.39      jms        89: 
1.40      jms        90: Interface for specifying file to upload.
1.39      jms        91: 
1.40      jms        92: =item phasetwo()
1.39      jms        93: 
1.40      jms        94: Interface for handling post-conditions about uploading (such
1.39      jms        95: as overwriting an existing file).
                     96: 
1.40      jms        97: =item phasethree()
1.39      jms        98: 
1.40      jms        99: Interface for handling secondary uploads of embedded objects
1.39      jms       100: in an html file.
                    101: 
1.40      jms       102: =item upfile_store()
1.39      jms       103: 
1.40      jms       104: Store contents of uploaded file into temporary space.  Invoked
1.39      jms       105: by phaseone subroutine.
                    106: 
1.40      jms       107: =item check_extension()
1.39      jms       108: 
1.40      jms       109: Checks if filename extension is permitted and checks type
1.39      jms       110:  of file - if html file, calls parser to check for embedded objects.
                    111:  Invoked by phasetwo subroutine.
                    112: 
                    113: =back
                    114: 
                    115: =cut
                    116: 
1.1       www       117: package Apache::lonupload;
                    118: 
                    119: use strict;
                    120: use Apache::File;
                    121: use File::Copy;
1.13      foxr      122: use File::Basename;
1.1       www       123: use Apache::Constants qw(:common :http :methods);
1.3       www       124: use Apache::loncacc;
1.10      harris41  125: use Apache::loncommon();
1.13      foxr      126: use Apache::lonnet;
1.14      foxr      127: use HTML::Entities();
1.20      www       128: use Apache::lonlocal;
1.29      albertel  129: use Apache::lonnet;
1.34      albertel  130: use LONCAPA();
1.12      foxr      131: 
                    132: my $DEBUG=0;
                    133: 
                    134: sub Debug {
1.30      albertel  135:     # Put out the indicated message but only if DEBUG is true.
1.22      albertel  136:     if ($DEBUG) {
1.30      albertel  137: 	my ($r,$message) = @_;
                    138: 	$r->log_reason($message);
1.22      albertel  139:     }
1.12      foxr      140: }
1.1       www       141: 
1.2       www       142: sub upfile_store {
                    143:     my $r=shift;
                    144: 	
1.29      albertel  145:     my $fname=$env{'form.upfile.filename'};
1.2       www       146:     $fname=~s/\W//g;
                    147:     
1.29      albertel  148:     chomp($env{'form.upfile'});
1.1       www       149:   
1.29      albertel  150:     my $datatoken=$env{'user.name'}.'_'.$env{'user.domain'}.
1.2       www       151: 		  '_upload_'.$fname.'_'.time.'_'.$$;
                    152:     {
                    153:        my $fh=Apache::File->new('>'.$r->dir_config('lonDaemons').
                    154:                                    '/tmp/'.$datatoken.'.tmp');
1.29      albertel  155:        print $fh $env{'form.upfile'};
1.1       www       156:     }
1.2       www       157:     return $datatoken;
                    158: }
                    159: 
                    160: sub phaseone {
1.25      raeburn   161:     my ($r,$fn,$uname,$udom,$mode)=@_;
                    162:     my $action = '/adm/upload';
                    163:     if ($mode eq 'testbank') {
                    164:         $action = '/adm/testbank';
                    165:     } elsif ($mode eq 'imsimport') {
                    166:         $action = '/adm/imsimport';
                    167:     }
1.49      bisitz    168: 
                    169:     # Check for file to be uploaded
1.29      albertel  170:     $env{'form.upfile.filename'}=~s/\\/\//g;
                    171:     $env{'form.upfile.filename'}=~s/^.*\/([^\/]+)$/$1/;
1.49      bisitz    172:     if (!$env{'form.upfile.filename'}) {
                    173:         $r->print('<p class="LC_warning">'.&mt('No upload file specified.').'</p>');
                    174:         return;
                    175:     }
                    176: 
                    177:     $fn=~s/\/[^\/]+$//;
                    178:     $fn=~s/([^\/])$/$1\//;
                    179:     $fn.=$env{'form.upfile.filename'};
                    180:     $fn=~s/^\///;
                    181:     $fn=~s/(\/)+/\//g;
                    182:     #    Fn is the full path to the destination filename.
                    183: 
                    184:     # Check for illegal filename
                    185:     &Debug($r, "Filename for upload: $fn");
                    186:     if (!(($fn) && ($fn!~/\/$/))) {
                    187:         $r->print('<p class="LC_warning">'.&mt('Illegal filename.').'</p>');
                    188:         return;
                    189:     }
                    190: 
                    191:     # Display additional options for upload
                    192:     # and upload button
                    193:     $r->print(
                    194:         '<form action="'.$action.'" method="post" name="fileupload">'
                    195:        .'<input type="hidden" name="phase" value="two" />'
                    196:        .'<input type="hidden" name="datatoken" value="'.&upfile_store.'" />'
                    197:        .'<input type="hidden" name="uploaduname" value="'.$uname.'" />'
                    198:     );
                    199:     $r->print(
                    200:         &Apache::lonhtmlcommon::start_pick_box()
                    201:        .&Apache::lonhtmlcommon::row_title(&mt('Save uploaded file as'))
                    202:        .'<span class="LC_filename">/priv/'.$uname.'/</span>'
                    203:        .'<input type="text" size="50" name="filename" value="'.$fn.'" />'
                    204:        .&Apache::lonhtmlcommon::row_closure()
                    205:        .&Apache::lonhtmlcommon::row_title(&mt('File Type'))
                    206:        .'<select name="filetype">'
                    207:        .'<option value="standard" selected="selected">'.&mt('Regular file').'</option>'
                    208:        .'<option value="testbank">'.&mt('Testbank file').'</option>'
                    209:        .'<option value="imsimport">'.&mt('IMS package').'</option>'
                    210:        .'</select>'.&Apache::loncommon::help_open_topic("Uploading_File_Options")
                    211:        .&Apache::lonhtmlcommon::row_closure(1)
                    212:        .&Apache::lonhtmlcommon::end_pick_box()
                    213:     );
                    214:     $r->print(
                    215:         '<p>'
                    216:        .'<input type="button" value="'.&mt('Upload').'" onclick="javascript:verifyForm()"/>'
                    217:        .'</p>'
                    218:        .'</form>'
                    219:     );
1.13      foxr      220: 
1.49      bisitz    221:    # Check for bad extension and warn user
                    222:     if ($fn=~/\.(\w+)$/ && 
                    223:         (&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
1.41      bisitz    224:                 $r->print('<p class="LC_error">'
1.49      bisitz    225:                           .&mt('The extension on this file, [_1], is reserved internally by LON-CAPA.',
                    226:                                '<span class="LC_filename">'.$1.'</span>')
1.41      bisitz    227:                           .' <br />'.&mt('Please change the extension.')
                    228:                           .'</p>');
1.49      bisitz    229:     } elsif($fn=~/\.(\w+)$/ && 
                    230:                     !defined(&Apache::loncommon::fileembstyle($1))) {
1.41      bisitz    231:                 $r->print('<p class="LC_error">'
1.49      bisitz    232:                          .&mt('The extension on this file, [_1], is not recognized by LON-CAPA.',
                    233:                               '<span class="LC_filename">'.$1.'</span>')
1.41      bisitz    234:                          .' <br />'.&mt('Please change the extension.')
                    235:                          .'</p>');
1.22      albertel  236:     }
1.1       www       237: }
                    238: 
                    239: sub phasetwo {
1.25      raeburn   240:     my ($r,$tfn,$uname,$udom,$mode)=@_;
1.37      raeburn   241:     my $output;
1.25      raeburn   242:     my $action = '/adm/upload';
                    243:     my $returnflag = '';
                    244:     if ($mode eq 'testbank') {
                    245:         $action = '/adm/testbank';
                    246:     } elsif ($mode eq 'imsimport') {
                    247:         $action = '/adm/imsimport';
                    248:     }
1.22      albertel  249:     my $fn='/priv/'.$uname.'/'.$tfn;
                    250:     $fn=~s/\/+/\//g;
                    251:     &Debug($r, "Filename is ".$tfn);
                    252:     if ($tfn) {
                    253: 	&Debug($r, "Filename for tfn = ".$tfn);
                    254: 	my $target='/home/'.$uname.'/public_html'.$tfn;
                    255: 	&Debug($r, "target -> ".$target);
1.13      foxr      256: #     target is the full filesystem path of the destination file.
1.22      albertel  257: 	my $base = &File::Basename::basename($fn);
                    258: 	my $path = &File::Basename::dirname($fn);
1.26      albertel  259: 	$base    = &HTML::Entities::encode($base,'<>&"');
1.22      albertel  260: 	my $url  = $path."/".$base; 
                    261: 	&Debug($r, "URL is now ".$url);
1.29      albertel  262: 	my $datatoken=$env{'form.datatoken'};
1.22      albertel  263: 	if (($fn) && ($datatoken)) {
1.36      www       264:             if ($env{'form.cancel'}) {
                    265:                 my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp';
                    266:                 my $dirpath=$path.'/';
                    267:                 $dirpath=~s/\/+/\//g;
1.49      bisitz    268:                 $output .= '<p class="LC_warning">'.&mt('Upload cancelled.').'</p>'
                    269:                           .'<p><a href="'.$dirpath.'">'.
                    270:                           &mt('Back to Directory').'</a></p>';
                    271:             } elsif ((-e $target) && (!$env{'form.override'})) {
                    272:                 $output .= '<form action="'.$action.'" method="post">'
                    273:                           .'<p class="LC_warning">'
                    274:                           .&mt('File [_1] already exists.',
                    275:                                '<span class="LC_filename">'.$fn.'</span>')
                    276:                          .'<input type="hidden" name="phase" value="two" />'
                    277:                          .'<input type="hidden" name="filename" value="'.$url.'" />'
                    278:                          .'<input type="hidden" name="datatoken" value="'.$datatoken.'" />'
                    279:                          .'<p>'
                    280:                          .'<input type="submit" name="cancel" value="'.&mt('Cancel').'" />'
                    281:                          .' <input type="submit" name="override" value="'.&mt('Overwrite').'" />'
                    282:                          .'</p>'
                    283:                          .'</form>';
1.36      www       284:             } else {
1.22      albertel  285: 		my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp';
1.27      www       286: 		my $dirpath=$path.'/';
                    287: 		$dirpath=~s/\/+/\//g;
1.22      albertel  288: 		# Check for bad extension and disallow upload
1.37      raeburn   289:                 my $result;
                    290:                 ($result,$returnflag) = &check_extension($fn,$mode,$source,$target,$action,$dirpath,$url);
                    291:                 $output .= $result;
1.22      albertel  292: 	    }
                    293: 	} else {
1.37      raeburn   294: 	    $output .= '<span class="LC_error">'.
1.22      albertel  295: 		      &mt('Please use browser "Back" button and pick a filename').
1.37      raeburn   296: 		      '</span><br />';
1.22      albertel  297: 	}
1.1       www       298:     } else {
1.37      raeburn   299: 	$output .= '<span class="LC_error">'.
                    300: 		   &mt('Please use browser "Back" button and pick a filename').
                    301: 		   '</span><br />';
                    302:     }
                    303:     return ($output,$returnflag);
                    304: }
                    305: 
                    306: sub check_extension {
                    307:     my ($fn,$mode,$source,$target,$action,$dirpath,$url) = @_;
                    308:     my ($result,$returnflag);
                    309:     # Check for bad extension and disallow upload
                    310:     if ($fn=~/\.(\w+)$/ &&
                    311:         (&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
1.49      bisitz    312:         $result .= '<p class="LC_warning">'.
                    313:                    &mt('File [_1] could not be copied.',
                    314:                        '<span class="LC_filename">'.$fn.'</span> ').
                    315:                    '<br />'.
                    316:                    &mt('The extension on this file is reserved internally by LON-CAPA.').
                    317:                    '</p>';
1.37      raeburn   318:     } elsif ($fn=~/\.(\w+)$/ &&
                    319:              !defined(&Apache::loncommon::fileembstyle($1))) {
1.49      bisitz    320:         $result .= '<p class="LC_warning">'.
                    321:                    &mt('File [_1] could not be copied.',
                    322:                        '<span class="LC_filename">'.$fn.'</span> ').
                    323:                    '<br />'.
                    324:                    &mt('The extension on this file is not recognized by LON-CAPA.').
                    325:                    '</p>';
1.37      raeburn   326:     } elsif (-d $target) {
1.49      bisitz    327:         $result .= '<p class="LC_warning">'.
                    328:                    &mt('File [_1] could not be copied.',
                    329:                        '<span class="LC_filename">'.$fn.'</span>').
                    330:                    '<br />'.
                    331:                    &mt('The target is an existing directory.').
                    332:                    '</p>';
1.37      raeburn   333:     } elsif (copy($source,$target)) {
                    334:         chmod(0660, $target); # Set permissions to rw-rw---.
                    335:         if ($mode eq 'testbank' || $mode eq 'imsimport') {
                    336:             $returnflag = 'ok';
1.49      bisitz    337:             $result .= '<p class="LC_success">'
                    338:                       .&mt('Your file - [_1] - was uploaded successfully.',
                    339:                            '<span class="LC_filename">'.$fn.'<span>')
                    340:                       .'</p>';
1.37      raeburn   341:         } else {
1.49      bisitz    342:             $result .= '<p class="LC_success">'
                    343:                       .&mt('File copied.')  
                    344:                       .'</p>';
1.37      raeburn   345:         }
                    346:         # Check for embedded objects.
                    347:         my (%allfiles,%codebase);
                    348:         my ($text,$header,$css,$js);
                    349:         if (($mode ne 'imsimport') && ($target =~ /\.(htm|html|shtml)$/i)) {
                    350:             my (%allfiles,%codebase);
                    351:             &Apache::lonnet::extract_embedded_items($target,\%allfiles,\%codebase);
                    352:             if (keys(%allfiles) > 0) {
1.50    ! raeburn   353:                 my ($currentpath) = ($url =~ m{^(.+)/[^/]+$});
1.37      raeburn   354:                 my $state = <<STATE;
                    355:     <input type="hidden" name="action"      value="upload_embedded" />
                    356:     <input type="hidden" name="mode"        value="$mode" />
                    357:     <input type="hidden" name="phase"       value="three" />
                    358:     <input type="hidden" name="filename" value="$url" />
                    359: STATE
1.50    ! raeburn   360:                 my $embedded = &Apache::loncommon::ask_for_embedded_content($action,$state,\%allfiles,\%codebase,
1.37      raeburn   361:                                       {'error_on_invalid_names'   => 1,
1.50    ! raeburn   362:                                        'ignore_remote_references' => 1,
        !           363:                                        'current_path'             => $currentpath});
        !           364:                 if ($embedded) {
        !           365:                     $result .= '<h3>'.&mt('Reference Warning').'</h3>'.
        !           366:                                '<p>'.&mt('Completed upload of the file. This file contained references to other files.').'</p>'.
        !           367:                                '<p>'.&mt('Please select the locations from which the referenced files are to be uploaded.').'</p>'.
        !           368:                                $embedded;
        !           369:                 }
1.37      raeburn   370:                 if ($mode eq 'testbank') {
                    371:                     $returnflag = 'embedded';
                    372:                     $result .=  '<p>'.&mt('Or [_1]continue[_2] the testbank import without these files','<a href="javascript:document.testbankForm.submit();">','</a>').'</p>';
                    373:                 }
                    374:             }
                    375:         }
                    376:         if (($mode ne 'imsimport') && ($mode ne 'testbank')) {
1.49      bisitz    377:             $result .= '<br /><a href="'.$url.'">'.
                    378:                         &mt('View file').'</a>';
1.37      raeburn   379:         }
                    380:     } else {
                    381:         $result .= &mt('Failed to copy: [_1].',$!);
                    382:     }
                    383:     if ($mode ne 'imsimport' && $mode ne 'testbank') {
1.49      bisitz    384:         $result .= '<br /><a href="'.$dirpath.'">'.
                    385:                    &mt('Back to Directory').'</a><br />';
1.37      raeburn   386:     }
                    387:     return ($result,$returnflag);
                    388: }
                    389: 
                    390: sub phasethree {
                    391:     my ($r,$fn,$uname,$udom,$mode) = @_;
                    392:     my $result;
                    393:     my $dir_root = '/home/'.$uname.'/public_html';
                    394:     my $url_root = '/priv/'.$uname;
                    395:     my $base = &File::Basename::basename($fn);
                    396:     my $path = &File::Basename::dirname($fn);
                    397:     $result = &Apache::loncommon::upload_embedded($mode,$path,$uname,$udom,
                    398:                                                   $dir_root,$url_root);
                    399:     if ($mode ne 'imsimport' && $mode ne 'testbank') {
                    400:         $result = '<br /><font size="+2"><a href="'.$url_root.$fn.'">'.
                    401:                   &mt('View main file').'</a></font>'.
                    402:                   '<br /><font size="+2"><a href="'.$url_root.$path.'">'.
                    403:                   &mt('Back to Directory').'</a></font><br />';
1.1       www       404:     }
1.37      raeburn   405:     return $result;
1.1       www       406: }
                    407: 
1.10      harris41  408: # ---------------------------------------------------------------- Main Handler
1.1       www       409: sub handler {
                    410: 
1.22      albertel  411:     my $r=shift;
1.1       www       412: 
1.22      albertel  413:     my $uname;
                    414:     my $udom;
1.25      raeburn   415:     my $javascript = '';
1.18      www       416: #
                    417: # phase two: re-attach user
                    418: #
1.29      albertel  419:     if ($env{'form.uploaduname'}) {
                    420: 	$env{'form.filename'}='/priv/'.$env{'form.uploaduname'}.'/'.
                    421: 	    $env{'form.filename'};
1.22      albertel  422:     }
                    423: 
1.29      albertel  424:     unless ($env{'form.phase'} eq 'two') {
1.25      raeburn   425:         $javascript = qq|
                    426: function verifyForm() {
1.28      raeburn   427:     var mode = document.fileupload.filetype.options[document.fileupload.filetype.selectedIndex].value
1.25      raeburn   428:     if (mode == "testbank") {
1.28      raeburn   429:         document.fileupload.action = "/adm/testbank";
1.25      raeburn   430:     }
                    431:     if (mode == "imsimport") {
1.28      raeburn   432:         document.fileupload.action = "/adm/imsimport";
1.25      raeburn   433:     }
                    434:     if (mode == "standard") {
1.28      raeburn   435:         document.fileupload.action = "/adm/upload";
1.25      raeburn   436:     }
1.28      raeburn   437:     document.fileupload.submit();
1.25      raeburn   438: }
1.33      albertel  439: 	|;
1.25      raeburn   440:     }
1.22      albertel  441:     ($uname,$udom)=
1.29      albertel  442: 	&Apache::loncacc::constructaccess($env{'form.filename'},
1.22      albertel  443: 					  $r->dir_config('lonDefDomain'));
1.37      raeburn   444: 
1.22      albertel  445:     unless (($uname) && ($udom)) {
                    446: 	$r->log_reason($uname.' at '.$udom.
1.29      albertel  447: 		       ' trying to publish file '.$env{'form.filename'}.
1.22      albertel  448: 		       ' - not authorized', 
                    449: 		       $r->filename); 
                    450: 	return HTTP_NOT_ACCEPTABLE;
                    451:     }
                    452:     
                    453:     my $fn;
1.29      albertel  454:     if ($env{'form.filename'}) {
                    455: 	$fn=$env{'form.filename'};
1.43      raeburn   456: 	$fn=~s/^https?\:\/\/[^\/]+\///;
1.22      albertel  457: 	$fn=~s/^\///;
1.34      albertel  458: 	$fn=~s{(~|priv/)($LONCAPA::username_re)}{};
1.22      albertel  459: 	$fn=~s/\/+/\//g;
                    460:     } else {
1.29      albertel  461: 	$r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
1.22      albertel  462: 		       ' unspecified filename for upload', $r->filename); 
                    463: 	return HTTP_NOT_FOUND;
                    464:     }
1.1       www       465: 
                    466: # ----------------------------------------------------------- Start page output
                    467: 
                    468: 
1.22      albertel  469:     &Apache::loncommon::content_type($r,'text/html');
                    470:     $r->send_http_header;
1.1       www       471: 
1.31      albertel  472:    $javascript = "<script type=\"text/javascript\">\n//<!--\n".
                    473: 	$javascript."\n// --></script>\n";
1.1       www       474: 
1.47      bisitz    475:     # Breadcrumbs
                    476:     my $brcrum = [{'href' => &Apache::loncommon::authorspace(),
                    477:                    'text' => 'Construction Space'},
                    478:                   {'href' => '/adm/upload',
                    479:                    'text' => 'Upload file to Construction Space'}];
1.31      albertel  480:     $r->print(&Apache::loncommon::start_page('Upload file to Construction Space',
1.47      bisitz    481:                                              $javascript,
                    482:                                              {'bread_crumbs' => $brcrum,})
                    483:              .&Apache::loncommon::head_subbox(
                    484:                 &Apache::loncommon::CSTR_pageheader())
                    485:     );
1.3       www       486:   
1.29      albertel  487:     if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
1.44      bisitz    488:         $r->print('<p class="LC_warning">'
1.46      bisitz    489:                  .&mt('Co-Author [_1]',$uname.':'.$udom)
1.44      bisitz    490:                  .'</p>'
                    491:         );
1.22      albertel  492:     }
                    493: 
1.37      raeburn   494:     if ($env{'form.phase'} eq 'three') {
                    495:         my $output = &phasethree($r,$fn,$uname,$udom,'author');
                    496:         $r->print($output);
                    497:     } elsif ($env{'form.phase'} eq 'two') {
                    498: 	my ($output,$returnflag) = &phasetwo($r,$fn,$uname,$udom);
                    499:         $r->print($output);
1.22      albertel  500:     } else {
                    501: 	&phaseone($r,$fn,$uname,$udom);
                    502:     }
1.1       www       503: 
1.31      albertel  504:     $r->print(&Apache::loncommon::end_page());
1.22      albertel  505:     return OK;  
1.1       www       506: }
1.7       www       507: 
                    508: 1;
                    509: __END__
1.10      harris41  510: 
                    511: 

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