Example #1
0
function mystery_footer()
{
    global $_MYSTERY;
    if ($_MYSTERY['footer_included'] != 'yes') {
        // stop the timer
        mystery_time_results('stop');
        // calculate time and show results
        if ($_MYSTERY['calculate_page_time'] == 'yes') {
            mystery_time_results('display');
        }
        // include the footer file and exit
        $_MYSTERY['footer_included'] = 'yes';
        include $_MYSTERY['footer_file'];
        exit;
    }
}
set_error_handler('mystery_simple_error_handler');
// at this point, we don't really need to connect to the database
// mystery_db_connect();
// use our custom session handlers instead of the PHP defaults
session_set_save_handler('mystery_session_open', 'mystery_session_close', 'mystery_session_read', 'mystery_session_write', 'mystery_session_destroy', 'mystery_session_gc');
// start the session
session_name($portal_config['session_name']);
session_start();
// allow the users to use the back button
header('Cache-control: private');
// use our custom error handler instead of the PHP default
set_error_handler('mystery_error_handler');
// catch all possible errors
ini_set('error_reporting', E_ALL);
// start the timer
mystery_time_results('start');
// configure the application
if (!mystery_configure()) {
    if (mystery_check_installation_status()) {
        mystery_header();
        mystery_display_user_error('Configuration Problem');
        echo '
		<p>Could not load the main system configuration.  The system
		Administrator should verify that the system is correctly
		installed and configured.</p>
		';
        mystery_footer();
    } else {
        mystery_header();
        mystery_display_installation_options();
        mystery_footer();