44 lines
587 B
C++
44 lines
587 B
C++
|
/*
|
||
|
* This file is a part of Winix
|
||
|
* and is not publicly distributed
|
||
|
*
|
||
|
* Copyright (c) 2008-2010, Tomasz Sowa
|
||
|
* All rights reserved.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#include "cat.h"
|
||
|
|
||
|
|
||
|
|
||
|
namespace Fun
|
||
|
{
|
||
|
|
||
|
Cat::Cat()
|
||
|
{
|
||
|
fun.url = "cat";
|
||
|
}
|
||
|
|
||
|
|
||
|
void Cat::MakeGet()
|
||
|
{
|
||
|
if( !request->is_item )
|
||
|
{
|
||
|
log << log1 << "Content: cat function requires an item" << logend;
|
||
|
request->status = WINIX_ERR_NO_ITEM;
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
|
||
|
if( !system->HasReadAccess(request->item) )
|
||
|
{
|
||
|
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
request->send_as_attachment = request->IsParam("attachment");
|
||
|
}
|
||
|
|
||
|
|
||
|
} // namespace
|