[Openfirst-cvscommit] members workspace.php,1.22,1.23
Brought to you by:
xtimg
From: Tim G. <xt...@us...> - 2004-04-12 13:30:21
|
Update of /cvsroot/openfirst/members In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18700 Modified Files: workspace.php Log Message: Fix bug #59 Index: workspace.php =================================================================== RCS file: /cvsroot/openfirst/members/workspace.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** workspace.php 12 Apr 2004 12:42:28 -0000 1.22 --- workspace.php 12 Apr 2004 13:16:31 -0000 1.23 *************** *** 82,89 **** } if(isset($_POST["action"]) == true && $_POST["action"] == "makedirectory") { ! mkdir(getcwd() . "/virtfs/$user->user/$filepath/" . $_POST["directory"], 0744); ! $uf = ofirst_dbquery("INSERT INTO ofirst_workspace_files (size, location, owner, permissions, date, description, filetype, name) VALUES('0', '$filepath', '$user->user', 'drw-------', '" . date('D M d Y h:m:s') . "', 'Sub Directory', 'dir-" . $_POST["directorytype"] . "', '" . $_POST["directory"] . "');"); ! echo("Sub directory Created [<a href='workspace.php?filepath=$filepath'>Return to Workspace</a> ]"); ! die(include_once($footer)); } --- 82,92 ---- } if(isset($_POST["action"]) == true && $_POST["action"] == "makedirectory") { ! if(! file_exists(getcwd() . "/virtfs/$user->user/$filepath/" . $_POST["directory"])) { ! mkdir(getcwd() . "/virtfs/$user->user/$filepath/" . $_POST["directory"], 0744); ! $uf = ofirst_dbquery("INSERT INTO ofirst_workspace_files (size, location, owner, permissions, date, description, filetype, name) VALUES('0', '$filepath', '$user->user', 'drw-------', '" . date('D M d Y h:m:s') . "', 'Sub Directory', 'dir-" . $_POST["directorytype"] . "', '" . $_POST["directory"] . "');"); ! echo("Sub directory Created [<a href='workspace.php?filepath=$filepath'>Return to Workspace</a> ]"); ! } else { ! echo("A directory with that name already exists. [<a href='workspace.php?filepath=$filepath'>Return to Workspace</a> ]"); ! } die(include_once($footer)); } *************** *** 131,139 **** if($filepath == "/") { ! deldir($ws->virtfspath . urldecode($_GET["directory"])); } else { ! deldir($ws->virtfspath . $filepath . "/" . urldecode($_GET["directory"])); } - echo("The sub directory <strong>"" . $_GET["directory"] . ""</strong> has been deleted. [ <a href='workspace.php'>Workspace</a> ]"); die(include_once($footer)); } elseif($_GET["action"] == "removedirectory" && isset($_GET["directory"]) && isset($_GET["filepath"]) && isset($_GET["confirmed"]) == false) { --- 134,151 ---- if($filepath == "/") { ! if(file_exists($ws->virtfspath . urldecode($_GET["directory"]))) { ! deldir($ws->virtfspath . urldecode($_GET["directory"])); ! echo("The sub directory <strong>"" . $_GET["directory"] . ""</strong> has been deleted. [ <a href='workspace.php'>Workspace</a> ]"); ! } else { ! echo("The requested directory does not exist. [ <a href='workspace.php'>Workspace</a> ]"); ! } } else { ! if(file_exists($ws->virtfspath . $filepath . "/" . urldecode($_GET["directory"]))) { ! deldir($ws->virtfspath . $filepath . "/" . urldecode($_GET["directory"])); ! echo("The sub directory <strong>"" . $_GET["directory"] . ""</strong> has been deleted. [ <a href='workspace.php'>Workspace</a> ]"); ! } else { ! echo("The requested directory does not exist. [ <a href='workspace.php'>Workspace</a> ]"); ! } } die(include_once($footer)); } elseif($_GET["action"] == "removedirectory" && isset($_GET["directory"]) && isset($_GET["filepath"]) && isset($_GET["confirmed"]) == false) { *************** *** 272,276 **** copy($filename, "$ws->virtfspath/$name"); } ! $uf = ofirst_dbquery("INSERT INTO ofirst_workspace_files (size, location, owner, division, permissions, date, description, filetype, name) VALUES('" .( filesize("$ws->virtfspath/" . $_POST["filepath"] . "/$name") / 1024). "', '" . $_POST["filepath"] . "', '$user->user', '" . $_POST["division"] . "', '" . $_POST["userperm"] . $_POST["groupperm"] . $_POST["otherperm"] . "', '" . date('D M d Y h:m:s') . "', '" . $_POST["description"] . "', '" . strtolower(substr($name, strrpos($name, ".") +1)) . "', '$name');"); echo("File "$name" has been uploaded successfully. [ <a href='workspace.php'>Workspace</a> | <a href='workspace.php?file=$name&owner=$user->user&action=view&filepath=" . $_POST["filepath"] ."'>View</a> ]"); die(include_once($footer)); --- 284,292 ---- copy($filename, "$ws->virtfspath/$name"); } ! ! if(ofirst_dbnum_rows(ofirst_dbquery("SELECT * FROM ofirst_workspace_files WHERE location = '" . $_POST["filepath"] . "' AND owner = '$user->user' AND name = '$name'")) == 0) { ! $uf = ofirst_dbquery("INSERT INTO ofirst_workspace_files (size, location, owner, division, permissions, date, description, filetype, name) VALUES('" .( filesize("$ws->virtfspath/" . $_POST["filepath"] . "/$name") / 1024). "', '" . $_POST["filepath"] . "', '$user->user', '" . $_POST["division"] . "', '" . $_POST["userperm"] . $_POST["groupperm"] . $_POST["otherperm"] . "', '" . date('D M d Y h:m:s') . "', '" . $_POST["description"] . "', '" . strtolower(substr($name, strrpos($name, ".") +1)) . "', '$name');"); ! } ! echo("File "$name" has been uploaded successfully. [ <a href='workspace.php'>Workspace</a> | <a href='workspace.php?file=$name&owner=$user->user&action=view&filepath=" . $_POST["filepath"] ."'>View</a> ]"); die(include_once($footer)); |