/include/init.php

Description

init.php -- initialisation file

File should be loaded in every file in src/ or plugins that occupate an entire frame

Includes
include_once (SM_PATH.'plugins/compatibility/functions.php') (line 435)

Include Compatibility plugin if available.

require (SM_PATH.'config/config_local.php') (line 220)
require (SM_PATH.'config/config.php') (line 217)
require (SM_PATH.'class/mime.class.php') (line 320)

includes from classes stored in the session

require (SM_PATH.'functions/prefs.php') (line 411)

SquirrelMail internal version number -- DO NOT CHANGE

$sm_internal_version = array (release, major, minor)

require (SM_PATH.'functions/plugin.php') (line 246)

Detect SSL connections

require (SM_PATH.'functions/auth.php') (line 552)

Do something special for some pages. This is based on the PAGE_NAME constant set at the top of every page.

require (SM_PATH.'functions/display_messages.php') (line 578)

Make sure icon variables are setup for the login page.

require (SM_PATH.'include/load_prefs.php') (line 679)

initializing user settings

require (SM_PATH.'include/constants.php') (line 200)

This theme as a failsafe if no themes were found, or if we error out before anything could be initialised.

require (SM_PATH.$prefs_backend) (line 461)

Plugin authors note that the "config_override" hook used to be executed here, but please adapt your plugin to use this "prefs_backend" hook instead, making sure that it does NOT return anything, since doing so will interfere with proper prefs system functionality.

Of course, otherwise, this hook may be used to do any configuration overrides as needed, as well as set up a custom preferences backend.

require (SM_PATH.'include/timezones.php') (line 717)

We'll need this to later have a noframes version

Check if the user has a language preference, but no cookie. Send him a cookie with his language preference, if there is such discrepancy.

require (SM_PATH.'functions/auth.php') (line 586)

Check if we are logged in and does optional referrer check

require (SM_PATH.'config/plugin_hooks.php') (line 447)

MAIN PLUGIN LOADING CODE HERE On init, we no longer need to load all plugin setup files.

Now, we load the statically generated hook registrations here and let the hook calls include only the plugins needed.

Constants
SM_BASE_URI = $base_uri (line 165)
SM_PATH = $sSM_PATH (line 164)

calculate SM_PATH and calculate the base_uri assumptions made: init.php is only called from plugins or from the src dir.

files in the plugin directory may not be part of a subdirectory called "src"

Functions
checkForJavascript (line 833)

Javascript support detection function

  • return: SMPREF_JS_ON or SMPREF_JS_OFF ({@see include/constants.php})
  • since: 1.5.1
integer checkForJavascript ([boolean $reset = FALSE])
  • boolean $reset: recheck javascript support if set to true.
sqm_baseuri (line 857)
void sqm_baseuri ()

Documentation generated on Mon, 13 Jan 2020 04:22:50 +0100 by phpDocumentor 1.4.3