Truemedia Posted August 22, 2011 Report Posted August 22, 2011 Hi, Just thought this would be really useful to a lot of people wanting to integrate phpVMS with other software. This is a code snippet that will allow you to logout of phpvms regardless of where the script is or where it's called from. Just make sure the directory to you codon file is correct and everything should work fine . Here is the code below (basically the logout function of the auth class but written out instead of referenced to avoid execute problems): <?php require("../../phpvms/core/codon.config.php"); #self::remove_sessions(SessionManager::GetValue('userinfo', 'pilotid')); # Mark them as guest Auth::update_session(Auth::$session_id, 0); # "Ghost" entry //self::start_session(self::$userinfo->pilotid); // Orphaned? SessionManager::Set('loggedin', false); SessionManager::Set('userinfo', ''); SessionManager::Set('usergroups', ''); # Delete cookie $_COOKIE['VMSAUTH'] = ''; setcookie("VMSAUTH", false, time() - 3600*24*30, "/"); Auth::$loggedin = false; ?> Hope this helps anyone that was looking for it. Quote
Jeff Posted August 22, 2011 Report Posted August 22, 2011 Very nice, thanks. Should be in Code Snippets though Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.