Update of /cvsroot/openfirst/base/config
In directory sc8-pr-cvs1:/tmp/cvs-serv16615
Modified Files:
modules.php
Log Message:
Completed updates and fixes
Index: modules.php
===================================================================
RCS file: /cvsroot/openfirst/base/config/modules.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** modules.php 27 Jun 2003 15:39:12 -0000 1.1
--- modules.php 27 Jun 2003 20:14:43 -0000 1.2
***************
*** 33,63 ****
membersmenu($user->membertype);
if($user->membertype == "administrator") {
if(ISSET($_POST['update'])){
! $query = mysql_query("SELECT * FROM ofirst_config");
! while($module = mysql_fetch_object($query)){
!
if(ISSET($_POST[$module->modulename.'-active'])){ $active = "1"; }else{ $active = "0"; }
if(ISSET($_POST[$module->modulename.'-showonmenu'])){ $showonmenu = "1"; }else{ $showonmenu = "0"; }
! mysql_query("UPDATE ofirst_config WHERE modulename='".$module->modulename."' SET
! modulename ='".$_POST[$module->modulename.'-modulename']."',
! modulename ='".$_POST[$module->modulename.'-modulenavigation']."',
! modulename ='".$_POST[$module->modulename.'-adminnavigation']."',
! modulename ='".$_POST[$module->modulename.'-includes']."',
! showonmenu ='".$showonmenu."',
! active ='".$active."'");
! }
!
! }
?>
! <h1>SQL Install</h1>
! <p>This utility will create the tables required for certain openFIRST
! components to run. Select the SQL scripts you would like to
! install...</p>
! <form method="post" action="dd">
<table width="52%" align="center">
<tr>
--- 33,70 ----
membersmenu($user->membertype);
+ // Check if user is actually an admin
if($user->membertype == "administrator") {
+
+ // Check if user wishes to make updates
if(ISSET($_POST['update'])){
! // Query for current module information and loop through with while
! $query = mysql_query("SELECT * FROM ofirst_config");
! while($module = mysql_fetch_object($query)){
!
! // Set values to update db for checkboxes
if(ISSET($_POST[$module->modulename.'-active'])){ $active = "1"; }else{ $active = "0"; }
if(ISSET($_POST[$module->modulename.'-showonmenu'])){ $showonmenu = "1"; }else{ $showonmenu = "0"; }
! // Creater query string then update information in database
! mysql_query("UPDATE ofirst_config SET
! modulename = '".$_POST[$module->modulename.'-modulename']."',
! includes = '".$_POST[$module->modulename.'-includes']."',
! showonmenu = '".$showonmenu."',
! active = '".$active."' WHERE modulename = '".$module->modulename."'") or die(mysql_error());
! }
!
! // Successful creation response and die with footers.
! echo "<br><br><center>Module information has been updated, thank you. [ <a href='modules.php'>Modules</a> ]<br><br>";
! die(include($footer));
!
! }
?>
! <h1>Module Administrator</h1>
! <p>This utility will allow you to manage modules for certain openFIRST components.
! You may find the options below:</p>
! <form method="post" action="modules.php">
<table width="52%" align="center">
<tr>
***************
*** 80,84 ****
</table>
<br />
! <input type="submit" value="Update Values" />
</form>
--- 87,91 ----
</table>
<br />
! <input type="submit" name="update" value="Update Values" />
</form>
|