News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Variables

Started by chris077, August 14, 2009, 09:30:44 PM

Previous topic - Next topic

chris077

Quote from: Arantor on August 15, 2009, 09:00:23 PM
That's what SSI Register does. It drops the form into your own page.

What exactly are you trying to do with Register()?
I understand that but its not for 2.0...and i dont really have time to wait for it to come out for 2.0..

I just trying to get the register form on my website so people can register on the website instead of the forum..

Arantor

SSI Register was not part of 2.0 nor part of 1.1 without a mod. You are either waiting for someone to upgrade the mod, or learn how to splice templates from 2.0 into your code.

I will take a look at upgrading SSI Register for 2.0 in the next couple of days - unless someone else wants to jump in (but I strongly doubt it)

chris077

Ok my login is still going to the forums.. Any help? This is a include file, I include it into the login box on every page..that might have something to do with it?

My forum is community.php and my homepage is index.php..


<?php
require_once('SSI.php');
$_SESSION['login_url'] = '****/index.php';
if (
$context['user']['is_guest'])
{
   
ssi_login('****/index.php');
}
else
{
   
//stuff

   
ssi_logout();
}
?>


Arantor

If you're using 2.0 there is a known bug where the session variable isn't properly maintained when using ssi_login, thus you have to pull the form out of ssi_login and display it yourself.

chris077

Quote from: Arantor on August 16, 2009, 01:53:48 PM
If you're using 2.0 there is a known bug where the session variable isn't properly maintained when using ssi_login, thus you have to pull the form out of ssi_login and display it yourself.
Theres no way to direct every login on the forums? not just the SSI?

Arantor

What exactly are you trying to do?

You were using SSI.php for the purposes of directing back to a site after logging in from the site, correct? Are you saying that you want to return to the non-forum page after successful login regardless of whether it's in the forum or outside it?

chris077

#26
Quote from: Arantor on August 16, 2009, 06:07:17 PM
What exactly are you trying to do?

You were using SSI.php for the purposes of directing back to a site after logging in from the site, correct? Are you saying that you want to return to the non-forum page after successful login regardless of whether it's in the forum or outside it?
That is correct.

edit: i just added this at the top of LogInOut.php

$_SESSION['login_url'] = '****/index.php';
$_SESSION['logout_url'] = '****/index.php';

Arantor

That would have been what I would advise you next, yes - if you want to force all users to return to a page other than the forum index on login - not just from outside via ssi_login but *all* logins, that's the only way to do it.

chris077

Another problem..when i click on the ssi_logout.

Session verification failed. Please try logging out and back in again, and then try again.

Arantor

Does the link that ssi_logout produce have a long string of alphanumeric characters in it?

chris077

Yes.
its the wrong session ID i think..

community.php?action=logout;dcf037cba53=e002ebf8ee0d66ff271959dbc974d07a

I made a nav item using ssi_logout on the forum and it worked fine, it was a different session id.

jollyrogue

this is the exact same problem i'm also having
http://www.simplemachines.org/community/index.php?topic=331264.msg2215670#msg2215670

Login redirects to the forum and logout brings up a session verification failed.

Frieling

instead of having include_once('SSI.php');

i always found include('SSI.php');

is alittle easier and cleaner, just a little coding assist
Just an average guy.

Orstio

Quote from: chris077 on August 16, 2009, 07:18:45 PM
Yes.
its the wrong session ID i think..

community.php?action=logout;dcf037cba53=e002ebf8ee0d66ff271959dbc974d07a

I made a nav item using ssi_logout on the forum and it worked fine, it was a different session id.

After you include SSI.php, you need this code:

global $context;

$sc = &$context['session_id'];
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

Advertisement: