[Openfirst-cvscommit] members workspace.php,1.11,1.12
Brought to you by:
xtimg
From: <xt...@us...> - 2003-10-26 04:23:45
|
Update of /cvsroot/openfirst/members In directory sc8-pr-cvs1:/tmp/cvs-serv21433 Modified Files: workspace.php Log Message: Fix broken uploading to directories not in the root, error on workspace account activation. Index: workspace.php =================================================================== RCS file: /cvsroot/openfirst/members/workspace.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** workspace.php 5 Oct 2003 23:16:33 -0000 1.11 --- workspace.php 26 Oct 2003 04:20:01 -0000 1.12 *************** *** 261,265 **** $name = str_replace(" ", "-", $_FILES['userfile']['name'][0]); $name = str_replace("&", "and", $name); ! copy($filename, "$ws->virtfspath/" . $_POST["filepath"] . "/$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&action=view&filepath=" . $_POST["filepath"] ."'>View</a> ]"); --- 261,269 ---- $name = str_replace(" ", "-", $_FILES['userfile']['name'][0]); $name = str_replace("&", "and", $name); ! if($_POST["filepath"] != "/") { ! copy($filename, "$ws->virtfspath/" . $_POST["filepath"] . "/$name"); ! } else { ! 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&action=view&filepath=" . $_POST["filepath"] ."'>View</a> ]"); *************** *** 460,465 **** mkdir(getcwd() . "/virtfs/$user->user/"); mkdir(getcwd() . "/virtfs/$user->user/www/"); ! mkdir(getcwd() . "/virtfs/$user->user/$filepath/" . $_POST["directory"]); ! $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') . "', 'Web Site Directory', 'dir-folder_html.png', 'www');"); --- 464,468 ---- mkdir(getcwd() . "/virtfs/$user->user/"); mkdir(getcwd() . "/virtfs/$user->user/www/"); ! $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') . "', 'Web Site Directory', 'dir-folder_html.png', 'www');"); |