added: to mount points: file systems
we have two file systems now: - simplefs - the files stored on the hard drive have the same structure as in the database (dir1/dir2/file) - hashfs - files are stored in special directories extented: the mountparser can read file system added: function download this is a default function for items which have static content git-svn-id: svn://ttmath.org/publicrep/winix/trunk@588 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -27,12 +27,6 @@ bool Content::FunUploadCheckAccess()
|
||||
return false;
|
||||
}
|
||||
|
||||
// !! in the future the 'upload' can be used everywhere
|
||||
if( data.mounts.pmount->type != Mount::cms )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -41,10 +35,7 @@ return true;
|
||||
|
||||
bool Content::UploadCreatePath(std::string & path)
|
||||
{
|
||||
path.clear();
|
||||
request.MakePath(path);
|
||||
|
||||
if( !request.MakeDirsOnFS() )
|
||||
if( !request.MakePath(path, true) )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
return false;
|
||||
@@ -116,11 +107,6 @@ void Content::UploadMulti()
|
||||
request.item.privileges = 0644; // !! tymczasowo
|
||||
SetUser(request.item);
|
||||
|
||||
if( !UploadCreatePath(tmp_path) )
|
||||
return;
|
||||
|
||||
tmp_path2 = tmp_path; // remember the path
|
||||
|
||||
PostFileTable::iterator i = request.post_file_table.begin();
|
||||
|
||||
for( ; i != request.post_file_table.end() ; ++i)
|
||||
@@ -134,14 +120,11 @@ void Content::UploadMulti()
|
||||
PrepareUrl(request.item);
|
||||
PostFunEmacsAdd(); // always adding a new item
|
||||
|
||||
if( request.session->done_status == Error::ok )
|
||||
{
|
||||
tmp_path += '/';
|
||||
tmp_path += request.item.url; // item.url could have been changed
|
||||
if( !UploadCreatePath(tmp_path) )
|
||||
return;
|
||||
|
||||
if( request.session->done_status == Error::ok )
|
||||
UploadSaveFile(i->second.tmp_filename, tmp_path);
|
||||
tmp_path = tmp_path2; // restoring the oryginal path
|
||||
}
|
||||
}
|
||||
|
||||
RedirectToLastDir();
|
||||
@@ -180,16 +163,19 @@ void Content::UploadSingle()
|
||||
if( !UploadCreatePath(tmp_path) )
|
||||
return;
|
||||
|
||||
tmp_path += '/';
|
||||
tmp_path += request.item.url; // item.url could have been changed
|
||||
|
||||
UploadSaveFile(tmp_filename, tmp_path);
|
||||
}
|
||||
|
||||
|
||||
if( request.session->done_status == Error::ok )
|
||||
RedirectTo(request.item);
|
||||
{
|
||||
if( !request.IsParam("ckeditor_upload") )
|
||||
RedirectTo(request.item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// !! dodac usuwanie plikow statycznych przez rm
|
||||
void Content::PostFunUpload()
|
||||
{
|
||||
|
Reference in New Issue
Block a user