I am trying to integrate my new vBulletin installation with my current CMS and need to have a custom logout button. How do I get the has code to logout the current user via custom php?
Announcement
Collapse
No announcement yet.
Custom Logout Code
Collapse
X
-
You would call the logout method of the vB_Api_User class.
http://vb5support.com/resources/mapi...#method_logoutTranslations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 API
-
Thank you for your reply.
I have the following code but it is giving me "Access Denied" error.
PHP Code:require_once(. '/forum/core/global.php');
require_once(. '/forum/core/includes/init.php'); // includes class_core.php
require_once(. '/forum/core/includes/class_dm.php'); // for class_dm_user.php
require_once(. '/forum/core/includes/class_dm_user.php'); // for user functions
require_once(. '/forum/core/includes/functions.php'); // vbsetcookie etc.
require_once(. '/forum/core/includes/functions_login.php'); // process login/logout
require_once(. '/forum/core/includes/functions_user.php'); // enable us to sort out activation
//--------------------------
// CLASS ForumOps
//---------------------------
class ForumOps extends vB_DataManager_User {
var $userdm;
public function logout()
{
// unsets all cookies and session data
process_logout();
}
} // end class ForumOps
Comment
-
All of that would be used for legacy code like the AdminCP.The API is under /core/vb/api. You would use the logout method of the vB_Api_User class after initializing the API.
Actually scratch that. You can log the user out with a GET call to <vBulletinURL>/auth/logout?logouthash=$logouthash. The logouthash would be the CSRF token that would be embedded for the user to submit a form. This token should be embedded in the user object as the $securitytoken variable.Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 API
Comment
-
https://vbmods.rocks. Glenn does freelance work.Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 API
Comment
Related Topics
Collapse
-
by dacstyleAfter upgrade from vb4 to vb5 i can't login to admincp, i receive this error:
Code:Fatal error: Call to undefined method vB_Template_Runtime::includeJs() in /home/amitosai/public_html/foro/includes/class_core.php(4627)
-
Channel: vBulletin 5 Installs & Upgrades
Thu 13 Sep '12, 9:26am -
Comment