added: to the Item: auth_path - a path to a static file (if auth is different from auth_none)

added: function 'mv' (move)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@596 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-03-15 01:47:26 +00:00
parent ebd868fa33
commit 6fbcffe63b
33 changed files with 1122 additions and 319 deletions

View File

@@ -33,9 +33,9 @@ return true;
bool Content::UploadCreatePath(std::string & path)
bool Content::UploadCreatePath()
{
if( !request.MakePath(path, true) )
if( !request.MakePath(request.item, true) )
{
request.status = WINIX_ERR_PERMISSION_DENIED;
return false;
@@ -107,18 +107,21 @@ void Content::UploadMulti()
{
const char * file_name = i->second.filename.c_str();
request.item.subject = file_name;
request.item.url = file_name;
request.item.auth = SelectFileType(file_name);
request.item.subject = file_name;
request.item.url = file_name;
request.item.auth = SelectFileType(file_name);
PrepareUrl(request.item);
PostFunEmacsAdd(); // always adding a new item
if( !UploadCreatePath(tmp_path) )
if( !UploadCreatePath() )
return;
if( request.status == WINIX_ERR_OK )
UploadSaveFile(i->second.tmp_filename, tmp_path);
{
UploadSaveFile(i->second.tmp_filename, request.item.auth_path);
request.status = db.EditAuthById(request.item, request.item.id);
}
}
RedirectToLastDir();
@@ -149,23 +152,19 @@ void Content::UploadSingle()
PostFunEmacsAdd(); // always adding a new item
// url can be changed by PostFunEmacsAdd()
if( !UploadCreatePath() )
return;
if( request.status == WINIX_ERR_OK )
{
const std::string & tmp_filename = request.post_file_table.begin()->second.tmp_filename;
if( !UploadCreatePath(tmp_path) )
return;
UploadSaveFile(tmp_filename, tmp_path);
UploadSaveFile(tmp_filename, request.item.auth_path);
request.status = db.EditAuthById(request.item, request.item.id);
}
if( request.status == WINIX_ERR_OK )
{
if( !request.IsParam("ckeditor_upload") )
RedirectTo(request.item);
}
RedirectTo(request.item, "/cat");
}