case 'key':
case 'value':
break;
- case 'sInitLocation':
- // FIXME: variable must be set only in src/login.php
- break;
default:
unset($GLOBALS[$key]);
}
/**
* Used as a dummy value, e.g., for passing as an empty
- * hook argument.
+ * hook argument (where the value is passed by reference,
+ * and therefore NULL itself is not acceptable).
*/
global $null;
$null = NULL;
session_set_cookie_params (0, $base_uri);
sqsession_is_active();
-/**
- * SquirrelMail version number -- DO NOT CHANGE
- */
-$version = '1.5.2 [SVN]';
-
/**
* SquirrelMail internal version number -- DO NOT CHANGE
* $sm_internal_version = array (release, major, minor)
*/
-$SQM_INTERNAL_VERSION = array(1,5,2);
+$SQM_INTERNAL_VERSION = explode('.', SM_VERSION, 3);
+$SQM_INTERNAL_VERSION[2] = intval($SQM_INTERNAL_VERSION[2]);
/* if plugins are disabled only for one user and
$squirrelmail_language = '';
}
-
/**
- * @var $sInitlocation From where do we include.
+ * Do something special for some pages. This is based on the PAGE_NAME constand
+ * set at the top of every page.
*/
-if (!isset($sInitLocation)) {
- $sInitLocation=NULL;
-}
-
-switch ($sInitLocation) {
+if ( !defined('PAGE_NAME') ) define('PAGE_NAME', NULL);
+switch (PAGE_NAME) {
case 'style':
// need to get the right template set up
// signout page will deal with users who aren't logged
// in on its own; don't show error here
//
- if (strpos($PHP_SELF, 'signout.php') !== FALSE) {
- return;
+ if ( PAGE_NAME == 'signout' ) {
+ return;
}
/**
}
// We want some variables to always be available to the template
-$oTemplate->assign('javascript_on', checkForJavascript());
+$oTemplate->assign('javascript_on',
+ (sqGetGlobalVar('user_is_logged_in', $user_is_logged_in, SQ_SESSION)
+ ? checkForJavascript() : 0));
$oTemplate->assign('base_uri', sqm_baseuri());
$always_include = array('sTemplateID', 'icon_theme_path');
foreach ($always_include as $var) {
if ( !$reset && sqGetGlobalVar('javascript_on', $javascript_on, SQ_SESSION) )
return $javascript_on;
+ $user_is_logged_in = FALSE;
if ( ( $reset || !isset($javascript_setting) )
// getPref() not defined (nor is it meaningful) when user not
// logged in, but that begs the question if $javascript_on is