eZ publish has current no function for limiting the amount of data you can insert. To create a limit for this you need to alter the function which creates new objects. This is located in kernel/content/action.php. Search for $class->instantiate(). This is the function which creates the actual object. Here you can add a limitation check to prevent creation of more than x objects.
Thank You Bård, hacking the kernel functions is the powerful solution.
I think an alternate solution is creating a cron script (or adding some stuff to "cronjobs") for testing regularly the resource compsuntion of sites and limiting accordly the roles for users (no creation and no upload).
Anyway, what is Your ideas for the much useful "test or resource usage" for a single siteaccess (filesystem usage, DB usage, cache, ...)?
Could you describe us the scenario of when you'd like to limit the amount of "things" created ?
If this is a commercial limitation (no more than X on the small pack), then I think that the easier to understand is the number of items (articles, folders...).
If this is a technical one, the size is the thing to monitor, then that's probably the size of the uploaded elements (files, images or multimedia) that matters.
Anyway, a not too bad place could be in an event in the publication workflow (before), isn't it ?
My scenario is very similar to a "quota" limit (much like the "user quota" on Linux filesystems), in which I want to limit the total amount of data the users of a single siteaccess may own. I want to be possible give to my users the equivalent of "max X MB of web space" for single web site.
I must read much carefully the workflow documentation...
Thanks.
Mauro
You must be logged in to post messages in this topic!