Index.php
Defines constant _VALID_MOS to '1', used for security: pages on the mambo server should always detect and should not display if mambo is not being used.
If Mambo has not been installed, it forwards to the installation directory and quits.
Includes globals.php which set up the global variables for earlier versions of php and if php's register_globals is turned off
Includes configuration.php at this point, which defines the literal root directory, login timeout, language, timezone, whether the site is up or not, etc…
Includes sef.php. This file retrieves all of the values from a URI and puts them into variables that appear to be form submitted, as well as adding them to the $QUERY_STRING variable. sefRelToAbs( $string ) returns a legal URL to the current page.
The $option and $Itemid variable are set from the request. The database object $database is declared along with General Access Control List $acl
If no option is selected, load the appropriate copy of the main menu.
If Itemid is not set, load the default main menu.
If the option selected is 'search,' set option to com_search to make it easier for template rendering later on.
Declares the mainframe variable $mainframe.
Includes the debug classes and declares $mosDebug an object of mosDebug type.
Execute the initSession function from $mainframe.
If no language has been selected, default to English, then load the appropriate language file.
Get the variable 'return' from the post and store it in $return.
If the option was 'login,' execute $mainframe->login() and either return to the url $return or reload index.php. Else, if the option was 'logout,' same procedure only call $mainframe->logout().
Set object $my to the result of $mainframe->getUser().
Detect whether or not this is the first visit through $mainframe->detect();
Get the group id as $gid.
Get the current template from $mainframe->getTemplate and store it in $cur_template.
Set $col_main to 1 [temporary fix?].
Set $do_gzip_compress to false.
If $mosConfig_gzip is set to 1, set up to use the browser appropriate gzip method. Else, ob_start().
Send headers.
Include the template file. If it does not exist, echo an error.
If $do_gzip_compress is set to true, use the code provided by php.net to handle gzip.
Index2.php displays content without the current template