Security

glassdog

Joined: 2002-12-01
Posts: 17
Posted: Sun, 2002-12-01 17:35

Is there a way to prevent users from downloading pictures from your ablums IE the no right click script used in html ??? :smile:

 
jacksdad
jacksdad's picture

Joined: 2002-08-24
Posts: 95
Posted: Sun, 2002-12-01 18:19

Here is a thread about the same subject:

<!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=1924" TARGET="_blank">Image Protection </A><!-- BBCode End -->

Maybe that will help. Not sure tho.

 
glassdog

Joined: 2002-12-01
Posts: 17
Posted: Sun, 2002-12-01 23:55

most excellent script but i will work to find a way to use it with the post nuke set up. I would also like to find a way to insert a simple no right click script into the gallry files somehow so that each page it creates has no right click options. Any help would be much welcomed.
Thanks Glassdog

 
jacksdad
jacksdad's picture

Joined: 2002-08-24
Posts: 95
Posted: Mon, 2002-12-02 00:04

I understand, however, disable right click will not solve your problem. I could go to File : Save As, in IE and bring down the images also.

Let me know when you think you have it and I can test all the way to get images.

Thanks

 
glassdog

Joined: 2002-12-01
Posts: 17
Posted: Mon, 2002-12-02 21:23

There will always be a way to get the images i simple disabled the right click option to slow down the honest thieves :smile:. Worked well i put the no right click script in the index.php file for the gallery after the ?> tag so any time the gallery is open the right click option is disabled. I am still working on the script that was in the link you gave me. I will pass along the info when i finish it.
Glassdog

 
Agatka
Agatka's picture

Joined: 2002-10-19
Posts: 140
Posted: Mon, 2002-12-02 23:55

Hey, can you share that script with us? I don't know what to put to disable the right click and would very much like that.

thanks

Agatka

 
ajoyprabhu

Joined: 2002-09-26
Posts: 65
Posted: Tue, 2002-12-03 01:17

Here is what I have on my site...

Hope it helps. Keeps 'innocent borrowers at bay!

:smile:

Ajoy

=================
<meta http-equiv="imagetoolbar" content="no">
<script>
<!--
// No rightclick script v.2.5
// (c) 1998 barts1000
//

// Don't delete this header!
var message="Images at http://www.ajoyprabhuu.com are copyrighted. Please write to me and in all cases, I will send you a better image for display at your site.";

// Message for the alert box

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert( "Images at http://www.ajoyprabhu.com are copyrighted. Please write to me and in all cases, I will send you a better image for display at your site. ");
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->
</script>

 
Agatka
Agatka's picture

Joined: 2002-10-19
Posts: 140
Posted: Tue, 2002-12-03 01:19

thanks :smile:

I'll try that

 
Agatka
Agatka's picture

Joined: 2002-10-19
Posts: 140
Posted: Tue, 2002-12-03 01:19

Ok it worked but I had to put it also in view_album.php and view_photo for it to work on all pages. :smile:

Thanks a lot

update: Actually on the photo page it doesn't work. Have to check what I did wrong.

update: Ok I got it :smile:

 
glassdog

Joined: 2002-12-01
Posts: 17
Posted: Tue, 2002-12-03 04:10

I used this script and you set it in the gallery index.php file at the bottom of the page after the ?> tag Simply paste it in and you are done
<script language=JavaScript>
<!--
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&amp;&amp;!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&amp;&amp;!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>

 
ajoyprabhu

Joined: 2002-09-26
Posts: 65
Posted: Tue, 2002-12-03 04:32

Think the javascripts seem essentially similar, except, the meta tag I insert, takes care of IE6 save image feature. Not my own idea, saw it some place! :wink:

Also, I have PHP code enabling the admin and the album owner to right click. Someone here had given me that initial seed for that idea. So, if anyone is interested, let me know (it is 2 more lines of code!)

Ajoy

 
phgrove

Joined: 2002-10-10
Posts: 101
Posted: Tue, 2002-12-03 08:43

These scripts are very basic methods. The user only needs to use opera or go veiw source and they can copy the picture easily. I did put a php script on the forum not long ago that stops anyone trying to take the pictures directly.

The no right click function is not the best way to go about stopping someone taking your pictures!

Peter

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Tue, 2002-12-03 16:27

There is no way to stop someone from taking your the images you allow them
to view. It's simply impossible. The best you can manage is to prevent people
from 'leaching' them. I use a simple mod_rewrite .htaccess file in my albums
for this:

# No indexes allowed.
Options -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/path/to/gallery/.* [NC]
RewriteRule .*.(jpg|gif|png)$ - [F]
</IfModule>

-- This is essentially the same as posted in the user guide someplace, add any other
extensions you need to the RewriteRule line for movies or whatnot. This is a better
solution IMO then trying to use scripts and java and so-on.

 
glassdog

Joined: 2002-12-01
Posts: 17
Posted: Tue, 2002-12-03 21:26

phgrove,
I saw your post on the other script and agree it is a better way to protect the files but i am having trouble working it into gallery as a postnuke module. I am still working it though lol thanks again
vallimar,
Thaks for the referance on the users guide i missed that section i will go back and reread it
glassdog :eek:

 
linton

Joined: 2002-10-12
Posts: 42
Posted: Wed, 2002-12-04 04:06

Ok, for some reason or another i can't get this code to work and i have some stupid kid taking all the pictures on my website and posting them on his. COuld someone let me know where in the pages to past the code .. right now i have it in the view_album in the head section but that won't work for some reason.

thanks
linton

 
glassdog

Joined: 2002-12-01
Posts: 17
Posted: Wed, 2002-12-04 04:30

wich script you trying ?

 
aus_dave

Joined: 2002-12-04
Posts: 2
Posted: Wed, 2002-12-04 05:18

I am setting up Gallery as an image library and so far the best way I have found to protect images is to batch process them with a transparent watermark. Can be done with Photoshop but I have started to use picture-shark which is specially made for the job.

I have seen other picture library scripts that can 'overlay' a transparent GIF over an image but I think I read even that method is not secure.

I sleep easier knowing that my images will be pixelated and covered in text if someone tries to steal them :grin: .

This is suitable for commercial sites only I guess.

 
phgrove

Joined: 2002-10-10
Posts: 101
Posted: Wed, 2002-12-04 08:26
Quote:
phgrove,
I saw your post on the other script and agree it is a better way to protect the files but i am having trouble working it into gallery as a postnuke module. I am still working it though lol thanks again
vallimar,
Thaks for the referance on the users guide i missed that section i will go back and reread it
glassdog :eek:

If you do get the script to work please let me know how you did it.

Thanks

Peter

 
glassdog

Joined: 2002-12-01
Posts: 17
Posted: Wed, 2002-12-04 11:10
Quote:
There is no way to stop someone from taking your the images you allow them
to view. It's simply impossible. The best you can manage is to prevent people
from 'leaching' them. I use a simple mod_rewrite .htaccess file in my albums
for this:

# No indexes allowed.
Options -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/path/to/gallery/.* [NC]
RewriteRule .*.(jpg|gif|png)$ - [F]
</IfModule>

-- This is essentially the same as posted in the user guide someplace, add any other
extensions you need to the RewriteRule line for movies or whatnot. This is a better
solution IMO then trying to use scripts and java and so-on.

I have tried this script and no matter what url i try i still cant get it to display my images
i created a .htacess file placed it in my albums folder (with an edited url ofcoarse) and when i reload the gallery i cant see my picks. any tweeks you might have had to do ????

 
phgrove

Joined: 2002-10-10
Posts: 101
Posted: Wed, 2002-12-04 11:35
Quote:
>>There is no way to stop someone from taking your the images you allow them
to view. It's simply impossible. The best you can manage is to prevent people
from 'leaching' them. I use a simple mod_rewrite .htaccess file in my albums
for this:

# No indexes allowed.
Options -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/path/to/gallery/.* [NC]
RewriteRule .*.(jpg|gif|png)$ - [F]
</IfModule>

-- This is essentially the same as posted in the user guide someplace, add any other
extensions you need to the RewriteRule line for movies or whatnot. This is a better
solution IMO then trying to use scripts and java and so-on.
<<
I have tried this script and no matter what url i try i still cant get it to display my images
i created a .htacess file placed it in my albums folder (with an edited url ofcoarse) and when i reload the gallery i cant see my picks. any tweeks you might have had to do ????

Try this site for lots of information on this topic.

http://www.thesitewizard.com/archive/bandwidththeft.shtml

Peter

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Wed, 2002-12-04 19:17

Ahhh, the forum ate my , the Rewrite Rule should be:

RewriteRule .*.(jpg|gif|png)$ - [F]

Although that shouldn't be the issue with you. Does your browser properly
transmit a Referer header?

 
glassdog

Joined: 2002-12-01
Posts: 17
Posted: Wed, 2002-12-04 21:06

Ok I am using IE 5.5 and nescape 7.0. The web page is postnuke 7.2.1 i have created a file named .htaccess and placed it in my albums folder with the following code
# No indexes allowed.
Options -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.promochickmusic.com/modules/gallery/.* [NC]
RewriteRule .*.(jpg|gif|png)$ - [F]
</IfModule>
Still I cant get it to allow my browser to show the pictures can it be something in the way post nuke calls the module ??
see webpage at http://www.promochickusmusic.com
Thanks Glassdog

 
glassdog

Joined: 2002-12-01
Posts: 17
Posted: Fri, 2002-12-06 00:31

Just wanted to make a quick update i got it all worked out and running great thanks for all the help anyone needs the code to set on postnuke let me know

 
xaphod
xaphod's picture

Joined: 2003-01-10
Posts: 6
Posted: Wed, 2003-01-15 11:58

I posted a link to a perl script which would block direct access to your images based on the referer. It also allows you to specify a maximum file size. Both restrictions can be bypassed based on the client's IP.

<!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=3041&amp;4" TARGET="_blank">Clich here for the original thread</A><!-- BBCode End -->

 
supra69

Joined: 2003-01-19
Posts: 4
Posted: Mon, 2003-01-27 09:46

hey glassdog...I was wondering how you got that mod_rewrite script up and working...could you add me to AIM if possible: GQxJeff

Thanks!

 
supra69

Joined: 2003-01-19
Posts: 4
Posted: Fri, 2003-01-31 03:51

Ok, I used the method posted on this thread but I wasn't able to get my images to come up...so I used the method from this URL: http://www.thesitewizard.com/archive/bandwidththeft.shtml

Apparently my pictures are working, but how would I go about testing this? Also in that URL it told me to put my .htaccess in the directory where the pictures were, but I wasn't able to upload the .htaccess in any specific album directory, just the general album directory itself...so would that be ok? Please help! Thanks in advance!