News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

deny direct access to Pages outside of joomla

Started by An-Old_User, December 25, 2005, 04:27:15 PM

Previous topic - Next topic

HoTmetal

Hi all, merry X-mas!
I got a quick question....
How can I deny direct access to my pages that are wrapped into Joomla and allow only to see them when wrappend in Joomla? Is there a way to redirect them automatically???


I tried the code from this topic...

http://www.simplemachines.org/community/index.php?topic=35225.0;all

but it just kept wrapping the page inside itself over & over & over again...lol
here's a screen shot.;

xenovanis

"Insanity: doing the same thing over and over again and expecting different results."

HoTmetal

I added it to the file I don't want direct access to....


here's my example......


I want

http://www.lifeoncampus.com/list_teachers.php

to redirect to.....

http://www.lifeoncampus.com/v2/component/option,com_wrapper/Itemid,27/


So I added the code to the list_teachers.php

But for some reason, the redirect part of the script works, but the ":defined('_VALID_MOS')){ " doesn't so it just keep redirecting, then that page reads the script & redirects etc...etc.... I looked kinda funny, so  I posted the screen shot here... Is there some lace else I should put the code?? thanks again rickC

Orstio

Quote":defined('_VALID_MOS')){ "

That should be an exclamation mark (!), not a colon (:).

HoTmetal

Sweet... I'll give this a try & post here on how it works.... thanks again

HoTmetal

#5
Ok thanks again for the help. I tried the change, but it seems that was the code I was using. my post was wrong... This is the Exact code I'm using....
Quoteif (strpos($_SERVER['QUERY_STRING'], 'dlattach') === false)
{
   if(!defined('_VALID_MOS')){ header("Location: http://www.lifeoncampus.com/v2/component/option,com_wrapper/Itemid,27/");}
}

I still get the same error, what am I doing wrong now ?? lol



Orstio

It's because you are using the wrapper component.  The wrapper component opens another page inside an iframe.

Iframes act as independent pages, so, inside the iframe, _VALID_MOS is not defined, so it redirects to the wrapper component as per the header instruction, and that again contains the iframe.  When the page in that iframe loads, again _VALID_MOS is not defined, and the cycle continues indefinitely.

HoTmetal

Quote from: Orstio on December 28, 2005, 02:26:52 AM
It's because you are using the wrapper component.  The wrapper component opens another page inside an iframe.

Iframes act as independent pages, so, inside the iframe, _VALID_MOS is not defined, so it redirects to the wrapper component as per the header instruction, and that again contains the iframe.  When the page in that iframe loads, again _VALID_MOS is not defined, and the cycle continues indefinitely.

Ok that makes sence... Is there a work around? I mean is there another way I could make it so the page(s) that are wrapped in, cant be seen outside the wrapper? thanks agan for your help RickC

Kindred

yes... do not use the WRAPPER...  when you add the menu link add a menu item for a COMPONENT and then choose com_smf...   do not link the smf url in a joomla wrapper
Сл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."

HoTmetal

Quote from: Kindred on December 28, 2005, 11:58:15 PM
yes... do not use the WRAPPER...  when you add the menu link add a menu item for a COMPONENT and then choose com_smf...   do not link the smf url in a joomla wrapper

But its not an SMF url.... Its a normal php page... I think I have to add these pages in a a com & link them that way... DO you can any good links to show people how to make there own Com;s/.?? thanks again rickC

darkpollo

Is there anyway of use that code with a wrapper page?

Thanks

HoTmetal

Quote from: darkpollo on March 21, 2006, 06:34:56 PM
Is there anyway of use that code with a wrapper page?

Thanks



I'm just going to build a com for my pages

darkpollo

Ok, i dont know how to do that... :P

But... is there any way to know if a web is open inside a wrap? Is there any code that detect something like this?

Advertisement: