--- loncom/interface/londocs.pm 2004/07/01 21:54:24 1.132 +++ loncom/interface/londocs.pm 2004/08/03 20:44:33 1.136 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.132 2004/07/01 21:54:24 www Exp $ +# $Id: londocs.pm,v 1.136 2004/08/03 20:44:33 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -201,7 +201,8 @@ sub dumpcourse { $r->print( ''); } else { - $r->print(''); + $r->print(''); } } } @@ -574,13 +575,15 @@ END my $isfolder=0; my $folderarg; if ($uploaded) { - if ($extension eq 'sequence') { - $icon=$iconpath.'/folder_closed.gif'; - $url=~/$coursenum\/([\/\w]+)\.sequence$/; - $url='/adm/coursedocs?'; - $folderarg=$1; - $isfolder=1; - } + if ($extension eq 'sequence') { + $icon=$iconpath.'/folder_closed.gif'; + $url=~/$coursenum\/([\/\w]+)\.sequence$/; + $url='/adm/coursedocs?'; + $folderarg=$1; + $isfolder=1; + } else { + &Apache::lonnet::allowuploaded('/adm/coursedoc',$url); + } } $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//; if ((!$isfolder) && ($residx) && ($folder!~/supplemental/)) { @@ -647,12 +650,20 @@ ENDPARMS # ---------------------------------------------------------------- tie the hash sub tiehash { + my ($mode)=@_; $hashtied=0; if ($ENV{'request.course.fn'}) { - if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db", - &GDBM_READER(),0640)) { + if ($mode eq 'write') { + if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db", + &GDBM_WRCREAT(),0640)) { + $hashtied=2; + } + } else { + if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db", + &GDBM_READER(),0640)) { $hashtied=1; - } + } + } } } @@ -818,8 +829,9 @@ sub checkversions { } else { $r->print('