MAMBO: terrible login & logout issues, please help...

Started by marcnyc, November 05, 2004, 12:05:02 PM

Previous topic - Next topic

marcnyc

Ok, i have installed and integrated MOS and SMF with the bridge.
I have followed the instructions carefully and read all the readme files that come with the bridge.
In index.english.php I have replaced:
$txt['welcome_guest'] = 'Welcome, <b>' . $txt[28] . '</b>. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';

with:
$txt['welcome_guest'] = 'Welcome, <b>' . $txt[28] . '</b>. Please login or <a href="http://www.your-mambo-installation.com/directory/index.php?option=com_smf_registration&task=register">register</a>.';

In index.template.php I have changed:
action=login2

into:
action=mambo_login
and:
action=logout
into:
action=mambo_logout


I have made the following assumptions (PLEASE!!! correct me if I am wrong because I could be confused):
1. I am supposed NOT to use the ssi_login() and ssi_logout() functions (unless I am willing to edit SSI.php as well)
2. I am supposed NOT to use the SMF registation page because if I do users will only be registered in SMF and not in MOS, while if I do the opposite (have them register from the MOS registration page) they will automatically be registered in both SMF and MOS.
3. I am supposed to be able to log in both from the SMF pages and the MOS pages.
4. I don't see a logout button in the Mambo pages so I am supposed to logout from the SMF logout button.

If these assumptions are correct then I don't know what is wrong with this scenario but the fact is that I can't seem to log in or log out (cookies are enabled of course).

1. If I log in from the integrated log in module in the mambo pages I get a message in the SMF pages that says the following:
QuoteAn Error Has Occurred!
You were unable to login. Please check your cookie settings.
The URL in this case is:
Quote/mambo/index.php?option=com_smf&Itemid=&?PHPSESSID=rle50irqa1rkqdbg4l795h0ic3&action=mambo_login;sa=check;id=3
Strangely the ssi_whoisonline() function says that I am logged in but as soon as I click any link it goes back to saluting me as a guest.

2. If on the other hand I log in from the SMF log in at the top of the page using the default SMF theme then I am able to log in but clicking on the SMF logout button has no effect at all. This button points to:
Quote/community/index.php?action=mambo_logout;sesc=da2bf1a3fd4d0d262e2d3946eedbf2c1

I am stuck and don't know what to do.
I am using SMF 1.0 RC2 and MOS 4.5.1a
Everything is being tested locally with PHP5 and seems to work except this.

Kindred

Your login string looks really wierd...

Quote
... /mambo/index.php?option=com_smf&Itemid=48&?action=login

There should be no session ID if you are not logged in yet.

(also, you did change the line:
... Please login or <a href="http://www.your-mambo-installation.com/directory/index.php?option=com_smf_registration...

to reflect your actual installation, correct?)

My logout looks somewhat similar...
Quote
... /mambo/?option=com_smf&Itemid=48&?action=mambo_logout;sesc=c7e94e8b9e8022c8af6ab8fabd31354a

And yes...  if you ONLY go into SMF, bypassing Mambo, logout does not work at all...
Сл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."

marcnyc

Ok so let's see.
What is wrong with my login string? How can I fix it?

Yes I have made the change as the readme file said so that the Please login... sentence reflects the proper path. I have made this change in index.english.php and the line looks like this:

$txt['welcome_guest'] = 'Welcome, <b>' . $txt[28] . '</b>. Please login or <a href="/content/?option=com_smf_registration&task=register">register</a>.';


(my MOS is installed in /content)

Ok so I am not supposed to log out from SMF, is that what you are saying? I should ALWAYS log out from the Mambo log out button. Is this correct?

Please help me out on this.

Kindred

I'm not sure how to fix your login link...  I just know that it's wrong...   Hopefully Orstio will see this and have an idea.

As for logging out...

If you bypass Mambo completely (in other words, load your SMF directly) the logout link does not work (at least it never has for me)

However, using the SMF logout link from the iframe of Mambo has always worked for me (to log me out of SMF, loggin out of Mambo is another story.
Сл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."

yardbird

maybe I'm reading this incorrectly (strange day.... don't ask)... but it LOOKS like you replaced your login link with a registration link.


[Unknown]

Why not add a few redirectexit()'s to LogInOut.php and make sure you got all the login/register links that way?

-[Unknown]

Orstio

Quote1. I am supposed NOT to use the ssi_login() and ssi_logout() functions (unless I am willing to edit SSI.php as well)
2. I am supposed NOT to use the SMF registation page because if I do users will only be registered in SMF and not in MOS, while if I do the opposite (have them register from the MOS registration page) they will automatically be registered in both SMF and MOS.
3. I am supposed to be able to log in both from the SMF pages and the MOS pages.
4. I don't see a logout button in the Mambo pages so I am supposed to logout from the SMF logout button.

1)  Correct.

2)  Incorrect.  You must use the com_smf_registration component in order for users to be registered in both.

3)  If you use the integrated login, you should be logged in to both.  If you use the SMF login, you will log in to SMF.  If you use the Mambo login, you will be logged in to Mambo.

4)  The integrated login comes with a logout button......   ???

It looks a lot to me like you are confusing registration and login.  And in the process you seem to have made things far more complicated for yourself than they need to be.

Kris

I would like to see in the new registration component, the agreement text displayed with a checkbox that a new member has to check to have read the agreement.

Orstio

QuoteI would like to see in the new registration component, the agreement text displayed with a checkbox that a new member has to check to have read the agreement.

That should be easy.  Do you want me to email that to you?

Kris

Quote from: Orstio on November 07, 2004, 07:45:02 AM
QuoteI would like to see in the new registration component, the agreement text displayed with a checkbox that a new member has to check to have read the agreement.

That should be easy.  Do you want me to email that to you?

You always can ;)

But I mean, I just noticed this is missing in the new registration and some site owners might appreciate that part included in the registration component.


marcnyc

Hello folks, strange I wasn't getting email notifications of your new posts so I missed them until now...
Anyway, thanks a lot for taking the time to reply, I ALWAYS appreciate your generosity, I know time is an asset.

My login problems continue.
All of the above I had written was happening on my local Mac OSX machine running Apache with PHP5, SMF RC2 and MOS 4.5.1a.
I decide to start over and I have just installed a fresh copy of Mambo on my remote server. This time it's a Unix machine with an Apache with PHP4. SMF is as always RC2 and MOS is 4.5.1a.
I installed Mambo in the folder /content/

I have made absolutely sure to perfectly follow ALL the instructions included in the four readme files of the bridge and this is what I get:

If I log in from the the integrated log in then I am logged into SMF but I am NOT logged into Mambo!!!
I don't know why this is happening, but I have made sure to follow all instructions carefully and I am really stuck now.

You can view the site here:
http://www.chaindlk.com/content/
the forum is here (obviously):
http://www.chaindlk.com/content/?option=com_smf

I know that I am not logged into Mambo is because if I go to the UserDetails page:
http://www.chaindlk.com/content/?option=com_user&task=UserDetails
it says that I am not authorized because I am not logged in!!!
I am currently working on this site so there are still things that aren't perfect and many dead links...

I hope somebody can lend a hand.
Feel free to create as many test accounts as you want, this website is not live yet...

Orstio

#11
QuoteIf I log in from the the integrated log in then I am logged into SMF but I am NOT logged into Mambo!!!
I don't know why this is happening, but I have made sure to follow all instructions carefully and I am really stuck now.

You can view the site here:
http://www.chaindlk.com/content/
the forum is here (obviously):
http://www.chaindlk.com/content/?option=com_smf

I know that I am not logged into Mambo is because if I go to the UserDetails page:
http://www.chaindlk.com/content/?option=com_user&task=UserDetails
it says that I am not authorized because I am not logged in!!!
I am currently working on this site so there are still things that aren't perfect and many dead links...

I hope somebody can lend a hand.
Feel free to create as many test accounts as you want, this website is not live yet...


Try v2.03:

http://mamboforge.net/frs/?group_id=543

It fixed those exact problems for everyone so far.

Very creative design you have there.  Nice work.  ;D

marcnyc

Wow, I didn't know there was a new version. I have v2.02beta...
I'll immediately try and see if the new version solves my problem, that would be heaven...
Do I need to uninstall the 2.02b bridge before installing the .03? Or does installing a component/module overwrite the existing one? If I do neet to uninstall it, does it matter in what order I do?
Thanks for the compliments about the site. I've been working on this for a long long time...
Marc

Orstio

QuoteDo I need to uninstall the 2.02b bridge before installing the .03? Or does installing a component/module overwrite the existing one?

Because you already have v2.02 installed, you can just overwrite the files.  It makes no difference in what order.

The instructions for the include in your Mambo template are a little different as well.  Make sure you do that.

marcnyc

Orstio it works. You are a genius!
Your work is very much appreciated, I want you to know this!
You rock! Awesome!
PS. I see that you have added anc changed some things to make it PHP5-compliant... I am glad you could make use of my input. I will be testing this locally on my MacOSX/PHP5 installation as well and report back to you to let you know how that went... I have a feeling that with that new if statement that you added to the MOS template I won't be getting that PHP5-only error about the already defined SMF constant...
Glad to see I could at least of a little help in debugging on php5, at least I redeem myself from all the whining and complaining I did in this post ;-)

marcnyc

Sadly I have to report there are still a few issues with PHP5 compatibility.
One is very easy to fix and I will post it here for anybody who wants to take advantage:

After having installed it, open mod_smf_login.php and change both instances (line 16 and line 101) of:
PHP_SELF
into:
$_SERVER['PHP_SELF']

That will avoid a few undefined index errors being displayed on PHP5 installations.

Apart from these easy fixes I get three more errors I am not sure how to fix properly, here they are:

Quote
<br />
<b>Notice</b>:  Constant SMF already defined in <b>/Library/WebServer/Documents/content/components/com_smf/smf.php</b> on line <b>10</b><br />
<br />
<b>Notice</b>:  A session had already been started - ignoring session_start() in <b>/Library/WebServer/Documents/community/Sources/Load.php</b> on line <b>1192</b><br />

<b>Notice</b>:  Undefined variable:  mosConfig_lang in <b>/Library/WebServer/Documents/community/Sources/Load.php(1098) : eval()'d code</b> on line <b>258</b><br />

PLEASE NOTE that the first and second errors will be at the top of your ?option=com_smf pages, while the third one you won't see but it's there. Just look at the source code of the rendered/parsed page you are looking at and you'll see it. The reason why you don't see it is because it is contained within a hidden form element tag so it's not displayed, but the whole error is sent along with the POST variables...

Anyway, important message to Orstio.
I know you are convinced that I am a crazy lunatic and that these issues are MacOSX related issues because your PHP5 beta tester did not see these errors, but it came to my mind that maybe he/she had error displaying and error handling disabled. Did you think about this?

If that is the case maybe you can ask your windows beta tester to do the following:
Quote
Comment the line: (remove the ; character at the beginning of the line)
;error_reporting = E_ALL & ~E_NOTICE

UNComment the line (add a ; character at the beginning of the line)
error_reporting = E_ALL

In my version of php.ini, these two lines were numbers 277 & 285 respectively.

This makes sure that all errors notices will be displayed.

Finally, change the line with display_errors to On: (line 292 for me)
display_errors = On

Let me know if that makes any difference... If it does you'll see it's not my Mac that is broken and neither is my brain or my eyes ;-)

Orstio you are the man!

Orstio

Quote from: marcnyc on November 07, 2004, 05:28:05 PM
Sadly I have to report there are still a few issues with PHP5 compatibility.
One is very easy to fix and I will post it here for anybody who wants to take advantage:

After having installed it, open mod_smf_login.php and change both instances (line 16 and line 101) of:
PHP_SELF
into:
$_SERVER['PHP_SELF']

That will avoid a few undefined index errors being displayed on PHP5 installations.

Apart from these easy fixes I get three more errors I am not sure how to fix properly, here they are:

Quote
<br />
<b>Notice</b>:  Constant SMF already defined in <b>/Library/WebServer/Documents/content/components/com_smf/smf.php</b> on line <b>10</b><br />
<br />
<b>Notice</b>:  A session had already been started - ignoring session_start() in <b>/Library/WebServer/Documents/community/Sources/Load.php</b> on line <b>1192</b><br />

<b>Notice</b>:  Undefined variable:  mosConfig_lang in <b>/Library/WebServer/Documents/community/Sources/Load.php(1098) : eval()'d code</b> on line <b>258</b><br />

PLEASE NOTE that the first and second errors will be at the top of your ?option=com_smf pages, while the third one you won't see but it's there. Just look at the source code of the rendered/parsed page you are looking at and you'll see it. The reason why you don't see it is because it is contained within a hidden form element tag so it's not displayed, but the whole error is sent along with the POST variables...

Anyway, important message to Orstio.
I know you are convinced that I am a crazy lunatic and that these issues are MacOSX related issues because your PHP5 beta tester did not see these errors, but it came to my mind that maybe he/she had error displaying and error handling disabled. Did you think about this?

If that is the case maybe you can ask your windows beta tester to do the following:
Quote
Comment the line: (remove the ; character at the beginning of the line)
;error_reporting = E_ALL & ~E_NOTICE

UNComment the line (add a ; character at the beginning of the line)
error_reporting = E_ALL

In my version of php.ini, these two lines were numbers 277 & 285 respectively.

This makes sure that all errors notices will be displayed.

Finally, change the line with display_errors to On: (line 292 for me)
display_errors = On

Let me know if that makes any difference... If it does you'll see it's not my Mac that is broken and neither is my brain or my eyes ;-)

Orstio you are the man!

I don't think you're a lunatic, just a little confused sometimes.  ;D

It could have something to do with error handling, or Apache, or PHP5, or MacOSX.  There are a lot of factors that could be causing problems for you when hosting a site on your local machine, because your settings may be completely unique from the majority of servers on the web.

Your fixes for some of the "unseen" PHP5 issues are appreciated.  ;D

marcnyc

Don't worry I was just kidding... Sometimes I do get confused, that happens when you are not a programmer and you try to figure out what is being said in a language that isn't yours (php in this case)...
I know that a local machine is unique, but I just can't imagine that it makes a difference if it is a Mac or a PC, in the end they are both running Apache, that's why in my humble non-programmer's opinion the real difference is PHP5 here and maybe your tester just didn't have error output enabled. I do, so I see ;-)

I should be your beta tester ;-) ha ha

Anyway, I am glad you appreciate my help, but please let me know if you have any ideas about where those other three erros I posted could come from... it really bugs me not to be able to test it locally ;-)

I see you are still on my production site... what are you doing there? ;-)) ha ha, stay as long as you want, smart people are always welcome in my book!

Orstio

QuotemosConfig_lang in <b>/Library/WebServer/Documents/community/Sources/Load.php

I have no idea about that one.  Nothing like that from Mambo should be passed to Load.php.  ???

Quote<b>Notice</b>:  A session had already been started - ignoring session_start() in <b>/Library/WebServer/Documents/community/Sources/Load.php</b> on line <b>1192</b><br />

I don't know if this one can be avoided without changing that file.

Quote<b>Notice</b>:  Constant SMF already defined in <b>/Library/WebServer/Documents/content/components/com_smf/smf.php</b> on line <b>10</b><br />

You should be able to fix that.  Change:


if (!defined('SMF')){
  require ("components/com_smf/config.smf.php");
  require ($smf_path."/SSI.php");
}

define('SMF', 1);


to:


if (!defined('SMF')){
  require ("components/com_smf/config.smf.php");
  require ($smf_path."/SSI.php");
  define('SMF', 1);
}

marcnyc

Quote from: Orstio on November 07, 2004, 06:04:23 PM
QuotemosConfig_lang in <b>/Library/WebServer/Documents/community/Sources/Load.php
I have no idea about that one. Nothing like that from Mambo should be passed to Load.php. ???
If you look at the code, that error happens when you try to assign the value to the POST language variable in the form's hidden element tag.

Quote from: Orstio on November 07, 2004, 06:04:23 PM
Quote<b>Notice</b>: A session had already been started - ignoring session_start() in <b>/Library/WebServer/Documents/community/Sources/Load.php</b> on line <b>1192</b><br />
I don't know if this one can be avoided without changing that file.
Isn't there a way to check if the session is already started and not start it again if it is?

Quote from: Orstio on November 07, 2004, 06:04:23 PM
Quote<b>Notice</b>: Constant SMF already defined in <b>/Library/WebServer/Documents/content/components/com_smf/smf.php</b> on line <b>10</b><br />
You should be able to fix that. Change:

if (!defined('SMF')){
require ("components/com_smf/config.smf.php");
require ($smf_path."/SSI.php");
}
define('SMF', 1);

to:

if (!defined('SMF')){
require ("components/com_smf/config.smf.php");
require ($smf_path."/SSI.php");
define('SMF', 1);
}

Where would I make this change? If you are referring to the MOS template then there isn't a define('SMF',1) line at all there...

Advertisement: