Modpack addition - prevent right click save as Modpack addition - prevent right click save as
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Modpack addition - prevent right click save as

Started by Stramm, June 11, 2006, 01:53:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stramm

I've played a lil bit with the classic theme. I think you could use that for most of the themes if you just copy/ paste function theme_display_fullsize_pic() and function theme_html_picture() from the attached theme.php to the theme.php you're actually using (if the functions are not already in there). But it's tested only with the classic theme.

What it's doing.
It's displaying the image in the table background and a transparent gif over that image. If someone right clicks - saves as, he'll get the transparent gif instead of the displayed image. Good to fool newbs

you'll have to place the attached gif into your coppermine/images dir

the version for a standard coppemine can be found here http://forum.coppermine-gallery.net/index.php?topic=33782.msg157813#msg157813

Megachip

Another possibility, prevent full size images save.

In include/themes.inc.php change:

Quote
    <table>
      <tr>
            <td>
          <div id="content">
              <?php     echo  '<a href="javascript: window.close()"><img src="'
                . htmlspecialchars($imagedata['path']) . '" '
                . $imagedata['geometry']
                . 'alt="'
                . htmlspecialchars($imagedata['name'])
                . '" title="'
                . htmlspecialchars($imagedata['name'])
                . "\n" . $lang_fullsize_popup['click_to_close']
                . '" /></a><br />' ."\n";
               ?>
          </div>
        </td>
      </tr>
    </table>
in
Quote
    <div id="vordergrund" style="position:absolute; left:0px; top:0px;">
    <?php     echo  '<a href="javascript: window.close()"><img src="images/overlay.gif" '
                   . $imagedata['geometry']
                   . 'alt="'
                   . htmlspecialchars($imagedata['name'])
                   . '" title="'
                   . htmlspecialchars($imagedata['name'])
                   . "\n" . $lang_fullsize_popup['click_to_close']
                   . '" /></a><br />' ."\n";
               ?>
    </div>
    <table>
      <tr>
            <td>
              <?php     echo  '<img src="'
                . htmlspecialchars($imagedata['path']) . '" '
                . $imagedata['geometry']
                ."\n";
               ?>
        </td>
      </tr>
    </table>

Stramm

don't edit themes.inc.php but copy the function/ var in question from themes/sample/theme.php to the theme.php you're actually using.

Haven't tried Megachips solution but it seems to work pretty well lfor the fullsized view

nbgeekguy

OK, what I did seems to prevent 90% of users on the web from downloading the images. I took the two functions from the sample theme and added them to my theme, added Megachip's hack, then added a little right click script to my theme template.html. As the fullsize window is opened by a java script, they must have java script enabled to view the image, but at the same time another java script prevents them from right clicking and viewing source.


<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&&!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&&!document.getElementById){
document.onmousedown=clickIE4;
}

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

// -->
</script>


The next thing I will try is to add another table to the mix that I can throw a watermark into the mix to at least have my watermark on the image if they do the Print Screen copy to paste into Paint.

I'm also going to try one of the script redirectors to prevent them from looking at the cached copy of the page to find the URL of the image.

ianc

Just a heads up with this one... I've just tried loading the Modpack addition after previously failing to get the previous version at: http://forum.coppermine-gallery.net/index.php?topic=33782.0 to work.

Both versions don't display any intermediate image using the classic view. Both of the mods I tried display a white area where the intermediate images should be.

If the mods work in a general environment, then there could possibly be a conflict with the full size photo access control plug-in at:http://forum.coppermine-gallery.net/index.php?topic=25010.0 which I'm using.

Thought you might like to know..

Stramm

#5
if a plugin changes one of the functions theme_html_picture, theme_display_fullsize_pic then that's probably the reason why it's not working.

edit: tried and works smooth for me

uk_martin

To prevent "right click / save as", I added the following into my theme.html file:

<script language='JavaScript' src='no_right_click.js' type='text/javascript'></script>

This then links into a JS file in the root of the gallery which has the following in it:

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100%" height="19" align="middle">');
document.write('    <param name="allowScriptAccess" value="sameDomain" />');
document.write('    <param name="movie" value="themes/brummies/images/menu.swf" />');
document.write('    <param name="quality" value="high" />');
document.write('    <param name="wmode" value="transparent" />');
document.write('<embed src="themes/brummies/images/menu.swf" wmode="Transparent" quality="high" width="100%" height="19" name="logo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');


Nt sure about the strengths and weaknesses of the relative ways of doing the same thing and have in any case become dismayed in discovering that there is a plug-in to IE7 that gets around all these protections anyway.





uk_martin

oops, that should have been the "template.html" file in my theme

See the results in action here:

www.ukmartin.com/gallery/

Nibbler

Don't post about an unrelated script (that doesn't even work) on a mod thread.

Cath22

Hi Stramm,
I like your "prevent right click" function, but I would also like to use the lightbox slideshow (http://forum.coppermine-gallery.net/index.php/topic,49596.msg276002.html#msg276002).
However the two collides unfortunately, since the code uses the same part. When clicking the intermediate the lightbox would start. The showing of the full picture would in that case also somewhat protected I guess, but the intermediate is yet not protected.
Upon changing the code to make the intermediate protected the whole lightbox does not work anymore. Im no coder so dont know how to change both to work next to each other. I left a post with on the other forum but got no reaction, thats why I try here.

Thanks in advance.
Cath
qui custodiet ipsos custodes

nyfalls

This is a great mod and I have been using it successfully for a while. There seems to be one exploit though. The e-cards still have the capability to save as. Is there away to apply a variation of this mod to the e-card?