<< Back index.php Guide Home

Index2.php

 

Defines constant _VALID_MOS to '1', same as index.php.

 

Also checks to make sure the configuration file is there, otherwise, forwards to the installation folder and exits.

 

Requires globals.php, configuration.php, classes/mambo.php, and the appropriate language pack.

 

Requires classes/admin.php, which defines two functions:

mosMakePassword()

Returns a randomized alphanumeric seven character password

mosShowSource( $filename, $withLineNums=false )

Returns source code with highlighted text. $filename specifies the file with code to highlight, and $withLineNums causes line numbers to be printed with the code, when set to true.

 

Includes the debug classes from includes/debug.php and the editor chooser from includes/editor.php, which chooses an editor based on the configuration variables in configuration.php.

 

Declares a database object $database and an access control list object $acl.

 

Starts a session named 'mosadmin.'

 

Declares a mosMainFrame object $mainframe and mosDebug object $mosDebug.

 

Retrieves the request variables task, act, section, mosmsg, and no_html, storing them in identically named PHP variables.

 

If the variable option is set to 'logout,' logout.php is required and the code exits. logout.php destroys the current session and redirects the user to the main index of the site.

 

Declares variable $my as a new mosUser object. Sets it with the session user id, user name, user type, and group id.

 

Sets $session_id to 'session_id.' Sets $logintime to 'session_logintime.'

 

If $session_id fails to match the database record's session, the user is forwarded back to the administrator/index.php and the program exits.

 

The database session record is then updated with the current time and old sessions are purged.

 

If the task is set to 'doBackup,' forward to the dbadmin component and exit the program.

 

If $no_html is set, and a path can be obtained from $mainframe->getPath("admin"), require it as code and exit.

 

Gzip code…

 

An output buffer is started and $tstart is set through the mosProfiler class function getmicrotime(). This is later used to calculate the amount of time it takes to generate the page.

 

HTML starts...

 

Calls initEditior() to get javascript code for the HTML formatted editor.

 

Calls showvar( $_REQUEST ) through the $mosDebug object.

 

"Reset cookie for hiding the toolbar and footer if the option is not set - provides additional support for 3rd party integration"

 

If $menu_hide is not set, require menubar.php, which requires menubar/html/HTML_menubar.php… which defines the class mosMenuBar.

 

If $mosmsg is set, display its contents appropriately.

 

If $path can be set with $mainframe->getPath( 'admin' ), then require $path. Essentially, including the page content…

 

Else, show the mos logo.

 

Display the footer if it is meant to be displayed, then getmicrotime() again and compute the amount of time it took to generate the page.