[Openfirst-cvscommit] base/config install.php,1.25,1.26
Brought to you by:
xtimg
From: Jamie <ast...@us...> - 2005-08-23 18:01:46
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4710/config Modified Files: install.php Log Message: kinda updated, still lots to do Index: install.php =================================================================== RCS file: /cvsroot/openfirst/base/config/install.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** install.php 26 May 2005 21:00:02 -0000 1.25 --- install.php 23 Aug 2005 18:01:20 -0000 1.26 *************** *** 1,118 **** ! <?php ! /* ! * openFIRST.base - config/install.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: 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 ! // 10 minutes should be sufficient, even for remote database servers ! ! if(isset($user->user) == true && $user->membertype == "administrator") { ! ?> ! ! <h1>Module Installer</h1> ! <p>This utility will create the tables required for certain openFIRST components ! to run.<br /> ! Select the modules you would like to install.<br /> ! <br /> ! <span style="color:red;">Once installed, modules must be enabled from the <a href="modules.php"><strong>Module ! Administrator</strong></a>.</span></p> ! ! <form method="post" action="install.php"> ! <table id="moduleInstall"> ! <colgroup> ! <col /> ! <col /> ! <col class="file" /> ! </colgroup> ! <colgroup> ! <col /> ! </colgroup> ! <thead> ! <tr><th colspan="3">Module Name</th><th>Status</th></tr> ! </thead> ! <tbody> ! <?php ! ! $InstalledModules = $Modules; ! ! $Modules = array(); ! ! $files = glob("$fBasePath/*/openfirst.info.php"); ! if (count($files) < 1) { ! ?> ! <p class="error">You have no modules to install or are misconfigured. You can go to <a href="http://www.openfirst.org/">openFIRST.org</a> ! to download them.</p> ! <?php ! die(include($Footer)); ! } ! ! # Get the meta data ! foreach ($files as $filename) { ! include($filename); ! } ! ! foreach($Modules as $code => $info) { ! $dir = "$fBasePath/$code"; ! $sqlf = "$dir/setup/setup.$DBaseType"; ! $WasInstalled = $IsInstalled = array_key_exists($code, $InstalledModules); ! $InstallFailed = false; ! if(isset($_POST[$code]) == true && $_POST[$code] == "on" && !$IsInstalled) { ! if (ofirst_dbexec_file($sqlf)) { ! $IsInstalled = true; ! } else { ! $InstallFailed = true; ! } ! } ! echo '<tr><td><input type="checkbox" name="'.htmlentities($code).'" '; ! if ($IsInstalled) echo 'checked="checked" '; ! echo '/><label for="'.htmlentities($code).'">'.htmlentities($info['name']).'</label></td> ! <td>('.htmlentities($info['ver']).')'.'</td> ! <td>'.htmlentities($code)."</td>"; ! ! if ($IsInstalled && !$WasInstalled) { ! echo('<td style="background-color: lime; color:black; font-weight:bold;">Module Installation succeeded!</td></tr>'); ! } else if ($InstallFailed) { ! echo('<td style="background-color: red; color:black; font-weight:bold;">Module Installation failed!</td></tr>'); ! } else if ($IsInstalled && $WasInstalled) { ! echo('<td style="background-color: green; color:white;">Module Installed</td></tr>'); ! } else { ! echo('<td style="background-color: gray; color:white;">Module available</td></tr>'); ! } ! } ! ?> ! </table> ! <br /><input type="submit" value="Create Tables" /> ! </form> ! ! <?php } else { ! showlogin(); ! } ! ! include($Footer); ?> --- 1,118 ---- ! <?php ! /* ! * openFIRST.base - config/install.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: 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 ! // 10 minutes should be sufficient, even for remote database servers ! ! if(isset($user->user) == true && $user->membertype == "administrator") { ! ?> ! ! <h1>Module Installer</h1> ! <p>This utility will create the tables required for certain openFIRST components ! to run.<br /> ! Select the modules you would like to install.<br /> ! <br /> ! <span style="color:red;">Once installed, modules must be enabled from the <a href="modules.php"><strong>Module ! Administrator</strong></a>.</span></p> ! ! <p class="error">The file <tt class="file">config/install.php</tt> needs to be updated for the new ! Module system.</p> ! ! <form method="post" action="install.php"> ! <table id="moduleInstall"> ! <colgroup> ! <col /> ! <col /> ! <col class="file" /> ! </colgroup> ! <colgroup> ! <col /> ! </colgroup> ! <thead> ! <tr><th colspan="3">Module Name</th><th>Status</th></tr> ! </thead> ! <tbody> ! <?php ! ! $InstalledModules = $ogModuleManager->getDirs(); ! ! $Modules = array(); ! ! $files = glob("$fBasePath/*/openfirst.info.xml"); ! if (count($files) < 1) { ! ?> ! <p class="error">You have no modules to install or are misconfigured. You can go to <a href="http://www.openfirst.org/">openFIRST.org</a> ! to download them.</p> ! <?php ! include($Footer); ! die(); ! } ! ! # Get the meta data ! foreach($Modules as $code => $info) { ! $dir = "$fBasePath/$code"; ! $sqlf = "$dir/setup/setup.$DBaseType"; ! $WasInstalled = $IsInstalled = array_key_exists($code, $InstalledModules); ! $InstallFailed = false; ! if(isset($_POST[$code]) == true && $_POST[$code] == "on" && !$IsInstalled) { ! if (ofirst_dbexec_file($sqlf)) { ! $IsInstalled = true; ! } else { ! $InstallFailed = true; ! } ! } ! echo '<tr><td><input type="checkbox" name="'.htmlentities($code).'" '; ! if ($IsInstalled) echo 'checked="checked" '; ! echo '/><label for="'.htmlentities($code).'">'.htmlentities($info['name']).'</label></td> ! <td>('.htmlentities($info['ver']).')'.'</td> ! <td>'.htmlentities($code)."</td>"; ! ! if ($IsInstalled && !$WasInstalled) { ! echo('<td style="background-color: lime; color:black; font-weight:bold;">Module Installation succeeded!</td></tr>'); ! } else if ($InstallFailed) { ! echo('<td style="background-color: red; color:black; font-weight:bold;">Module Installation failed!</td></tr>'); ! } else if ($IsInstalled && $WasInstalled) { ! echo('<td style="background-color: green; color:white;">Module Installed</td></tr>'); ! } else { ! echo('<td style="background-color: gray; color:white;">Module available</td></tr>'); ! } ! } ! ?> ! </table> ! <br /><input type="submit" value="Create Tables" /> ! </form> ! ! <?php } else { ! showlogin(); ! } ! ! include($Footer); ?> |