ElkArte Community

Title: Testing ILA permissions.
Post by: emanuele on April 16, 2016, 03:38:23 pm
This attachment is posted in a restricted board:
(Link-3531)

Do you see anything?
I hope not. :P

What would you expect to see?
Title: Re: Testing ILA permissions.
Post by: meetdilip on April 16, 2016, 03:41:30 pm
I see no attachment.
Title: Re: Testing ILA permissions.
Post by: emanuele on April 16, 2016, 03:48:15 pm
Cool, then it works! :P
Title: Re: Testing ILA permissions.
Post by: Spuds on April 16, 2016, 04:52:57 pm
And I see it  :D
Title: Re: Testing ILA permissions.
Post by: emanuele on April 16, 2016, 04:56:14 pm
I wonder if it should show a default image along the lines "you don't have permissions to see this image" (created on-the-fly for localization).
Title: Re: Testing ILA permissions.
Post by: lordrt on April 16, 2016, 05:05:55 pm
Quote from: emanuele – I wonder if it should show a default image along the lines "you don't have permissions to see this image" (created on-the-fly for localization).

Would be nicer then just looking like a broken image.
Title: Re: Testing ILA permissions.
Post by: meetdilip on April 16, 2016, 05:25:01 pm
What about " if you can't use it, you can't see it " theory ?
Title: Re: Testing ILA permissions.
Post by: Spuds on April 16, 2016, 05:42:21 pm
I think one of those new facebook emoji (http://www.ElkArte.net/community/index.php?topic=3387.msg24280#msg24280) might just be the ticket as a default, nope should work fine :P 

Probably just the old red circle / slash combo ?

Just to note, but I'll forget, when I did a preview on this post, I got the Circumflex character after the smiley.
Title: Re: Testing ILA permissions.
Post by: radu81 on April 16, 2016, 07:15:05 pm
Quote from: lordrt – Would be nicer then just looking like a broken image.
I agree ;)
Title: Re: Testing ILA permissions.
Post by: Frenzie on April 19, 2016, 05:09:20 am
Quote from: meetdilip – What about " if you can't use it, you can't see it " theory ?
That doesn't really work for a picture in a post you can see. Consider:

QuoteHey, look at this picture!

crickets

Isn't it awesome?
Title: Re: Testing ILA permissions.
Post by: Frenzie on April 19, 2016, 05:27:38 am
Testing an inline text file.

(Link-3574)

How about actually displaying it for the user? Basically the HTML from server would be a download link (like now) but a script would replace it in a similar vein to the video autoembed.

Code: [Select]
Attachment blabla.css(this is a link):
html {
background-color: #666;
}


PS I'm not saying someone not me should write this. I'm just tossing the idea out there and I suppose I'm effectively volunteering.
Title: Re: Testing ILA permissions.
Post by: emanuele on April 19, 2016, 05:59:44 am
Rather interesting idea!
I wonder about a couple of things, though:
1) txt is kind of easy, but if you provide txt then others will ask for pdf "at least", is there anything for them?
2) ... hmmm... no, okay, security should not be such a huge problem, provided the text is htmlspecialchar'ed, right?
Title: Re: Testing ILA permissions.
Post by: Frenzie on April 19, 2016, 06:42:29 am
Quote from: emanuele – 1) txt is kind of easy, but if you provide txt then others will ask for pdf "at least", is there anything for them?
Blergh. PDF in browsers ftl. That being said, seems like premade solutions exist (http://pdfobject.com/). But that would be a lot less lightweight than just simple text. Maybe it could be loaded optionally only when encountering a PDF attachment or something.

Quote2) ... hmmm... no, okay, security should not be such a huge problem, provided the text is htmlspecialchar'ed, right?
Right, except I see no reason to do it in PHP. Just do something like string.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;') in JS (possibly quotes too like in PHP, but there should be no reason to). I mean this purely as a JS enhancement without changing anything anywhere.
[1]
Except maybe a little classname hook in the ATTACH BBC, which should be there for styling purposes as well anyway.