part II of rewriting

git-svn-id: svn://ttmath.org/publicrep/winix/trunk@635 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-08-12 19:10:12 +00:00
parent c3fac2e83f
commit 9a199cd834
38 changed files with 1159 additions and 1167 deletions

View File

@@ -7,10 +7,9 @@
*
*/
// !! potrzebne errno?
#include <errno.h>
#include "mv.h"
#include "functions.h"
namespace Fun
@@ -34,7 +33,7 @@ Item * last_but_one = 0;
if( request->method != Request::post )
{
// used in GET (HEAD in the future?)
// used in GET or HEAD
if( !system->HasWriteAccess(*last) &&
(!last_but_one || !system->HasWriteAccess(*last_but_one)) )
@@ -134,15 +133,7 @@ return true;
bool Mv::MoveParseDir(long & dir_id, std::string & dir, std::string & file)
{
std::string * move_to = request->PostVar("to");
if( !move_to )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return false;
}
int res = system->dirs.AnalyzePath(*move_to, dir_id, dir, file);
int res = system->dirs.AnalyzePath(request->PostVar("to"), dir_id, dir, file);
if( res == 1 )
request->status = WINIX_ERR_NO_ROOT_DIR;
@@ -209,7 +200,7 @@ void Mv::MoveFile(Item & item, bool redirect)
if( !mv_file.empty() )
{
item.url = mv_file;
system->PrepareUrl(item);
functions->PrepareUrl(item);
}
item.parent_id = mv_dir_id;
@@ -313,7 +304,7 @@ void Mv::MoveDir(Item & item, bool redirect)
if( !mv_file.empty() )
{
item.url = mv_file;
system->PrepareUrl(item);
functions->PrepareUrl(item);
}
request->status = db->EditParentUrlById(item, item.id);