2010-08-10 18:12:50 +02:00
|
|
|
/*
|
|
|
|
* This file is a part of Winix
|
2014-10-04 20:04:03 +02:00
|
|
|
* and is distributed under the 2-Clause BSD licence.
|
|
|
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2021-02-24 01:19:47 +01:00
|
|
|
* Copyright (c) 2010-2021, Tomasz Sowa
|
2010-08-10 18:12:50 +02:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
2014-10-04 20:04:03 +02:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
2010-08-10 18:12:50 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "functionbase.h"
|
|
|
|
#include "functions.h"
|
2021-05-31 18:59:20 +02:00
|
|
|
#include "templates/templates.h"
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
|
2014-02-12 17:30:49 +01:00
|
|
|
namespace Winix
|
|
|
|
{
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
FunctionBase::FunctionBase()
|
|
|
|
{
|
2011-01-05 22:24:11 +01:00
|
|
|
follow_symlinks = true;
|
2011-08-26 01:53:49 +02:00
|
|
|
template_index = size_t(-1);
|
2012-09-24 20:38:35 +02:00
|
|
|
need_ssl = false;
|
2018-06-19 15:52:08 +02:00
|
|
|
need_session = true;
|
2021-06-20 18:04:50 +02:00
|
|
|
register_default_models = true;
|
2010-08-13 22:04:57 +02:00
|
|
|
|
2021-02-24 01:19:47 +01:00
|
|
|
fun.item_content.user_id = -1;
|
|
|
|
fun.item_content.group_id = -1;
|
|
|
|
fun.item_content.privileges = 07555;
|
2012-01-25 00:03:36 +01:00
|
|
|
fun.parent_id = -1;
|
2010-08-10 18:12:50 +02:00
|
|
|
fun.id = -1;
|
|
|
|
fun.type = Item::file;
|
2018-11-21 12:03:53 +01:00
|
|
|
|
|
|
|
db = nullptr;
|
|
|
|
functions = nullptr;
|
|
|
|
templates = nullptr;
|
2010-08-10 18:12:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-01-31 20:52:17 +01:00
|
|
|
FunctionBase::~FunctionBase()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2018-11-21 12:03:53 +01:00
|
|
|
//void FunctionBase::SetConfig(Config * pconfig)
|
|
|
|
//{
|
|
|
|
// config = pconfig;
|
|
|
|
//}
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
|
2018-11-21 12:03:53 +01:00
|
|
|
//void FunctionBase::SetCur(Cur * pcur)
|
|
|
|
//{
|
|
|
|
// cur = pcur;
|
|
|
|
//}
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
void FunctionBase::SetDb(Db * pdb)
|
|
|
|
{
|
|
|
|
db = pdb;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-11-21 12:03:53 +01:00
|
|
|
//void FunctionBase::SetSystem(System * psystem)
|
|
|
|
//{
|
|
|
|
// system = psystem;
|
|
|
|
//}
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
void FunctionBase::SetFunctions(Functions * pfunctions)
|
|
|
|
{
|
|
|
|
functions = pfunctions;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FunctionBase::SetTemplates(Templates * ptemplates)
|
|
|
|
{
|
|
|
|
templates = ptemplates;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-11-21 12:03:53 +01:00
|
|
|
//void FunctionBase::SetSynchro(Synchro * psynchro)
|
|
|
|
//{
|
|
|
|
// synchro = psynchro;
|
|
|
|
//}
|
2010-12-06 01:25:46 +01:00
|
|
|
|
|
|
|
|
2018-11-21 12:03:53 +01:00
|
|
|
//void FunctionBase::SetSessionManager(SessionManager * pmanager)
|
|
|
|
//{
|
|
|
|
// session_manager = pmanager;
|
|
|
|
//}
|
2012-10-27 09:44:26 +02:00
|
|
|
|
|
|
|
|
2010-11-04 17:46:19 +01:00
|
|
|
void FunctionBase::Init()
|
|
|
|
{
|
|
|
|
// this method is called only once at the beginning
|
|
|
|
// when winix starts
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
bool FunctionBase::HasAccess()
|
|
|
|
{
|
|
|
|
// true by default
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-10 22:43:38 +02:00
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
void FunctionBase::MakePost()
|
|
|
|
{
|
|
|
|
// do nothing by default
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FunctionBase::MakeGet()
|
|
|
|
{
|
|
|
|
// do nothing by default
|
|
|
|
}
|
|
|
|
|
2018-04-25 21:48:47 +02:00
|
|
|
void FunctionBase::MakeDelete()
|
|
|
|
{
|
|
|
|
// do nothing by default
|
|
|
|
}
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
|
2021-06-20 20:47:59 +02:00
|
|
|
void FunctionBase::Clear()
|
|
|
|
{
|
|
|
|
// do nothing by default
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2014-02-12 17:30:49 +01:00
|
|
|
} // namespace Winix
|
|
|
|
|
|
|
|
|