** Changes by Paul Lesneiwski ** (c) 2001 (GNU GPL - see ../../COPYING) ** ** This plugin monitors page changes in the right-hand frame. ** If the right-hand frame doesn't update within a set number ** of minutes, then the plugin logs the user out automatically. ** ** To change the timeout, see the file config.php. **/ // include compatibility plugin // if (defined('SM_PATH')) include_once(SM_PATH . 'plugins/compatibility/functions.php'); else if (file_exists('../plugins/compatibility/functions.php')) include_once('../plugins/compatibility/functions.php'); else if (file_exists('./plugins/compatibility/functions.php')) include_once('./plugins/compatibility/functions.php'); // This is the text that appears on the options page // function timeout_user_show_options_do() { global $timeout_in_minutes, $allow_user_timeout_config, $username, $data_dir, $javascript_on, $allow_user_disable; if (compatibility_check_sm_version(1, 3)) include_once (SM_PATH . 'plugins/timeout_user/config.php'); else include_once ('../plugins/timeout_user/config.php'); sq_change_text_domain('timeout_user', SM_PATH . 'plugins/timeout_user/locale/'); if (!$allow_user_timeout_config) return; $timeout_in_minutes = getPref($data_dir, $username, 'timeout_user', $timeout_in_minutes); echo " \n" . "\n". _("Automatic Logout Timer:") . "\n". "" . _("minutes") . ($allow_user_disable ? ' ' . _("(zero to disable)") : '') . "\n\n"; sq_change_text_domain('squirrelmail'); } // Here we save the user's timeout preferences // function timeout_user_save_options_do() { global $timeout_user_value, $allow_user_timeout_config, $username, $data_dir, $allow_user_disable; if (compatibility_check_sm_version(1, 3)) include_once (SM_PATH . 'plugins/timeout_user/config.php'); else include_once ('../plugins/timeout_user/config.php'); if (!$allow_user_timeout_config) return; compatibility_sqextractGlobalVar('timeout_user_value'); if (!$allow_user_disable && $timeout_user_value <= 0) $timeout_user_value = 1; setPref($data_dir, $username, 'timeout_user', $timeout_user_value); } function timeout_user_metatag_do() { global $timeout_in_minutes, $allow_user_timeout_config, $username, $data_dir; if (compatibility_check_sm_version(1, 3)) include_once (SM_PATH . 'plugins/timeout_user/config.php'); else include_once ('../plugins/timeout_user/config.php'); // get global variables for versions of PHP < 4.1 // if (!compatibility_check_php_version(4, 1)) { global $HTTP_SERVER_VARS; $_SERVER = $HTTP_SERVER_VARS; } if ($allow_user_timeout_config) $timeout_in_minutes = getPref($data_dir, $username, 'timeout_user', $timeout_in_minutes); $timeout = $timeout_in_minutes * 60; // we need this in seconds $js_timeout = ($timeout - 5) * 1000; // js needs milliseconds, and this should take precedence over meta preg_match('/(.*)\/.*\/.*/', $_SERVER['REQUEST_URI'], $matches); $url = $matches[1]; if ($timeout > 0) { if (strpos($url, 'plugins') === FALSE) { ?> ' . $timeout_in_minutes . ' ' . _("minutes idle. Logging out automatically.") . "
\n"; else echo "
$timeout_in_minutes " . _("minutes idle. Logging out automatically.") . "

\n"; } sq_change_text_domain('squirrelmail'); } // end timeout_user_explanation_do() ?>