[Openfirst-cvscommit] update system.php,1.6,1.7
Brought to you by:
xtimg
From: Tim G. <xt...@us...> - 2004-11-19 17:06:40
|
Update of /cvsroot/openfirst/update In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9501 Modified Files: system.php Log Message: Make frontend actually update backend for some variables. Index: system.php =================================================================== RCS file: /cvsroot/openfirst/update/system.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** system.php 19 Nov 2004 14:01:52 -0000 1.6 --- system.php 19 Nov 2004 17:06:30 -0000 1.7 *************** *** 17,20 **** --- 17,22 ---- $NewServer = True; } elseif(! isset($_REQUEST["id"])) { + echo "<a href='system.php?new=new'>Create new system profile</a> or <p>"; + echo "Please select the system to edit."; $sq = mysql_query("SELECT id, displayname FROM ofirst_systems WHERE owner='$user->id' ORDER BY displayname;"); *************** *** 27,34 **** $NewServer = False; - $Modules = array( - 'Base' => array('Version' => '1.0.1', 'Installed' => True), - 'Guestbook' => array('Version' => '1.0.2', 'Installed' => True) - ); } --- 29,32 ---- *************** *** 38,41 **** --- 36,42 ---- die(include_once($footer)); } elseif(! isset($_REQUEST["id"])) { + // DEBUG HERE. + + // Add as a new system mysql_query("INSERT INTO ofirst_systems (email, *************** *** 49,52 **** --- 50,75 ---- echo "System setup"; die(include_once($footer)); + } elseif(isset($_REQUEST["id"])) { + // Update existing system configuration + echo "<br>Installation settings updated.<br>"; + mysql_query("UPDATE ofirst_systems SET + email='" . $_REQUEST["email"] . "', + displayname='" . $_REQUEST["displayname"] . "', + ftpusername='" . $_REQUEST["ftpusername"] . "', + ftpserver='" . $_REQUEST["ftpserver"] . "', + notifywhenupdatesavailable='" . $_REQUEST["notifywhenupdatesavailable"] . "', + autoinstallsecurity='". $_REQUEST["autoinstallsecurity"] . "', + autoinstallnewversions='" . $_REQUEST["autoinstallnewversions"] . "', + notifywhenupdatecomplete='" . $_REQUEST["notifywhenupdatecomplete"] . "' + WHERE id='" . $_REQUEST["id"] . "' AND owner='$user->id';"); + echo "<br>" . mysql_error(); + if($_REQUEST["ftppassword"] == $_REQUEST["ftpconfirmpassword"] && $_REQUEST["ftppassword"] != "") { + mysql_query("UPDATE ofirst_systems SET ftppassword='" . $_REQUEST["ftppassword"] . "' WHERE id='" . $_REQUEST["id"] . "' AND owner='$user->id';"); + echo "<br />FTP password updated."; + } else { + echo "<br/ >FTP password not changed."; + } + include_once($footer); + die(); } } *************** *** 89,93 **** <th>Display Name</th> <td> ! <input type='text' name='display' <?php if(isset($system->displayname) && $system->displayname != "") { echo --- 112,116 ---- <th>Display Name</th> <td> ! <input type='text' name='displayname' <?php if(isset($system->displayname) && $system->displayname != "") { echo *************** *** 99,103 **** <th>FTP Username</th> <td> ! <input type='text' name='ftpuser' <?php if(isset($system->ftpusername) && $system->ftpusername != "") { echo --- 122,126 ---- <th>FTP Username</th> <td> ! <input type='text' name='ftpusername' <?php if(isset($system->ftpusername) && $system->ftpusername != "") { echo *************** *** 145,149 **** </th> <td> ! <input type='checkbox' checked='checked' name='autoinstallsecurity' <?php if(isset($system->autoinstallsecurity) && $system->autoinstallsecurity == 1) { --- 168,172 ---- </th> <td> ! <input type='checkbox' value='1' name='autoinstallsecurity' <?php if(isset($system->autoinstallsecurity) && $system->autoinstallsecurity == 1) { *************** *** 151,165 **** ?>> Automatically install security fixes<br /> ! <input type='checkbox' name='autoinstallnewversions' <?php if(isset($system->autoinstallnewversions) && $system->autoinstallnewversions == 1) { echo "checked='checked'"; } ?>>Automatically install new versions<br /> ! <input type='checkbox' name='notifywhenupdatesavailable' <?php if(isset($system->notifywhenupdatesavailable) && $system->notifywhenupdatesavailable == 1) { echo "checked='checked'"; } ?>>Notify admin via e-mail when an update is available.<br /> ! <input type='checkbox' name='notifywhenupdatecomplete' <?php if(isset($system->notifywhenupdatecomplete --- 174,188 ---- ?>> Automatically install security fixes<br /> ! <input type='checkbox' value='1' name='autoinstallnewversions' <?php if(isset($system->autoinstallnewversions) && $system->autoinstallnewversions == 1) { echo "checked='checked'"; } ?>>Automatically install new versions<br /> ! <input type='checkbox' value='1' name='notifywhenupdatesavailable' <?php if(isset($system->notifywhenupdatesavailable) && $system->notifywhenupdatesavailable == 1) { echo "checked='checked'"; } ?>>Notify admin via e-mail when an update is available.<br /> ! <input type='checkbox' value='1' name='notifywhenupdatecomplete' <?php if(isset($system->notifywhenupdatecomplete *************** *** 189,193 **** $p = mysql_fetch_object($pq); $v = mysql_fetch_object(mysql_query("SELECT * FROM ofirst_directory_software_versions WHERE id='$s->version';")); ! echo "<input type='checkbox' name='$s->id' value='$s->id'>$p->name (version: $v->versionname) [<a href='#'>Remove</a>]<br />"; } } --- 212,216 ---- $p = mysql_fetch_object($pq); $v = mysql_fetch_object(mysql_query("SELECT * FROM ofirst_directory_software_versions WHERE id='$s->version';")); ! echo "<input type='checkbox' name='$s->id' value='$s->id'>$p->name (version: $v->versionname) [<a href=\"javascript: alert('Remove functionality for packages has not yet been implemented.');\">Remove</a>]<br />"; } } |