--- loncom/interface/portfolio.pm 2006/11/05 21:08:53 1.170 +++ loncom/interface/portfolio.pm 2007/03/20 15:36:14 1.178 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.170 2006/11/05 21:08:53 raeburn Exp $ +# $Id: portfolio.pm,v 1.178 2007/03/20 15:36:14 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -101,7 +101,6 @@ sub display_common { # FIXME: This line should be deleted once Portfolio uses breadcrumbs $r->print(&Apache::loncommon::help_open_topic('Portfolio About', 'Help on the portfolio')); - $r->print(<<"TABLE"); <table id="LC_portfolio_actions"> <tr id="LC_portfolio_upload"> @@ -148,12 +147,12 @@ TABLE ); $r->print('<span class="LC_current_location">'.&make_anchor($url,\%anchor_fields,$port_path).'/'); if (@tree > 1){ - my $newCurrentPath = ''; + my $newCurrentPath = '/'; for (my $i = 1; $i< @tree; $i++){ $newCurrentPath .= $tree[$i].'/'; my %anchor_fields = ( 'selectfile' => $tree[$i], - 'currentpath' => '/', + 'currentpath' => $newCurrentPath, 'mode' => $env{"form.mode"}, 'fieldname' => $env{"form.fieldname"}, 'continue' => $env{"form.continue"} @@ -270,7 +269,9 @@ sub display_directory { $r->print(&Apache::loncommon::help_open_topic('Portfolio FileList', 'Using the portfolio file list')); $r->print('<table id="LC_browser">'. - '<tr><th colspan="2">Actions</th><th> </th><th> </th><th>Name'. + '<tr><th colspan="2">Actions'. + &Apache::loncommon::help_open_topic('Portfolio FileAction'). + '</th><th> </th><th> </th><th>Name'. &Apache::loncommon::help_open_topic('Portfolio OpenFile'). '</th><th>Size</th><th>Last Modified</th><th>Current Access Status'. &Apache::loncommon::help_open_topic('Portfolio ShareFile'). @@ -760,9 +761,16 @@ sub display_access { $info .= '<br /><ul><li>'.&mt('Public files are available to anyone without the need for login.'); $info .= '</li><li>'.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.'); $info .= '</li><li>'.&explain_conditionals(); - $info .= '</li></ul>'; + $info .= '</li></ul>'. + &mt('A listing of files viewable without log-in is available at: ')."<a href=\"/adm/$udom/$uname/aboutme/portfolio\">http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio</a>.<br />"; if ($group eq '') { - $info .= (&mt("A listing of files viewable without log-in is available at: <a href='/adm/$udom/$uname/aboutme/portfolio'>http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio</a>.<br />For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:<br /><a href='/adm/$udom/$uname/aboutme'>http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme</a><br />")); + $info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:"); + } else { + $info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on the course information page:"); + } + $info .= "<br /><a href=\"/adm/$udom/$uname/aboutme\">http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme</a><br />"; + if ($group ne '') { + $info .= &mt("Users with privileges to edit course contents may add a course information page to a course using the 'Course Info' button in DOCS").'<br />'; } } else { $header = '<h3>'.&mt('Conditional access controls for file: [_1]',$port_path.$env{'form.currentpath'}.$env{'form.access'}).'</h3>'. @@ -872,7 +880,7 @@ sub build_access_summary { if ($scope eq 'guest') { $r->print(&mt('Passphrase').': '.$content->{'password'}); } elsif ($scope eq 'course') { - $r->print('<table><tr>'); + $r->print('<table width="100%"><tr>'); $r->print('<th>'.&mt('Roles').'</th><th>'. &mt('Access').'</th><th>'. &mt('Sections').'</th>'); @@ -1334,12 +1342,12 @@ sub display_access_row { $r->print(&Apache::loncommon::start_data_table_header_row()); $r->print('<th>'.&mt('Action?').'</th><th>'.&mt($uctype).'</th><th>'. &mt('Dates available').'</th>'); - if ($type eq 'course') { + if ($type eq 'course' && $status eq 'old') { $r->print('<th>'.&mt('Allowed [_1] member affiliations',$type). '</th>'); $colspan ++; } elsif ($type eq 'domains') { - @all_doms = &Apache::loncommon::get_domains(); + @all_doms = sort(&Apache::lonnet::all_domains()); } $r->print(&Apache::loncommon::end_data_table_header_row()); foreach my $key (@{$items}) { @@ -1371,34 +1379,37 @@ sub display_access_row { sub course_js { return qq| <script type="text/javascript"> -function setRoleOptions(caller,num,cdom,cnum,type) { - addIndexnum = getCallerIndex(caller); - updateIndexnum = getIndex('update',num); - if (caller.checked) { - document.portform.elements[updateIndexnum].checked = true; - var url = '/adm/portfolio?action=rolepicker&setroles='+addIndexnum+'&cnum='+cnum+'&cdom='+cdom+'&type='+type; +function setRoleOptions(num,roleid,cdom,cnum,type) { + updateIndexNum = getIndexByValue('update',num); + var addItem = 'add_role_'+num; + var addIndexNum = getIndexByName(addItem); + if (document.portform.elements[addItem].checked) { + document.portform.elements[updateIndexNum].checked = true; + var url = '/adm/portfolio?action=rolepicker&setroles='+num+'_'+roleid+'&cnum='+cnum+'&cdom='+cdom+'&type='+type; var title = 'Roles_Chooser'; var options = 'scrollbars=1,resizable=1,menubar=0'; options += ',width=700,height=600'; rolebrowser = open(url,title,options,'1'); rolebrowser.focus(); } else { - for (var j=0;j<5;j++) { - document.portform.elements[addIndexnum+j].value = ''; + addArray = new Array ('role','access','section','group'); + for (var j=0;j<addArray.length;j++) { + var itemIndex = getIndexByName(addArray[j]+'_'+num+'_'+roleid); + document.portform.elements[itemIndex].value = ''; } } } -function getCallerIndex(caller) { +function getIndexByName(item) { for (var i=0;i<document.portform.elements.length;i++) { - if (document.portform.elements[i] == caller) { + if (document.portform.elements[i].name == item) { return i; } } return -1; } -function getIndex(name,value) { +function getIndexByValue(name,value) { for (var i=0;i<document.portform.elements.length;i++) { if (document.portform.elements[i].name == name && document.portform.elements[i].value == value) { return i; @@ -1431,33 +1442,53 @@ sub course_row { my %course_description = &Apache::lonnet::coursedescription($cid); $r->print('<td><input type="hidden" name="crsdom_'.$num.'" value="'.$content->{'domain'}.'" /><input type="hidden" name="crsnum_'.$num.'" value="'.$content->{'number'}.'" />'.$course_description{'description'}.'</td>'); } elsif ($status eq 'new') { - $r->print('<td>'.&Apache::loncommon::selectcourse_link('portform','crsnum_'.$num,'crsdom_'.$num,'description_'.$num,undef,undef,$uctype).' <input type="text" name="description_'.$num.'" size="30" /><input type="hidden" name="crsdom_'.$num.'" /><input type="hidden" name="crsnum_'.$num.'" /></td>'); + $r->print('<td>'.&Apache::loncommon::selectcourse_link('portform','crsnum_'.$num,'crsdom_'.$num,'description_'.$num,$num.'_1',undef,$uctype).' <input type="text" name="description_'.$num.'" size="30" /><input type="hidden" name="crsdom_'.$num.'" /><input type="hidden" name="crsnum_'.$num.'" /></td>'); } - $r->print('<td>'.&dateboxes($num,$start,$end).'</td>'); - $r->print('<td><table><tr>'); - $r->print('<th>'.&mt('Action').'</th><th>'.&mt('Roles').'</th><th>'. - &mt('Access').'</th><th>'.&mt('Sections').'</th><th>'. - &mt('Groups').'</th></tr>'); + $r->print('<td>'.&dateboxes($num,$start,$end)); + my $newrole_id = 1; if ($status eq 'old') { + $r->print('</td><td>'); my $max_id = 0; - foreach my $role_id (sort(keys(%{$content->{'roles'}}))) { - if ($role_id > $max_id) { - $max_id = $role_id; - } - $max_id ++; - my $role_selects = &role_selectors($num,$role_id,$status,$type,$content,'display'); - $r->print('<tr><td><span style="white-space: nowrap"><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></span><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>'); - } - $r->print('</table><br />'.&mt('Add a roles-based condition').' <input type="checkbox" name ="add_role_'.$num.'" onClick="javascript:setRoleOptions(this,'."'$num','$content->{'domain'}','$content->{'number'}','$uctype'".')" value="'.$max_id.'" /><input type="hidden" name="role_'.$num.'_'.$max_id.'" /><input type="hidden" name="access_'.$num.'_'.$max_id.'" /><input type="hidden" name="section_'.$num.'_'.$max_id.'" /><input type="hidden" name="group_'.$num.'_'.$max_id.'" /></td>'); - } elsif ($status eq 'new') { - my $role_id = 1; - my $role_selects = &role_selectors($num,$role_id,$status,$type,undef,'display'); - $r->print('<tr><td><input type="checkbox" name="add_role_'.$num.'" value="'.$role_id.'" checked="checked" />'.&mt('Add').'<input type="hidden" name="grplist_'.$num.'_'.$role_id.'" /></td>'.$role_selects); - $r->print('</tr></table></td>'); + if (keys(%{$content->{'roles'}}) > 0) { + $r->print('<table><tr><th>'.&mt('Action').'</th>'. + '<th>'.&mt('Roles').'</th>'. + '<th>'.&mt('Access').'</th>'. + '<th>'.&mt('Sections').'</th>'. + '<th>'.&mt('Groups').'</th></tr>'); + foreach my $role_id (sort(keys(%{$content->{'roles'}}))) { + if ($role_id > $max_id) { + $max_id = $role_id; + } + $max_id ++; + my $role_selects = &role_selectors($num,$role_id,$type,$content,'display'); + $r->print('<tr><td><span style="white-space: nowrap"><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></span><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>'); + } + $r->print('</table>'); + } + $r->print('<br />'.&mt('Add a roles-based condition'). + ' <input type="checkbox" name ="add_role_'. + $num.'" onClick="javascript:setRoleOptions('."'$num', + '$max_id','$content->{'domain'}','$content->{'number'}', + '$uctype'".')" value="" />'); + $newrole_id = $max_id; + } else { + $r->print('<input type="hidden" name ="add_role_'.$num.'" value="" />'); } + $r->print(&add_course_role($num,$newrole_id)); + $r->print('</td>'); return; } +sub add_course_role { + my ($num,$max_id) = @_; + my $output; + $output .='<input type="hidden" name="role_'.$num.'_'.$max_id.'" />'. + '<input type="hidden" name="access_'.$num.'_'.$max_id.'" />'. + '<input type="hidden" name="section_'.$num.'_'.$max_id.'" />'. + '<input type="hidden" name="group_'.$num.'_'.$max_id.'" />'; + return $output; +} + sub domains_row { my ($r,$status,$item,$all_doms,$access_controls,$now,$then) = @_; my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, @@ -1560,21 +1591,12 @@ sub set_identifiers { } sub role_selectors { - my ($num,$role_id,$status,$type,$content,$caller) = @_; + my ($num,$role_id,$type,$content,$caller) = @_; my ($output,$cdom,$cnum,$longid); if ($caller eq 'display') { $longid = '_'.$num.'_'.$role_id; - if ($status eq 'new') { - foreach my $item ('role','access','section','group') { - $output .= '<td><select name="'.$item.$longid.'">'. - '<option value="">'.&mt('Pick [_1] first',$type). - '</option></select></td>'; - } - return $output; - } else { - $cdom = $$content{'domain'}; - $cnum = $$content{'number'}; - } + $cdom = $$content{'domain'}; + $cnum = $$content{'number'}; } elsif ($caller eq 'rolepicker') { $cdom = $env{'form.cdom'}; $cnum = $env{'form.cnum'}; @@ -1612,7 +1634,7 @@ sub role_selectors { 'role' => $allroles, 'access' => \@allaccesses, 'section' => $sections, - 'group' => $groups, + 'group' => $groups, ); foreach my $item ('role','access','section','group') { $output .= '<td><select name="'.$item.$longid.'" multiple="true" size="4">'."\n"; @@ -1636,16 +1658,21 @@ sub role_selectors { sub role_options_window { my ($r) = @_; - my $cdom = $env{'form.cdom'}; - my $cnum = $env{'form.cnum'}; my $type = $env{'form.type'}; - my $addindex = $env{'form.setroles'}; - my $role_selects = &role_selectors(1,1,'new',$type,undef,'rolepicker'); + my $rolenum = $env{'form.setroles'}; + my ($num,$role_id) = ($rolenum =~ /^([\d_]+)_(\d+)$/); + my $role_elements; + foreach my $item ('role','access','section','group') { + $role_elements .= "'".$item.'_'.$rolenum."',"; + } + $role_elements =~ s/,$//; + my $role_selects = &role_selectors($num,$role_id,$type,undef, + 'rolepicker'); $r->print(<<"END_SCRIPT"); <script type="text/javascript"> function setRoles() { - var addidx = $addindex+1; - for (var i=0; i<4; i++) { + var role_elements = new Array($role_elements); + for (var i=0; i<role_elements.length; i++) { var copylist = ''; for (var j=0; j<document.rolepicker.elements[i].length; j++) { if (document.rolepicker.elements[i].options[j].selected) { @@ -1653,10 +1680,23 @@ function setRoles() { } } copylist = copylist.substr(0,copylist.length-1); - opener.document.portform.elements[addidx+i].value = copylist; + var openerItem = getIndexByName(role_elements[i]); + opener.document.portform.elements[openerItem].value = copylist; } + var roleAdder = getIndexByName('add_role_$num'); + opener.document.portform.elements[roleAdder].value = '$role_id'; self.close(); } + +function getIndexByName(item) { + for (var i=0;i<opener.document.portform.elements.length;i++) { + if (opener.document.portform.elements[i].name == item) { + return i; + } + } + return -1; +} + </script> END_SCRIPT $r->print(&mt('Select roles, course status, section(s) and group(s) for users who will be able to access the portfolio file.')); @@ -1710,32 +1750,23 @@ ENDSMP } } -sub upload { - my ($r,$url,$group)=@_; - my $fname=$env{'form.uploaddoc.filename'}; - my $filesize = (length($env{'form.uploaddoc'})) / 1000; #express in k (1024?) - my $disk_quota = 20000; # expressed in k - if (defined($group)) { - my $grp_quota = &get_group_quota($group); # quota expressed in k - if ($grp_quota ne '') { - $disk_quota = $grp_quota; - } else { - $disk_quota = 0; - } - } - $fname=&Apache::lonnet::clean_filename($fname); - my $portfolio_root=&get_portfolio_root(); - my ($uname,$udom) = &get_name_dom(); +sub check_for_upload { + my ($path,$fname,$group,$element) = @_; + my $disk_quota = &get_quota($group); + my $filesize = (length($env{'form.'.$element})) / 1000; #express in k (1024?) + + my $portfolio_root = &get_portfolio_root(); my $port_path = &get_port_path(); + my ($uname,$udom) = &get_name_dom(); # Fixme --- Move the checking for existing file to LOND error return - my @dir_list=&get_dir_list($portfolio_root); + my @dir_list=&get_dir_list($portfolio_root,$path); my $found_file = 0; my $locked_file = 0; foreach my $line (@dir_list) { my ($file_name)=split(/\&/,$line,2); if ($file_name eq $fname){ - $file_name = $env{'form.currentpath'}.$file_name; + $file_name = $path.$file_name; $file_name = &prepend_group($file_name); $found_file = 1; if (&Apache::lonnet::is_locked($file_name,$udom,$uname) eq 'true') { @@ -1744,32 +1775,108 @@ sub upload { } } my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname,$portfolio_root); + if (($current_disk_usage + $filesize) > $disk_quota){ - $r->print('<span class="LC_error">Unable to upload <strong>'.$fname.' (size = '.$filesize.' kilobytes)</strong>. Disk quota will be exceeded.</span>'. - '<br />Disk quota is '.$disk_quota.' kilobytes. Your current disk usage is '.$current_disk_usage.' kilobytes.'); - $r->print(&done('Back',$url)); - } - elsif ($found_file){ - if ($locked_file){ - $r->print('<span class="LC_error">'.'Unable to upload <strong>'.$fname.'</strong>, a <strong>locked</strong> file by that name was found in <strong>'.$port_path.$env{'form.currentpath'}.'</strong></span>'. - '<br />You will be able to rename or delete existing '.$fname.' after a grade has been assigned.'); - $r->print(&done('Back',$url)); - } else { - $r->print('<span class="LC_error">'.'Unable to upload <strong>'.$fname.'</strong>, a file by that name was found in <strong>'.$port_path.$env{'form.currentpath'}.'</strong></span>'. - '<br />To upload, rename or delete existing '.$fname.' in '.$port_path.$env{'form.currentpath'}); - $r->print(&done('Back',$url)); - } - } else { - my $result=&Apache::lonnet::userfileupload('uploaddoc','', - $port_path.$env{'form.currentpath'}); - if ($result !~ m|^/uploaded/|) { - $r->print('<span class="LC_error">'.'An errror occured ('.$result. - ') while trying to upload '.&display_file().'</span><br />'); - $r->print(&done('Back',$url)); - } else { - $r->print(&done(undef,$url)); - } + my $msg = '<span class="LC_error">Unable to upload <strong>'.$fname.' (size = '.$filesize.' kilobytes)</strong>. Disk quota will be exceeded.</span>'. + '<br />Disk quota is '.$disk_quota.' kilobytes. Your current disk usage is '.$current_disk_usage.' kilobytes.'; + return ('will_exceed_quota',$msg); + } elsif ($found_file) { + if ($locked_file) { + my $msg = '<span class="LC_error">'.'Unable to upload <strong>'.$fname.'</strong>, a <strong>locked</strong> file by that name was found in <strong>'.$port_path.$path.'</strong></span>'. + '<br />You will be able to rename or delete existing '.$fname.' after a grade has been assigned.'; + return ('file_locked',$msg); + } else { + my $msg = '<span class="LC_error">'.'Unable to upload <strong>'.$fname.'</strong>, a file by that name was found in <strong>'.$port_path.$path.'</strong></span>'. + '<br />To upload, rename or delete existing '.$fname.' in '.$port_path.$path; + return ('file_exists',$msg); + } + } +} + +sub upload { + my ($r,$url,$group)=@_; + my $fname=&Apache::lonnet::clean_filename($env{'form.uploaddoc.filename'}); + + my ($state,$msg) = &check_for_upload($env{'form.currentpath'}, + $fname,$group,'uploaddoc'); + + if ($state eq 'will_exceed_quota' + || $state eq 'file_locked' + || $state eq 'file_exists' ) { + $r->print($msg.&done('Back',$url)); + return; + } + + my $port_path = &get_port_path(); + my (%allfiles,%codebase,$mode); + if ($env{'form.uploaddoc.filename'} =~ m/(\.htm|\.html|\.shtml)$/i) { + $mode = 'parse'; + + } + my $result= + &Apache::lonnet::userfileupload('uploaddoc','', + $port_path.$env{'form.currentpath'}, + $mode,\%allfiles,\%codebase); + if ($result !~ m|^/uploaded/|) { + $r->print('<span class="LC_error">'.'An errror occured ('.$result. + ') while trying to upload '.&display_file().'</span><br />'); + $r->print(&done('Back',$url)); + } else { + if (%allfiles) { + my $state = <<STATE; + <input type="hidden" name="action" value="upload_embedded" /> + <input type="hidden" name="currentpath" value="$env{'form.currentpath'}" /> + <input type="hidden" name="fieldname" value="$env{'form.fieldname'}" /> + <input type="hidden" name="mode" value="$env{'form.mode'}" /> +STATE + $r->print("<p>Completed upload of the file. This file contained references to other files. You can upload these now: </p>"); + $r->print(&Apache::londocs::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase,{'error_on_invalid_names' => 1})); + $r->print('<p>Or '.&done('Return to directory listing',$url).'</p>'); + } else { + $r->print(&done(undef,$url)); + } + } +} + +sub upload_embedded { + my ($r,$url,$group)=@_; + for (my $i=0; $i<$env{'form.number_embedded_items'}; $i++) { + next if (!exists($env{'form.embedded_item_'.$i.'.filename'})); + + $env{'form.embedded_orig_'.$i} = + &unescape($env{'form.embedded_orig_'.$i}); + my ($path,$fname) = + ($env{'form.embedded_orig_'.$i} =~ m{(.*/)([^/]*)}); + $path = $env{'form.currentpath'}.$path; + $fname = &Apache::lonnet::clean_filename($fname); + + my ($state,$msg) = &check_for_upload($path,$fname,$group, + 'embedded_item_'.$i); + + if ($state eq 'will_exceed_quota' + || $state eq 'file_locked' + || $state eq 'file_exists' ) { + $r->print($msg); + next; + } + + my $port_path = &get_port_path(); + my $src_path = $env{'form.embedded_orig_'.$i}; + $env{'form.embedded_item_'.$i.'.filename'}=$fname; + + my $result= + &Apache::lonnet::userfileupload('embedded_item_'.$i,'', + $port_path.$path); + if ($result !~ m|^/uploaded/|) { + $r->print('<span class="LC_error">'.'An errror occured ('.$result. + ') while trying to upload '.&display_file($path,$fname).'</span><br />'); + next; + } else { + $r->print("<p> Uploaded ". + &display_file($port_path.$path,$fname).'</p>'); + } } + $r->print(&done(undef,$url)); } sub lock_info { @@ -1889,10 +1996,10 @@ sub get_group_quota { } sub get_dir_list { - my ($portfolio_root) = @_; + my ($portfolio_root,$path) = @_; + $path ||= $env{'form.currentpath'}; my ($uname,$udom) = &get_name_dom(); - return &Apache::lonnet::dirlist($env{'form.currentpath'}, - $udom,$uname,$portfolio_root); + return &Apache::lonnet::dirlist($path,$udom,$uname,$portfolio_root); } sub get_name_dom { @@ -1988,6 +2095,23 @@ sub coursegrp_portfolio_header { return $output; } +sub get_quota { + my ($group) = @_; + my $disk_quota; + if (defined($group)) { + my $grp_quota = &get_group_quota($group); # quota expressed in k + if ($grp_quota ne '') { + $disk_quota = $grp_quota; + } else { + $disk_quota = 0; + } + } else { + $disk_quota = &Apache::loncommon::get_user_quota($env{'user.name'}, + $env{'user.domain'}); #expressed in Mb + $disk_quota = 1000 * $disk_quota; # convert from Mb to kb + } + return $disk_quota; +} sub handler { # this handles file management @@ -2084,6 +2208,13 @@ sub handler { $r->print(&Apache::loncommon::start_page($title)); } $r->rflush(); + my ($blocked,$blocktext) = + &Apache::loncommon::blocking_status('port',$uname,$udom); + if ($blocked) { + $r->print($blocktext); + $r->print(&Apache::loncommon::end_page()); + return OK; + } if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){ $r->print('<span class="LC_error">'. 'No file was selected to upload.'. @@ -2106,6 +2237,12 @@ sub handler { } else { &missing_priv($r,$url,'upload'); } + } elsif ($env{'form.action'} eq 'upload_embedded') { + if ($can_upload) { + &upload_embedded($r,$url,$group); + } else { + &missing_priv($r,$url,'upload'); + } } elsif ($env{'form.action'} eq 'delete' && $env{'form.confirmed'}) { if ($can_delete) { &delete_confirmed($r,$url,$group);