[Openfirst-cvscommit] base/config globals.tpl,NONE,1.1
Brought to you by:
xtimg
From: Astronouth7303 <ast...@us...> - 2004-12-29 02:56:59
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3000/config Added Files: globals.tpl Log Message: Basic template for Globals.php, still need to implement the replacer (which would take all of 10 minutes) in First.php. --- NEW FILE: globals.tpl --- <?php /* * openFIRST base configuration file * This file has been automatically generated by first.php. * it contains the basic configuration options required to * operate the OpenFIRST web portal software. Note, that * most configuration options are now stored in the MySQL * database, in the ofirst_config table. */ $dbasetype = %DBTYPE%; $peardb = %PEAR%; $ostype = %OS%; if ($ostype == "windows") { ini_set("include_path", ini_get("include_path") . ";../config/;."); } else { ini_set("include_path", ini_get("include_path") . ":../config/:."); } include_once('dbase.php'); $encryption = %ENCRYPT%; $title = %TITLE%; $version = %VER%; $sqlserver = %DBSERVER%; $sqluser = %DBUSER%; $sqlpassword = %DBPASS%; $sqldatabase = %DBNAME%; if(function_exists("ofirst_dbconnect") == false) { die("Your version of PHP has not been compiled with SQL support, therefore the openFIRST web portal system cannot run on this system. Please contact your system administrator to request SQL support for your version of PHP."); } $sqlconnection = ofirst_dbconnect("$sqlserver","$sqluser","$sqlpassword"); if($peardb) { $sqlconnection = ofirst_select_db($sqldatabase); } else { ofirst_select_db($sqldatabase); } $regenabled=true; $home = %HOME%; $header = %HEADER%; $footer = %FOOTER%; $mailnotify = %MASTERMAIL%; $mailfrom = %BOTMAIL%; $basepath = %BASEPATH%; $fbasepath = %FBASEPATH; // Determine what module the user is viewing $currentmodule = str_replace($basepath, "", $_SERVER["SCRIPT_NAME"]); $currentmodule = substr($currentmodule, 1, strpos($currentmodule, "/", 2) - 1); session_start(); include('auth.php'); if(function_exists("glob")) { // Include the functions using glob(); if(is_readable(getcwd() . "/../config/functions/")) { foreach (glob(getcwd() . "/../config/functions/*.php") as $filename) { include($filename); } } elseif (is_readable(getcwd() . "/../../config/functions/")) { foreach (glob(getcwd() . "/../../config/functions/*.php") as $filename) { include($filename); } } } else { // Include the functions without using glob(); } $headers = ""; $incl = ofirst_dbquery("SELECT * FROM ofirst_config"); // If there is no error then run the module add feature if(ofirst_dberrno() == 0) { // Begin to loop through modules from the databaes while($module = ofirst_dbfetch_object($incl)) { // Check if the value is try, if it is then run an include if( (bool) $module->active == true) { // Check if there are includes that need to be included if(! $module->includes == ""){ // If the list is not empty then explode the value and put it into inclist $inclist = explode(",",$module->includes); // This is to remove an error that you have if you don't check if there are more then 2 if(count($inclist) >= 2){ // Loop through the inclist and add them according to their paths foreach($inclist As $inc){ include("$fbasepath/$module->modulename/$inc"); } } else { // If there is only 1 include available then use this line to include it instead include("$fbasepath/$module->modulename/$module->includes"); } } // If the module has requested to be shown on the menu then add it if( (bool) $module->showonmenu == true) { // If it is the current module then color the item if ($currentmodule == $module->modulename){ $headers .= " » <font color='red'><u><a class='menu' href='$basepath/$module->modulename'>".ucwords($module->modulename)."</a></u></font> |"; // Declare important variables so that headers can pick them up and preview them $adminnav = str_replace("\$basepath", $basepath, $module->adminnavigation) . " <a href='http://bugzilla.openfirst.org'>Report Bug</a>"; $subnav = str_replace("\$basepath", $basepath, $module->modulenavigation); } else { $headers .= " » <a class='menu' href='$basepath/$module->modulename'>".ucwords($module->modulename)."</a> |"; } } } } } session_write_close(); ?> |