News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Image Host Whitelist

Started by the7thGhost, August 09, 2009, 01:13:03 AM

Previous topic - Next topic

the7thGhost

Image Host Whitelist





Originally written by: ArantorCurrent version: 1.4
Taken over by: the7thGhostUpdates: New update site coming soon
Suitable for: 2.0 RC1.2, 2.0 RC2, 2.0 RC3Supported languages:

Link to Mod | Mod support topic | Mod bugtracker | Donate



This mod is no longer being supported by Arantor - I have taken it over, and am now actively supporting and developing it.



Summary

Provides the facility inside your forum to enable whitelists or blacklists for img tags, so that only set websites can be used, or set websites cannot be used.

For example, if you have your forum at mydomain.com/forum, and you want to restrict img use to only images hosted on mydomain.com and images.mydomain.com, you just add those two lines to the configuration and only those images will be displayed - all others just leave the URL present.

If you do not want to show images from a certain website, just set the mode to "Blacklist" and add the website to the configuration. All images will be shown except those from that website.

You can also put paths into it, for example, media.mydomain.com/images would restrict embedded images only to paths that started with media.mydomain.com/images/

The mod itself checks both http:// and https:// automatically, so you should leave this off from the entries in the whitelist.

Installation

Package Manager should work in most cases. If you need to make any edits, it will be limited to Subs.php - no theme changes are necessary.

Useful links
Manual Installation Of Mods
How Do I Modify Files?

Support

Questions should be posted to the mod support topic. Anything that is a bug or feature request can additionally be reported to the mod bugtracker.

Updating

Please remove any previous versions before installing the latest version. Your existing settings will be preserved.

Translations

Translators are wanted! If you know a language this mod does not support, please translate and post to the mod support topic. All languages are welcome!

Changelog

1.4 - April 7, 2010
Added SMF 2.0 RC3 support

1.3 - December 21, 2009
Taken over by the7thGhost
Added Blacklist feature

1.2 - November 1, 2009
Added English-British support
Added 2.0 RC2 compatibility support

1.1 - October 19, 2009
Minor bugfix update regarding admin panel quick search

1.0 - August 7, 2009
First release

Files modified by Image Host Whitelist

./Sources/Admin.php
./Sources/ManageSettings.php
./Sources/Subs.php
./Themes/default/languages/Modifications.english.php

Optionally:
./Themes/default/languages/Modifications.english-utf8.php
./Themes/default/languages/Modifications.english_british.php
./Themes/default/languages/Modifications.english_british-utf8.php

Sabre™

Nice :)

When adding imageshack, I put  www.imageshack.us  in the AP, have also tried  imageshack.us, but it didnt work.
The urls for the images change before  imageshack.us

eg.
h**p://img20.imageshack.us/img20/4091/neuron129.jpg
h**p://img219.imageshack.us/img219/4892/forest100.jpg

Am I missing something?

Cheers :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Arantor

No, applies on full domain, not partial domain, so you'd have to put in a line for every img entry in imageshack. It doesn't do matching on just any part of the URL, it only matches the start of the URL, meaning you'd have to whitelist every subdomain.
Holder of controversial views, all of which my own.


edi67

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Sabre™

Quote from: Arantor on August 10, 2009, 06:47:31 AM
No, applies on full domain, not partial domain, so you'd have to put in a line for every img entry in imageshack. It doesn't do matching on just any part of the URL, it only matches the start of the URL, meaning you'd have to whitelist every subdomain.

Yeah, I know, I was just seeing if you were going to change that, as imageshack is a popular host used by a vast number of 'net peeps'.
I personally couldn't afford to not let image shack be included.
Good idea though mate.

Cheers :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Arantor

I'm not going to change it, no.

The reason is that all you'd have to do would be whitelist png, jpg, and gif and you suddenly make it near enough pointless.

It is a domain-only, or domain+path whitelist, and changing that considerably diminishes its effectiveness.
Holder of controversial views, all of which my own.


qtime

As a smf 1 user, you can imagine my question.... do you intend to make it available for smf1 as well?

Arantor

I have no plans to make this available to SMF 1.x. It does not have the infrastructure necessary for the user interface.
Holder of controversial views, all of which my own.


qtime

ok, thanks for reply and your good work!

the7thGhost

I've taken over this mod, so I'm now supporting it. Feature requests/bug reports should be put in at my site, not at Arantor's site, from now on.

the7thGhost

Version 1.3 released.

Now has a blacklist feature in addition to a whitelist.

Those who know other languages, please translate!
$txt['ihwl_title'] = 'Image Host Whitelist';
$txt['ihwl_select'] = 'Use the whitelist or the blacklist?';
$txt['ihwl_chooseone'] = 'Disabled';
$txt['ihwl_whitelist'] = 'Whitelist';
$txt['ihwl_blacklist'] = 'Blacklist';
$txt['ihwl_whitelist_long'] = 'The domain(s) you wish to allow images from <br />
e.g. website.com, or even website.com/directory<br />
<span class="smalltext">Add one per line, and do not add http:// at the start.</span>';
$txt['ihwl_blacklist_long'] = 'The domain(s) you do not wish to allow images from, e.g. website.com<br />
<span class="smalltext">Add one per line, and do not add http:// at the start.</span>';

Leave HTML code (everything in the carets (< and >) there, at the same part in the sentence.

Arantor

English_british is the same as above.
Holder of controversial views, all of which my own.


the7thGhost

I'd guessed that, so I already had it as a language, but thanks for letting me know. Now I'm sure. ;D

Arantor

Heh, very often they are the same, actually. I can only think of a very rare couple of times I had to make them different for any reason.
Holder of controversial views, all of which my own.


qtime

and an update to SMF 2.0 RC3  ?

The subs.php file is different

the7thGhost

I'm going to update this when I update Menu Order.
I was going to do it a while ago, but school assignments got in the way.
Now that I'm on spring break I'll be able ot update them.

qtime

Great, waiting, and I hope your school will be ok as well :).

the7thGhost

Version 0.4 released!

It now supports SMF 2.0 RC3.
That's the only change, so if you're using RC2 you don't need to upgrade.

Download

qtime

I need to do some more tests, but is hit working to block links (urls) in general or only the picture?

For example if I put rapidshare.com at the blacklist, or a few url's in the whitelist (not rs), is it possible to post a url to rapidshare.com ?

the7thGhost

Quote from: qtime on April 09, 2010, 03:40:27 PM
I need to do some more tests, but is hit working to block links (urls) in general or only the picture?

For example if I put rapidshare.com at the blacklist, or a few url's in the whitelist (not rs), is it possible to post a url to rapidshare.com ?

This mod only blocks images, not links.

Advertisement: