Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: bigdavisc - marraskuu 17, 2013, 06:25:25 IP

Otsikko: SSI is not working for me!
Kirjoitti: bigdavisc - marraskuu 17, 2013, 06:25:25 IP
Hi I have just installed SMF and I want it to work properly.

I want my users to go to a page that either direct them to a login page if they are not logged it to my forum. and will redirect them to a different page if they are logged in.

I have tried this code:

<?php
include ('../forum/SSI.php');
if ($context['user']['is_guest']) {
ssi_login();
}
else {

//Redirect Goes Here

}
?>


But no matter whether I am logged in or not I will be directed to the Login Form

Please Help.
Otsikko: Re: SSI is not working for me!
Kirjoitti: Arantor - marraskuu 17, 2013, 06:32:56 IP
/me assumes you're using SMF 2.0.6

What's the setting of Admin > Configuration > Server Settings > Cookies and Sessions > Enable subdomain independent cookies? (Or for that matter, same page, 'enable local cookes')
Otsikko: Re: SSI is not working for me!
Kirjoitti: bigdavisc - marraskuu 17, 2013, 06:34:36 IP
Subdomain independent cookies is checked and local cookies is unchecked
Otsikko: Re: SSI is not working for me!
Kirjoitti: Arantor - marraskuu 17, 2013, 06:38:27 IP
Hmm, that seems like it should be correct. Did you change those settings at any point? (If so, log out and log back in to ensure your cookie gets rebuilt)

Also, where did you put that code exactly?
Otsikko: Re: SSI is not working for me!
Kirjoitti: bigdavisc - marraskuu 17, 2013, 06:41:10 IP
I did not change these settings.

This code is in a file on a subdomain. The forum is stored on a different subdomain on the same server.
Otsikko: Re: SSI is not working for me!
Kirjoitti: Arantor - marraskuu 17, 2013, 06:43:03 IP
That wasn't what I meant... you've made a file. Is that file inside something else (e.g. embedded inside WordPress whose cookie handling is well known to damage anything else)
Otsikko: Re: SSI is not working for me!
Kirjoitti: bigdavisc - marraskuu 17, 2013, 07:13:36 IP
Oh Sorry  ;D

No it is not. it is just a plain .php file