Restrict Guest account to 1 album? Restrict Guest account to 1 album?
 

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

Restrict Guest account to 1 album?

Started by edd7, February 07, 2011, 10:28:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

edd7

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.


Αndré

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

edd7

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

Αndré

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

edd7

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.

Αndré

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

edd7

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.

Αndré

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.

edd7

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.


Αndré

Quote from: edd7 on February 08, 2011, 04:47:57 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'.


Quote from: edd7 on February 08, 2011, 04:47:57 PM
When I log in as admin I can't see the test album.
Quote from: Αndré on February 08, 2011, 09:31:40 AM
you probably have to update that code:
$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.

edd7

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.

Αndré

Quote from: edd7 on February 08, 2011, 05:35:09 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.


Quote from: edd7 on February 08, 2011, 05:35:09 PM
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.

edd7

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.