Location: PHPKode > projects > Phpman > phpman-2.0a_RC2/includes/common_header.php
<?php
/**
* Common header file
* @package phpman
* @copyright (C) 2004 Samuel Suter
* @author Samuel Suter <hide@address.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
* @version 1.0
**/

/**
* load required classes
*/
require_once(_mlsDocroot."classes/db.class.php");
require_once(_mlsDocroot."classes/dbtable.class.php");
require_once(_mlsDocroot."classes/lang.class.php");
require_once(_mlsDocroot."classes/html.class.php");
require_once(_mlsDocroot."classes/user.class.php");
require_once(_mlsDocroot."classes/class.pdf.php");
require_once(_mlsDocroot."classes/class.ezpdf.php");
require_once(_mlsDocroot."classes/phpmanpdf.class.php");
require_once(_mlsDocroot."includes/phpman.php");
require_once(_mlsDocroot."includes/frontend.php");
$database = new database(_mlsDBhost,_mlsDBname,_mlsDBuser,_mlsDBpass,_mlsDBprefix);
$database->connect();

if($_REQUEST["data"]["login"]["username"]) {
	/** we have to log-in */
	$my = new mlsUser($database);
	$my->login($_REQUEST["data"]["login"]["username"],$_REQUEST["data"]["login"]["password"]);
}


if($_COOKIE["login_ID"]) {
	$my = new mlsUser($database);
	$my->login("","",$_REQUEST["login_ID"]);
	$tbl = new mlsDBtable("#__languages","language_ID",$database);
	$l = $tbl->load($my->_data["language_ID"]);
	$mylang = $l["isocode"];
}

if($_REQUEST["logout"]) {
	$my->logout();
	unset($my);
}

if(!$_GET["lang"] AND $mylang) {
	$lang = new mlsLang(_mlsLang,$mylang);
	$_GET["lang"] = $mylang;
} elseif($_GET["lang"]) {
	$lang = new mlsLang(_mlsLang,$_GET["lang"]);
} else {
	$_GET["lang"] = _mlsLang;
	$lang = new mlsLang(_mlsLang,_mlsLang);
}

?>
Return current item: Phpman