<commit_before><?php
/**
 *                    Jojo CMS
 *                ================
 *
 * Copyright 2007-2008 <NAME> <<EMAIL>>
 * Copyright 2007-2008 <NAME> <<EMAIL>>
 * Copyright 2007 <NAME> <<EMAIL>>
 *
 * See the enclosed file license.txt for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 *
 * @author  <NAME> <<EMAIL>>
 * @author  <NAME> <<EMAIL>>
 * @author  <NAME> <<EMAIL>>
 * @license http://www.fsf.org/copyleft/lgpl.html GNU Lesser General Public License
 * @link    http://www.jojocms.org JojoCMS
 * @package jojo_core
 */

class Jojo_Plugin_Logout extends Jojo_Plugin
{
    function _getContent()
    {
        global $smarty;

        /* Delete all cookies from the computer */
        setcookie("jojoR", "", time() - 3600, '/' . _SITEFOLDER);

        /* Delete session values */
        unset($_SESSION['userid']);

        $_SESSION['loggingout'] = true;

        /* Redirect */
        header('Location: ' . _SITEURL);
        exit();
    }
}<commit_msg>Add a hook for processing after-logiout actions.<commit_after><?php
/**
 *                    Jojo CMS
 *                ================
 *
 * Copyright 2007-2008 <NAME> <<EMAIL>>
 * Copyright 2007-2008 <NAME> <<EMAIL>>
 * Copyright 2007 <NAME> <<EMAIL>>
 *
 * See the enclosed file license.txt for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 *
 * @author  <NAME> <<EMAIL>>
 * @author  <NAME> <<EMAIL>>
 * @author  <NAME> <<EMAIL>>
 * @license http://www.fsf.org/copyleft/lgpl.html GNU Lesser General Public License
 * @link    http://www.jojocms.org JojoCMS
 * @package jojo_core
 */

class Jojo_Plugin_Logout extends Jojo_Plugin
{
    function _getContent()
    {
        global $smarty;

        /* Delete all cookies from the computer */
        setcookie("jojoR", "", time() - 3600, '/' . _SITEFOLDER);

        /* Delete session values */
        $userid = $_SESSION['userid'];
        unset($_SESSION['userid']);

        $_SESSION['loggingout'] = true;
        
        Jojo::runHook('after_logout', array($userid));        

        /* Redirect */
        header('Location: ' . _SITEURL);
        exit();
    }
}
{'fraction_non_alphanumeric': 0.16651705565529623, 'fraction_numerical': 0.02154398563734291, 'mean_word_length': 2.4665629860031104, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '364247', 'n_tokens_mistral': 756, 'n_tokens_neox': 690, 'n_words': 174}