Location: PHPKode > projects > Polymer > polymer_0.02/html/poly/index.php
<?php

/**
 * index.php
 *
 * PHP version 4
 *
 * This file is part of Polymer.
 *
 * Polymer is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Polymer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Polymer; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * @link       http://polymer.sourceforge.net
 * @author     Allen Shaw <hide@address.com> for IIFWP
 * @copyright  2005 Allen Shaw
 * @license    http://www.gnu.org/licenses/gpl.txt  GNU General Public License
 * @version    20050718.001
 * @since      File available since Polymer 0.01
 */



/////////// NOTHING BELOW THIS LINE REQUIRES (OR ANTICIPATES) ANY MODIFICATION ///////////////

$time_start = getmicrotime();

// include the file that will include the correct config file.
include "config-path.php";

require_once POLYMER_DIR.'prepend.php';

// checks authorization and either continues or bails (bail = ask for new credentials).
require POLYMER_DIR.'check_auth.php';

// IF we're still alive here, we set up a new page and we go on as usual.

require(POLYMER_DIR.'polymer.class.php');

$page = new Page;
$page->userdefaults = $userdefaults;


// $page->fail may be set in the module (or anywhere else,really), indicating that the page
// should roll back and not change, effectively reloading the page most recently displayed.
// This block either creates a new page (all GET and POST varialbes have been rolled back
// already -- see page.class.php) or continues to show the original page:
if ($page->fail){

	$pageback = new Page;
	// assign value to {$thistemplate} -- we'll need it for the javascript tag.
	$pageback->assign('thistemplate',$pageback->toTemplate);
	$pageback->assign('result', $page->failnotice);

	$pageback->showPage();

}
else {
	// assign value to {$thistemplate} -- we'll need it for the javascript tag.
	$page->assign('thistemplate',$page->toTemplate);

	$page->showPage();
}

// FIXME (AS-mar03,2005): the $auth object doesn't exist anymore
if ($auth->newlogin){
	clear_submitid($_SESSION[APP_NAME][INTERFACE_NAME]['auth']['contactid']);
	login_statistics($page);
}

else {
	log_last_action($page);
}

$time_end = getmicrotime();
$time = $time_end - $time_start;

echo "<div align=right><font color=white>Page rendered in $time seconds</font></div>";

function getmicrotime(){
    list($usec, $sec) = explode(" ",microtime());
    return ((float)$usec + (float)$sec);
    }


echo "</body>

</html>";
?>
Return current item: Polymer