[Openfirst-cvscommit] projects/admin editgroups.php,NONE,1.1 edittasks.php,NONE,1.1 updatesetup.php,
Brought to you by:
xtimg
From: <dav...@us...> - 2003-10-12 23:41:09
|
Update of /cvsroot/openfirst/projects/admin In directory sc8-pr-cvs1:/tmp/cvs-serv21096/admin Added Files: editgroups.php edittasks.php updatesetup.php Log Message: initial upload --- NEW FILE: editgroups.php --- <?php /* * openFIRST.projects - groups.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 { // Remove button process if(isset($_POST['remove'])){ // If the confirmation button is selected then remove all group data if(! isset($_POST['confirm'])){ echo "<br><br>Your request to remove the group was denied because you have not confirmed! [ <a href='editgroups.php?GroupID=".$_GET['GroupID']."'>Groups</a> ]<br><br>"; die(include($footer)); } // Remove data from every table that is related ofirst_dbquery("DELETE FROM ofirst_projects_groups WHERE ID = '".$_GET['GroupID']."'") or die(ofirst_dberror()); ofirst_dbquery("DELETE FROM ofirst_projects_notes WHERE GroupID = '".$_GET['GroupID']."'") or die(ofirst_dberror()); ofirst_dbquery("DELETE FROM ofirst_projects_tasks WHERE GroupID = '".$_GET['GroupID']."'") or die(ofirst_dberror()); ofirst_dbquery("DELETE FROM ofirst_projects_projects WHERE GroupID = '".$_GET['GroupID']."'") or die(ofirst_dberror()); echo "<br><br>Group removed! [ <a href='../groups.php'>Groups</a> ]<br><br>"; die(include($footer)); } $group_query = mysql_query("SELECT * FROM ofirst_projects_groups WHERE ID = '".$_GET['GroupID']."'"); $group = mysql_fetch_object($group_query); if(isset($_POST['removemoderators'])){ $newmod = $group->Moderators; $assigned = explode(",",$group->Members); foreach($assigned as $assign){ if(isset($_POST[$assign])){ unset($assigned[array_search("$assign",$assigned)]); echo "<br>User $assign removed!"; } } $assigned = implode(",",$assigned); mysql_query("UPDATE ofirst_projects_groups SET Moderators = '$assigned' WHERE ID = '".$_GET['GroupID']."';") or die(mysql_error()); $group_query = mysql_query("SELECT * FROM ofirst_projects_groups WHERE ID = '".$_GET['GroupID']."'"); $group = mysql_fetch_object($group_query); } ?> <h2>Edit Group <font color="red"><?php echo $group->GroupName; ?></font></h2> <form action="editgroups.php?GroupID=<?php echo $_GET['GroupID']; ?>" method="POST"> <p> <textarea name="textarea" cols="60" rows="10"><?php echo $group->Members; ?></textarea> </p> <p> <input name="confirm" type="checkbox" id="confirm" value="checkbox"> Remove this group and all its related data from the database. <input name="remove" type="submit" id="remove" value="Remove Group"> </form></p> <p> </p> <?php } include($footer); ?> --- NEW FILE: edittasks.php --- <?php /* * openFIRST.projects - groups.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); // Remove button process if(isset($_POST['remove'])){ // If a remove confirm is selected then allow the process to continue if(! isset($_POST['confirm'])){ echo "<br><br>Your request to remove the task was denied because you have not confirmed! [ <a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$_GET['ProjectID']."'>Tasks</a> ]<br><br>"; die(include($footer)); } // Remove every task related value in the database ofirst_dbquery("DELETE FROM ofirst_projects_tasks WHERE ID = '".$_POST['task']."'") or die(ofirst_dberror()); ofirst_dbquery("DELETE FROM ofirst_projects_notes WHERE TaskID = '".$_POST['task']."'") or die(ofirst_dberror()); ofirst_dbquery("DELETE FROM ofirst_projects_tasks WHERE TaskID = '".$_POST['task']."'") or die(ofirst_dberror()); ofirst_dbquery("DELETE FROM ofirst_projects_projects WHERE TaskID = '".$_POST['task']."'") or die(ofirst_dberror()); echo "<br><br>Task removed! [ <a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$_GET['ProjectID']."'>Projects</a> ]<br><br>"; die(include($footer)); } ?> <h2>Task Edit</h2> <?php } include($footer); ?> --- NEW FILE: updatesetup.php --- <?php /* * openFIRST.projects - updatesetup.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> </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. It 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. <strong>You must also ensure that the updatesetup.php script is set set as a user who has complete access to cmd</strong>, if this does not work then trying setting php.exe with a user. Read more about this in the Microsoft Help and Support option on your operating system or on the Windows website.</font> <br> works by using the Microsoft Task Schedule Service. It combines the information you provide above and automatically creates and performs the (at) command in cmd.exe. To view, edit, or remove this task you can use the schtasks command in cmd.exe. 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 } } include($footer); ?> |