ElkArte Community

Project Support => Support => Topic started by: gevv on December 18, 2019, 12:14:52 pm

Title: Special file permission for guests ?
Post by: gevv on December 18, 2019, 12:14:52 pm
Hi,

Guests  can see the uploaded image files, but do not download the archive files.

how to make this special permission?
Title: Re: Special file permission for guests ?
Post by: radu81 on December 19, 2019, 02:43:32 am
Hi,
there is no file permission to set, if guests can see image attachments they can download zip or other files. I just tested on my forum and works.

p.s. you need to click to the filename of the zip to start download, not on the icon
Title: Re: Special file permission for guests ?
Post by: gevv on December 19, 2019, 05:30:54 am
want to do; guests  only see images (jpg, png etc.)  in topic.  do not download archive (zip, rar etc.) files.

edit Display.controller.php

find;          

Code: [Select]
// Fetch attachments.
if (!empty($modSettings['attachmentEnable']) && allowedTo('view_attachments'))


replace;
Code: [Select]
      // Fetch attachments.
      if (!empty($modSettings['attachmentEnable']))
      {
                      if(!allowedTo('view_attachments'))
                             $modSettings['attachmentShowImages'] = 0;}

see guests archive (zip, rar) filename, link appears.   ok.

guests click attachment link redirect to login page. ok.  

but the image does not appear to the guests

Title: Re: Special file permission for guests ?
Post by: radu81 on December 19, 2019, 05:43:51 am
have a look here skodaclub.it/index.php?topic=8172.msg138151#msg138151 , you can view the image attachment and also download the zip attachment

The only problem is that as a member I see the zip icon, while the zip icon is not visible as guest. Probably this could be a bug, what do yo think @Spuds‍  @emanuele‍ ?
Title: Re: Special file permission for guests ?
Post by: gevv on December 19, 2019, 05:57:54 am
I don't want guest to download archive files.   Guests see archived (zip, rar etc.)  attachments but not download.  i solved this problem with the above code


Guests  only see images (jpg, png etc.)  in topic.

(Link-6395)

(https://i.postimg.cc/DZgP7RvP/Untitled.gif) (https://postimages.org/)
Title: Re: Special file permission for guests ?
Post by: gevv on December 19, 2019, 10:49:16 am
actually the spiders   that I want to do see the attacments, image etc

https://custom.simplemachines.org/mods/index.php?mod=143
https://custom.simplemachines.org/mods/index.php?mod=1546