Update of /cvsroot/openfirst/projects
In directory sc8-pr-cvs1:/tmp/cvs-serv24851
Added Files:
updatesetup.php
Log Message:
Initial upload. Still requires a lot of changes for permissions and syntax.
--- NEW FILE: updatesetup.php ---
<?php
/*
* openFIRST.projects - today.php
*
* Copyright (C) 2003,
* openFIRST Project
* Original Author: David Di Biase <dav...@ea...>
*
* 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
*
*/
// Include globals and set header condense (not coded yet)
include("../config/globals.php");
$header_condense = true;
include($header);
// Check if user is a member
if(! isset($user->user)){
showlogin();
} else {
if(isset($_POST['addtask'])){
$time = $_POST['when'];
$when = $_POST['perform'];
$script = $_POST['scriptlocation'];
$engine = $_POST['engine'];
if(isset($_POST['useoutput'])){
$output = "^>".getcwd()."\updatelog.txt";
}else{
$output = "";
}
$command = "at $time /every:$when $engine -f $script $output";
system($command,$message);
echo "<br><br><b>Command returned:</b> ";
echo $message;
}
?>
<h2>Update System </h2>
<table width="494" align="center">
<?php if($ostype == "windows"){ ?>
<tr>
<th><div align="center"><font color="#000000">Windows Update Setup</font></div></th>
</tr>
<tr>
<td><p align="center">
<form method="POST" action="updatesetup.php">
<div align="center">
<p>Confirm Update Script Location:<br>
<input name="scriptlocation" type="text" id="scriptlocation" value="<?php echo getcwd()."\updates.php"; ?>" size="70">
<br>
<font size="1">(This value is automatically set, although please check to see if this<br>
file location is correct.)</font></p>
<p>Please note the location of your PHP engine:<br>
<input name="engine" type="text" id="engine" value="c:\PHP\php.exe" size="50">
<br>
<font size="1">(Some users may have to specify the loaction of their<br>
PHP engine, if they have installed it in a different location)
</font> </p>
</p>
</div>
<p align="center"> <input name="useoutput" type="checkbox" id="useoutput" value="checkbox">
Record update schedule task for review.</p>
<p align="center">Perform Task:
<select name="perform" id="perform">
<option value="M,T,W,Th,F,S,Su" selected>Daily</option>
<option value="M,W,F,Su">Every 2 Days</option>
<option value="Th,S">Every 3 Days</option>
<option value="Th">Every 4 Days</option>
<option value="F">Every 5 Days</option>
<option value="S">Every 6 Days</option>
<option value="Su">Weekly</option>
</select>
</p>
<p align="center">Send Update At:
<input name="when" type="text" id="when" value="24:00" size="10" maxlength="5">
<font size="2"><br>
(Enter time using 24 hour clock time)</font></p>
<p align="center">
<input name="addtask" type="submit" id="addtask" value="Add Update">
<input type="reset" name="Submit2" value="Reset">
</p>
</form>
<p align="left"><font size="2"><strong>Note:</strong> This update installer
works by using the Microsoft Task Schedule Service. Itcombines
the information you provide above and automatically creates and performs
the (at) command in cmd. To view, edit, or remove this task you can
use the schtasks command in cmd. To make sure this task will work you<br>
must make sure the schedule service is on. Read more about this in the Microsoft<br>
Help and Support option on your operating system.</font> <br>
<br>
</p></td>
</tr>
<?php }else{ ?>
<tr>
<th>Unix Crontab Setup</th>
</tr>
<tr>
<td>Not implemented yet! </td>
</tr>
</table>
<?php } ?>
<?php
}
include($footer);
?>
|