coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 permissions => Topic started by: gianso on May 19, 2011, 05:04:01 PM

Title: Viewing pictures immediately without approval
Post by: gianso on May 19, 2011, 05:04:01 PM
Recently, the considerable increase in traffic in our image gallery (http://www.naturavventura.it/cpg/) I turned in some users Registered users Administrators. Now when they upload pictures, despite being set in the group, Public Upload Album, the pictures they need approval, these will be published immediately. Strange no? Why?
Title: Re: Viewing pictures immediately without approval
Post by: Αndré on May 19, 2011, 05:06:41 PM
Your issue is the the following: you have some users in the Administrators group that upload pictures to your gallery, which will be published immediately, although they need approval as per group manager settings?
Title: Re: Viewing pictures immediately without approval
Post by: gianso on May 19, 2011, 05:23:49 PM
Yes, excuse my english google
Title: Re: Viewing pictures immediately without approval
Post by: Αndré on May 19, 2011, 06:30:03 PM
Counter question: why should pictures of administrators need approval? They could approve them immediately anyway. We recommend to give no one admin privileges who doesn't necessarily need it.
Title: Re: Viewing pictures immediately without approval
Post by: gianso on May 19, 2011, 10:20:13 PM
Why is provided for the group administrator approval if it is not possible? We have given the role of managers to employees who help us maintain the portal.
Title: Re: Viewing pictures immediately without approval
Post by: Αndré on May 20, 2011, 10:42:23 AM
The users in the admin group have a special mode 'GALLERY_ADMIN_MODE'. You can toggle that mode by clicking 'Show/hide admin controls' in the menu. If the user is in GALLERY_ADMIN_MODE, pictures will always be approved. If you want to change that behavior, open include/picmgmt.inc.php, find
    if (GALLERY_ADMIN_MODE) {
        $approved = 'YES';
    } elseif (!$USER_DATA['priv_upl_need_approval'] && $category == FIRST_USER_CAT + USER_ID) {
        $approved = 'YES';
    } elseif (!$USER_DATA['pub_upl_need_approval'] && $category < FIRST_USER_CAT) {
        $approved = 'YES';
    } else {
        $approved = 'NO';
    }

and replace with
    if (!$USER_DATA['priv_upl_need_approval'] && $category == FIRST_USER_CAT + USER_ID) {
        $approved = 'YES';
    } elseif (!$USER_DATA['pub_upl_need_approval'] && $category < FIRST_USER_CAT) {
        $approved = 'YES';
    } else {
        $approved = 'NO';
    }

Title: Re: Viewing pictures immediately without approval
Post by: gianso on May 21, 2011, 12:20:45 PM
Thanks for the technical solution, but if it is just the malfunction detected, why not put the change in the next update?
Title: Re: Viewing pictures immediately without approval
Post by: Αndré on May 21, 2011, 02:17:43 PM
There is no malfunction. Coppermine works exactly as designed. The GALLERY_ADMIN_MODE overwrites some settings, i.e. grants the user admin privileges. If the admin mode is disabled, all 'regular' settings/restrictions apply. That's what I already tried to explain you.