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:
48
content/download.cpp
Executable file
48
content/download.cpp
Executable file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "content.h"
|
||||
#include "../core/request.h"
|
||||
#include "../core/data.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Content::FunDownload()
|
||||
{
|
||||
// !! moze wywalic to no_item i wszedzie w takich miejscach dac poprostu permission_denied?
|
||||
if( !request.is_item )
|
||||
{
|
||||
log << log1 << "Content: pv function requires an item" << logend;
|
||||
request.status = Error::no_item;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if( !request.HasReadAccess(request.item) ||
|
||||
request.item.static_auth == Item::static_none ||
|
||||
data.static_simplefs_dir.empty() )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
return;
|
||||
}
|
||||
|
||||
request.send_as_attachment = request.IsParam("attachment");
|
||||
|
||||
if( !request.MakePath(request.x_sendfile) )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user