• Welcome to Simple Machines Community Forum. Please login or sign up.
December 07, 2021, 05:02:35 PM

News:

SMF 2.0.18 has been released! Please update. Read more.


Is it possible to tie SMF's login to another page / program?

Started by mlthmp, June 21, 2013, 08:38:10 PM

Previous topic - Next topic

mlthmp

I've checked out http://docs.simplemachines.org/index.php?topic=789.0  and haven't been able to get it right using those examples.

I am trying to make it where only users can access a certain webpage which isn't part of the forum. I do have "require('SSI.php');" as the first line of the page right after the opening <?php.. the file in question is in the main form directory along with the SSI file. So I guess that's the correct term to use?

Is there any certain code that I should use? I don't need anything fancy.. no usergroup permissions, etc. Just the ability to make users login to access, and redirect back to that page after login if they're not. I am using 2.0.4

Chalky

Hi there, did you follow the link through to the updated page in the wiki/online manual?  http://wiki.simplemachines.org/smf/How_to_use_the_SMF_user_system_outside_of_SMF.  Make sure the path to your SSI.php file is correct in the "require_once" bit and then just try straight copying the code shown under "How do I show a login/logout form?" as is wherever you want the login box to show.  If that works you can customise it later  :)

mlthmp

Yes Ive tried that. It shows the login boxes like it should, but right under it the rest of the page is openly available logged in or not lol.


Chalky

Ah ok, what about this bit right at the bottom of that page?

QuoteIf you want to block the page completely from guest access add is_not_guest('messageorreasontologin'); After the call for SSI.php.

If that isn't what you want I'm sure somebody will be along shortly who has a better idea than I do  :)

mlthmp

Oh thank you! I totally missed that I guess! =(

That did it. Thanks again!

Chalky


Advertisement: