<commit_before><?php
/**
 * Keep epesi logged in.
 * @author <EMAIL>
 * @copyright <EMAIL>
 * @license SPL
 * @version 0.1
 * @package apps-sessionkeeper
 */
defined("_VALID_ACCESS") || die('Direct access forbidden');

class Apps_SessionKeeperCommon extends ModuleCommon {
	public static function user_settings(){
		return array('Session settings'=>array(
			array('name'=>'time','label'=>'Keep session at least','type'=>'select','values'=>array('default'=>'default server time','1800'=>'30 minutes','3600'=>'1 hour', '7200'=>'2 hours', '14400'=>'4 hours', '28800'=>'8 hours'),'default'=>'default','reload'=>true)
			));
	}

}
if(Acl::is_user()) {
	$time = Base_User_SettingsCommon::get('Apps/SessionKeeper','time');
	if($time!='default') {
		load_js('modules/Apps/SessionKeeper/sk.js');
		$sys_time = ini_get("session.gc_maxlifetime");
		$x_time = $time-$sys_time;
		if($x_time>0)
			eval_js_once('SessionKeeper.maxtime='.$x_time.';'.
				'SessionKeeper.interval='.($sys_time/2).';'.
				'SessionKeeper.load()');
	}
}
?><commit_msg>bug fixes<commit_after><?php
/**
 * Keep epesi logged in.
 * @author <EMAIL>
 * @copyright <EMAIL>
 * @license SPL
 * @version 0.1
 * @package apps-sessionkeeper
 */
defined("_VALID_ACCESS") || die('Direct access forbidden');

class Apps_SessionKeeperCommon extends ModuleCommon {
	public static function user_settings(){
		$time = ini_get("session.gc_maxlifetime");
		$def = array('default'=>'default server time ('.($time/60).' minutes)');
		if($time<1800)
			$def['1800']='30 minutes';
		if($time<3600)
			$def['3600']='1 hour';
		if($time<7200)
			$def['7200']='2 hours';
		if($time<14400)
			$def['14400']='4 hours';
		if($time<28800)
			$def['28800']='8 hours';
		return array('Session'=>array(
			array('name'=>'time','label'=>'Keep session at least','type'=>'select','values'=>$def,'default'=>'default','reload'=>true)
			));
	}

}
if(Acl::is_user()) {
	$time = Base_User_SettingsCommon::get('Apps/SessionKeeper','time');
	if($time!='default') {
		load_js('modules/Apps/SessionKeeper/sk.js');
		$sys_time = ini_get("session.gc_maxlifetime");
		$x_time = $time-$sys_time;
		if($x_time>0) {
			$interval = $sys_time/2;
			if($x_time<$interval)
				$interval = $x_time;
			eval_js_once('SessionKeeper.maxtime='.$x_time.';'.
				'SessionKeeper.interval='.($sys_time/2).';'.
				'SessionKeeper.load()');
		}
	}
}
?>
{'fraction_non_alphanumeric': 0.22288387920034028, 'fraction_numerical': 0.03785623139089749, 'mean_word_length': 5.700854700854701, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 32, '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': '3866284', 'n_tokens_mistral': 964, 'n_tokens_neox': 857, 'n_words': 132}