--- loncom/publisher/lonpubdir.pm 2014/05/20 19:53:59 1.153 +++ loncom/publisher/lonpubdir.pm 2014/06/20 18:00:51 1.155 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Authoring Space Directory Lister # -# $Id: lonpubdir.pm,v 1.153 2014/05/20 19:53:59 raeburn Exp $ +# $Id: lonpubdir.pm,v 1.155 2014/06/20 18:00:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,7 +40,7 @@ use Apache::lonlocal; use Apache::lonmsg; use Apache::lonmenu; use Apache::lonnet; -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); sub handler { @@ -60,6 +60,25 @@ sub handler { my $thisdisfn=$fn; my $docroot=$r->dir_config('lonDocRoot'); # Apache londocument root. + if ($thisdisfn eq "$docroot/priv/$udom") { + if ((-d "/home/$uname/public_html/") && (!-e "$docroot/priv/$udom/$uname")) { + my ($version) = ($r->dir_config('lonVersion') =~ /^\'?(\d+\.\d+)\./); + &Apache::loncommon::content_type($r,'text/html'); + $r->send_http_header; + + &Apache::lonhtmlcommon::clear_breadcrumbs(); + $r->print(&Apache::loncommon::start_page('Authoring Space'). + '
'. + &mt('Your Authoring Space is currently in the location used by LON-CAPA version 2.10 and older, but your domain is using a newer LON-CAPA version ([_1]).',$version).'
'. + ''. + &mt('Please ask your Domain Coordinator to move your Authoring Space to the new location.'). + '
'. + ''.&mt('This Authoring Space is currently empty.').'
'); + $r->print(&Apache::loncommon::end_page()); + return OK; + } + # Start off the directory table. $r->print(&Apache::loncommon::start_data_table() .&Apache::loncommon::start_data_table_header_row() @@ -119,10 +148,7 @@ sub handler { ); my $dirptr=16384; # Mask indicating a directory in stat.cmode. - - opendir(DIR,$fn); my $filehash = {}; - my @files= readdir(DIR); foreach my $filename (@files) { # Skip .DS_Store and hidden files my ($extension) = ($filename=~/\.(\w+)$/); @@ -221,12 +247,10 @@ sub handler { } } - closedir(DIR); - $r->print( &Apache::loncommon::end_data_table() .&Apache::loncommon::end_page() ); - return OK; + return OK; } @@ -627,7 +651,7 @@ sub putdirectory { '