coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: ukcbajr on April 10, 2007, 11:36:12 PM

Title: Family friendly access rights
Post by: ukcbajr on April 10, 2007, 11:36:12 PM
Ok so I've downloaded coppermine and I'm very happy with it. But I have a special access need I can't figure out.

Here's what I want:
Anyone can register (no problems here)
Anyone can create their own albums, upload images, and view their own image(no problems here)
Admin enables image available for public viewing - no matter what category, or album. No idea how to do this.
In other words I want the default for every image uploaded to be private.
Title: Re: Family friendly access rights
Post by: Nibbler on April 11, 2007, 12:42:58 AM
Require upload approval on the groups page.
Title: Re: Family friendly access rights
Post by: ukcbajr on April 11, 2007, 02:05:23 AM
No this isn't it.  When logged out, I still see images posted in private galleries. I need user galleries forced to private, and I want to prevent registered users from making anything public.

Title: Re: Family friendly access rights
Post by: Nibbler on April 11, 2007, 02:31:37 AM
Then you could disable the permissions dropdown for regular users and make the albums default to private. Would that do what you want?
Title: Re: Family friendly access rights
Post by: ukcbajr on April 11, 2007, 06:12:05 AM
Yes - this would work. But how do I do it? I can't see any options like this in the admin menu...
Title: Re: Family friendly access rights
Post by: Nibbler on April 12, 2007, 12:20:37 AM
No, it would require manual code changes.

modifyalb.php

change


    if (!$CONFIG['allow_private_albums']) {
        echo '        <input type="hidden" name="' . $name . '" value="0" />' . "\n";
        return;
    }


to


    if (!GALLERY_ADMIN_MODE) {
        echo '        <input type="hidden" name="' . $name . '" value="0" />' . "\n";
        return;
    }


That will hide the dropdown box. Try searching the board for default album visibility; I think it's been posted before.
Title: Re: Family friendly access rights
Post by: ukcbajr on April 12, 2007, 04:45:46 AM
Thanks - this bit works. Making progress,

On chnaging default values I found this: http://forum.coppermine-gallery.net/index.php?topic=40004.msg190164#msg190164

However
a) the text to change is slightly different - there's a parameter 'pos' I don't have. So I ignore this.
b) I can't find the value for 'visibility' that makes the default value 'Me only'. I tied several numbers - including negative numbers - and they do cause the default to change (very encouraging). But they seem to jump over this one....

Thanks for helping - I feel I'm getting there....
Title: Re: Family friendly access rights
Post by: ukcbajr on April 12, 2007, 08:00:42 AM
Actually I think I just figured it out. Looking at the source code of the HTML I found the number is variable. So rather than set the default value of visibility to '1' or '2' I set it to '".(FIRST_USER_CAT + USER_ID)."' This seems to work. Will this cause problems?

Everything looks ok now except for one thing. Linking. A user with a now private album can use a keyword to link an image to a public album. How can I stop this?
Title: Re: Family friendly access rights
Post by: ukcbajr on April 13, 2007, 06:11:27 AM
Ok I hacked the script in two places so that only admin could edit keywords. Here's what I did - please let me know if there are other files I need to edit. If not consider this solved.

1) upload.php - deleted one line:

    array($lang_upload_php['keywords'], 'keywords', 0, 255, 1,(isset($iptc['Keywords'])) ? implode(' ',$iptc['Keywords']): ''),

near the bottom of the script. I think this means no-one (including admin) is given the option of providing keywords when uploading files.


2) editOnePic.php - modified lines near the bottom of the script

From:

                                <input type="text" style="width: 100%" name="keywords" maxlength="255" value="{$CURRENT_PIC['keywords']}" class="textinput" />
                        </td>
        </tr>

To:


EOT;

if (GALLERY_ADMIN_MODE) {
echo <<<EOT
                                <input type="text" style="width: 100%" name="keywords" maxlength="255" value="{$CURRENT_PIC['keywords']}" class="textinput" />

                        </td>
        </tr>
EOT;
}

if (!GALLERY_ADMIN_MODE) {
echo <<<EOT
   {$CURRENT_PIC ['keywords']}
EOT;
}