|
From: <ope...@li...> - 2002-07-09 01:23:32
|
Update of /cvsroot/openposs/Server
In directory usw-pr-cvs1:/tmp/cvs-serv26972
Added Files:
module.php
Log Message:
Initial creation
--- NEW FILE: module.php ---
<?php
/******************************************************************************
* *
* File Name: module.php *
* *
* Created : Jun 30, 2002 *
* *
* Purpose : Entry point for all modules in the openPOS system. *
* *
*----------------------------------------------------------------------------*
* Change Log *
*----------------------------------------------------------------------------*
* Date | Description *
* -------------+------------------------------------------------------------ *
* Jun 30, 2002 | Initial Coding. *
******************************************************************************/
/******************************************************************************
* Function: *
* -------------------------------------------------------------------------- *
* Place function description here, including any API info. *
* *
* Returned Values *
* None. *
* *
* Input Values *
* None. *
******************************************************************************/
/******************************************************************************
* Begin Session *
******************************************************************************/
session_start();
if(isset($HTTP_GET_VARS["action"]))
{
$HTTP_SESSION_VARS["action"] = $HTTP_GET_VARS["action"];
}
/******************************************************************************
* System Includes *
******************************************************************************/
include_once("./includes/database.php");
include_once("./includes/vars.inc");
include_once("./includes/functions.php");
//Refuse User if they are not logged in!
if (!(isset($HTTP_SESSION_VARS["openPOSAuthTok"])))
{
$HTTP_SESSION_VARS["OutputLang"] = "eng";
$themeFile = "theme/".$HTTP_SESSION_VARS["OutputTheme"]."/theme.php";
include_once ($themeFile);
$langFile = "language/".$HTTP_SESSION_VARS["OutputLang"]."/global.php";
include_once ($langFile);
$HTTP_SESSION_VARS["OutputTheme"] = "Default";
die(_OPENPOSLOGINMESSAGE);
}
$themeFile = "theme/".$HTTP_SESSION_VARS["OutputTheme"]."/theme.php";
include_once ($themeFile);
$langFile = "language/".$HTTP_SESSION_VARS["OutputLang"]."/global.php";
include_once ($langFile);
global $HTMLOutput, $OutputLang, $Action, $OutputTheme, $SystemConfig;
global $UserName, $Password;
//Make DB Connection
if (!DBInit())
{
die("Unable to connect to the database.");
}
$query = "SELECT * FROM modules WHERE status='A'";
$result = DB_Query($query);
//of type Array
$activeModules = DB_Fetch_Data_Array($result);
foreach($activeModules as $tmp)
{
if($tmp[0] == $HTTP_GET_VARS["module"])
{
$isActive = TRUE;
}
}
if(!($isActive))
{
die("There has been an error. The module you requested is unavailbe at this time");
}
$HTMLOutput = Theme_Open_Page(_OPENPOSMAINTITLE);
echo $HTMLOutput;
include "./module/".$HTTP_GET_VARS["module"]."/module.php";
$HTMLOutput = Theme_Close_Page();
echo "</TD></TR></table>".$HTMLOutput;
?>
|