[Openfirst-cvscommit] base/config first.php,1.60,1.61 index.php,1.11,1.12 install.php,1.24,1.25 modu
Brought to you by:
xtimg
From: Astronouth7303 <ast...@us...> - 2005-05-26 21:00:44
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25684/config Modified Files: first.php index.php install.php modules.php version.php Log Message: radical changes, with more to come Index: first.php =================================================================== RCS file: /cvsroot/openfirst/base/config/first.php,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** first.php 17 May 2005 01:55:57 -0000 1.60 --- first.php 26 May 2005 21:00:02 -0000 1.61 *************** *** 65,71 **** // They have submitted the form, write a new globals.php file and test // options. ! $ConfigFile = 'sitesettings.php'; ! if ( (file_exists("./$ConfigFile") && is_writable("./$ConfigFile")) || is_writable('./') ) { ! $file = file_get_contents('./sitesettings.tpl'); $cookielogins = ((isset($_POST["cookielogins"]) && $_POST["cookielogins"]=="yes") ? true : false); $allowreg = ((isset($_POST["allowreg"]) && $_POST["allowreg"]=="yes") ? true : false); --- 65,72 ---- // They have submitted the form, write a new globals.php file and test // options. ! $fbasepath = realpath($_POST['fbasepath']); ! $ConfigFile = "$fbasepath/includes/sitesettings.php"; ! if ( (file_exists($ConfigFile) && is_writable($ConfigFile)) || is_writable(dirname($ConfigFile) ) { ! $file = file_get_contents('../includes/sitesettings.tpl'); $cookielogins = ((isset($_POST["cookielogins"]) && $_POST["cookielogins"]=="yes") ? true : false); $allowreg = ((isset($_POST["allowreg"]) && $_POST["allowreg"]=="yes") ? true : false); *************** *** 107,118 **** GetVarValue($_POST['server']), GetVarValue($_POST['basepath']), ! GetVarValue($_POST['fbasepath'])); $file = str_replace($find, $replace, $file); ! $hfile = fopen("./$ConfigFile",'w'); fwrite($hfile, $file); fclose($hfile); ! include_once("../config/globals.php"); ! include_once("$header"); ! echo("<h1>openFIRST Software Configured</h1> <p>If this page does not display errors elsewhere, then your openFIRST has now been successfully configured. If there are errors, check your configuration options and try again. You may now --- 108,119 ---- GetVarValue($_POST['server']), GetVarValue($_POST['basepath']), ! GetVarValue($fbasepath)); $file = str_replace($find, $replace, $file); ! $hfile = fopen("$ConfigFile",'w'); fwrite($hfile, $file); fclose($hfile); ! include_once("../includes/globals.php"); ! include_once($header); ! echo("<div class=\"success\"><h1>openFIRST Software Configured</h1> <p>If this page does not display errors elsewhere, then your openFIRST has now been successfully configured. If there are errors, check your configuration options and try again. You may now *************** *** 122,133 **** the password for that account has been changed, or the MySQL settings are incorrect.</p>"); showlogin(); ! die(include_once("$footer")); } else { echo '<p class="error"><span class="file">'.htmlentities($ConfigFile).'</span> is not writable</p> '; ! if(is_readable("config/headers.php")) { ! include_once("config/headers.php"); } else { ! include_once("../config/headers.php"); } echo("<h1 class=\"error\">System Configuration Error</h1> --- 123,134 ---- the password for that account has been changed, or the MySQL settings are incorrect.</p>"); showlogin(); ! die(include_once($footer)); } else { echo '<p class="error"><span class="file">'.htmlentities($ConfigFile).'</span> is not writable</p> '; ! if(is_readable("style/headers.php")) { ! include_once("style/headers.php"); } else { ! include_once("../style/headers.php"); } echo("<h1 class=\"error\">System Configuration Error</h1> *************** *** 143,150 **** // Do form ! if(is_readable("config/headers.php")) { ! include_once("config/headers.php"); } else { ! include_once("../config/headers.php"); } --- 144,151 ---- // Do form ! if(is_readable("style/headers.php")) { ! include_once("style/headers.php"); } else { ! include_once("../style/headers.php"); } *************** *** 240,256 **** <dd> <label for="header">Header file</label> ! <input type="text" name="header" value="<?php echo htmlentities($fbasepath); ?>/config/headers.php" /> </dd> <dt>This should be a full system path, eg, ! <code class="file">c:\inetpub\wwwroot\openfirst\config\header.php</code> or ! <code class="file">/home/site/public_html/openfirst/config/headers.php</code> </dt> <dd> <label for="footer">Footer file</label> ! <input type="text" name="footer" value="<?php echo htmlentities($fbasepath); ?>/config/footers.php" /> </dd> <dt>This should be a full system path, eg, ! <code class="file">c:\inetpub\wwwroot\openfirst\config\footers.php</code> or ! <code class="file">/home/site/public_html/openfirst/config/footers.php</code> </dt> <dd> --- 241,257 ---- <dd> <label for="header">Header file</label> ! <input type="text" name="header" value="<?php echo htmlentities(realpath("$fbasepath/style/headers.php")); ?>" /> </dd> <dt>This should be a full system path, eg, ! <code class="file">c:\inetpub\wwwroot\openfirst\style\header.php</code> or ! <code class="file">/home/site/public_html/openfirst/style/headers.php</code> </dt> <dd> <label for="footer">Footer file</label> ! <input type="text" name="footer" value="<?php echo htmlentities(realpath("$fbasepath/style/footers.php")); ?>" /> </dd> <dt>This should be a full system path, eg, ! <code class="file">c:\inetpub\wwwroot\openfirst\style\footers.php</code> or ! <code class="file">/home/site/public_html/openfirst/style/footers.php</code> </dt> <dd> *************** *** 259,263 **** <span class="warning">Must not have a trailing slash and must include a protocol.</span> </dd> ! <dt>eg, <code class="url"><strong>http://openfirst.sourceforge.net</strong>/openfirst</code></dt> <dd> <label for="basepath">URL base path</label> --- 260,264 ---- <span class="warning">Must not have a trailing slash and must include a protocol.</span> </dd> ! <dt>eg, <code class="url"><b>http://openfirst.sourceforge.net</b>/openfirst</code></dt> <dd> <label for="basepath">URL base path</label> *************** *** 265,269 **** <span class="warning">Must not have a trailing slash.</span> </dd> ! <dt>ie. example: <code class="url">http://openfirst.sourceforge.net<strong>/openfirst</strong></code>) this should always have a beginning slash but no ending slash. (If openFIRST is in the root directory, then leave blank.) </dt> --- 266,270 ---- <span class="warning">Must not have a trailing slash.</span> </dd> ! <dt>ie. example: <code class="url">http://openfirst.sourceforge.net<b>/openfirst</b></code>) this should always have a beginning slash but no ending slash. (If openFIRST is in the root directory, then leave blank.) </dt> *************** *** 326,333 **** <?php } ! if(is_readable("config/footers.php")) { ! include_once("config/footers.php"); } else { ! include_once("../config/footers.php"); } ?> --- 327,334 ---- <?php } ! if(is_readable("style/footers.php")) { ! include_once("style/footers.php"); } else { ! include_once("../style/footers.php"); } ?> Index: install.php =================================================================== RCS file: /cvsroot/openfirst/base/config/install.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** install.php 17 May 2005 01:55:58 -0000 1.24 --- install.php 26 May 2005 21:00:02 -0000 1.25 *************** *** 28,33 **** // Purpose: set up OpenFIRST modules ! include("../config/globals.php"); ! include($header); ini_set("max_execution_time", 600); // Bypass problem of timeouts when many modules are installed --- 28,33 ---- // Purpose: set up OpenFIRST modules ! include("../includes/globals.php"); ! include($Header); ini_set("max_execution_time", 600); // Bypass problem of timeouts when many modules are installed *************** *** 61,65 **** <?php ! $files = glob("$fbasepath/*/openfirst.info.php"); if (count($files) < 1) { ?> --- 61,69 ---- <?php ! $InstalledModules = $Modules; ! ! $Modules = array(); ! ! $files = glob("$fBasePath/*/openfirst.info.php"); if (count($files) < 1) { ?> *************** *** 67,75 **** to download them.</p> <?php ! die(include($footer)); } - $InstalledModules = $Modules; - # Get the meta data foreach ($files as $filename) { --- 71,77 ---- to download them.</p> <?php ! die(include($Footer)); } # Get the meta data foreach ($files as $filename) { *************** *** 78,83 **** foreach($Modules as $code => $info) { ! $dir = "$fbasepath/$code"; ! $sqlf = "$dir/setup/setup.$dbasetype"; $WasInstalled = $IsInstalled = array_key_exists($code, $InstalledModules); $InstallFailed = false; --- 80,85 ---- foreach($Modules as $code => $info) { ! $dir = "$fBasePath/$code"; ! $sqlf = "$dir/setup/setup.$DBaseType"; $WasInstalled = $IsInstalled = array_key_exists($code, $InstalledModules); $InstallFailed = false; *************** *** 114,116 **** } ! include($footer); ?> --- 116,118 ---- } ! include($Footer); ?> Index: version.php =================================================================== RCS file: /cvsroot/openfirst/base/config/version.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** version.php 13 Mar 2005 20:45:39 -0000 1.9 --- version.php 26 May 2005 21:00:02 -0000 1.10 *************** *** 28,33 **** // Purpose: set up OpenFIRST modules ! include("../config/globals.php"); ! include($header); if(isset($user->user) == true && $user->membertype == "administrator") { --- 28,33 ---- // Purpose: set up OpenFIRST modules ! include("../includes/globals.php"); ! include($Header); if(isset($user->user) == true && $user->membertype == "administrator") { *************** *** 67,94 **** <h1>Version Information</h1> ! <p>The version as displayed on your pages is <?php echo $title . " " . $version; ?></p> <table> ! <tr><th>Status</th><th>File</th><th>Module</th><th>Description</th><th>Link</th></tr> <?php ! if(function_exists("glob")) { ! foreach (rglob("..", "*") as $filename) { ! if(is_file($filename) && ! is_link($filename)) { ! $mod = str_replace("../", "", $filename); ! $mod = substr($mod, 0, strpos($mod, "/", 2)); ! $fil = str_replace("../$mod/", "", $filename); ! if(is_readable($filename) && function_exists("md5_file")) { ! @include(str_replace(" ", "%20", "http://update.openfirst.org/versions.php?showgood=f&md5=" . md5_file($filename) . "&module=$mod&file=$fil")); ! } ! unset($filename); ! } ! } ! } else { ! echo("<p>The version information requires the <strong>glob</strong> function, which your version ! of PHP does not have. In the future there will be version for systems without ! <strong>glob</strong> functionality, but at the moment only a <strong>glob</strong> ! version is provided.</p>"); } ?> </table> --- 67,83 ---- <h1>Version Information</h1> ! <p>The version as displayed on your pages is <?php echo htmlentities("$Title $Version"); ?></p> <table> ! <thead> ! <tr><th>Status</th><th>File</th><th>Module</th><th>Description</th><th>Link</th></tr> ! </thead> ! <tbody> <?php ! foreach($Modules as $code=>$info) { ! @include('http://update.openfirst.org/versions.php?version=2&module='.urlencode($code).'&ver='.urlencode($info['ver'])); } ?> + </tbody> </table> *************** *** 97,99 **** } ! include($footer); ?> --- 86,88 ---- } ! include($Footer); ?> Index: modules.php =================================================================== RCS file: /cvsroot/openfirst/base/config/modules.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** modules.php 1 Aug 2004 19:25:34 -0000 1.8 --- modules.php 26 May 2005 21:00:02 -0000 1.9 *************** *** 28,33 **** // Purpose: configure OpenFIRST modules, including their position on menus ! include("../config/globals.php"); ! include($header); // Check if user is actually an admin --- 28,33 ---- // Purpose: configure OpenFIRST modules, including their position on menus ! include("../includes/globals.php"); ! include($Header); // Check if user is actually an admin *************** *** 54,58 **** // Successful creation response and die with footers. echo "<p>Module information has been updated, thank you. [ <a href='modules.php'>Modules</a> ]</p>"; ! die(include($footer)); } --- 54,58 ---- // Successful creation response and die with footers. echo "<p>Module information has been updated, thank you. [ <a href='modules.php'>Modules</a> ]</p>"; ! die(include($Footer)); } *************** *** 100,102 **** showlogin(); } ! include($footer); ?> --- 100,102 ---- showlogin(); } ! include($Footer); ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/base/config/index.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** index.php 7 Aug 2004 02:07:52 -0000 1.11 --- index.php 26 May 2005 21:00:02 -0000 1.12 *************** *** 28,33 **** // Purpose: Provide a control center for configuration activities. ! include("./globals.php"); ! include($header); if(isset($user->user) == true && $user->membertype == "administrator") { ?> --- 28,33 ---- // Purpose: Provide a control center for configuration activities. ! include("../includes/globals.php"); ! include($Header); if(isset($user->user) == true && $user->membertype == "administrator") { ?> *************** *** 41,48 **** <?php ! if(is_writable("./globals.php") && file_exists("./first.php")) { ! echo("<p><strong>Warning: </strong> Your globals.php file is writable by the web user. Also, first.php is still in existance. After you have setup the openFIRST web portal system, it is safe to remove first.php. Removing first.php prevents the accidental reset of configuration information and prevents external users from altering your configuration. For maximal security, you should also change the filesystem permissions so that globals.php is not writable by the web user."); ! } elseif(is_writable("./globals.php")) { ! echo("<p><strong>Warning: </strong> Your globals.php file is writable by the web user. For maximal security, you should change the filesystem permissions to correct this.</p>"); } ?> --- 41,48 ---- <?php ! if(is_writable("$fBasePath/includes/globals.php") && file_exists("$fBasePath/includes/first.php")) { ! echo("<p><strong>Warning</strong>: Your globals.php file is writable by the web user. Also, first.php is still in existance. After you have setup the openFIRST web portal system, it is safe to remove first.php. Removing first.php prevents the accidental reset of configuration information and prevents external users from altering your configuration. For maximal security, you should also change the filesystem permissions so that globals.php is not writable by the web user."); ! } elseif(is_writable("$fBasePath/includes/globals.php")) { ! echo("<p><strong>Warning</strong>: Your globals.php file is writable by the web user. For maximal security, you should change the filesystem permissions to correct this.</p>"); } ?> *************** *** 92,96 **** showlogin(); } ! include($footer); ?> </p> --- 92,96 ---- showlogin(); } ! include($Footer); ?> </p> |