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: Restrict Guest account to 1 album?  (Read 9676 times)

0 Members and 1 Guest are viewing this topic.

edd7

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Restrict Guest account to 1 album?
« on: February 07, 2011, 10:28:19 pm »

Hi Folks.


I have read the thread, Restrict Guest account to 1 album? here http://forum.coppermine-gallery.net/index.php/topic,70251.0.html

Don't want to hijack it.

I would like to do the same with my Gallery and have edited the code as sudjested in that thread but it's not working.

Any help help would be appreciated.

http://www.lonblitz.com/Gallery/

Test account, test  /password test1

The home button takes you to my smf forum.

Many thanks.
edd7.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Restrict Guest account to 1 album?
« Reply #1 on: February 08, 2011, 09:31:40 am »

Seems to work for me as expected, as I cannot select to make the album public.

As your gallery is bridged, you probably have to update that code:
Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, owner, visibility) VALUES ('$category', '$get_album_name', 'NO', '{$position}', '', '$user_id', '2')";to match your 'default group' of your board.
Logged

edd7

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Restrict Guest account to 1 album?
« Reply #2 on: February 08, 2011, 01:58:13 pm »

Hi Αndré.

Thank you very much for your help.

I have it set so only admin can create public albums and I had the properties for uploading to the public album set wrong.

( Afon Taf Valley Calender 2012 ) is the album I want visable to guests ( have changed properties ) but only visable and able to rate, comment on but not upload.

With the code you say I need to update, do you mean the code in coppermine or the code in my smf forum ?.

Here is the code in my coppermine, delete.php file. might I have put it in the wrong place.
Code: [Select]
if (!empty($get_album_name)) {
            //add the album to database
           $query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, owner, visibility) VALUES ('$category', '$get_album_name', 'NO', '{$position}', '', '$user_id', '2')";
            cpg_db_query($query);

Many thanks for your help.
Regards.
edd7.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Restrict Guest account to 1 album?
« Reply #3 on: February 08, 2011, 02:16:34 pm »

Please describe what's your actual issue. What exactly do you try to accomplish?
Logged

edd7

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Restrict Guest account to 1 album?
« Reply #4 on: February 08, 2011, 02:44:26 pm »

Hi Αndré.

My forum and gallery are private only regesterd users have access, what I am trying to accomplish is to have one album visable to non regesterd usesers. This one ( Afon Taf Valley Calender 2012 )

I would like people ( non regesterd usesers ) to be able comment and rate the images in that album, but not able to upload images or see any other content in either the gallery or the forum.


I hope that makes sense.

Many thanks.
edd7.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Restrict Guest account to 1 album?
« Reply #5 on: February 08, 2011, 02:52:37 pm »

Are you (as admin) the only person who can create albums, or do your users have that privileges, too?
Logged

edd7

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Restrict Guest account to 1 album?
« Reply #6 on: February 08, 2011, 03:33:37 pm »

I as admin am the only one who can create public albums but regesterd users can upload to it and they can also create personal albums to upload to.

Regards.
edd7.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Restrict Guest account to 1 album?
« Reply #7 on: February 08, 2011, 03:50:22 pm »

You have to set the guest permissions, so they can view the gallery without forcing the login. Then you have set the permissions of all albums, that guests cannot view it. Now we're at the point to apply the mod. The mod removes the permission for regular users to create albums that can be viewed by guests.
Logged

edd7

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Restrict Guest account to 1 album?
« Reply #8 on: February 08, 2011, 04:47:57 pm »

Hi Αndré.

I have 11 user groups, one is the guest group.


I have set the guest group permisions to, ( Rating, yes / Comments, yes ).
Access level  ( thumbnail and intermediate image ) all other user group permisions are set to Access level ( thumbnail, intermediate, and full-size image ).

I created a test album with the test account and uploaded 3 files, In the Album properties / Album can be viewed by. I can only pick ( me only or members of newbie group ) it is missing the other other member groups.
When I log in as admin I can't see the test album.



Regards.edd7.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Restrict Guest account to 1 album?
« Reply #9 on: February 08, 2011, 05:08:27 pm »

I created a test album with the test account and uploaded 3 files, In the Album properties / Album can be viewed by. I can only pick ( me only or members of newbie group ) it is missing the other other member groups.
Well, so the mod works as expected. Non-admin users can only choose between 'me', 'my user group(s)' and 'everybody'. The mod removes 'everybody'.


When I log in as admin I can't see the test album.
you probably have to update that code:
Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, owner, visibility) VALUES ('$category', '$get_album_name', 'NO', '{$position}', '', '$user_id', '2')";to match your 'default group' of your board.

Maybe the best way would be to check which user group the current user belongs to and then use that value as default value. I try to update the code accordingly asap.
Logged

edd7

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Restrict Guest account to 1 album?
« Reply #10 on: February 08, 2011, 05:35:09 pm »

Hi Αndré.

Thanks, you have been a great help to me.

If it was set to use the user group the current user belongs to and then use that value as default value, would that not exclude
members of the other regesterd members user groups.

Also when I set the, public album properties / Visitors can upload files to yes, non regesterd guests are able to upload to the album which I don't want, but if I set it to no, regesterd members can't upload. All regesterd member group permissions are set to ( Public albums upload Allowed )

Regards.
edd7.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Restrict Guest account to 1 album?
« Reply #11 on: February 08, 2011, 06:52:14 pm »

If it was set to use the user group the current user belongs to and then use that value as default value, would that not exclude
members of the other regesterd members user groups.
Yes. As a workaround you could add all your users to a specific group and use that group's id as default value.


Also when I set the, public album properties / Visitors can upload files to yes, non regesterd guests are able to upload to the album which I don't want
You can disable it in the groups manager. Please reads the docs, it's all explained there.
Logged

edd7

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Restrict Guest account to 1 album?
« Reply #12 on: February 11, 2011, 03:20:38 pm »

Hi Αndré.

Thanks for all your help with this, I think I will leave the groups as they are for now and build a new gallery for the calendar.

Thanks again.
Regards.
edd.
Logged
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 19 queries.