Reducing Space Quota for users Reducing Space Quota for users
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Reducing Space Quota for users

Started by Chunky C, December 14, 2006, 05:01:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chunky C

I have CPG 1.4.10 bridged with phpBB v2.0.21.  I set up a 'restricted' group that I want to be on a sort of probation resticting their ability to upload pics to cpg.

Restricted Group
Quota: 0KB
Rating: No
Ecards: No
Comments: No

Public albums upload
Allowed: No
Approval: No

Personal gallery
Allowed: No
Approval: No

File upload boxes: 0
URI upload boxes: 0

When I go to the user management page, it shows them in Registered Users and Restricted groups, but the user still can upload pics.  It seems to be using the Registered User group permissions verses the Restricted group permissions.

Is this normal behavior?  Is there a way around this other than moving all 3000+ members to a new group and setting the Registered users so they can't upload pics?


Thanks,

Chunk
What's the point of wearing your favorite rocketship underpants if nobody ever asks to see 'em?" --Calvin

Nibbler

Users get the 'best' permissions from their groups, so a restricted group would not work in this way.

See bridge/udb_base.inc.php, core_udb::get_user_data() - you can try changing some of the MAXs to MINs.

Chunky C

#2
Worked like a charm.  Thank you much!


This prevents "Restricted" Group from uploading.  In fact, they don't even get the upload link in the navigation bar at the top of the gallery.

In case someone would like to do this here is what I changed:


$result = cpg_db_query("SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, " .
"MIN(can_rate_pictures) as can_rate_pictures, MIN(can_send_ecards) as can_send_ecards, " .
"MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, " .
"MIN(custom_user_upload) as custom_user_upload, MIN(num_file_upload) as num_file_upload, " .
"MAX(num_URI_upload) as num_URI_upload, " .
"MIN(can_post_comments) as can_post_comments, MIN(can_upload_pictures) as can_upload_pictures, " .
"MAX(can_create_albums) as can_create_albums, " .
"MAX(has_admin_access) as has_admin_access, " .
"MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval ".
"FROM {$CONFIG['TABLE_USERGROUPS']} WHERE group_id in (" .  implode(",", $groups). ")");


cc
What's the point of wearing your favorite rocketship underpants if nobody ever asks to see 'em?" --Calvin