Family friendly access rights Family friendly access rights
 

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

Family friendly access rights

Started by ukcbajr, April 10, 2007, 11:36:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ukcbajr

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.

Nibbler

Require upload approval on the groups page.

ukcbajr

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.


Nibbler

Then you could disable the permissions dropdown for regular users and make the albums default to private. Would that do what you want?

ukcbajr

Yes - this would work. But how do I do it? I can't see any options like this in the admin menu...

Nibbler

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.

ukcbajr

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....

ukcbajr

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?

ukcbajr

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;
}