<commit_before><?php

/**
 * Idle timer modules
 * @package modules
 * @subpackage idletimer
 */

if (!defined('DEBUG_MODE')) { die(); }

/**
 * @subpackage idletimer/handler
 */
class Hm_Handler_idle_time_check extends Hm_Handler_Module {
    public function process() {
        $logout = false;
        if ($this->session->loaded) {
            $this->session->set('idletime_start', time());
        }
        $start = $this->session->get('idletime_start', 0);
        if (!$start) {
            $logout = true;
        }
        else {
            $max = $this->user_config->get('idle_time', 1)*60*60;
            if ($max && (time() - $start) > $max) {
                $logout = true;
            }
        }
        if ($logout) {
            Hm_Debug::add('IDLETIMER: timer exceeded, logged out');
            $this->session->destroy($this->request);
        }
        else {
            $this->session->set('idletime_start', time());
        }
    }
}

/**
 * @subpackage idletimer/handler
 */<commit_msg>default to no forced logout in the idle timer<commit_after><?php

/**
 * Idle timer modules
 * @package modules
 * @subpackage idletimer
 */

if (!defined('DEBUG_MODE')) { die(); }

/**
 * @subpackage idletimer/handler
 */
class Hm_Handler_idle_time_check extends Hm_Handler_Module {
    public function process() {
        $logout = false;
        if ($this->session->loaded) {
            $this->session->set('idletime_start', time());
        }
        $start = $this->session->get('idletime_start', 0);
        if (!$start) {
            $logout = true;
        }
        else {
            $max = $this->user_config->get('idle_time', 0)*60*60;
            if ($max && (time() - $start) > $max) {
                $logout = true;
            }
        }
        if ($logout) {
            Hm_Debug::add('IDLETIMER: timer exceeded, logged out');
            $this->session->destroy($this->request);
        }
        else {
            $this->session->set('idletime_start', time());
        }
    }
}

/**
 * @subpackage idletimer/handler
 */
{'fraction_non_alphanumeric': 0.16634241245136186, 'fraction_numerical': 0.005836575875486381, 'mean_word_length': 1.9597122302158274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4894317', 'n_tokens_mistral': 650, 'n_tokens_neox': 645, 'n_words': 122}