Recent Topics

1 May 24, 2022 13:54    

Hello,
does anyone know how to disable ?disp=mediaidx for anonymous users?
In recent months, hotlininking developed into a real plague and sometime it starts by crawling images via ?disp=mediaidx.

I figured out how to disable it for all users (by editing _mediaidx.main.php) but how to disable it only for anonymous users I don't know.

Would appreciate an advice.

Thanks, Will

2 May 24, 2022 21:08

OK It has taken a while to work it out, but that was fun. :)

Basically there is no [$current_User->ID] if someone is not logged in so checked for that and die if there is no logged in user.

In[ /skins_fallback_5/_mediaidx.disp.php]
add line after 16

if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );

if( !isset($current_User->ID) ) die();

That's the simple idea, you can see what happens it stops the page from loading.
You could redirect, rather than just die(). For example to the home page or any other item you would like to display


Form is loading...