version 1.256, 2015/06/18 20:19:06
|
version 1.260, 2019/08/07 16:08:04
|
Line 121 END
|
Line 121 END
|
.'<fieldset>' |
.'<fieldset>' |
.'<legend>'.$lt{'upload_label'}.'</legend>' |
.'<legend>'.$lt{'upload_label'}.'</legend>' |
.$groupitem |
.$groupitem |
.'<input name="uploaddoc" type="file" class="flUpload" />' |
.'<input name="uploaddoc" type="file" class="LC_flUpload" />' |
.'<input type="hidden" id="free_space" value="'.$free_space.'" />' |
.'<input type="hidden" id="free_space" value="'.$free_space.'" />' |
.'<input type="hidden" name="currentpath" value="'.$current_path.'" />' |
.'<input type="hidden" name="currentpath" value="'.$current_path.'" />' |
.'<input type="hidden" name="action" value="'.$env{"form.action"}.'" />' |
.'<input type="hidden" name="action" value="'.$env{"form.action"}.'" />' |
Line 203 sub display_portfolio_usage {
|
Line 203 sub display_portfolio_usage {
|
.$helpitem |
.$helpitem |
.'</div>' |
.'</div>' |
.'<div>' |
.'<div>' |
.&Apache::lonhtmlcommon::display_usage($current_disk_usage,$disk_quota) |
.&Apache::lonhtmlcommon::display_usage($current_disk_usage, |
|
$disk_quota,'portfolio') |
.'</div>'); |
.'</div>'); |
} |
} |
|
|
Line 1072 sub build_access_summary {
|
Line 1073 sub build_access_summary {
|
$r->print(&mt('Users: ').$curr_user_list); |
$r->print(&mt('Users: ').$curr_user_list); |
} elsif ($scope eq 'ip') { |
} elsif ($scope eq 'ip') { |
my $curr_ips_list = &sort_ips($content->{'ip'}); |
my $curr_ips_list = &sort_ips($content->{'ip'}); |
$r->print(&mt('IP(s): ').$curr_ips_list); |
$r->print(&mt('IP(s):').' '.$curr_ips_list); |
} else { |
} else { |
$r->print(' '); |
$r->print(' '); |
} |
} |
Line 2571 sub get_quota {
|
Line 2572 sub get_quota {
|
} else { |
} else { |
$disk_quota = &Apache::loncommon::get_user_quota($env{'user.name'}, |
$disk_quota = &Apache::loncommon::get_user_quota($env{'user.name'}, |
$env{'user.domain'}); #expressed in MB |
$env{'user.domain'}); #expressed in MB |
$disk_quota = 1000 * $disk_quota; # convert from MB to kB |
$disk_quota = 1024 * $disk_quota; # convert from MB to kB |
} |
} |
return $disk_quota; |
return $disk_quota; |
} |
} |
Line 2614 sub free_space {
|
Line 2615 sub free_space {
|
return $free_space; |
return $free_space; |
} |
} |
|
|
|
sub valid_container { |
|
my ($uname,$udom,$group) = @_; |
|
my $container_prefix; |
|
if ($group ne '') { |
|
$container_prefix = "/uploaded/$udom/$uname/groups/$group/portfolio"; |
|
} else { |
|
$container_prefix = "/uploaded/$udom/$uname/portfolio"; |
|
} |
|
if ($env{'form.currentpath'}) { |
|
$container_prefix .= $env{'form.currentpath'}; |
|
} else { |
|
$container_prefix .= '/'; |
|
} |
|
if ($env{'form.container'} =~ m{^\Q$container_prefix\E(.+)$}) { |
|
my $filename = $1; |
|
if ($filename eq &Apache::lonnet::clean_filename($filename)) { |
|
return 1; |
|
} |
|
} |
|
return; |
|
} |
|
|
|
sub invalid_parms { |
|
my ($r,$url,$currentpath) = @_; |
|
my $escpath = &HTML::Entities::encode($currentpath,'&<>"'); |
|
my $rtnlink = '<a href="'.$url; |
|
if ($url =~ /\?/) { |
|
$rtnlink .= '&'; |
|
} else { |
|
$rtnlink .= '?'; |
|
} |
|
$rtnlink .= 'currentpath='.$escpath; |
|
$rtnlink .= '">'.&mt('Return to directory').'</a>'; |
|
$r->print('<h3>'.&mt('Action disallowed').'</h3>'); |
|
$r->print(&mt('Some of the data included with this request were invalid')); |
|
$r->print('<br />'.$rtnlink); |
|
return; |
|
} |
|
|
sub handler { |
sub handler { |
# this handles file management |
# this handles file management |
my $r = shift; |
my $r = shift; |
Line 2762 sub handler {
|
Line 2802 sub handler {
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
} |
|
if (($env{'form.currentpath'}) && ($env{'form.currentpath'} ne '/')) { |
|
my $clean_currentpath = '/'.&Apache::loncommon::clean_path($env{'form.currentpath'}).'/'; |
|
unless ($env{'form.currentpath'} eq $clean_currentpath) { |
|
&invalid_parms($r,$url); |
|
$r->print(&Apache::loncommon::end_page()); |
|
return OK; |
|
} |
|
} |
|
if ($env{'form.container'}) { |
|
unless (&valid_container($uname,$udom,$group)) { |
|
&invalid_parms($r,$url,$env{'form.currentpath'}); |
|
$r->print(&Apache::loncommon::end_page()); |
|
return OK; |
|
} |
} |
} |
if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){ |
if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){ |
$r->print( |
$r->print( |