I am looking for the function used to log out a user. I have looked for the function that gets called when you use ?SQ_ACTION=logout but I am having a hard time finding it.
mysource.inc has _processGlobalActions() which is a private method. It has a switch statement: switch ($_REQUEST['SQ_ACTION']) which is used for the SQ_ACTION=logout. Is there any other way to logout a user other than using this? Is there a public function that can be used?
Function that logs out user
[quote]
I am looking for the function used to log out a user. I have looked for the function that gets called when you use ?SQ_ACTION=logout but I am having a hard time finding it.
mysource.inc has _processGlobalActions() which is a private method. It has a switch statement: switch ($_REQUEST['SQ_ACTION']) which is used for the SQ_ACTION=logout. Is there any other way to logout a user other than using this? Is there a public function that can be used?
[/quote]
Hi Nick,
I am not sure how you are trying to set the current user. But if it is a script you are trying to use, you can always use restoreCurrentUser() from mysource.inc. Also loginPublicUser() might be used to clear the $_SESSION stuff.
Hope this helps. Or if not can you briefly tell us what you are trying to do, if possible, which might help shed some light on what is being tried to accomplish.
Cheers,
Ash
The SOAP server does not have a logout function, so I am trying to write my own.
[quote]
The SOAP server does not have a logout function, so I am trying to write my own.
[/quote]
I think you would have to at least:
- MySource->_clearSession() (i know it private, but the contents are small it should be easy to replicate in your function)
- MySource->loginPublicUser()
- MySource->generateLoginKey(TRUE)
- And possibly clear $SERVER['PHP_AUTH*'] vars.
- Also you should create a small function to log 'system.security.logout.manual' Security messages (that way you wont get a heap of logins with no logouts)
But also, a nice thing would be to fire the logout triggers as well.
I think that should get the user logged out completely.
Hope that helps!