Guest user as "Only viewer" Guest user as "Only viewer"
 

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

Guest user as "Only viewer"

Started by FrA1l3, March 26, 2018, 12:40:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FrA1l3

Hello,

I open this thread because I just did not find the correct configuration to have a user with "display only" permissions.
A user who can not create / manage albums can not edit their own profile but can see all public images and albums.

To carry out this task I had to put this code as a temporary solution
<?php 
if (! GALLERY_ADMIN_MODE) {
cpg_die (ERROR, $ lang_errors ['access_denied'], __FILE____LINE__);
?>



Certainly it is not the solution, but after playing with the groups / users I have not found another effective way to make it so.
I had to include it in the files

profile.php
albmgr.php

I tried to disable at the menu level the crossed out icons of the attachment, but the arrangement does not work well to me and what limited only with the solution of the code.

Is there any way to have a user only viewer? That is not able to create / manage albums or upload files or modify their profile?


ron4mac

You can modify your theme to not provide 'Guests' with buttons for uploading, albums or profile.

Example:
   if ($USER_DATA['group_id'] != 3) addbutton($sys_menu_buttons,'{UPL_PIC_LNK}','{UPL_PIC_TITLE}','{UPL_PIC_TGT}','upload_pic'........

ron4mac

I spent some time looking at how to achieve what you want.

I think you should not use the 'Guest' group for your purpose. Using the Curve Theme, I turned off allowing uploads, etc for the 'Registered' group, and as a result there was no 'My gallery', 'Upload file' or 'Profile' menu items. Create another group, say 'Viewers', and try to disable its rights to see if you can achieve what you're looking for.

Also, perhaps it is your theme that may be causing your issues. Try one of the CPG 1.6 included themes.

FrA1l3

Hello

Sorry for the delay in responding, thank you very much for the help.
First of all I say that I use the old curve theme, of the 1.5.x versions with some slight mod.

I will try to make the changes that you indicate and I tell you the result, again thank you very much!

FrA1l3

Sorry for the delay.
Finally the solution has been to create the group "viewers" with the options that you have indicated and indeed the menus no longer appear.
I was wrong and the group "registered" has more permissions even if it was configured identical.

thank you for your support @ron4mac!  :)