Location: PHPKode > projects > Webgenerator-X content management system > wgx_rc1.5/WG-X/start.php
<?
/*
* This file is part of Webgenerator-X,
* an object oriented website management engine working an top of
* Apache/PHP4/MySQL.
* http://www.webgenerator-x.com
* @2001 REGNI Giorgio
* hide@address.com
*
* Webgenerator-X 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.
*
* Webgenerator-X 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 Foobar; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/*************************************************************************/
// initialisation
// Hack Win32 cgi PHP_SELF ERROR
if ($win32) $PHP_SELF = str_replace( "/php/php.exe","",$PHP_SELF);

/* Connection bdd      */
$databaseoff = false;

function set_databaseoff()
{
	global $databaseoff;
	$databaseoff=true;
}

@mysql_connect($db_host,$db_user,$db_pass) or set_databaseoff();
@mysql_select_db($db_bdd) or set_databaseoff();

/* User Management */
if (!isset($adminsession) and isset($session))
{
	if ($userlogout)
		$USERMANAGER->logout();
	else
	{
		$userdata = $USERMANAGER->make_userarray( $user );
		if (!$USERMANAGER->check_session($userdata,$session))	// check_session sets the userlogged variable too
			$USERMANAGER->logout();
	}
}
else
if ($userlogin=="true")	// trying to log in
{
	if ($USERMANAGER->Login($login,$pass)==false)
		$usererr = "Incorrect Login or password";
}

// Create Cache object
$CACHEENGINE = new A_CacheEngine();
// Create Smarty object and register plugins
$SMARTY = new Smarty();
/*
$SMARTY->register_resource("db", array("smarty_resource_db_source",
                                       "smarty_resource_db_timestamp",
                                       "smarty_resource_db_secure",
                                       "smarty_resource_db_trusted"));
*/

?>
Return current item: Webgenerator-X content management system