Update of /cvsroot/openfirst/members
In directory sc8-pr-cvs1:/tmp/cvs-serv11408
Modified Files:
workspace.php
Log Message:
Fix various file path problems upon removing directories and files. Fixes bugs #46, 51 and duplicates.
Index: workspace.php
===================================================================
RCS file: /cvsroot/openfirst/members/workspace.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** workspace.php 31 Dec 2003 06:22:29 -0000 1.19
--- workspace.php 21 Jan 2004 00:24:33 -0000 1.20
***************
*** 99,104 ****
die(include_once($footer));
} elseif($_GET["action"] == "delete" && isset($_GET["confirmed"]) == true) {
! $del = ofirst_dbquery("DELETE FROM ofirst_workspace_files WHERE name='" . $_GET["file"] . "' AND owner='$user->user' AND location='" . $_GET["filepath"] . "';");
! unlink($ws->virtfspath . "/" . $_GET["file"]);
echo("The file <strong>"" . $_GET["file"] . ""</strong> has been deleted. [ <a href='workspace.php'>Workspace</a> ]");
die(include_once($footer));
--- 99,108 ----
die(include_once($footer));
} elseif($_GET["action"] == "delete" && isset($_GET["confirmed"]) == true) {
! if(is_writable($ws->virtfspath . $_GET["filepath"] . "/" . $_GET["file"])) {
! $del = ofirst_dbquery("DELETE FROM ofirst_workspace_files WHERE name='" . $_GET["file"] . "' AND owner='$user->user' AND location='" . $_GET["filepath"] . "';");
! unlink($ws->virtfspath . $_GET["filepath"] . "/" . $_GET["file"]);
! } else {
! echo($ws->virtfspath . $_GET["filepath"] . "/" . $_GET["file"] . " is not writable");
! }
echo("The file <strong>"" . $_GET["file"] . ""</strong> has been deleted. [ <a href='workspace.php'>Workspace</a> ]");
die(include_once($footer));
***************
*** 119,123 ****
deldir("${dir}/${entryname}");
} elseif($entryname != "." and $entryname!="..") {
! unlink("${dir}/${entryname}");
}
}
--- 123,129 ----
deldir("${dir}/${entryname}");
} elseif($entryname != "." and $entryname!="..") {
! if(is_writeable("${dir}/${entryname}")) {
! unlink("${dir}/${entryname}");
! }
}
}
***************
*** 129,133 ****
deldir($ws->virtfspath . $_GET["directory"]);
} else {
! deldir($ws->virtfspath . $filepath . $_GET["directory"]);
}
echo("The sub directory <strong>"" . $_GET["directory"] . ""</strong> has been deleted. [ <a href='workspace.php'>Workspace</a> ]");
--- 135,139 ----
deldir($ws->virtfspath . $_GET["directory"]);
} else {
! deldir($ws->virtfspath . $filepath . "/" . $_GET["directory"]);
}
echo("The sub directory <strong>"" . $_GET["directory"] . ""</strong> has been deleted. [ <a href='workspace.php'>Workspace</a> ]");
|