deny direct access to SMF

Started by Gianni_T, May 07, 2005, 03:49:43 AM

Previous topic - Next topic

Orstio

1) You don't want it executing that much.  Place it higher. Directly under the top comments is fine.

2) You have two // before index.php, which could be another potential problem.

Naesstrom

Quote from: Orstio on December 15, 2005, 05:23:58 PM
1) You don't want it executing that much.  Place it higher. Directly under the top comments is fine.

2) You have two // before index.php, which could be another potential problem.

ok... now it looks like this but it still doesn't help!
$forum_version = 'SMF 1.0.5';

// Get everything started up...
// Redirect users who try to access /forum directly
if (strpos($_SERVER['QUERY_STRING'], 'dlattach') === false)
{
        if(!defined('_VALID_MOS')){ header("Location: http://portal.sharpweaponcenter.com/index.php?option=com_smf&Itemid=26");}
}
define('SMF', 1);
@set_magic_quotes_runtime(0);
error_reporting(E_ALL);
$time_start = microtime();

Orstio


exrace


Naesstrom

Omg... I must have been 2 tired last night... I want it to do the opposite... when I log in I DON'T want to go directly to the SMF... I have always done that since I installed the bridge...

now I finally understand why I thought it nevered worked... :D

Orstio

QuoteOmg... I must have been 2 tired last night... I want it to do the opposite... when I log in I DON'T want to go directly to the SMF... I have always done that since I installed the bridge...

Denying direct access to the forum has nothing to do with redirects on login and logout....

Naesstrom

nope... I missunderstood the entire topic last night... ;)

ChaosEnergy

hi

works perfectly :)

i only have a question, is there a way, to make some code between to give me a chance to reach forum old way, when coming from special adress, or with a parameter in link, or only when going to admin...

sometimes i have little issues when using wrapped mode, and i need a possibility to check if it is wrapped issue or not :P
Chaos Empire ®

Nitro

ok, here we go again. guys, i have been using this little tool for some time and i never had any errors, well actually there is no errors at all, but the redirect code doesn't work any more, i moved my forum to another server. i put this little code in the forum root index.php
if (strpos($_SERVER['QUERY_STRING'], 'dlattach') === false)
{
        if(!defined('_VALID_MOS')){ header("Location: http://www.mypowerforum.com/index.php");}
}


but that doesn't work, it gaves me page cannot be displayed. this is really weird, can someone tell me what am i missing? thank you guys, and specially Orstio for this little cool code.
MPF Rocks!!!

Ouly

I have just tried to access http://www.mypowerforum.com/bb/ and I have been correctly redirected without any error... (with Firefox 1.5 and IE 6.0)

Nitro

hey, that's weird! it wasn't working at first  :D

cool! i don't what happend but... it works now.

thank you man!
MPF Rocks!!!

Ouly

Notice : sometimes, a redirection shouldn't only be :

header("Location: http://...");

but :

header("Location: http://...");
exit;

rmderks

Hi guys,

I am confused. Can i use any of these codes to fix the links in the
email notifications to wrapped.

How can i get my email notifications in wrapped form?

CMS: Joomla
Bridge: not using any, just standard wrap function in Joomla
This is my website: hxxp:www.hortiforum.nl [nonactive]
Template: classic

Thank you so much!!

Roy

Kindred

no...

1- this hack will only work in combination with the bridge
2- using the wrapper component will screw up your forum (the forum does not run well in an iframe)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: