Ignore:
Timestamp:
Jun 7, 2007, 1:50:45 PM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #630.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/filemanager/upload/select.jsp

    r3463 r3465  
    3636  import="net.sf.basedb.core.File"
    3737  import="net.sf.basedb.core.FileType"
     38  import="net.sf.basedb.core.User"
     39  import="net.sf.basedb.core.Group"
     40  import="net.sf.basedb.core.Quota"
     41  import="net.sf.basedb.core.QuotaType"
     42  import="net.sf.basedb.core.Location"
    3843  import="net.sf.basedb.core.PluginDefinition"
    3944  import="net.sf.basedb.core.Include"
     
    102107  }
    103108 
     109  if (file == null || file.getLocation() != Location.PRIMARY)
     110  {
     111    // Check quota
     112    User user = User.getById(dc, sc.getLoggedInUserId());
     113    QuotaType totalQuotaType = QuotaType.getById(dc, SystemItems.getId(QuotaType.TOTAL));
     114    QuotaType fileQuotaType = QuotaType.getById(dc, SystemItems.getId(QuotaType.FILE));
     115   
     116    if (user.hasExceededQuota(totalQuotaType, Location.PRIMARY)
     117      || user.hasExceededQuota(fileQuotaType, Location.PRIMARY))
     118    {
     119      throw new PermissionDeniedException("Quota has been exceeded");
     120    }
     121  }
     122 
     123 
    104124  // Query to retrieve file types
    105125  final ItemQuery<FileType> fileTypeQuery = FileType.getQuery();
Note: See TracChangeset for help on using the changeset viewer.