[Openfirst-cvscommit] base/config sitesettings.tpl,NONE,1.1 .cvsignore,1.1,1.2 first.php,1.53,1.54 g
Brought to you by:
xtimg
From: Astronouth7303 <ast...@us...> - 2005-05-14 22:26:05
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25080/config Modified Files: .cvsignore first.php globals.php Added Files: sitesettings.tpl Removed Files: globals.tpl Log Message: Moved settings from globals.php to sitesettings.php --- NEW FILE: sitesettings.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%; $encryption = %ENCRYPT%; $title = %TITLE%; $version = %VER%; $sqlserver = %DBSERVER%; $sqluser = %DBUSER%; $sqlpassword = %DBPASS%; $sqldatabase = %DBNAME%; $sqlconnection = ofirst_dbconnect("$sqlserver","$sqluser","$sqlpassword"); ofirst_select_db($sqldatabase); $pass_save_disabled=%COOKIE%; $regenabled=%REG%; $home = %HOME%; $header = %HEADER%; $footer = %FOOTER%; $mailnotify = %MASTERMAIL%; $mailfrom = %BOTMAIL%; $server = %SERVER%; $basepath = %BASEPATH%; $fbasepath = %FBASEPATH%; ?> Index: first.php =================================================================== RCS file: /cvsroot/openfirst/base/config/first.php,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** first.php 14 May 2005 20:34:33 -0000 1.53 --- first.php 14 May 2005 22:25:56 -0000 1.54 *************** *** 38,42 **** ! if(isset($_POST["ostype"])) { $sqlserver = $_POST["sqlserver"]; $sqluser = $_POST["sqluser"]; --- 38,42 ---- ! if(isset($_POST["sqlserver"])) { $sqlserver = $_POST["sqlserver"]; $sqluser = $_POST["sqluser"]; *************** *** 60,70 **** // They have submitted the form, write a new globals.php file and test // options. ! if (is_writable("./globals.php")) { ! $file = file_get_contents('./globals.tpl'); $cookielogins = ((isset($_POST["cookielogins"]) && $_POST["cookielogins"]=="yes") ? true : false); $allowreg = ((isset($_POST["allowreg"]) && $_POST["allowreg"]=="yes") ? true : false); $find = array('%DBTYPE%', - '%OS%', '%ENCRYPT%', '%TITLE%', --- 60,69 ---- // They have submitted the form, write a new globals.php file and test // options. ! if (is_writable("./sitesettings.php")) { ! $file = file_get_contents('./sitesettings.tpl'); $cookielogins = ((isset($_POST["cookielogins"]) && $_POST["cookielogins"]=="yes") ? true : false); $allowreg = ((isset($_POST["allowreg"]) && $_POST["allowreg"]=="yes") ? true : false); $find = array('%DBTYPE%', '%ENCRYPT%', '%TITLE%', *************** *** 86,90 **** $replace = array(GetVarValue($_POST['dbasetype']), - GetVarValue($_POST['ostype']), GetVarValue($_POST['encryption']), GetVarValue($_POST['title']), --- 85,88 ---- *************** *** 195,216 **** </tr> <tr> - <td>Operating System of Web Server</td> - <td><select name="ostype"> - <?php - if ($windows) { - echo("<option value='unix'>UNIX</option> - <option value='windows' selected='selected'>Windows</option>"); - } else { - echo("<option value='unix' selected='selected'>UNIX</option> - <option value='windows'>Windows</option>"); - } - ?> - </select> <font size="2">(UNIX includes variants, such as Linux, Mac OS - X, and BeOS) </font></td> - </tr> - <tr> <td>Database Type - <?php - ?> </td> <td> --- 193,197 ---- Index: .cvsignore =================================================================== RCS file: /cvsroot/openfirst/base/config/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 13 Mar 2005 01:52:02 -0000 1.1 --- .cvsignore 14 May 2005 22:25:56 -0000 1.2 *************** *** 1 **** --- 1,2 ---- Globals.php + sitesettings.php \ No newline at end of file --- globals.tpl DELETED --- Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/config/globals.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** globals.php 13 Mar 2005 01:49:26 -0000 1.7 --- globals.php 14 May 2005 22:25:56 -0000 1.8 *************** *** 1,15 **** <?php /* ! * openFIRST globals.php ! * This is a placeholder file. It will be recreated ! * by first.php when you first access and configure ! * your OpenFIRST portal software. ! */ ! if(file_exists("../config/first.php")) { ! header("Location: ../config/first.php"); ! } elseif(file_exists("config/first.php")) { ! header("Location: config/first.php"); ! } elseif(file_exists("../../config/first.php")) { ! header("Location: ../../config/first.php"); } ?> --- 1,131 ---- <?php /* ! * openFIRST.base - config/globals.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program 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. ! * ! * This program 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. ! * This program 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 this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! // Purpose: Initialize the openFIRST system. ! ! $configdir = dirname(__FILE__); ! if( !file_exists( "$configdir/sitesettings.php" ) ) { ! die( "You'll have to set openFIRST up first!" ); ! } ! ! if (substr(PHP_OS, 0, 3) == 'WIN') { ! $ostype = 'windows'; ! } else { ! $ostype = 'unix'; ! } ! ! if ($ostype == 'windows') { ! set_include_path( get_include_path().";$configdir/;."); ! } else { ! set_include_path( get_include_path().":$configdir/:."); ! } ! unset($configdir); ! ! require_once('dbase.php'); ! ! 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."); ! } ! ! require_once('sitesettings.php'); ! ! ! // Determine what module the user is viewing ! $currentmodule = str_replace($basepath, '', $_SERVER['SCRIPT_NAME']); ! $currentmodule = substr($currentmodule, 1, strpos($currentmodule, '/', 2) - 1); ! ! #FIXME: Use $fbasepath instead of getcwd() ! 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($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> | ! "; ! } ! } ! } ! } } + + if (!preg_match('/\A[a-zA-Z0-9]+\z/',session_id())) session_regenerate_id(); + + session_write_close(); ?> |