Module: Quotas

rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2011-09-13 00:31

Quotas is a module for Gallery 3 that will track how much total space is being used to store each users photos and movies and will allow admins to place upload limits on user groups.

Once activated, this module will keep a running total (in bytes) of the file sizes for photos and movies as each user uploads and deletes files (albums are ignored). If a file would push a user over their limit, it will be automatically rejected on upload, with the user seeing a message that Gallery was unable to process their file.
[img]http://gallery.menalto.com/files/quotas_unable_to_process.png[/img]

Be aware that any module that can reassign a users photos to another user (other then deleting a user) or modify a file (other then rotating) will mess up this total file size number as the change in file size will not be logged.

This module contains a maintenance script to calculate the current disc space usage for all existing files and users. It can be found at Admin -> Maintenance -> Rebuild user quotas table.

This module will also display a message at the bottom of album/photo/movie pages for logged in users to tell them how much space they're using, and what their limit is (if they have one).
[img]http://gallery.menalto.com/files/quotas_current_usage.png[/img]

Admin users may log in and see a current user's usage from the Admin -> Content -> User quotas screen.
[img]http://gallery.menalto.com/files/quotas_all_users_usage.png[/img]

Admin users may assign upload limits (in megabytes) from the Admin -> Content -> User quotas screen. Admin's may also specify if resizes and thumbnails should be counted towards a users limit from this page.
[img]http://gallery.menalto.com/files/quotas_set_limit.png[/img]

Once a limit is set, all users in that group will be unable to upload more then their limit, with the exception that if a full sized image does not put the user over their limit, but the resize+thumb does, the photo will still be accepted (as resizes and thumbs are not generated until after the photo is stored in Gallery and after the quota check is run). A value of 0 can be used to specify "no limit" for a group. If a user is assigned to more then one group, the largest non-zero value will be used as their limit.

---
Report Problems/Suggestions Here | Get latest version | Documentation | Coffee Fund | My Library | My GitHub

AttachmentSize
quotas_current_usage.png7.78 KB
quotas_unable_to_process.png3.94 KB
quotas_all_users_usage.png5.2 KB
quotas_set_limit.png11.62 KB
 
Shemo725

Joined: 2008-04-18
Posts: 424
Posted: Tue, 2011-09-13 12:22

wow, this is great. thanks rwatcher! now I just need to get someone to extend the permissions on gallery so that I can use it as a bridge with mybb.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2012-06-13 18:49

I've updated the quotas module. This version will display space usage and limits for users with an "appropriate" file size prefix instead of using "MB" for everything (Groups will continue to display everything in MB). It also displays an infinity symbol instead of "0.00 MB" for users without a limit.
[img]http://gallery.menalto.com/files/quotasupdate.png[/img]

Tested with Gallery 3.0.3.

 
inchains

Joined: 2012-04-19
Posts: 18
Posted: Mon, 2012-05-21 13:44

How can I edit your module so that the info will show in a specific area of the site, lets say, the footer?

thank you.

________________________________
API:
- Gallery 3.0.3
Server:
- Apache 2.2.22
- PHP 5.2.17
- MySQL 5.1.61-community-log
- OS linux x86_64

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2012-05-22 01:16
inchains wrote:
How can I edit your module so that the info will show in a specific area of the site, lets say, the footer?

thank you.

If you're referring to the code that inserts text into the bottom of the pages to let the user know what percentage of their quota is currently being used, it's generated in this file:
http://github.com/rWatcher/gallery3-contrib/blob/master/3.0/modules/quotas/helpers/quotas_theme.php

You could change page_bottom to a different page function to insert it somewhere else, or use that code as part of a custom theme.

 
inchains

Joined: 2012-04-19
Posts: 18
Posted: Tue, 2012-05-22 14:07

Where/how can I find the page functions available for use? I'm using theme Wind.

Thanks

________________________________
API:
- Gallery 3.0.3
Server:
- Apache 2.2.22
- PHP 5.2.17
- MySQL 5.1.61-community-log
- OS linux x86_64

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2012-05-23 05:23
 
inchains

Joined: 2012-04-19
Posts: 18
Posted: Wed, 2012-05-23 08:32

Thank you!

________________________________
API:
- Gallery 3.0.3
Server:
- Apache 2.2.22
- PHP 5.2.17
- MySQL 5.1.61-community-log
- OS linux x86_64

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2012-06-13 18:51

Update --
This module now generates a "User stats" section on the user profile pages.
[img]http://gallery.menalto.com/files/quotas_stats.png[/img]