Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: mlthmp on June 21, 2013, 08:38:10 PM

Title: Is it possible to tie SMF's login to another page / program?
Post by: mlthmp on June 21, 2013, 08:38:10 PM
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
Title: Re: Is it possible to tie SMF's login to another page / program?
Post by: Chalky on June 21, 2013, 08:45:28 PM
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  :)
Title: Re: Is it possible to tie SMF's login to another page / program?
Post by: mlthmp on June 21, 2013, 08:51:52 PM
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.

Title: Re: Is it possible to tie SMF's login to another page / program?
Post by: Chalky on June 21, 2013, 08:57:38 PM
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  :)
Title: Re: Is it possible to tie SMF's login to another page / program?
Post by: mlthmp on June 21, 2013, 09:18:59 PM
Oh thank you! I totally missed that I guess! =(

That did it. Thanks again!
Title: Re: Is it possible to tie SMF's login to another page / program?
Post by: Chalky on June 22, 2013, 04:16:53 AM
Oh excellent!  :)