posted 18 years ago
After much debugging (the hard way LOL), I finally figured out the problem. Here was my code before:
The problem was both of the logical tests (the second and third else if statements) were both returning false. That is because I was simply checking to see if the name was in the session, then -intending- to return true if so. In order to make these expressions evaluate the way I wanted them too, I needed to either remove them or add the requested data to the session.
Now I realize this is essentially forcing my expressions to evaluate to true by brute force. The reason I decided to leave them, however, was that I expect that this session management should be dealt with before the call to isSessionValid by JForum. If this is not true, then perhaps this should be a part of the authenticateUser method. I would assume this would be so given the name of the method, but the fact that it does not accept a UserSession object as a parameter leads me to believe I simply do not understand its purpose.
When I figure out a more proper place to add this data to the session, I'll be moving this code fragment there. Until then, I'd like to ask if you think the authenticateUser method should be doing this session management.
[originally posted on jforum.net by uniq]