4 * init.php -- initialisation file
6 * File should be loaded in every file in src/ or plugins that occupate an entire frame
8 * @copyright © 2006 The SquirrelMail Project Team
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
11 * @package squirrelmail
15 * This is a development version so in order to track programmer mistakes we
16 * set the error reporting to E_ALL
17 FIXME: disabling this for now, because we now have $sm_debug_mode, but the problem with that is that we don't know what it will be until we have loaded the config file, a good 175 lines below after several important files have been included, etc. For now, we'll trust that developers have turned on E_ALL in php.ini anyway, but this can be uncommented if not.
19 //error_reporting(E_ALL);
24 * Make sure we have a page name
27 if ( !defined('PAGE_NAME') ) define('PAGE_NAME', NULL);
31 * If register_globals are on, unregister globals.
32 * Second test covers boolean set as string (php_value register_globals off).
34 if ((bool) ini_get('register_globals') &&
35 strtolower(ini_get('register_globals'))!='off') {
37 * Remove all globals that are not reserved by PHP
38 * 'value' and 'key' are used by foreach. Don't unset them inside foreach.
40 foreach ($GLOBALS as $key => $value) {
42 case 'HTTP_POST_VARS':
46 case 'HTTP_COOKIE_VARS':
48 case 'HTTP_SERVER_VARS':
52 case 'HTTP_POST_FILES':
55 case 'HTTP_SESSION_VARS':
62 unset($GLOBALS[$key]);
65 // Unset variables used in foreach
66 unset($GLOBALS['key']);
67 unset($GLOBALS['value']);
71 * Used as a dummy value, e.g., for passing as an empty
72 * hook argument (where the value is passed by reference,
73 * and therefore NULL itself is not acceptable).
79 * [#1518885] session.use_cookies = off breaks SquirrelMail
81 * When session cookies are not used, all http redirects, meta refreshes,
82 * src/download.php and javascript URLs are broken. Setting must be set
83 * before session is started.
85 if (!(bool)ini_get('session.use_cookies') ||
86 ini_get('session.use_cookies') == 'off') {
87 ini_set('session.use_cookies','1');
91 * Initialize seed of random number generator.
92 * We use a number of things to randomize input: current time in ms,
93 * info about the remote client, info about the current process, the
94 * randomness of uniqid and stat of the current file.
96 * We seed this here only once per init, not only to save cycles
97 * but also to make the result of mt_rand more random (it now also
98 * depends on the number of times mt_rand was called before in this
101 $seed = microtime() . $_SERVER['REMOTE_PORT'] . $_SERVER['REMOTE_ADDR'] . getmypid();
103 if (function_exists('getrusage')) {
104 /* Avoid warnings with Win32 */
106 if (isset($dat) && is_array($dat)) { $seed .= implode('', $dat); }
109 if(!empty($_SERVER['UNIQUE_ID'])) {
110 $seed .= $_SERVER['UNIQUE_ID'];
113 $seed .= uniqid(mt_rand(),TRUE);
114 $seed .= implode( '', stat( __FILE__
) );
116 /** PHP 4.2 and up don't require seeding, but their used seed algorithm
117 * is of questionable quality, so we keep doing it ourselves. */
118 mt_srand(hexdec(md5($seed)));
121 * calculate SM_PATH and calculate the base_uri
122 * assumptions made: init.php is only called from plugins or from the src dir.
123 * files in the plugin directory may not be part of a subdirectory called "src"
126 if (isset($_SERVER['SCRIPT_NAME'])) {
127 $a = explode('/', $_SERVER['SCRIPT_NAME']);
128 } elseif (isset($HTTP_SERVER_VARS['SCRIPT_NAME'])) {
129 $a = explode('/', $HTTP_SERVER_VARS['SCRIPT_NAME']);
131 $error = 'Unable to detect script environment. Please test your PHP '
132 . 'settings and send your PHP core configuration, $_SERVER and '
133 . '$HTTP_SERVER_VARS contents to the SquirrelMail developers.';
137 for($i = count($a) -2; $i > -1; --$i) {
139 if ($a[$i] === 'src' ||
$a[$i] === 'plugins') {
144 $base_uri = implode('/', array_slice($a, 0, $i)). '/';
146 define('SM_PATH',$sSM_PATH);
147 define('SM_BASE_URI', $base_uri);
151 * global var $bInit is used to check if initialisation took place.
152 * At this moment it's a workarounf for the include of addrbook_search_html
153 * inside compose.php. If we found a better way then remove this. Do only use
154 * this var if you know for sure a page can be called stand alone and be included
160 * This theme as a failsafe if no themes were found, or if we error
161 * out before anything could be initialised.
164 $color[0] = '#DCDCDC'; /* light gray TitleBar */
165 $color[1] = '#800000'; /* red */
166 $color[2] = '#CC0000'; /* light red Warning/Error Messages */
167 $color[3] = '#A0B8C8'; /* green-blue Left Bar Background */
168 $color[4] = '#FFFFFF'; /* white Normal Background */
169 $color[5] = '#FFFFCC'; /* light yellow Table Headers */
170 $color[6] = '#000000'; /* black Text on left bar */
171 $color[7] = '#0000CC'; /* blue Links */
172 $color[8] = '#000000'; /* black Normal text */
173 $color[9] = '#ABABAB'; /* mid-gray Darker version of #0 */
174 $color[10] = '#666666'; /* dark gray Darker version of #9 */
175 $color[11] = '#770000'; /* dark red Special Folders color */
176 $color[12] = '#EDEDED';
177 $color[13] = '#800000'; /* (dark red) Color for quoted text -- > 1 quote */
178 $color[14] = '#ff0000'; /* (red) Color for quoted text -- >> 2 or more */
179 $color[15] = '#002266'; /* (dark blue) Unselectable folders */
180 $color[16] = '#ff9933'; /* (orange) Highlight color */
182 require(SM_PATH
. 'include/constants.php');
183 require(SM_PATH
. 'functions/global.php');
184 require(SM_PATH
. 'functions/strings.php');
185 require(SM_PATH
. 'functions/arrays.php');
187 /* load default configuration */
188 require(SM_PATH
. 'config/config_default.php');
189 /* reset arrays in default configuration */
190 $ldap_server = array();
193 $aTemplateSet = array();
194 $aTemplateSet[0]['ID'] = 'default';
195 $aTemplateSet[0]['NAME'] = 'Default';
197 /* load site configuration */
198 require(SM_PATH
. 'config/config.php');
199 /* load local configuration overrides */
200 if (file_exists(SM_PATH
. 'config/config_local.php')) {
201 require(SM_PATH
. 'config/config_local.php');
206 * Set PHP error reporting level based on the SquirrelMail debug mode
209 if ($sm_debug_mode & SM_DEBUG_MODE_SIMPLE
)
210 $error_level |
= E_ERROR
;
211 if ($sm_debug_mode & SM_DEBUG_MODE_MODERATE
212 ||
$sm_debug_mode & SM_DEBUG_MODE_ADVANCED
)
213 $error_level |
= E_ALL
;
214 if ($sm_debug_mode & SM_DEBUG_MODE_STRICT
)
215 $error_level |
= E_STRICT
;
216 error_reporting($error_level);
219 require(SM_PATH
. 'functions/plugin.php');
220 require(SM_PATH
. 'include/languages.php');
221 require(SM_PATH
. 'class/template/Template.class.php');
222 require(SM_PATH
. 'class/error.class.php');
225 * If magic_quotes_runtime is on, SquirrelMail breaks in new and creative ways.
226 * Force magic_quotes_runtime off.
227 * tassium@squirrelmail.org - I put it here in the hopes that all SM code includes this.
228 * If there's a better place, please let me know.
230 ini_set('magic_quotes_runtime','0');
233 /* if running with magic_quotes_gpc then strip the slashes
234 from POST and GET global arrays */
235 if (function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc
()) {
236 sqstripslashes($_GET);
237 sqstripslashes($_POST);
241 /* strip any tags added to the url from PHP_SELF.
242 This fixes hand crafted url XXS expoits for any
243 page that uses PHP_SELF as the FORM action */
244 $_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);
246 $PHP_SELF = php_self();
249 * Initialize the session
252 /** set the name of the session cookie */
253 if (!isset($session_name) ||
!$session_name) {
254 $session_name = 'SQMSESSID';
258 * When session.auto_start is On we want to destroy/close the session
260 $sSessionAutostartName = session_name();
262 if (isset($sSessionAutostartName) && $sSessionAutostartName !== $session_name) {
263 $sCookiePath = ini_get('session.cookie_path');
264 $sCookieDomain = ini_get('session.cookie_domain');
266 setcookie($sSessionAutostartName,'',time() - 604800,$sCookiePath,$sCookieDomain);
268 session_write_close();
272 * includes from classes stored in the session
274 require(SM_PATH
. 'class/mime.class.php');
276 ini_set('session.name' , $session_name);
277 session_set_cookie_params (0, $base_uri);
278 sqsession_is_active();
281 * When on login page, have to reset the user session, making
282 * sure to save session restore data first
284 if (PAGE_NAME
== 'login') {
285 if (!sqGetGlobalVar('session_expired_post', $sep, SQ_SESSION
))
287 if (!sqGetGlobalVar('session_expired_location', $sel, SQ_SESSION
))
290 session_write_close();
293 * in some rare instances, the session seems to stick
294 * around even after destroying it (!!), so if it does,
295 * we'll manually flatten the $_SESSION data
297 if (!empty($_SESSION))
301 * Allow administrators to define custom session handlers
302 * for SquirrelMail without needing to change anything in
303 * php.ini (application-level).
305 * In config_local.php, admin needs to put:
307 * $custom_session_handlers = array(
309 * 'my_close_handler',
311 * 'my_write_handler',
312 * 'my_destroy_handler',
315 * session_module_name('user');
316 * session_set_save_handler(
317 * $custom_session_handlers[0],
318 * $custom_session_handlers[1],
319 * $custom_session_handlers[2],
320 * $custom_session_handlers[3],
321 * $custom_session_handlers[4],
322 * $custom_session_handlers[5]
325 * We need to replicate that code once here because PHP has
326 * long had a bug that resets the session handler mechanism
327 * when the session data is also destroyed. Because of this
328 * bug, even administrators who define custom session handlers
329 * via a PHP pre-load defined in php.ini (auto_prepend_file)
330 * will still need to define the $custom_session_handlers array
331 * in config_local.php.
333 global $custom_session_handlers;
334 if (!empty($custom_session_handlers)) {
335 $open = $custom_session_handlers[0];
336 $close = $custom_session_handlers[1];
337 $read = $custom_session_handlers[2];
338 $write = $custom_session_handlers[3];
339 $destroy = $custom_session_handlers[4];
340 $gc = $custom_session_handlers[5];
341 session_module_name('user');
342 session_set_save_handler($open, $close, $read, $write, $destroy, $gc);
345 sqsession_is_active();
346 session_regenerate_id();
348 // put session restore data back into session if necessary
350 sqsession_register($sel, 'session_expired_location');
352 sqsession_register($sep, 'session_expired_post');
357 * SquirrelMail internal version number -- DO NOT CHANGE
358 * $sm_internal_version = array (release, major, minor)
360 $SQM_INTERNAL_VERSION = explode('.', SM_VERSION
, 3);
361 $SQM_INTERNAL_VERSION[2] = intval($SQM_INTERNAL_VERSION[2]);
364 /* load prefs system; even when user not logged in, should be OK to do this here */
365 require(SM_PATH
. 'functions/prefs.php');
368 /* if plugins are disabled only for one user and
369 * the current user is NOT that user, turn them
372 sqgetGlobalVar('username', $username, SQ_SESSION
);
373 if ($disable_plugins && !empty($disable_plugins_user)
374 && $username != $disable_plugins_user) {
375 $disable_plugins = false;
379 /* remove all plugins if they are disabled */
380 if ($disable_plugins) {
386 * Include Compatibility plugin if available.
388 if (!$disable_plugins && file_exists(SM_PATH
. 'plugins/compatibility/functions.php'))
389 include_once(SM_PATH
. 'plugins/compatibility/functions.php');
393 * MAIN PLUGIN LOADING CODE HERE
394 * On init, we no longer need to load all plugin setup files.
395 * Now, we load the statically generated hook registrations here
396 * and let the hook calls include only the plugins needed.
398 $squirrelmail_plugin_hooks = array();
399 if (!$disable_plugins && file_exists(SM_PATH
. 'config/plugin_hooks.php')) {
400 //FIXME: if we keep the plugin hooks array static like this, it seems like we should also keep the template files list in a static file too (when a new user session is started or the template set is changed, the code will dynamically iterate through the directory heirarchy of the template directory and catalog all the template files therein (and store the "catalog" in PHP session) -- instead, we could do that once at config-time and keep that static so SM can just include the file just like the line below)
401 require(SM_PATH
. 'config/plugin_hooks.php');
406 * Plugin authors note that the "config_override" hook used to be
407 * executed here, but please adapt your plugin to use this "prefs_backend"
408 * hook instead, making sure that it does NOT return anything, since
409 * doing so will interfere with proper prefs system functionality.
410 * Of course, otherwise, this hook may be used to do any configuration
411 * overrides as needed, as well as set up a custom preferences backend.
413 $prefs_backend = do_hook('prefs_backend', $null);
414 if (isset($prefs_backend) && !empty($prefs_backend) && file_exists(SM_PATH
. $prefs_backend)) {
415 require(SM_PATH
. $prefs_backend);
416 } elseif (isset($prefs_dsn) && !empty($prefs_dsn)) {
417 require(SM_PATH
. 'functions/db_prefs.php');
419 require(SM_PATH
. 'functions/file_prefs.php');
426 * Remove globalized session data in rg=on setups
428 * Code can be utilized when session is started, but data is not loaded.
429 * We have already loaded configuration and other important vars. Can't
430 * clean session globals here, beside, the cleanout of globals at the
431 * top of this file will have removed anything this code would find anyway.
432 if ((bool) @ini_get('register_globals') &&
433 strtolower(ini_get('register_globals'))!='off') {
434 foreach ($_SESSION as $key => $value) {
435 unset($GLOBALS[$key]);
440 sqsession_register(SM_BASE_URI
,'base_uri');
443 * Retrieve the language cookie
445 if (! sqgetGlobalVar('squirrelmail_language',$squirrelmail_language,SQ_COOKIE
)) {
446 $squirrelmail_language = '';
451 * Do something special for some pages. This is based on the PAGE_NAME constant
452 * set at the top of every page.
454 $set_up_langage_after_template_setup = FALSE;
458 // need to get the right template set up
460 sqGetGlobalVar('templateid', $templateid, SQ_GET
);
462 // sanitize just in case...
464 $templateid = preg_replace('/(\.\.\/){1,}/', '', $templateid);
466 // make sure given template actually is available
468 $found_templateset = false;
469 for ($i = 0; $i < count($aTemplateSet); ++
$i) {
470 if ($aTemplateSet[$i]['ID'] == $templateid) {
471 $found_templateset = true;
476 // FIXME: do we need/want to check here for actual (physical) presence of template sets?
477 // selected template not available, fall back to default template
479 if (!$found_templateset) {
480 $sTemplateID = Template
::get_default_template_set();
482 $sTemplateID = $templateid;
485 session_write_close();
493 require(SM_PATH
. 'functions/auth.php');
497 require(SM_PATH
. 'functions/display_messages.php' );
498 require(SM_PATH
. 'functions/page_header.php');
499 require(SM_PATH
. 'functions/html.php');
501 // reset template file cache
503 $sTemplateID = Template
::get_default_template_set();
504 Template
::cache_template_file_hierarchy($sTemplateID, TRUE);
507 * Make sure icon variables are setup for the login page.
509 $icon_theme = $icon_themes[$icon_theme_def]['PATH'];
511 * NOTE: The $icon_theme_path var should contain the path to the icon
512 * theme to use. If the admin has disabled icons, or the user has
513 * set the icon theme to "None," no icons will be used.
515 $icon_theme_path = (!$use_icons ||
$icon_theme=='none') ?
NULL : ($icon_theme == 'template' ? SM_PATH
. Template
::calculate_template_images_directory($sTemplateID) : $icon_theme);
518 * cleanup old cookies with a cookie path the same as the standard php.ini
519 * cookie path. All previous SquirrelMail version used the standard php.ini
520 * cookie path for storing the session name. That behaviour changed.
522 if ($sCookiePath !== SM_BASE_URI
) {
524 * do not delete the standard sessions with session.name is i.e. PHPSESSID
525 * because they probably belong to other php apps
527 if (ini_get('session.name') !== $sSessionAutostartName) {
528 // This does not work. Sometimes the cookie with SQSESSID=deleted and path /
529 // is picked up in webmail.php => login will fail
530 //sqsetcookie(ini_get('session.name'),'',0,$sCookiePath);
535 require(SM_PATH
. 'functions/display_messages.php' );
536 require(SM_PATH
. 'functions/page_header.php');
537 require(SM_PATH
. 'functions/html.php');
541 * Check if we are logged in
543 require(SM_PATH
. 'functions/auth.php');
545 if ( !sqsession_is_registered('user_is_logged_in') ) {
547 // use $message to indicate what logout text the user
548 // will see... if 0, typical "You must be logged in"
549 // if 1, information that the user session was saved
550 // and will be resumed after (re)login
554 // First we store some information in the new session to prevent
557 $session_expired_post = $_POST;
558 $session_expired_location = PAGE_NAME
;
559 if (!sqsession_is_registered('session_expired_post')) {
560 sqsession_register($session_expired_post,'session_expired_post');
562 if (!sqsession_is_registered('session_expired_location')) {
563 sqsession_register($session_expired_location,'session_expired_location');
564 if ($session_expired_location == 'compose')
567 // signout page will deal with users who aren't logged
568 // in on its own; don't show error here
570 if ( PAGE_NAME
== 'signout' ) {
575 * Initialize the template object (logout_error uses it)
578 * $sTemplateID is not initialized when a user is not logged in, so we
579 * will use the config file defaults here. If the neccesary variables
580 * are not set, force a default value.
582 if (PAGE_NAME
== 'squirrelmail_rpc') {
583 $sTemplateID = Template
::get_rpc_template_set();
585 $sTemplateID = Template
::get_default_template_set();
587 $oTemplate = Template
::construct_template($sTemplateID);
589 set_up_language($squirrelmail_language, true);
591 logout_error( _("You must be logged in to access this page.") );
593 logout_error( _("Your session has expired, but will be resumed after logging in again.") );
597 sqgetGlobalVar('authz',$authz,SQ_SESSION
);
600 * Setting the prefs backend
602 sqgetGlobalVar('prefs_cache', $prefs_cache, SQ_SESSION
);
603 sqgetGlobalVar('prefs_are_cached', $prefs_are_cached, SQ_SESSION
);
605 if ( !sqsession_is_registered('prefs_are_cached') ||
606 !isset( $prefs_cache) ||
607 !is_array( $prefs_cache)) {
608 $prefs_are_cached = false;
609 $prefs_cache = false; //array();
613 * initializing user settings
615 require(SM_PATH
. 'include/load_prefs.php');
617 // i do not understand the frames language cookie story
619 * We'll need this to later have a noframes version
621 * Check if the user has a language preference, but no cookie.
622 * Send him a cookie with his language preference, if there is
625 $my_language = getPref($data_dir, $username, 'language');
626 if ($my_language != $squirrelmail_language) {
627 sqsetcookie('squirrelmail_language', $my_language, time()+
2592000, $base_uri);
631 $set_up_langage_after_template_setup = TRUE;
633 $timeZone = getPref($data_dir, $username, 'timezone');
635 /* Check to see if we are allowed to set the TZ environment variable.
636 * We are able to do this if ...
637 * safe_mode is disabled OR
638 * safe_mode_allowed_env_vars is empty (you are allowed to set any) OR
639 * safe_mode_allowed_env_vars contains TZ
641 $tzChangeAllowed = (!ini_get('safe_mode')) ||
642 !strcmp(ini_get('safe_mode_allowed_env_vars'),'') ||
643 preg_match('/^([\w_]+,)*TZ/', ini_get('safe_mode_allowed_env_vars'));
645 if ( $timeZone != SMPREF_NONE
&& ($timeZone != "")
646 && $tzChangeAllowed ) {
648 // get time zone key, if strict or custom strict timezones are used
649 if (isset($time_zone_type) &&
650 ($time_zone_type == 1 ||
$time_zone_type == 3)) {
651 /* load time zone functions */
652 require(SM_PATH
. 'include/timezones.php');
653 $realTimeZone = sq_get_tz_key($timeZone);
655 $realTimeZone = $timeZone;
660 putenv("TZ=".$realTimeZone);
665 * php 5.1.0 added time zone functions. Set time zone with them in order
666 * to prevent E_STRICT notices and allow time zone modifications in safe_mode.
668 if (function_exists('date_default_timezone_set')) {
669 if ($timeZone != SMPREF_NONE
&& $timeZone != "") {
670 date_default_timezone_set($timeZone);
672 // interface runs on server's time zone. Remove php E_STRICT complains
673 $default_timezone = @date_default_timezone_get
();
674 date_default_timezone_set($default_timezone);
681 * $sTemplateID is not initialized when a user is not logged in, so we
682 * will use the config file defaults here. If the neccesary variables
683 * are not set, force a default value.
685 * If the user is logged in, $sTemplateID will be set in load_prefs.php,
686 * so we shouldn't change it here.
688 if (!isset($sTemplateID)) {
689 if (PAGE_NAME
== 'squirrelmail_rpc') {
690 $sTemplateID = Template
::get_rpc_template_set();
692 $sTemplateID = Template
::get_default_template_set();
694 $icon_theme_path = !$use_icons ?
NULL : Template
::calculate_template_images_directory($sTemplateID);
697 // template object may have already been constructed in load_prefs.php
699 if (empty($oTemplate)) {
700 $oTemplate = Template
::construct_template($sTemplateID);
703 // We want some variables to always be available to the template
705 $oTemplate->assign('javascript_on',
706 (sqGetGlobalVar('user_is_logged_in', $user_is_logged_in, SQ_SESSION
)
707 ?
checkForJavascript() : 0));
708 $oTemplate->assign('base_uri', sqm_baseuri());
709 $always_include = array('sTemplateID', 'icon_theme_path');
710 foreach ($always_include as $var) {
711 $oTemplate->assign($var, (isset($
$var) ? $
$var : NULL));
714 // A few output elements are used often, so just get them once here
716 $nbsp = $oTemplate->fetch('non_breaking_space.tpl');
717 $br = $oTemplate->fetch('line_break.tpl');
721 * Set up the language.
723 * This code block corresponds to the *default* block of the switch
724 * statement above, but the language cannot be set up until after the
725 * template is instantiated, so we set $set_up_langage_after_template_setup
726 * above and do the linguistic stuff now.
728 if ($set_up_langage_after_template_setup) {
729 $err=set_up_language(getPref($data_dir, $username, 'language'));
731 // Japanese translation used without mbstring support
733 $sError = "<p>Your administrator needs to have PHP installed with the multibyte string extension enabled (using configure option --enable-mbstring).</p>\n"
734 . "<p>This system has assumed that you accidently switched to Japanese and has reverted your language preference to English.</p>\n"
735 . "<p>Please refresh this page in order to continue using your webmail.</p>\n";
742 * Initialize our custom error handler object
744 $oErrorHandler = new ErrorHandler($oTemplate,'error_message.tpl');
748 * Activate custom error handling
750 if (version_compare(PHP_VERSION
, "4.3.0", ">=")) {
751 $oldErrorHandler = set_error_handler(array($oErrorHandler, 'SquirrelMailErrorhandler'));
753 $oldErrorHandler = set_error_handler('SquirrelMailErrorhandler');
757 // ============================================================================
758 // ================= End of Live Code, Beginning of Functions =================
759 // ============================================================================
763 * Javascript support detection function
764 * @param boolean $reset recheck javascript support if set to true.
765 * @return integer SMPREF_JS_ON or SMPREF_JS_OFF ({@see include/constants.php})
768 function checkForJavascript($reset = FALSE) {
769 global $data_dir, $username, $javascript_on, $javascript_setting;
771 if ( !$reset && sqGetGlobalVar('javascript_on', $javascript_on, SQ_SESSION
) )
772 return $javascript_on;
774 $user_is_logged_in = FALSE;
775 if ( $reset ||
!isset($javascript_setting) )
776 $javascript_setting = getPref($data_dir, $username, 'javascript_setting', SMPREF_JS_AUTODETECT
);
778 if ( !sqGetGlobalVar('new_js_autodetect_results', $js_autodetect_results) &&
779 !sqGetGlobalVar('js_autodetect_results', $js_autodetect_results) )
780 $js_autodetect_results = SMPREF_JS_OFF
;
782 if ( $javascript_setting == SMPREF_JS_AUTODETECT
)
783 $javascript_on = $js_autodetect_results;
785 $javascript_on = $javascript_setting;
787 sqsession_register($javascript_on, 'javascript_on');
788 return $javascript_on;
791 function sqm_baseuri() {