[Openfirst-cvscommit] downloads/admin editinfo.php,1.1,1.2 index.php,1.1,1.2 killfile.php,1.1,1.2 up
Brought to you by:
xtimg
From: <xt...@us...> - 2003-11-23 17:28:23
|
Update of /cvsroot/openfirst/downloads/admin In directory sc8-pr-cvs1:/tmp/cvs-serv10361/admin Modified Files: editinfo.php index.php killfile.php upload.php Log Message: Change all occurances of include() to include_once(), correct some style issues, add mssql setup script Index: editinfo.php =================================================================== RCS file: /cvsroot/openfirst/downloads/admin/editinfo.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editinfo.php 7 Oct 2003 01:33:23 -0000 1.1 --- editinfo.php 23 Nov 2003 17:28:19 -0000 1.2 *************** *** 26,31 **** * */ ! include("../../config/globals.php"); ! include($header); echo("<h1>Edit File Information</h1>"); --- 26,31 ---- * */ ! include_once("../../config/globals.php"); ! include_once($header); echo("<h1>Edit File Information</h1>"); *************** *** 103,112 **** <?php ! } ! else { echo('<div>This file does not exist.</div>'); } ! } ! else { $query=ofirst_dbquery("UPDATE ofirst_downloads SET Title='".$_POST["title"]."', Description='".$_POST["desc"]."', Category='".$_POST["category"]."' WHERE ID='".$_POST["ID"]."';"); --- 103,110 ---- <?php ! } else { echo('<div>This file does not exist.</div>'); } ! } else { $query=ofirst_dbquery("UPDATE ofirst_downloads SET Title='".$_POST["title"]."', Description='".$_POST["desc"]."', Category='".$_POST["category"]."' WHERE ID='".$_POST["ID"]."';"); *************** *** 117,120 **** echo("You must be logged on as an administrative user to edit file details."); } ! include($footer); ?> --- 115,118 ---- echo("You must be logged on as an administrative user to edit file details."); } ! include_once($footer); ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/downloads/admin/index.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.php 7 Oct 2003 01:33:23 -0000 1.1 --- index.php 23 Nov 2003 17:28:19 -0000 1.2 *************** *** 26,31 **** * */ ! include("../../config/globals.php"); ! include($header); echo("<h1>Category Editor</h1>"); --- 26,31 ---- * */ ! include_once("../../config/globals.php"); ! include_once($header); echo("<h1>Category Editor</h1>"); *************** *** 80,85 **** </td></tr></table></form> <?php ! } ! else { // Action $nodelete=false; --- 80,84 ---- </td></tr></table></form> <?php ! } else { // Action $nodelete=false; *************** *** 112,117 **** <?php } ! } ! else { switch($_POST["conflictaction"]){ case "delete": { --- 111,115 ---- <?php } ! } else { switch($_POST["conflictaction"]){ case "delete": { *************** *** 132,142 **** echo("Category " . $_POST["cat"] . " has been deleted. [ <a href='../index.php'>Main</a> ]"); } ! } ! else { if(isset($_POST["newcat"])){ if($_POST["customicon"]!=""){ $icon=$_POST["customicon"]; ! } ! else { $icon=$_POST["newicon"]; } --- 130,138 ---- echo("Category " . $_POST["cat"] . " has been deleted. [ <a href='../index.php'>Main</a> ]"); } ! } else { if(isset($_POST["newcat"])){ if($_POST["customicon"]!=""){ $icon=$_POST["customicon"]; ! } else { $icon=$_POST["newicon"]; } *************** *** 147,154 **** } } ! } ! else { echo("You must be logged on as an administrative user to edit categories."); } ! include($footer); ?> --- 143,149 ---- } } ! } else { echo("You must be logged on as an administrative user to edit categories."); } ! include_once($footer); ?> Index: killfile.php =================================================================== RCS file: /cvsroot/openfirst/downloads/admin/killfile.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** killfile.php 7 Oct 2003 01:33:23 -0000 1.1 --- killfile.php 23 Nov 2003 17:28:19 -0000 1.2 *************** *** 26,31 **** * */ ! include("../../config/globals.php"); ! include($header); ?> --- 26,31 ---- * */ ! include_once("../../config/globals.php"); ! include_once($header); ?> *************** *** 64,69 **** echo('<div>Delete '.$filename.'?</div><br>'); echo('<input type="submit" value="Confirm"></form>'); ! } ! else { echo('<div>This file does not exist.</div>'); } --- 64,68 ---- echo('<div>Delete '.$filename.'?</div><br>'); echo('<input type="submit" value="Confirm"></form>'); ! } else { echo('<div>This file does not exist.</div>'); } *************** *** 82,90 **** echo("<div>The file has been deleted.</div><div>[<a href='../index.php'>Return to File Manager</a>]</div>"); } ! } ! else { echo("You must be logged on as an administrative user to delete files."); } echo("</td></tr></table>"); ! include($footer); ?> --- 81,88 ---- echo("<div>The file has been deleted.</div><div>[<a href='../index.php'>Return to File Manager</a>]</div>"); } ! } else { echo("You must be logged on as an administrative user to delete files."); } echo("</td></tr></table>"); ! include_once($footer); ?> Index: upload.php =================================================================== RCS file: /cvsroot/openfirst/downloads/admin/upload.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** upload.php 7 Oct 2003 01:33:23 -0000 1.1 --- upload.php 23 Nov 2003 17:28:19 -0000 1.2 *************** *** 28,33 **** // Import globals and estbalish database connection ! include("../../config/globals.php"); ! include($header); //directory to upload to --- 28,33 ---- // Import globals and estbalish database connection ! include_once("../../config/globals.php"); ! include_once($header); //directory to upload to *************** *** 38,42 **** if(! isset($user->user) || $user->membertype != "administrator"){ showlogin(); ! die(include($footer)); } --- 38,42 ---- if(! isset($user->user) || $user->membertype != "administrator"){ showlogin(); ! die(include_once($footer)); } *************** *** 53,68 **** echo('<div style="color:green">'.$_FILES['newfile']['name'].' was successfully uploaded to filesystem</div>'); ofirst_dbquery("INSERT INTO ofirst_downloads (Category, Title, Description, mime, ext, DateAdded, FileData) VALUES ('".$_POST["Category"]."', '".$_POST["Title"]."', '".$_POST["Description"]."', '".$_FILES['newfile']['type']."', '".$extension."', '$now', 'location:".$serverdir.$_FILES['newfile']['name']."');"); ! } ! else { echo('<div style="color:red">Could not upload '.$_FILES['newfile']['name'].'</div>'); } ! } ! else { if($bindata=file_get_contents($_FILES['newfile']['tmp_name'])){ $bindata=base64_encode($bindata); echo('<div style="color:green">'.$_FILES['newfile']['name'].' was successfully uploaded to database</div>'); ofirst_dbquery("INSERT INTO ofirst_downloads (Category, Title, Description, mime, ext, DateAdded, FileData) VALUES ('".$_POST["Category"]."', '".$_POST["Title"]."', '".$_POST["Description"]."', '".$_FILES['newfile']['type']."', '".$extension."', '$now', '".$bindata."');"); ! } ! else { echo('<div style="color:red">Could not upload '.$_FILES['newfile']['name'].'</div>'); } --- 53,65 ---- echo('<div style="color:green">'.$_FILES['newfile']['name'].' was successfully uploaded to filesystem</div>'); ofirst_dbquery("INSERT INTO ofirst_downloads (Category, Title, Description, mime, ext, DateAdded, FileData) VALUES ('".$_POST["Category"]."', '".$_POST["Title"]."', '".$_POST["Description"]."', '".$_FILES['newfile']['type']."', '".$extension."', '$now', 'location:".$serverdir.$_FILES['newfile']['name']."');"); ! } else { echo('<div style="color:red">Could not upload '.$_FILES['newfile']['name'].'</div>'); } ! } else { if($bindata=file_get_contents($_FILES['newfile']['tmp_name'])){ $bindata=base64_encode($bindata); echo('<div style="color:green">'.$_FILES['newfile']['name'].' was successfully uploaded to database</div>'); ofirst_dbquery("INSERT INTO ofirst_downloads (Category, Title, Description, mime, ext, DateAdded, FileData) VALUES ('".$_POST["Category"]."', '".$_POST["Title"]."', '".$_POST["Description"]."', '".$_FILES['newfile']['type']."', '".$extension."', '$now', '".$bindata."');"); ! } else { echo('<div style="color:red">Could not upload '.$_FILES['newfile']['name'].'</div>'); } *************** *** 72,76 **** echo('<br><br><div><a href="../index.php">[Return to File Manager]</a></div>'); ! include($footer); ?> --- 69,73 ---- echo('<br><br><div><a href="../index.php">[Return to File Manager]</a></div>'); ! include_once($footer); ?> |