Space/resource limit per user

Author Message

Piotrek Karaś

Friday 04 July 2008 4:25:24 pm

Hello there,

I'm getting ready to implementing some sort of user-based resource limit in eZ Publish. The point is to have control over what a user can upload, for example a limit of 20MB of photos/video per account.

Do you have any experiences with such approach? I expect quite a bit of work and thinking and decision making, for example when it comes to what exactly to measure in case of images ;) Any experiences or thoughts would be greatly appreciated.

Also, I believe this would be an important community feature, don't you think?

Thanks,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

michiel n.

Thursday 10 July 2008 2:54:18 am

I'd say keep the webdav functionality in mind.

Then on top of that: you probably want to try to keep it os and fs-independent which can be tricky.

And like you mentioned: what with images? Maybe you have the rounded-corners, small, thumb, etc. images. Which all add up to diskspace. Same goes for movies: maybe you want users to be able to download the original file and on top of that offer 2 different quality versions....

I'm curious what you will come up with!

Certified eZ developer looking for projects.
michieln at gmail dot com
http://ez.no/certification/verify/225305

Piotrek Karaś

Saturday 12 July 2008 6:25:42 am

The project was terminated, so I no longer worry about it, even though I may still try to approach such functionality. Yes, definitely a tricky problem under eZ Publish. As far as images go, I would have probably introduced two modes, calculating the space of either all the resources (including aliases) or just the originals/sources, which also stands a form of control. Let you know if anything happens ;)

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Noicokuna Niemoge

Thursday 22 January 2009 11:55:39 pm

It should be in eZ by default... but anyway.

Shiki soku ze ku...

Kristof Coomans

Friday 30 January 2009 7:03:04 am

Some thinking:

You can track the total file size of published items in a separate table, per user. Increase when an object gets published, decrease when an object gets removed. We need a signal / post remove workflow trigger though to be able to track this, which is currently not available in eZ Publish.

Using the new content edit handler validation feature, test on the file size of any supported datatypes (binary file, image, ...) and compare it with the file size of all published items with the same owner:

valid = max >= ( total_sizes_object_owner - current_size_of_object + new_size_of_object )

If the object is not published now, then current_size_of_object is 0.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 21:42:52
Script start
Timing: Jan 30 2025 21:42:52
Module start 'layout'
Timing: Jan 30 2025 21:42:52
Module start 'content'
Timing: Jan 30 2025 21:42:52
Module end 'content'
Timing: Jan 30 2025 21:42:52
Script end

Main resources:

Total runtime0.0220 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 588.1328151.2109
Module start 'layout' 0.00490.0037 739.3438220.6875
Module start 'content' 0.00860.0120 960.03131,005.7891
Module end 'content' 0.02060.0014 1,965.820337.9922
Script end 0.0220  2,003.8125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002511.1304140.0002
Check MTime0.00104.4385140.0001
Mysql Total
Database connection0.00083.690610.0008
Mysqli_queries0.002410.753730.0008
Looping result0.00000.090910.0000
Template Total0.00104.510.0010
Template load0.00083.473110.0008
Template processing0.00020.994610.0002
Override
Cache load0.00052.410310.0005
General
dbfile0.00021.085580.0000
String conversion0.00000.030340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs