Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Family friendly access rights  (Read 3553 times)

0 Members and 1 Guest are viewing this topic.

ukcbajr

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Family friendly access rights
« 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.
Logged

Nibbler

  • Guest
Re: Family friendly access rights
« Reply #1 on: April 11, 2007, 12:42:58 am »

Require upload approval on the groups page.
Logged

ukcbajr

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Family friendly access rights
« Reply #2 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.

Logged

Nibbler

  • Guest
Re: Family friendly access rights
« Reply #3 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?
Logged

ukcbajr

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Family friendly access rights
« Reply #4 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...
Logged

Nibbler

  • Guest
Re: Family friendly access rights
« Reply #5 on: April 12, 2007, 12:20:37 am »

No, it would require manual code changes.

modifyalb.php

change

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

to

Code: [Select]
    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.
Logged

ukcbajr

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Family friendly access rights
« Reply #6 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....
Logged

ukcbajr

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Family friendly access rights
« Reply #7 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?
Logged

ukcbajr

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Family friendly access rights
« Reply #8 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;
}

Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 15 queries.