coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: olandir on January 18, 2007, 06:29:12 AM

Title: Limiting quota for users without a personal album
Post by: olandir on January 18, 2007, 06:29:12 AM
I've read both the documentation and several forum posts and have been unable to find an answer to this question.

I have Copermine 1.4.10 integrated with SMF 1.1.1, use post-based groups is set to 1.

I would like to set it so that any registered user can post to the public gallery, and when they reach a certain post-based group level, they get options like a personal album. However, I have read in the documentation that in order to set a quota for user groups, they have to have a personal album.

This does that make sense to me. Essentially the documentation reads that users without a personal album automatically have unlimited quota, which I certainly don't want. I need to be able to restrict these users as well so that they are limited to what they can post in the public albums.

Please let me know if I am missing any piece of information. As I said, I've read everything I can find and I've seen no one address this yet.

Title: Re: Limiting quota for users without a personal album
Post by: Nibbler on January 18, 2007, 01:09:33 PM
You can change the quota check to do that, find in include/picmgmt.inc.php

$result = cpg_db_query("SELECT sum(total_filesize) FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE  {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND category = '" . (FIRST_USER_CAT + USER_ID) . "'");

change to

$result = cpg_db_query("SELECT sum(total_filesize) FROM {$CONFIG['TABLE_PICTURES']} WHERE owner_id = " . USER_ID);
Title: Re: Limiting quota for users without a personal album
Post by: olandir on January 18, 2007, 03:31:51 PM
Just so I'm 100% clear, if I make this change, that means that even users without a personal album will adhear to whatever quota I set?
Title: Re: Limiting quota for users without a personal album
Post by: Nibbler on January 18, 2007, 03:42:35 PM
The limit will apply to all the user's files, not just those in their user gallery.