<commit_before><?php

//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER['SCRIPT_NAME'],basename(__FILE__)) !== false) {
  header('location: index.php');
  exit;
}

if (!$user) {
	$smarty->assign('tpl_module_title', tra('Webmail error'));
	$smarty->assign('error', 'You are not logged in');
	return;	// modules cannot "exit", they must "return" to keep tiki alive
}

if ($prefs['feature_webmail'] != 'y') {
	$smarty->assign('tpl_module_title', tra('Webmail error'));
	$smarty->assign('error', 'This feature is disabled');
	return;
}
global $tiki_p_use_webmail;
if ($tiki_p_use_webmail != 'y') {
	$smarty->assign('tpl_module_title', tra('Webmail error'));
	$smarty->assign('error', 'Permission denied to use this feature');
	return;
}

if ($prefs['feature_ajax'] == 'y') {
	// this includes what we need for ajax
	require_once ('tiki-webmail_ajax.php');
}

global $webmaillib, $trklib, $headerlib, $user, $webmail_reload, $webmail_start, $smarty, $dbTiki;
if (!isset($webmaillib)) { include_once ('lib/webmail/webmaillib.php'); }
require_once ('lib/webmail/net_pop3.php');
include_once ('lib/webmail/tikimaillib.php');
if (!isset($trklib)) { include_once('lib/trackers/trackerlib.php'); }<commit_msg>[FIX] mod-webmail_inbox: correct no-AJAX error<commit_after><?php

//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER['SCRIPT_NAME'],basename(__FILE__)) !== false) {
  header('location: index.php');
  exit;
}

if (!$user) {
	$smarty->assign('tpl_module_title', tra('Webmail error'));
	$smarty->assign('error', 'You are not logged in');
	return;	// modules cannot "exit", they must "return" to keep tiki alive
}

if ($prefs['feature_webmail'] != 'y') {
	$smarty->assign('tpl_module_title', tra('Webmail error'));
	$smarty->assign('error', 'This feature is disabled');
	return;
}
global $tiki_p_use_webmail;
if ($tiki_p_use_webmail != 'y') {
	$smarty->assign('tpl_module_title', tra('Webmail error'));
	$smarty->assign('error', 'Permission denied to use this feature');
	return;
}

if ($prefs['feature_ajax'] == 'y') {
	// this includes what we need for ajax
	require_once ('tiki-webmail_ajax.php');
} else  {
	require_once $smarty->_get_plugin_filepath('function', 'icon');
	$smarty->assign('tpl_module_title', tra('Webmail error'));
	$smarty->assign('error', tra('AJAX feature required').'&nbsp;'.
		'<a href="tiki-admin.php?page=features">'.smarty_function_icon(array('_id'=>'arrow_right'), $smarty)).'</a>';
	return;
}

global $webmaillib, $trklib, $headerlib, $user, $webmail_reload, $webmail_start, $smarty, $dbTiki;
if (!isset($webmaillib)) { include_once ('lib/webmail/webmaillib.php'); }
require_once ('lib/webmail/net_pop3.php');
include_once ('lib/webmail/tikimaillib.php');
if (!isset($trklib)) { include_once('lib/trackers/trackerlib.php'); }
{'fraction_non_alphanumeric': 0.19149683766690093, 'fraction_numerical': 0.0007027406886858749, 'mean_word_length': 6.394805194805195, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, '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': '4096060', 'n_tokens_mistral': 1021, 'n_tokens_neox': 1024, 'n_words': 227}