'tickets' can use 'threads' now
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@706 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
3fad25b8c8
commit
ab84a5169e
3
Makefile
3
Makefile
|
@ -26,6 +26,7 @@ winix: FORCE
|
||||||
@cd templates ; $(MAKE) -e
|
@cd templates ; $(MAKE) -e
|
||||||
@cd notify ; $(MAKE) -e
|
@cd notify ; $(MAKE) -e
|
||||||
@cd plugins/stats ; $(MAKE) -e
|
@cd plugins/stats ; $(MAKE) -e
|
||||||
|
@cd plugins/thread ; $(MAKE) -e
|
||||||
@cd plugins/ticket ; $(MAKE) -e
|
@cd plugins/ticket ; $(MAKE) -e
|
||||||
@cd ../ezc/src ; $(MAKE) -e
|
@cd ../ezc/src ; $(MAKE) -e
|
||||||
$(CXX) -shared -o winix.so $(CXXFLAGS) core/*.o db/*.o functions/*.o templates/*.o notify/*.o ../ezc/src/ezc.a -lfcgi -lpq -lz -lpthread -lfetch
|
$(CXX) -shared -o winix.so $(CXXFLAGS) core/*.o db/*.o functions/*.o templates/*.o notify/*.o ../ezc/src/ezc.a -lfcgi -lpq -lz -lpthread -lfetch
|
||||||
|
@ -42,6 +43,7 @@ clean:
|
||||||
@cd templates ; $(MAKE) -e clean
|
@cd templates ; $(MAKE) -e clean
|
||||||
@cd notify ; $(MAKE) -e clean
|
@cd notify ; $(MAKE) -e clean
|
||||||
@cd plugins/stats ; $(MAKE) -e clean
|
@cd plugins/stats ; $(MAKE) -e clean
|
||||||
|
@cd plugins/thread ; $(MAKE) -e clean
|
||||||
@cd plugins/ticket ; $(MAKE) -e clean
|
@cd plugins/ticket ; $(MAKE) -e clean
|
||||||
@cd ../ezc/src ; $(MAKE) -e clean
|
@cd ../ezc/src ; $(MAKE) -e clean
|
||||||
@cd main ; $(MAKE) -e clean
|
@cd main ; $(MAKE) -e clean
|
||||||
|
@ -59,6 +61,7 @@ depend:
|
||||||
@cd templates ; $(MAKE) -e depend
|
@cd templates ; $(MAKE) -e depend
|
||||||
@cd notify ; $(MAKE) -e depend
|
@cd notify ; $(MAKE) -e depend
|
||||||
@cd plugins/stats ; $(MAKE) -e depend
|
@cd plugins/stats ; $(MAKE) -e depend
|
||||||
|
@cd plugins/thread ; $(MAKE) -e depend
|
||||||
@cd plugins/ticket ; $(MAKE) -e depend
|
@cd plugins/ticket ; $(MAKE) -e depend
|
||||||
@cd ../ezc/src ; $(MAKE) -e depend
|
@cd ../ezc/src ; $(MAKE) -e depend
|
||||||
@cd main ; $(MAKE) -e depend
|
@cd main ; $(MAKE) -e depend
|
||||||
|
|
|
@ -107,6 +107,6 @@ LastTab::iterator i = FindNotLoggedOut(user_id, session_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log << log1 << "LC: there is no such a user to log out" << logend;
|
log << log4 << "LC: there is no such a user to log out" << logend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,14 +18,13 @@
|
||||||
|
|
||||||
Mounts::Mounts()
|
Mounts::Mounts()
|
||||||
{
|
{
|
||||||
pmount = 0;
|
pmount = &empty_mount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Mounts::CreateMountType()
|
void Mounts::CreateMountType()
|
||||||
{
|
{
|
||||||
mount_type_cms = AddMountType(L"cms");
|
mount_type_cms = AddMountType(L"cms");
|
||||||
mount_type_thread = AddMountType(L"thread");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,8 +38,8 @@ void Mounts::CreateMountFs()
|
||||||
void Mounts::CreateMountPar()
|
void Mounts::CreateMountPar()
|
||||||
{
|
{
|
||||||
mount_par_page = AddMountPar(L"page");
|
mount_par_page = AddMountPar(L"page");
|
||||||
mount_par_thread = AddMountPar(L"thread");
|
//mount_par_thread = AddMountPar(L"thread");
|
||||||
mount_par_createthread_on = AddMountPar(L"createthread_on");
|
//mount_par_createthread_on = AddMountPar(L"createthread_on");
|
||||||
mount_par_only_root_remove = AddMountPar(L"only_root_remove");
|
mount_par_only_root_remove = AddMountPar(L"only_root_remove");
|
||||||
mount_par_emacs_on = AddMountPar(L"emacs_on");
|
mount_par_emacs_on = AddMountPar(L"emacs_on");
|
||||||
mount_par_mkdir_on = AddMountPar(L"mkdir_on");
|
mount_par_mkdir_on = AddMountPar(L"mkdir_on");
|
||||||
|
@ -56,6 +55,9 @@ void Mounts::CreateMounts()
|
||||||
CreateMountPar();
|
CreateMountPar();
|
||||||
|
|
||||||
plugin.Call(WINIX_ADD_MOUNTS);
|
plugin.Call(WINIX_ADD_MOUNTS);
|
||||||
|
|
||||||
|
empty_mount.param.resize(mount_par_tab.size());
|
||||||
|
empty_mount.ClearParams();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -246,6 +248,8 @@ void Mounts::CalcCurMount()
|
||||||
{
|
{
|
||||||
std::vector<Item*>::reverse_iterator i;
|
std::vector<Item*>::reverse_iterator i;
|
||||||
|
|
||||||
|
pmount = &empty_mount;
|
||||||
|
|
||||||
// when the program starts (when the dir_tab is empty()
|
// when the program starts (when the dir_tab is empty()
|
||||||
// we don't want to call MountCmsForRoot()
|
// we don't want to call MountCmsForRoot()
|
||||||
if( request->dir_tab.empty() )
|
if( request->dir_tab.empty() )
|
||||||
|
|
|
@ -37,7 +37,6 @@ public:
|
||||||
|
|
||||||
// id of a specific mount type (the id is always valid)
|
// id of a specific mount type (the id is always valid)
|
||||||
int MountTypeCms() { return mount_type_cms; }
|
int MountTypeCms() { return mount_type_cms; }
|
||||||
int MountTypeThread() { return mount_type_thread; }
|
|
||||||
|
|
||||||
// return -1 if there is no such a mount type
|
// return -1 if there is no such a mount type
|
||||||
// or index otherwhise
|
// or index otherwhise
|
||||||
|
@ -64,8 +63,8 @@ public:
|
||||||
const std::wstring & GetMountPar(int id);
|
const std::wstring & GetMountPar(int id);
|
||||||
|
|
||||||
int MountParPage() { return mount_par_page; }
|
int MountParPage() { return mount_par_page; }
|
||||||
int MountParThread() { return mount_par_thread; }
|
//int MountParThread() { return mount_par_thread; }
|
||||||
int MountParCreatethreadOn() { return mount_par_createthread_on; }
|
//int MountParCreatethreadOn() { return mount_par_createthread_on; }
|
||||||
int MountParOnlyRootRemove() { return mount_par_only_root_remove; }
|
int MountParOnlyRootRemove() { return mount_par_only_root_remove; }
|
||||||
int MountParEmacsOn() { return mount_par_emacs_on; }
|
int MountParEmacsOn() { return mount_par_emacs_on; }
|
||||||
int MountParMkdirOn() { return mount_par_mkdir_on; }
|
int MountParMkdirOn() { return mount_par_mkdir_on; }
|
||||||
|
@ -102,16 +101,14 @@ private:
|
||||||
Dirs * dirs;
|
Dirs * dirs;
|
||||||
Request * request;
|
Request * request;
|
||||||
|
|
||||||
|
Mount empty_mount;
|
||||||
const std::wstring empty_str;
|
const std::wstring empty_str;
|
||||||
|
|
||||||
MountParser mount_parser;
|
MountParser mount_parser;
|
||||||
|
|
||||||
// cms
|
|
||||||
// thread
|
|
||||||
std::vector<std::wstring> mount_type_tab;
|
std::vector<std::wstring> mount_type_tab;
|
||||||
|
|
||||||
int mount_type_cms;
|
int mount_type_cms;
|
||||||
int mount_type_thread;
|
|
||||||
|
|
||||||
// simplefs
|
// simplefs
|
||||||
// hashfs
|
// hashfs
|
||||||
|
@ -120,13 +117,11 @@ private:
|
||||||
int mount_fs_simplefs;
|
int mount_fs_simplefs;
|
||||||
int mount_fs_hashfs;
|
int mount_fs_hashfs;
|
||||||
|
|
||||||
// page
|
|
||||||
// thread
|
|
||||||
std::vector<std::wstring> mount_par_tab;
|
std::vector<std::wstring> mount_par_tab;
|
||||||
|
|
||||||
int mount_par_page;
|
int mount_par_page;
|
||||||
int mount_par_thread;
|
//int mount_par_thread;
|
||||||
int mount_par_createthread_on;
|
//int mount_par_createthread_on;
|
||||||
int mount_par_only_root_remove;
|
int mount_par_only_root_remove;
|
||||||
int mount_par_emacs_on;
|
int mount_par_emacs_on;
|
||||||
int mount_par_mkdir_on;
|
int mount_par_mkdir_on;
|
||||||
|
|
|
@ -32,7 +32,6 @@ size_t i;
|
||||||
Plugin::Plugin()
|
Plugin::Plugin()
|
||||||
{
|
{
|
||||||
current_plugin = -1;
|
current_plugin = -1;
|
||||||
request = 0;
|
|
||||||
|
|
||||||
db = 0;
|
db = 0;
|
||||||
config = 0;
|
config = 0;
|
||||||
|
@ -42,6 +41,9 @@ Plugin::Plugin()
|
||||||
templates = 0;
|
templates = 0;
|
||||||
synchro = 0;
|
synchro = 0;
|
||||||
session_manager = 0;
|
session_manager = 0;
|
||||||
|
|
||||||
|
ret_false = 0;
|
||||||
|
ret_true = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -284,10 +286,17 @@ void Plugin::Call(int message, Slots::iterator & slot)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Plugin::Call(int message, void * p1_, void * p2_, long l1_, long l2_)
|
void Plugin::Call(int message, void * p1_, void * p2_, long l1_, long l2_)
|
||||||
{
|
{
|
||||||
|
// how many plugins return 'false' and 'true'
|
||||||
|
// we are using local variables because Call() method can be called
|
||||||
|
// from a plugin too (one Call() can execute another Call())
|
||||||
|
int ret_false_loc = 0;
|
||||||
|
int ret_true_loc = 0;
|
||||||
|
int old_current_plugin = current_plugin;
|
||||||
|
|
||||||
Slots::iterator i = slots.lower_bound(message);
|
Slots::iterator i = slots.lower_bound(message);
|
||||||
int old_current_plugin = current_plugin;
|
|
||||||
|
|
||||||
for( ; i!=slots.end() && i->first==message ; ++i )
|
for( ; i!=slots.end() && i->first==message ; ++i )
|
||||||
{
|
{
|
||||||
|
@ -298,9 +307,16 @@ void Plugin::Call(int message, void * p1_, void * p2_, long l1_, long l2_)
|
||||||
info.l2 = l2_;
|
info.l2 = l2_;
|
||||||
|
|
||||||
Call(message, i);
|
Call(message, i);
|
||||||
|
|
||||||
|
if( info.res )
|
||||||
|
++ret_true_loc;
|
||||||
|
else
|
||||||
|
++ret_false_loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
current_plugin = old_current_plugin;
|
current_plugin = old_current_plugin;
|
||||||
|
ret_false = ret_false_loc;
|
||||||
|
ret_true = ret_true_loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -352,8 +368,6 @@ void Plugin::Call(int message, void * p1_, void * p2_, long l1_)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
size_t Plugin::Size()
|
size_t Plugin::Size()
|
||||||
{
|
{
|
||||||
return plugins.size();
|
return plugins.size();
|
||||||
|
@ -361,6 +375,19 @@ size_t Plugin::Size()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int Plugin::True()
|
||||||
|
{
|
||||||
|
return ret_true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Plugin::False()
|
||||||
|
{
|
||||||
|
return ret_false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Plugin::Assign(int message, Fun1 fun1)
|
void Plugin::Assign(int message, Fun1 fun1)
|
||||||
{
|
{
|
||||||
Slot s;
|
Slot s;
|
||||||
|
|
|
@ -74,7 +74,7 @@ struct PluginInfo
|
||||||
|
|
||||||
// function return status
|
// function return status
|
||||||
// default: false (if not set by the plugin)
|
// default: false (if not set by the plugin)
|
||||||
bool ret;
|
bool res;
|
||||||
|
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
|
@ -89,7 +89,7 @@ struct PluginInfo
|
||||||
plugin_id = -1;
|
plugin_id = -1;
|
||||||
plugin_data_base = 0;
|
plugin_data_base = 0;
|
||||||
|
|
||||||
ret = false;
|
res = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -161,6 +161,14 @@ public:
|
||||||
// how many plugins there are
|
// how many plugins there are
|
||||||
size_t Size();
|
size_t Size();
|
||||||
|
|
||||||
|
// how many plugins returned 'true'
|
||||||
|
// from last Call()
|
||||||
|
int True();
|
||||||
|
|
||||||
|
// how many plugins returned 'false'
|
||||||
|
// from last Call()
|
||||||
|
int False();
|
||||||
|
|
||||||
// assign a function to a message
|
// assign a function to a message
|
||||||
// you can assign more than one function to a specific message
|
// you can assign more than one function to a specific message
|
||||||
void Assign(int message, Fun1);
|
void Assign(int message, Fun1);
|
||||||
|
@ -177,6 +185,9 @@ private:
|
||||||
Synchro * synchro;
|
Synchro * synchro;
|
||||||
SessionManager * session_manager;
|
SessionManager * session_manager;
|
||||||
|
|
||||||
|
int ret_false;
|
||||||
|
int ret_true;
|
||||||
|
|
||||||
std::wstring temp_path;
|
std::wstring temp_path;
|
||||||
|
|
||||||
struct PluginsItem
|
struct PluginsItem
|
||||||
|
|
|
@ -93,4 +93,13 @@
|
||||||
#define WINIX_NOTIFY_ADD_TEMPLATE 3013
|
#define WINIX_NOTIFY_ADD_TEMPLATE 3013
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// values from 4000 - 4099 reserved for 'thread' plugin
|
||||||
|
// see plugins/thread/pluginmsg.h
|
||||||
|
|
||||||
|
// values from 4100 - 4199 reserved for 'ticket' plugin
|
||||||
|
// see plugins/ticket/pluginmsg.h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -50,8 +50,6 @@ void Request::ClearPostFileTmp()
|
||||||
|
|
||||||
void Request::Clear()
|
void Request::Clear()
|
||||||
{
|
{
|
||||||
// warning: don't clear: in, out, err, env
|
|
||||||
|
|
||||||
// id is never 0
|
// id is never 0
|
||||||
if( ++id == 0 )
|
if( ++id == 0 )
|
||||||
++id;
|
++id;
|
||||||
|
@ -80,15 +78,16 @@ void Request::Clear()
|
||||||
env_content_type = &char_empty;
|
env_content_type = &char_empty;
|
||||||
env_http_accept_encoding = &char_empty;
|
env_http_accept_encoding = &char_empty;
|
||||||
|
|
||||||
|
temporary_session.Clear();
|
||||||
session = 0;
|
temporary_session.id = 0;
|
||||||
|
session = &temporary_session;
|
||||||
|
|
||||||
item_tab.clear();
|
item_tab.clear();
|
||||||
item.Clear();
|
item.Clear();
|
||||||
dir_tab.clear();
|
dir_tab.clear();
|
||||||
last_item = 0;
|
last_item = &item;
|
||||||
is_item = false;
|
is_item = false;
|
||||||
function = 0;
|
function = 0; // !! dodac jakas empty funkcje
|
||||||
param_tab.clear();
|
param_tab.clear();
|
||||||
|
|
||||||
status = WINIX_ERR_OK;
|
status = WINIX_ERR_OK;
|
||||||
|
|
|
@ -138,6 +138,9 @@ private:
|
||||||
|
|
||||||
Config * config;
|
Config * config;
|
||||||
|
|
||||||
|
// session with id 0
|
||||||
|
Session temporary_session;
|
||||||
|
|
||||||
void ClearPostFileTmp();
|
void ClearPostFileTmp();
|
||||||
|
|
||||||
// contains '\0'
|
// contains '\0'
|
||||||
|
|
|
@ -151,7 +151,8 @@ IndexId::iterator i;
|
||||||
if( i == index_id.end() )
|
if( i == index_id.end() )
|
||||||
{
|
{
|
||||||
i = index_id.begin();
|
i = index_id.begin();
|
||||||
WaitForSignalSleep(30);
|
WaitForSignalSleep(10);
|
||||||
|
//WaitForSignalSleep(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -186,19 +187,24 @@ return outdated;
|
||||||
// it's called from the other thread (with Lock and Unlock)
|
// it's called from the other thread (with Lock and Unlock)
|
||||||
void SessionContainer::DeleteSession(SessionContainer::IndexId::iterator i)
|
void SessionContainer::DeleteSession(SessionContainer::IndexId::iterator i)
|
||||||
{
|
{
|
||||||
Session * old_session = request->session;
|
Session * old_session = 0;
|
||||||
|
Session * del_session = &(*i->second);
|
||||||
|
|
||||||
request->session = &(*i->second);
|
if( del_session != request->session )
|
||||||
|
old_session = request->session;
|
||||||
|
|
||||||
//log << log3 << "SessionContainer: deleting outdated session, id: " << i->second->id << logend;
|
request->session = del_session;
|
||||||
|
|
||||||
if( i->second->puser )
|
log << log4 << "SessionContainer: deleting outdated session, id: " << del_session->id << logend;
|
||||||
last_container->UserLogout(i->second->puser->id, i->second->id);
|
|
||||||
|
if( del_session->puser )
|
||||||
|
last_container->UserLogout(del_session->puser->id, del_session->id);
|
||||||
|
|
||||||
table.erase(i->second);
|
table.erase(i->second);
|
||||||
index_id.erase(i);
|
index_id.erase(i);
|
||||||
table_size -= 1;
|
table_size -= 1;
|
||||||
|
|
||||||
|
// !! tu moze byc zero
|
||||||
request->session = old_session;
|
request->session = old_session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@ db.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||||
db.o: ../core/ugcontainer.h ../core/log.h ../core/misc.h
|
db.o: ../core/ugcontainer.h ../core/log.h ../core/misc.h
|
||||||
dbbase.o: dbbase.h dbconn.h dbtextstream.h ../core/textstream.h
|
dbbase.o: dbbase.h dbconn.h dbtextstream.h ../core/textstream.h
|
||||||
dbbase.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
|
dbbase.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
|
||||||
dbbase.o: ../core/textstream.h ../core/log.h ../../ezc/src/utf8.h
|
dbbase.o: ../core/textstream.h ../core/log.h ../core/misc.h
|
||||||
|
dbbase.o: ../../ezc/src/utf8.h
|
||||||
dbconn.o: dbconn.h dbtextstream.h ../core/textstream.h ../core/misc.h
|
dbconn.o: dbconn.h dbtextstream.h ../core/textstream.h ../core/misc.h
|
||||||
dbconn.o: ../core/item.h ../core/log.h ../core/error.h ../core/log.h
|
dbconn.o: ../core/item.h ../core/log.h ../core/error.h ../core/log.h
|
||||||
dbconn.o: ../core/textstream.h
|
dbconn.o: ../core/textstream.h
|
||||||
|
|
|
@ -626,6 +626,14 @@ PGresult * Db::GetItemsQuery(const DbItemQuery & iq, bool skip_other_sel)
|
||||||
const char * if_and = "";
|
const char * if_and = "";
|
||||||
|
|
||||||
if( iq.where_id ) { query << R(if_and) << R("item.id=") << iq.id ; if_and = add_and; }
|
if( iq.where_id ) { query << R(if_and) << R("item.id=") << iq.id ; if_and = add_and; }
|
||||||
|
|
||||||
|
if( iq.id_tab && !iq.id_tab->empty() )
|
||||||
|
{
|
||||||
|
CreateIdList(*iq.id_tab, iq_id_list);
|
||||||
|
query << R(if_and) << R("item.id in ") << R(iq_id_list);
|
||||||
|
if_and = add_and;
|
||||||
|
}
|
||||||
|
|
||||||
if( iq.where_parent_id ){ query << R(if_and) << R("parent_id=") << iq.parent_id ; if_and = add_and; }
|
if( iq.where_parent_id ){ query << R(if_and) << R("parent_id=") << iq.parent_id ; if_and = add_and; }
|
||||||
|
|
||||||
if( iq.where_type )
|
if( iq.where_type )
|
||||||
|
|
2
db/db.h
2
db/db.h
|
@ -23,7 +23,6 @@
|
||||||
#include "core/item.h"
|
#include "core/item.h"
|
||||||
#include "core/user.h"
|
#include "core/user.h"
|
||||||
#include "core/group.h"
|
#include "core/group.h"
|
||||||
#include "core/thread.h"
|
|
||||||
#include "core/dircontainer.h"
|
#include "core/dircontainer.h"
|
||||||
#include "core/ugcontainer.h"
|
#include "core/ugcontainer.h"
|
||||||
|
|
||||||
|
@ -93,6 +92,7 @@ protected:
|
||||||
DbTextStream query, query_create_url;
|
DbTextStream query, query_create_url;
|
||||||
std::wstring temp_url;
|
std::wstring temp_url;
|
||||||
Item dir_temp;
|
Item dir_temp;
|
||||||
|
std::wstring iq_id_list;
|
||||||
|
|
||||||
bool AddItemCreateUrlSubject(Item & item);
|
bool AddItemCreateUrlSubject(Item & item);
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,11 @@
|
||||||
#include "dbbase.h"
|
#include "dbbase.h"
|
||||||
#include "core/log.h"
|
#include "core/log.h"
|
||||||
#include "core/error.h"
|
#include "core/error.h"
|
||||||
|
#include "core/misc.h"
|
||||||
#include "utf8.h"
|
#include "utf8.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DbBase::DbBase()
|
DbBase::DbBase()
|
||||||
{
|
{
|
||||||
db_conn = 0;
|
db_conn = 0;
|
||||||
|
@ -283,7 +285,7 @@ tm t;
|
||||||
if( len != 19 )
|
if( len != 19 )
|
||||||
{
|
{
|
||||||
// the format must be like this: 2008-12-31 22:30:00
|
// the format must be like this: 2008-12-31 22:30:00
|
||||||
log << log1 << "DbBase: ConvertTime: unknown time format: \"" << str << "\"";
|
log << log1 << "DbBase: ConvertTime: unknown time format: \"" << str << "\"" << logend;
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,7 +335,7 @@ size_t buffer_len = sizeof(buffer) / sizeof(wchar_t);
|
||||||
|
|
||||||
for(size_t i=0 ; i<id_tab.size() ; ++i)
|
for(size_t i=0 ; i<id_tab.size() ; ++i)
|
||||||
{
|
{
|
||||||
swprintf(buffer, buffer_len, L"%lu", (unsigned long)id_tab[i]);
|
Toa((unsigned long)id_tab[i], buffer, buffer_len);
|
||||||
list += buffer;
|
list += buffer;
|
||||||
|
|
||||||
if( i+1 < id_tab.size() )
|
if( i+1 < id_tab.size() )
|
||||||
|
|
|
@ -20,6 +20,7 @@ DbItemQuery::DbItemQuery()
|
||||||
SetAll(true, false);
|
SetAll(true, false);
|
||||||
|
|
||||||
id = -1;
|
id = -1;
|
||||||
|
id_tab = 0;
|
||||||
parent_id = -1;
|
parent_id = -1;
|
||||||
type = Item::none;
|
type = Item::none;
|
||||||
file_type = WINIX_ITEM_FILETYPE_NONE;
|
file_type = WINIX_ITEM_FILETYPE_NONE;
|
||||||
|
@ -77,6 +78,11 @@ void DbItemQuery::WhereId(long id_)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DbItemQuery::WhereIdIn(const std::vector<long> & id_tab_list)
|
||||||
|
{
|
||||||
|
id_tab = &id_tab_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DbItemQuery::WhereParentId(long parent_id_)
|
void DbItemQuery::WhereParentId(long parent_id_)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
#define headerfile_winix_db_dbitemquery
|
#define headerfile_winix_db_dbitemquery
|
||||||
|
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
#include "core/item.h"
|
#include "core/item.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct DbItemQuery
|
struct DbItemQuery
|
||||||
{
|
{
|
||||||
// id and content_id is selected always
|
// id and content_id is selected always
|
||||||
|
@ -46,6 +46,8 @@ struct DbItemQuery
|
||||||
bool file_type_equal; // if true means file_type should be equal
|
bool file_type_equal; // if true means file_type should be equal
|
||||||
bool sort_asc;
|
bool sort_asc;
|
||||||
|
|
||||||
|
const std::vector<long> * id_tab; // != 0 if WhereIdIn was used
|
||||||
|
|
||||||
long limit;
|
long limit;
|
||||||
long offset;
|
long offset;
|
||||||
|
|
||||||
|
@ -56,6 +58,7 @@ struct DbItemQuery
|
||||||
void SetAll(bool sel, bool where_);
|
void SetAll(bool sel, bool where_);
|
||||||
|
|
||||||
void WhereId(long id_);
|
void WhereId(long id_);
|
||||||
|
void WhereIdIn(const std::vector<long> & id_tab_list);
|
||||||
void WhereParentId(long parent_id_);
|
void WhereParentId(long parent_id_);
|
||||||
void WhereType(Item::Type type_, bool equal = true);
|
void WhereType(Item::Type type_, bool equal = true);
|
||||||
void WhereFileType(int file_t, bool equal = true);
|
void WhereFileType(int file_t, bool equal = true);
|
||||||
|
|
|
@ -77,14 +77,7 @@ return true;
|
||||||
|
|
||||||
void Emacs::PostFunEmacsModifyMountPoint(bool adding)
|
void Emacs::PostFunEmacsModifyMountPoint(bool adding)
|
||||||
{
|
{
|
||||||
if( system->mounts.pmount->type == system->mounts.MountTypeThread() && adding )
|
system->RedirectToLastItem();
|
||||||
db->EditThreadAddItem(request->dir_tab.back()->id, request->item.id);
|
|
||||||
|
|
||||||
|
|
||||||
if( system->mounts.pmount->type == system->mounts.MountTypeCms() )
|
|
||||||
system->RedirectTo(request->item);
|
|
||||||
else
|
|
||||||
system->RedirectToLastDir();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,8 +85,9 @@ void Emacs::PostFunEmacsModifyMountPoint(bool adding)
|
||||||
|
|
||||||
int Emacs::NotifyCodeEdit()
|
int Emacs::NotifyCodeEdit()
|
||||||
{
|
{
|
||||||
if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
|
// !! nie potrzebne
|
||||||
return WINIX_NOTIFY_CODE_THREAD_POST_CHANGED;
|
// if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
|
||||||
|
// return WINIX_NOTIFY_CODE_THREAD_POST_CHANGED;
|
||||||
|
|
||||||
return WINIX_NOTIFY_CODE_FILE_EDIT;
|
return WINIX_NOTIFY_CODE_FILE_EDIT;
|
||||||
}
|
}
|
||||||
|
@ -103,8 +97,9 @@ return WINIX_NOTIFY_CODE_FILE_EDIT;
|
||||||
|
|
||||||
int Emacs::NotifyCodeAdd()
|
int Emacs::NotifyCodeAdd()
|
||||||
{
|
{
|
||||||
if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
|
// !! nie potrzebne
|
||||||
return WINIX_NOTIFY_CODE_THREAD_REPLAYED;
|
// if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
|
||||||
|
// return WINIX_NOTIFY_CODE_THREAD_REPLAYED;
|
||||||
|
|
||||||
return WINIX_NOTIFY_CODE_FILE_ADD;
|
return WINIX_NOTIFY_CODE_FILE_ADD;
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,6 @@ void Functions::CreateFunctions()
|
||||||
Add(fun_chown);
|
Add(fun_chown);
|
||||||
Add(fun_ckeditor);
|
Add(fun_ckeditor);
|
||||||
Add(fun_cp);
|
Add(fun_cp);
|
||||||
Add(fun_createthread);
|
|
||||||
Add(fun_default);
|
Add(fun_default);
|
||||||
Add(fun_download);
|
Add(fun_download);
|
||||||
Add(fun_emacs);
|
Add(fun_emacs);
|
||||||
|
@ -196,7 +195,6 @@ void Functions::CreateFunctions()
|
||||||
Add(fun_stat);
|
Add(fun_stat);
|
||||||
Add(fun_subject);
|
Add(fun_subject);
|
||||||
Add(fun_template);
|
Add(fun_template);
|
||||||
Add(fun_thread);
|
|
||||||
Add(fun_tinymce);
|
Add(fun_tinymce);
|
||||||
Add(fun_uname);
|
Add(fun_uname);
|
||||||
Add(fun_upload);
|
Add(fun_upload);
|
||||||
|
@ -249,9 +247,11 @@ void Functions::SetDefaultFunctionForFile()
|
||||||
|
|
||||||
void Functions::SetDefaultFunctionForDir()
|
void Functions::SetDefaultFunctionForDir()
|
||||||
{
|
{
|
||||||
if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
|
// !! nie potrzebne
|
||||||
request->function = &fun_thread;
|
// if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
|
||||||
else
|
// request->function = &fun_thread;
|
||||||
|
// else
|
||||||
|
|
||||||
request->function = &fun_ls;
|
request->function = &fun_ls;
|
||||||
|
|
||||||
log << log3 << "Functions: default function: " << request->function->fun.url << logend;
|
log << log3 << "Functions: default function: " << request->function->fun.url << logend;
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include "chown.h"
|
#include "chown.h"
|
||||||
#include "ckeditor.h"
|
#include "ckeditor.h"
|
||||||
#include "cp.h"
|
#include "cp.h"
|
||||||
#include "createthread.h"
|
|
||||||
#include "default.h"
|
#include "default.h"
|
||||||
#include "download.h"
|
#include "download.h"
|
||||||
#include "emacs.h"
|
#include "emacs.h"
|
||||||
|
@ -38,7 +37,6 @@
|
||||||
#include "specialdefault.h"
|
#include "specialdefault.h"
|
||||||
#include "stat.h"
|
#include "stat.h"
|
||||||
#include "subject.h"
|
#include "subject.h"
|
||||||
#include "funthread.h"
|
|
||||||
#include "template.h"
|
#include "template.h"
|
||||||
#include "tinymce.h"
|
#include "tinymce.h"
|
||||||
#include "uname.h"
|
#include "uname.h"
|
||||||
|
@ -63,7 +61,6 @@ public:
|
||||||
Fun::Chown fun_chown;
|
Fun::Chown fun_chown;
|
||||||
Fun::Ckeditor fun_ckeditor;
|
Fun::Ckeditor fun_ckeditor;
|
||||||
Fun::Cp fun_cp;
|
Fun::Cp fun_cp;
|
||||||
Fun::CreateThread fun_createthread;
|
|
||||||
Fun::Default fun_default;
|
Fun::Default fun_default;
|
||||||
Fun::Download fun_download;
|
Fun::Download fun_download;
|
||||||
Fun::Emacs fun_emacs;
|
Fun::Emacs fun_emacs;
|
||||||
|
@ -82,7 +79,6 @@ public:
|
||||||
Fun::SpecialDefault fun_special_default;
|
Fun::SpecialDefault fun_special_default;
|
||||||
Fun::Stat fun_stat;
|
Fun::Stat fun_stat;
|
||||||
Fun::Subject fun_subject;
|
Fun::Subject fun_subject;
|
||||||
Fun::FunThread fun_thread;
|
|
||||||
Fun::Template fun_template;
|
Fun::Template fun_template;
|
||||||
Fun::Tinymce fun_tinymce;
|
Fun::Tinymce fun_tinymce;
|
||||||
Fun::Uname fun_uname;
|
Fun::Uname fun_uname;
|
||||||
|
|
|
@ -147,7 +147,9 @@ void Rm::RemoveFileOrSymlink(Item & item)
|
||||||
|
|
||||||
TemplatesFunctions::pattern_cacher.DeletePattern(item);
|
TemplatesFunctions::pattern_cacher.DeletePattern(item);
|
||||||
plugin.Call(WINIX_FILE_REMOVED, item.id);
|
plugin.Call(WINIX_FILE_REMOVED, item.id);
|
||||||
db->EditThreadRemoveItem(item.parent_id);
|
|
||||||
|
// !! nie potrzebne
|
||||||
|
//db->EditThreadRemoveItem(item.parent_id);
|
||||||
|
|
||||||
if( item.file_type != WINIX_ITEM_FILETYPE_NONE )
|
if( item.file_type != WINIX_ITEM_FILETYPE_NONE )
|
||||||
RemoveStaticFile(item);
|
RemoveStaticFile(item);
|
||||||
|
@ -182,7 +184,9 @@ void Rm::RemoveDirTree(long dir_id)
|
||||||
if( db->DelDirById(dir_id) == WINIX_ERR_OK )
|
if( db->DelDirById(dir_id) == WINIX_ERR_OK )
|
||||||
{
|
{
|
||||||
system->dirs.DelDir(dir_id);
|
system->dirs.DelDir(dir_id);
|
||||||
db->RemoveThread(dir_id);
|
|
||||||
|
// !! nie potrzebne
|
||||||
|
//db->RemoveThread(dir_id);
|
||||||
|
|
||||||
plugin.Call(WINIX_DIR_REMOVED, dir_id);
|
plugin.Call(WINIX_DIR_REMOVED, dir_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,29 +8,18 @@
|
||||||
<legend>{form_thread_legend}</legend>
|
<legend>{form_thread_legend}</legend>
|
||||||
|
|
||||||
<p class="withnext">{title}:</p>
|
<p class="withnext">{title}:</p>
|
||||||
<input class="edit" type="text" name="subject" value="">
|
<input class="edit" type="text" name="subject" value="[item_subject]">
|
||||||
|
|
||||||
|
|
||||||
[# !! change names form_emacs_content_thread and form_emacs_content_ticket]
|
|
||||||
|
|
||||||
<p class="withnext">{form_emacs_content_thread}</p>
|
|
||||||
<textarea class="multitext" rows="10" cols="60" name="itemcontent"></textarea>
|
|
||||||
|
|
||||||
<p class="withnext">{form_emacs_content_type}</p>
|
|
||||||
|
|
||||||
<select name="contenttype" class="contenttype">
|
|
||||||
<option value="0">{form_emacs_content_type_text}</option>
|
|
||||||
<option selected value="1">{form_emacs_content_type_formatted_text}</option>
|
|
||||||
[if-one user_can_use_html]<option value="2">{form_emacs_content_type_html}</option>[end]
|
|
||||||
[if-one user_can_use_bbcode]<option value="3">{form_emacs_content_type_bbcode}</option>[end]
|
|
||||||
[if-one user_can_use_raw]<option value="4">{form_emacs_content_type_raw}</option>[end]
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
[if mount_thread_arg_is "subject"]
|
||||||
|
<p class="withnext">{suggested_url}:</p>
|
||||||
|
<input class="edit" type="text" name="url" value="[item_url]">
|
||||||
|
[end]
|
||||||
|
|
||||||
|
[include "fun_emacs_post.html"]
|
||||||
|
|
||||||
[if-no user_logged]
|
[if-no user_logged]
|
||||||
<p class="withnext">{nick}:</p>
|
<p class="withnext">{nick}:</p>
|
||||||
<input class="edit" type="text" name="guestname" value="">
|
<input class="edit" type="text" name="guestname" value="[item_guest_name]">
|
||||||
|
|
||||||
<p class="withnext">{rebus_how_is_it} [rebus_question]?</p>
|
<p class="withnext">{rebus_how_is_it} [rebus_question]?</p>
|
||||||
<input class="edit" type="text" name="rebus">
|
<input class="edit" type="text" name="rebus">
|
||||||
|
@ -39,3 +28,4 @@
|
||||||
<input class="submit" type="submit" value="{button_thread_submit}">
|
<input class="submit" type="submit" value="{button_thread_submit}">
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -15,14 +15,6 @@
|
||||||
<input class="edit" type="text" name="url" value="[item_url]">
|
<input class="edit" type="text" name="url" value="[item_url]">
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
[if-any mount_type_is "thread" mount_thread_arg_is "subject"]
|
|
||||||
<p class="withnext">{title}:</p>
|
|
||||||
<input class="edit" type="text" name="subject" value="[item_subject]">
|
|
||||||
|
|
||||||
<p class="withnext">{suggested_url}:</p>
|
|
||||||
<input class="edit" type="text" name="url" value="[item_url]">
|
|
||||||
[end]
|
|
||||||
|
|
||||||
[include "fun_emacs_post.html"]
|
[include "fun_emacs_post.html"]
|
||||||
|
|
||||||
[if-no user_logged]
|
[if-no user_logged]
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
<h1>{thread_header_reply}</h1>
|
||||||
|
|
||||||
|
[include "error.html"]
|
||||||
|
|
||||||
|
|
||||||
|
<form id="additem" method="post" action="[doc_base_url][dir][item_url]/reply">
|
||||||
|
<fieldset>
|
||||||
|
<legend>{form_thread_reply}</legend>
|
||||||
|
|
||||||
|
[if mount_thread_arg_is "subject"]
|
||||||
|
<p class="withnext">{title}:</p>
|
||||||
|
<input class="edit" type="text" name="subject" value="">
|
||||||
|
|
||||||
|
<p class="withnext">{suggested_url}:</p>
|
||||||
|
<input class="edit" type="text" name="url" value="">
|
||||||
|
[end]
|
||||||
|
|
||||||
|
|
||||||
|
[if mount_type_is "thread"]<p class="withnext">{form_emacs_content_thread}</p>[end]
|
||||||
|
<textarea class="multitext" rows="10" cols="60" name="itemcontent"></textarea>
|
||||||
|
|
||||||
|
|
||||||
|
<p class="withnext">{form_emacs_content_type}</p>
|
||||||
|
|
||||||
|
<select name="contenttype" class="contenttype">
|
||||||
|
<option value="0">{form_emacs_content_type_text}</option>
|
||||||
|
<option selected value="1">{form_emacs_content_type_formatted_text}</option>
|
||||||
|
[if user_can_use_html]<option value="2">{form_emacs_content_type_html}</option>[end]
|
||||||
|
[if user_can_use_bbcode]<option value="3">{form_emacs_content_type_bbcode}</option>[end]
|
||||||
|
[if user_can_use_raw]<option value="4">{form_emacs_content_type_raw}</option>[end]
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[if-no user_logged]
|
||||||
|
<p class="withnext">{nick}:</p>
|
||||||
|
<input class="edit" type="text" name="guestname" value="">
|
||||||
|
|
||||||
|
<p class="withnext">{rebus_how_is_it} [rebus_question]?</p>
|
||||||
|
<input class="edit" type="text" name="rebus">
|
||||||
|
[end]
|
||||||
|
|
||||||
|
<input class="submit" type="submit" value="{add}">
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
[if mount_page_arg_is "subject"]<h1[if mount_page_arg_is "info"] class="withinfo"[end]>[dir_last_subject]</h1>[end]
|
||||||
|
[if mount_page_arg_is "info"][include "dir_last_info.html"][end]
|
||||||
|
|
||||||
|
|
||||||
|
[if thread_can_create]
|
||||||
|
<ul class="itemmenu">
|
||||||
|
<li><a href="[doc_base_url][dir]createthread">{thread_create_new}</a></li>
|
||||||
|
</ul>
|
||||||
|
[end]
|
||||||
|
|
||||||
|
|
||||||
|
[if thread_sort_tab]
|
||||||
|
<table class="forum">
|
||||||
|
<tr><th>{thread_tab_title}</th><th>{thread_tab_author}</th><th>{thread_tab_replies}</th><th>{thread_tab_last_post}</th></tr>
|
||||||
|
[for thread_sort_tab]
|
||||||
|
<tr>
|
||||||
|
<td><a href="[doc_base_url][dir][thread_sort_tab_url]">[thread_sort_tab_subject]</a></td> [# dodac sprawdzanie subject empty]
|
||||||
|
<td class="smallfont">[thread_sort_tab_user]</td><td class="smallfont">[thread_sort_tab_replies]</td>
|
||||||
|
<td class="smallfont">[thread_sort_tab_last_item_date_modification_nice] ([thread_sort_tab_last_item_user])</td>
|
||||||
|
</tr>
|
||||||
|
[end]
|
||||||
|
</table>
|
||||||
|
[end]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
[if mount_page_arg_is "info"][include "dir_last_info.html"][end]
|
[if mount_page_arg_is "info"][include "dir_last_info.html"][end]
|
||||||
|
|
||||||
|
|
||||||
[if-one ticket_can_create]
|
[if ticket_can_create]
|
||||||
<ul class="itemmenu">
|
<ul class="itemmenu">
|
||||||
<li><a href="[doc_base_url][dir]createticket">{ticket_create_new}</a></li>
|
<li><a href="[doc_base_url][dir]createticket">{ticket_create_new}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -17,6 +17,12 @@
|
||||||
[for ticket_tab]
|
[for ticket_tab]
|
||||||
<th>[ticket_tab_param]</th>
|
<th>[ticket_tab_param]</th>
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
|
[if winix_has_plugin "thread"]
|
||||||
|
<th>{thread_tab_author}</th>
|
||||||
|
<th>{thread_tab_replies}</th>
|
||||||
|
<th>{thread_tab_last_post}</th>
|
||||||
|
[end]
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
[for tickets_tab]
|
[for tickets_tab]
|
||||||
|
@ -29,6 +35,13 @@
|
||||||
<td>[tickets_tab_conf_tab_value]</td>
|
<td>[tickets_tab_conf_tab_value]</td>
|
||||||
[end]
|
[end]
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
|
[if winix_has_plugin "thread"]
|
||||||
|
<td>[thread_sort_tab_user]</td>
|
||||||
|
<td>[if thread_sort_tab_has_thread][thread_sort_tab_replies][end]</td>
|
||||||
|
<td>[if thread_sort_tab_has_thread][thread_sort_tab_last_item_date_modification_nice] ([thread_sort_tab_last_item_user])[end]</td>
|
||||||
|
[end]
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
|
|
|
@ -1,43 +1,29 @@
|
||||||
[if mount_page_arg_is "subject"]<h1[if mount_page_arg_is "info"] class="withinfo"[end]>[dir_last_subject]</h1>[end]
|
[if mount_page_arg_is "subject"]<h1[if mount_page_arg_is "info"] class="withinfo"[end]>[item_subject]</h1>[end]
|
||||||
[if mount_page_arg_is "info"][include "dir_last_info.html"][end]
|
[if mount_page_arg_is "info"][include "item_info.html"][end]
|
||||||
|
|
||||||
[if-one thread_can_create]
|
|
||||||
|
[if thread_can_reply]
|
||||||
<ul class="itemmenu">
|
<ul class="itemmenu">
|
||||||
[if-one thread_can_create]<li><a href="[doc_base_url][dir]createthread">{thread_create_new}</a></li>[end]
|
<li><a href="[doc_base_url][dir][item_url]/reply">{thread_reply_in_this_thread}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
[if-one thread_tab]
|
|
||||||
<table class="forum">
|
<div class="threadbox">
|
||||||
<tr><th>{thread_tab_title}</th><th>{thread_tab_author}</th><th>{thread_tab_replies}</th><th>{thread_tab_last_post}</th></tr>
|
[if item_can_write]<a class="threadedit" href="[item_link]/emacs">\[{edit}\]</a>[end]
|
||||||
[for thread_tab]
|
[if mount_thread_arg_is "subject"]<h2[if mount_thread_arg_is "info"] class="withinfo"[end]>[item_subject]</h2>[end]
|
||||||
<tr>
|
[if mount_thread_arg_is "info"][include "item_info.html"][end]
|
||||||
<td><a href="[doc_base_url][dir][thread_tab_url]">[thread_tab_subject]</a></td>
|
[item_print_content]
|
||||||
<td class="smallfont">[thread_tab_author]</td><td class="smallfont">[thread_tab_answers]</td>
|
</div>
|
||||||
<td class="smallfont">[thread_tab_last_item_date_modification_nice] ([thread_tab_last_item_user])</td>
|
|
||||||
</tr>
|
|
||||||
[end]
|
|
||||||
</table>
|
|
||||||
[end]
|
|
||||||
|
|
||||||
|
|
||||||
|
[for thread_sort_tab]
|
||||||
|
<div class="threadbox[if-index even] threadboxcolor[end]">
|
||||||
[if-one thread_is]
|
[if thread_sort_tab_can_write]<a class="threadedit" href="[thread_sort_tab_link]/emacs">\[{edit}\]</a>[end]
|
||||||
[if-one dir_can_use_emacs]
|
[if mount_thread_arg_is "subject"]<h2[if mount_thread_arg_is "info"] class="withinfo"[end]>[thread_sort_tab_subject]</h2>[end]
|
||||||
<ul class="itemmenu">
|
[if mount_thread_arg_is "info"][include "thread_sort_tab_info.html"][end]
|
||||||
<li><a href="[doc_base_url][dir]emacs">{thread_reply_in_this_thread}</a></li>
|
[thread_sort_tab_print_content]
|
||||||
</ul>
|
|
||||||
[end]
|
|
||||||
|
|
||||||
[for item_tab]
|
|
||||||
<div class="threadbox[if-index item_tab odd] threadboxcolor[end]">
|
|
||||||
[if-one item_tab_can_use_emacs]<a class="threadedit" href="[item_tab_link]/emacs">\[{edit}\]</a>[end]
|
|
||||||
[if mount_thread_arg_is "subject"]<h2[if mount_thread_arg_is "info"] class="withinfo"[end]>[item_tab_subject]</h2>[end]
|
|
||||||
[if mount_thread_arg_is "info"][include "item_tab_info.html"][end]
|
|
||||||
[item_tab_print_content]
|
|
||||||
</div>
|
</div>
|
||||||
[end]
|
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,18 +35,22 @@
|
||||||
[item_print_content]
|
[item_print_content]
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
[if-one dir_can_use_emacs]
|
|
||||||
|
[if thread_can_reply]
|
||||||
<ul class="itemmenu">
|
<ul class="itemmenu">
|
||||||
<li><a href="[doc_base_url][dir]emacs">{ticket_reply_in_this_thread}</a></li>
|
<li><a href="[doc_base_url][dir][item_url]/reply">{thread_reply_in_this_thread}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
[for item_tab]
|
|
||||||
<div class="threadbox[if-index item_tab odd] threadboxcolor[end]">
|
[for thread_sort_tab]
|
||||||
[if mount_thread_arg_is "subject"]<h2[if mount_thread_arg_is "info"] class="withinfo"[end]>[item_tab_subject]</h2>[end]
|
<div class="threadbox[if-index even] threadboxcolor[end]">
|
||||||
[if mount_thread_arg_is "info"][include "item_tab_info.html"][end]
|
[if thread_sort_tab_can_write]<a class="threadedit" href="[thread_sort_tab_link]/emacs">\[{edit}\]</a>[end]
|
||||||
[item_tab_print_content]
|
[if mount_thread_arg_is "subject"]<h2[if mount_thread_arg_is "info"] class="withinfo"[end]>[thread_sort_tab_subject]</h2>[end]
|
||||||
|
[if mount_thread_arg_is "info"][include "thread_sort_tab_info.html"][end]
|
||||||
|
[thread_sort_tab_print_content]
|
||||||
</div>
|
</div>
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<p class="[if-index item_tab odd]itemtabinfo[else][if mount_thread_arg_is "subject"]itemtabinfo[else]itemtabinfo2[end][end]">
|
<p class="[if-index odd]itemtabinfo[else][if mount_thread_arg_is "subject"]itemtabinfo[else]itemtabinfo2[end][end]">
|
||||||
|
|
||||||
{added_by}: [item_tab_user], [item_tab_date_creation_nice][if-no item_tab_dates_equal],
|
{added_by}: [item_tab_user], [item_tab_date_creation_nice][if-no item_tab_dates_equal],
|
||||||
{last_modified}[if-one item_tab_users_different] {by}: [item_tab_modification_user],[else]:[end]
|
{last_modified}[if-one item_tab_users_different] {by}: [item_tab_modification_user],[else]:[end]
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<p class="[if-index odd]itemtabinfo[else][if mount_thread_arg_is "subject"]itemtabinfo[else]itemtabinfo2[end][end]">
|
||||||
|
|
||||||
|
{added_by}: [thread_sort_tab_user], [thread_sort_tab_date_creation_nice][if-no thread_sort_tab_dates_equal],
|
||||||
|
{last_modified}[if thread_sort_tab_users_different] {by}: [thread_sort_tab_modification_user],[else]:[end]
|
||||||
|
[thread_sort_tab_date_modification_nice]
|
||||||
|
[end]
|
||||||
|
|
||||||
|
</p>
|
|
@ -150,6 +150,9 @@ thread_tab_author = Author
|
||||||
thread_tab_replies = Rep.
|
thread_tab_replies = Rep.
|
||||||
thread_tab_last_post = Last post
|
thread_tab_last_post = Last post
|
||||||
thread_reply_in_this_thread = Reply in this thread
|
thread_reply_in_this_thread = Reply in this thread
|
||||||
|
form_thread_reply = Reply form
|
||||||
|
thread_header_reply = Reply
|
||||||
|
|
||||||
|
|
||||||
ticket_progress_image_path = ticket_progress
|
ticket_progress_image_path = ticket_progress
|
||||||
ticket_create_new = Create a new ticket
|
ticket_create_new = Create a new ticket
|
||||||
|
@ -291,7 +294,7 @@ winix_err_default = An error occured, error code:
|
||||||
|
|
||||||
# those errors are taken automatically by [winix_err_msg_from_locales]
|
# those errors are taken automatically by [winix_err_msg_from_locales]
|
||||||
winix_err_3 = Incorrect directory.
|
winix_err_3 = Incorrect directory.
|
||||||
winix_err_18 = You are suspected to be a spammer,<br>you cannot send anything without logging first.
|
winix_err_18 = You are suspected to be a spammer, you cannot send anything without logging first.
|
||||||
winix_err_19 = Solve the rebus please!
|
winix_err_19 = Solve the rebus please!
|
||||||
|
|
||||||
winix_err_25 = Passwords are different!
|
winix_err_25 = Passwords are different!
|
||||||
|
|
|
@ -150,6 +150,8 @@ thread_tab_author = Autor
|
||||||
thread_tab_replies = Odp.
|
thread_tab_replies = Odp.
|
||||||
thread_tab_last_post = Ostatni post
|
thread_tab_last_post = Ostatni post
|
||||||
thread_reply_in_this_thread = Odpowiedz w tym wątku
|
thread_reply_in_this_thread = Odpowiedz w tym wątku
|
||||||
|
form_thread_reply = Formularz odpowiedzi w wątku
|
||||||
|
thread_header_reply = Odpowiedz w wątku
|
||||||
|
|
||||||
ticket_progress_image_path = ticket_progress
|
ticket_progress_image_path = ticket_progress
|
||||||
ticket_create_new = Załóż nowe zgłoszenie
|
ticket_create_new = Załóż nowe zgłoszenie
|
||||||
|
@ -294,7 +296,7 @@ winix_err_default = Wystąpiły problemy z tą operacją, kod błędu:
|
||||||
|
|
||||||
# those errors are taken automatically by [winix_err_msg_from_locales]
|
# those errors are taken automatically by [winix_err_msg_from_locales]
|
||||||
winix_err_3 = Nieprawidłowy katalog.
|
winix_err_3 = Nieprawidłowy katalog.
|
||||||
winix_err_18 = Jesteś podejrzany jako spamer,<br> nie możesz nic wysłać do czasu zalogowania się!
|
winix_err_18 = Jesteś podejrzany jako spamer, nie możesz nic wysłać do czasu zalogowania się!
|
||||||
winix_err_19 = Proszę rozwiązać rebus!
|
winix_err_19 = Proszę rozwiązać rebus!
|
||||||
|
|
||||||
winix_err_25 = Podane hasła różnią się od siebie!
|
winix_err_25 = Podane hasła różnią się od siebie!
|
||||||
|
|
|
@ -127,7 +127,7 @@ void SessionCreated(PluginInfo & info)
|
||||||
|
|
||||||
if( !info.request->IsParam(nostat_param) )
|
if( !info.request->IsParam(nostat_param) )
|
||||||
{
|
{
|
||||||
log << log3 << "created stats plugin data"
|
log << log4 << "Stats: created stats plugin data"
|
||||||
<< ", plugin id: " << info.plugin_id
|
<< ", plugin id: " << info.plugin_id
|
||||||
<< ", pointer: " << d << logend;
|
<< ", pointer: " << d << logend;
|
||||||
}
|
}
|
||||||
|
@ -146,16 +146,14 @@ void RemoveSession(PluginInfo & info)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
StatsSession * d = reinterpret_cast<StatsSession*>(info.plugin_data_base);
|
||||||
//StatsSession * d = reinterpret_cast<StatsSession*>(info.plugin_data_base);
|
|
||||||
|
|
||||||
if( !d->nostat )
|
if( !d->nostat )
|
||||||
{
|
{
|
||||||
log << log3 << "deleting stats plugin data"
|
log << log4 << "Stats: deleting stats plugin data"
|
||||||
<< ", plugin id: " << info.plugin_id
|
<< ", plugin id: " << info.plugin_id
|
||||||
<< ", pointer: " << info.plugin_data_base << logend;
|
<< ", pointer: " << info.plugin_data_base << logend;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
delete info.plugin_data_base;
|
delete info.plugin_data_base;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,374 +1,294 @@
|
||||||
# DO NOT DELETE
|
# DO NOT DELETE
|
||||||
|
|
||||||
createticket.o: createticket.h tdb.h ticket.h ../../db/dbbase.h
|
createthread.o: createthread.h ../../functions/functionbase.h
|
||||||
createticket.o: ../../db/dbconn.h ../../db/dbtextstream.h
|
createthread.o: ../../core/item.h ../../db/db.h ../../db/dbbase.h
|
||||||
createticket.o: ../../core/textstream.h ../../core/misc.h ../../core/item.h
|
createthread.o: ../../db/dbconn.h ../../db/dbtextstream.h
|
||||||
createticket.o: ../../core/error.h ../../core/log.h ../../core/textstream.h
|
createthread.o: ../../core/textstream.h ../../core/misc.h ../../core/item.h
|
||||||
createticket.o: ../../functions/functionbase.h ../../core/item.h
|
createthread.o: ../../core/error.h ../../core/log.h ../../core/textstream.h
|
||||||
createticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
|
createthread.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
|
||||||
createticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
|
createthread.o: ../../core/user.h ../../core/group.h
|
||||||
createticket.o: ../../core/thread.h ../../core/dircontainer.h
|
createthread.o: ../../core/dircontainer.h ../../core/ugcontainer.h
|
||||||
createticket.o: ../../core/ugcontainer.h ../../core/request.h
|
createthread.o: ../../core/request.h ../../core/requesttypes.h
|
||||||
createticket.o: ../../core/requesttypes.h ../../core/session.h
|
createthread.o: ../../core/session.h ../../core/error.h ../../core/user.h
|
||||||
createticket.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
|
createthread.o: ../../core/plugindata.h ../../core/rebus.h
|
||||||
createticket.o: ../../core/rebus.h ../../core/config.h
|
createthread.o: ../../core/config.h ../../core/confparser.h
|
||||||
createticket.o: ../../core/confparser.h ../../core/htmlfilter.h
|
createthread.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
|
||||||
createticket.o: ../../templates/htmltextstream.h ../../core/config.h
|
createthread.o: ../../core/config.h ../../core/system.h ../../core/dirs.h
|
||||||
createticket.o: ../../core/system.h ../../core/dirs.h
|
createthread.o: ../../core/dircontainer.h ../../core/request.h
|
||||||
createticket.o: ../../core/dircontainer.h ../../core/request.h
|
createthread.o: ../../notify/notify.h ../../notify/notifypool.h
|
||||||
createticket.o: ../../notify/notify.h ../../notify/notifypool.h
|
createthread.o: ../../templates/locale.h ../../core/confparser.h
|
||||||
createticket.o: ../../templates/locale.h ../../core/confparser.h
|
createthread.o: ../../templates/misc.h ../../templates/localefilter.h
|
||||||
createticket.o: ../../templates/misc.h ../../templates/localefilter.h
|
createthread.o: ../../templates/locale.h ../../../ezc/src/ezc.h
|
||||||
createticket.o: ../../templates/locale.h ../../../ezc/src/ezc.h
|
createthread.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
|
||||||
createticket.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
|
createthread.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
|
||||||
createticket.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
|
createthread.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
|
||||||
createticket.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
|
createthread.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
|
||||||
createticket.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
|
createthread.o: ../../core/basethread.h ../../core/synchro.h
|
||||||
createticket.o: ../../core/basethread.h ../../core/synchro.h
|
createthread.o: ../../notify/templatesnotify.h ../../core/users.h
|
||||||
createticket.o: ../../notify/templatesnotify.h ../../core/users.h
|
createthread.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
|
||||||
createticket.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
|
createthread.o: ../../core/mounts.h ../../core/mount.h
|
||||||
createticket.o: ../../core/mounts.h ../../core/mount.h
|
createthread.o: ../../core/mountparser.h ../../core/users.h
|
||||||
createticket.o: ../../core/mountparser.h ../../core/users.h
|
createthread.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
|
||||||
createticket.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
|
createthread.o: ../../core/thumb.h ../../core/basethread.h
|
||||||
createticket.o: ../../core/thumb.h ../../core/basethread.h
|
createthread.o: ../../core/synchro.h tdb.h thread.h ../../db/dbbase.h
|
||||||
createticket.o: ../../core/synchro.h ticketinfo.h ticketparser.h ticketconf.h
|
createthread.o: threadinfo.h ../../functions/functions.h
|
||||||
createticket.o: ../../functions/functions.h ../../functions/functionbase.h
|
createthread.o: ../../functions/functionbase.h
|
||||||
createticket.o: ../../functions/functionparser.h ../../functions/adduser.h
|
createthread.o: ../../functions/functionparser.h ../../functions/adduser.h
|
||||||
createticket.o: ../../functions/cat.h ../../functions/chmod.h
|
createthread.o: ../../functions/cat.h ../../functions/chmod.h
|
||||||
createticket.o: ../../functions/privchanger.h ../../functions/chown.h
|
createthread.o: ../../functions/privchanger.h ../../functions/chown.h
|
||||||
createticket.o: ../../functions/ckeditor.h ../../functions/cp.h
|
createthread.o: ../../functions/ckeditor.h ../../functions/cp.h
|
||||||
createticket.o: ../../functions/createthread.h ../../functions/default.h
|
createthread.o: ../../functions/default.h ../../functions/download.h
|
||||||
createticket.o: ../../functions/download.h ../../functions/emacs.h
|
createthread.o: ../../functions/emacs.h ../../functions/last.h
|
||||||
createticket.o: ../../functions/last.h ../../functions/login.h
|
createthread.o: ../../functions/login.h ../../functions/logout.h
|
||||||
createticket.o: ../../functions/logout.h ../../functions/ln.h
|
createthread.o: ../../functions/ln.h ../../functions/ls.h
|
||||||
createticket.o: ../../functions/ls.h ../../functions/mkdir.h
|
createthread.o: ../../functions/mkdir.h ../../functions/mv.h
|
||||||
createticket.o: ../../functions/mv.h ../../functions/node.h
|
createthread.o: ../../functions/node.h ../../functions/priv.h
|
||||||
createticket.o: ../../functions/priv.h ../../functions/reload.h
|
createthread.o: ../../functions/reload.h ../../functions/rm.h
|
||||||
createticket.o: ../../functions/rm.h ../../functions/run.h
|
createthread.o: ../../functions/run.h ../../functions/specialdefault.h
|
||||||
createticket.o: ../../functions/specialdefault.h ../../functions/stat.h
|
createthread.o: ../../functions/stat.h ../../functions/subject.h
|
||||||
createticket.o: ../../functions/subject.h ../../functions/funthread.h
|
createthread.o: ../../functions/template.h ../../functions/tinymce.h
|
||||||
createticket.o: ../../functions/template.h ../../functions/tinymce.h
|
createthread.o: ../../functions/uname.h ../../functions/upload.h
|
||||||
createticket.o: ../../functions/uname.h ../../functions/upload.h
|
createthread.o: ../../functions/uptime.h ../../functions/who.h
|
||||||
createticket.o: ../../functions/uptime.h ../../functions/who.h
|
createthread.o: ../../functions/vim.h ../../core/htmlfilter.h
|
||||||
createticket.o: ../../functions/vim.h ../../core/htmlfilter.h sessiondata.h
|
funthread.o: ../../core/misc.h ../../core/item.h funthread.h
|
||||||
createticket.o: ../../core/plugindata.h
|
funthread.o: ../../functions/functionbase.h ../../core/item.h ../../db/db.h
|
||||||
editticket.o: editticket.h tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
|
funthread.o: ../../db/dbbase.h ../../db/dbconn.h ../../db/dbtextstream.h
|
||||||
editticket.o: ../../db/dbtextstream.h ../../core/textstream.h
|
funthread.o: ../../core/textstream.h ../../core/misc.h ../../core/error.h
|
||||||
editticket.o: ../../core/misc.h ../../core/item.h ../../core/error.h
|
funthread.o: ../../core/log.h ../../core/textstream.h ../../db/dbitemquery.h
|
||||||
editticket.o: ../../core/log.h ../../core/textstream.h ticketinfo.h
|
funthread.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
|
||||||
editticket.o: ticketparser.h ticketconf.h ../../core/item.h
|
funthread.o: ../../core/dircontainer.h ../../core/ugcontainer.h
|
||||||
editticket.o: ../../core/system.h ../../core/dirs.h ../../core/dircontainer.h
|
funthread.o: ../../core/request.h ../../core/requesttypes.h
|
||||||
editticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
|
funthread.o: ../../core/session.h ../../core/error.h ../../core/user.h
|
||||||
editticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
|
funthread.o: ../../core/plugindata.h ../../core/rebus.h ../../core/config.h
|
||||||
editticket.o: ../../core/thread.h ../../core/dircontainer.h
|
funthread.o: ../../core/confparser.h ../../core/htmlfilter.h
|
||||||
editticket.o: ../../core/ugcontainer.h ../../core/request.h
|
funthread.o: ../../templates/htmltextstream.h ../../core/config.h
|
||||||
editticket.o: ../../notify/notify.h ../../notify/notifypool.h
|
funthread.o: ../../core/system.h ../../core/dirs.h ../../core/dircontainer.h
|
||||||
editticket.o: ../../templates/locale.h ../../core/confparser.h
|
funthread.o: ../../core/request.h ../../notify/notify.h
|
||||||
editticket.o: ../../templates/misc.h ../../templates/localefilter.h
|
funthread.o: ../../notify/notifypool.h ../../templates/locale.h
|
||||||
editticket.o: ../../templates/locale.h ../../../ezc/src/ezc.h
|
funthread.o: ../../core/confparser.h ../../templates/misc.h
|
||||||
editticket.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
|
funthread.o: ../../templates/localefilter.h ../../templates/locale.h
|
||||||
editticket.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
|
funthread.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
|
||||||
editticket.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
|
funthread.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
|
||||||
editticket.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
|
funthread.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
|
||||||
editticket.o: ../../core/basethread.h ../../core/synchro.h
|
funthread.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
|
||||||
editticket.o: ../../notify/templatesnotify.h ../../core/config.h
|
funthread.o: ../../notify/notifythread.h ../../core/basethread.h
|
||||||
editticket.o: ../../core/users.h ../../core/user.h ../../core/ugcontainer.h
|
funthread.o: ../../core/synchro.h ../../notify/templatesnotify.h
|
||||||
editticket.o: ../../core/lastcontainer.h ../../core/mounts.h
|
funthread.o: ../../core/users.h ../../core/ugcontainer.h
|
||||||
editticket.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
|
funthread.o: ../../core/lastcontainer.h ../../core/mounts.h
|
||||||
editticket.o: ../../core/config.h ../../core/confparser.h
|
funthread.o: ../../core/mount.h ../../core/mountparser.h ../../core/users.h
|
||||||
editticket.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
|
funthread.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
|
||||||
editticket.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
|
funthread.o: ../../core/thumb.h ../../core/basethread.h ../../core/synchro.h
|
||||||
editticket.o: ../../core/thumb.h ../../core/basethread.h
|
funthread.o: tdb.h thread.h ../../db/dbbase.h threadinfo.h
|
||||||
editticket.o: ../../functions/functions.h ../../functions/functionbase.h
|
init.o: tdb.h thread.h ../../db/dbbase.h ../../core/error.h ../../core/log.h
|
||||||
editticket.o: ../../functions/functionparser.h ../../core/request.h
|
init.o: ../../core/textstream.h reply.h ../../functions/functionbase.h
|
||||||
editticket.o: ../../core/requesttypes.h ../../core/session.h
|
init.o: ../../core/item.h ../../db/db.h ../../db/dbbase.h ../../db/dbconn.h
|
||||||
editticket.o: ../../core/plugindata.h ../../templates/htmltextstream.h
|
|
||||||
editticket.o: ../../functions/adduser.h ../../functions/cat.h
|
|
||||||
editticket.o: ../../functions/chmod.h ../../functions/privchanger.h
|
|
||||||
editticket.o: ../../functions/chown.h ../../functions/ckeditor.h
|
|
||||||
editticket.o: ../../functions/cp.h ../../functions/createthread.h
|
|
||||||
editticket.o: ../../functions/default.h ../../functions/download.h
|
|
||||||
editticket.o: ../../functions/emacs.h ../../functions/last.h
|
|
||||||
editticket.o: ../../functions/login.h ../../functions/logout.h
|
|
||||||
editticket.o: ../../functions/ln.h ../../functions/ls.h
|
|
||||||
editticket.o: ../../functions/mkdir.h ../../functions/mv.h
|
|
||||||
editticket.o: ../../functions/node.h ../../functions/priv.h
|
|
||||||
editticket.o: ../../functions/reload.h ../../functions/rm.h
|
|
||||||
editticket.o: ../../functions/run.h ../../functions/specialdefault.h
|
|
||||||
editticket.o: ../../functions/stat.h ../../functions/subject.h
|
|
||||||
editticket.o: ../../functions/funthread.h ../../functions/template.h
|
|
||||||
editticket.o: ../../functions/tinymce.h ../../functions/uname.h
|
|
||||||
editticket.o: ../../functions/upload.h ../../functions/uptime.h
|
|
||||||
editticket.o: ../../functions/who.h ../../functions/vim.h
|
|
||||||
editticket.o: ../../core/htmlfilter.h ../../functions/functionbase.h
|
|
||||||
editticket.o: ../../core/synchro.h sessiondata.h ../../core/plugindata.h
|
|
||||||
funticket.o: funticket.h tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
|
|
||||||
funticket.o: ../../db/dbtextstream.h ../../core/textstream.h
|
|
||||||
funticket.o: ../../core/misc.h ../../core/item.h ../../core/error.h
|
|
||||||
funticket.o: ../../core/log.h ../../core/textstream.h ticketinfo.h
|
|
||||||
funticket.o: ticketparser.h ticketconf.h ../../core/item.h
|
|
||||||
funticket.o: ../../core/system.h ../../core/dirs.h ../../core/dircontainer.h
|
|
||||||
funticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
|
|
||||||
funticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
|
|
||||||
funticket.o: ../../core/thread.h ../../core/dircontainer.h
|
|
||||||
funticket.o: ../../core/ugcontainer.h ../../core/request.h
|
|
||||||
funticket.o: ../../notify/notify.h ../../notify/notifypool.h
|
|
||||||
funticket.o: ../../templates/locale.h ../../core/confparser.h
|
|
||||||
funticket.o: ../../templates/misc.h ../../templates/localefilter.h
|
|
||||||
funticket.o: ../../templates/locale.h ../../../ezc/src/ezc.h
|
|
||||||
funticket.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
|
|
||||||
funticket.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
|
|
||||||
funticket.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
|
|
||||||
funticket.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
|
|
||||||
funticket.o: ../../core/basethread.h ../../core/synchro.h
|
|
||||||
funticket.o: ../../notify/templatesnotify.h ../../core/config.h
|
|
||||||
funticket.o: ../../core/users.h ../../core/user.h ../../core/ugcontainer.h
|
|
||||||
funticket.o: ../../core/lastcontainer.h ../../core/mounts.h
|
|
||||||
funticket.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
|
|
||||||
funticket.o: ../../core/config.h ../../core/confparser.h
|
|
||||||
funticket.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
|
|
||||||
funticket.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
|
|
||||||
funticket.o: ../../core/thumb.h ../../core/basethread.h
|
|
||||||
funticket.o: ../../functions/functions.h ../../functions/functionbase.h
|
|
||||||
funticket.o: ../../functions/functionparser.h ../../core/request.h
|
|
||||||
funticket.o: ../../core/requesttypes.h ../../core/session.h
|
|
||||||
funticket.o: ../../core/plugindata.h ../../templates/htmltextstream.h
|
|
||||||
funticket.o: ../../functions/adduser.h ../../functions/cat.h
|
|
||||||
funticket.o: ../../functions/chmod.h ../../functions/privchanger.h
|
|
||||||
funticket.o: ../../functions/chown.h ../../functions/ckeditor.h
|
|
||||||
funticket.o: ../../functions/cp.h ../../functions/createthread.h
|
|
||||||
funticket.o: ../../functions/default.h ../../functions/download.h
|
|
||||||
funticket.o: ../../functions/emacs.h ../../functions/last.h
|
|
||||||
funticket.o: ../../functions/login.h ../../functions/logout.h
|
|
||||||
funticket.o: ../../functions/ln.h ../../functions/ls.h
|
|
||||||
funticket.o: ../../functions/mkdir.h ../../functions/mv.h
|
|
||||||
funticket.o: ../../functions/node.h ../../functions/priv.h
|
|
||||||
funticket.o: ../../functions/reload.h ../../functions/rm.h
|
|
||||||
funticket.o: ../../functions/run.h ../../functions/specialdefault.h
|
|
||||||
funticket.o: ../../functions/stat.h ../../functions/subject.h
|
|
||||||
funticket.o: ../../functions/funthread.h ../../functions/template.h
|
|
||||||
funticket.o: ../../functions/tinymce.h ../../functions/uname.h
|
|
||||||
funticket.o: ../../functions/upload.h ../../functions/uptime.h
|
|
||||||
funticket.o: ../../functions/who.h ../../functions/vim.h
|
|
||||||
funticket.o: ../../core/htmlfilter.h ../../functions/functionbase.h
|
|
||||||
funticket.o: ../../core/synchro.h
|
|
||||||
init.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
|
|
||||||
init.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
|
init.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
|
||||||
init.o: ../../core/item.h ../../core/error.h ../../core/log.h
|
init.o: ../../core/item.h ../../db/dbitemquery.h ../../db/dbitemcolumns.h
|
||||||
init.o: ../../core/textstream.h funticket.h ticketinfo.h ticketparser.h
|
init.o: ../../core/user.h ../../core/group.h ../../core/dircontainer.h
|
||||||
init.o: ticketconf.h ../../core/item.h ../../core/system.h ../../core/dirs.h
|
init.o: ../../core/ugcontainer.h ../../core/request.h
|
||||||
init.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
|
init.o: ../../core/requesttypes.h ../../core/session.h ../../core/error.h
|
||||||
init.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h ../../core/user.h
|
init.o: ../../core/user.h ../../core/plugindata.h ../../core/rebus.h
|
||||||
init.o: ../../core/group.h ../../core/thread.h ../../core/dircontainer.h
|
init.o: ../../core/config.h ../../core/confparser.h ../../core/htmlfilter.h
|
||||||
init.o: ../../core/ugcontainer.h ../../core/request.h ../../notify/notify.h
|
init.o: ../../templates/htmltextstream.h ../../core/config.h
|
||||||
init.o: ../../notify/notifypool.h ../../templates/locale.h
|
init.o: ../../core/system.h ../../core/dirs.h ../../core/dircontainer.h
|
||||||
init.o: ../../core/confparser.h ../../templates/misc.h
|
init.o: ../../core/request.h ../../notify/notify.h ../../notify/notifypool.h
|
||||||
init.o: ../../templates/localefilter.h ../../templates/locale.h
|
init.o: ../../templates/locale.h ../../core/confparser.h
|
||||||
init.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
|
init.o: ../../templates/misc.h ../../templates/localefilter.h
|
||||||
init.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
|
init.o: ../../templates/locale.h ../../../ezc/src/ezc.h
|
||||||
init.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
|
init.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
|
||||||
init.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
|
init.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
|
||||||
init.o: ../../notify/notifythread.h ../../core/basethread.h
|
init.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
|
||||||
init.o: ../../core/synchro.h ../../notify/templatesnotify.h
|
init.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
|
||||||
init.o: ../../core/config.h ../../core/users.h ../../core/user.h
|
init.o: ../../core/basethread.h ../../core/synchro.h
|
||||||
|
init.o: ../../notify/templatesnotify.h ../../core/users.h
|
||||||
init.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
|
init.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
|
||||||
init.o: ../../core/mounts.h ../../core/mount.h ../../core/error.h
|
init.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h
|
||||||
init.o: ../../core/mountparser.h ../../core/config.h ../../core/confparser.h
|
init.o: ../../core/users.h ../../core/groups.h ../../core/group.h
|
||||||
init.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
|
init.o: ../../core/loadavg.h ../../core/thumb.h ../../core/basethread.h
|
||||||
init.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
|
init.o: ../../core/synchro.h threadinfo.h funthread.h createthread.h
|
||||||
init.o: ../../core/thumb.h ../../core/basethread.h
|
init.o: showthreads.h ../../core/log.h ../../core/plugin.h pluginmsg.h
|
||||||
init.o: ../../functions/functions.h ../../functions/functionbase.h
|
init.o: ../../core/system.h ../../core/sessionmanager.h
|
||||||
init.o: ../../functions/functionparser.h ../../core/request.h
|
init.o: ../../core/sessioncontainer.h ../../functions/functions.h
|
||||||
init.o: ../../core/requesttypes.h ../../core/session.h
|
init.o: ../../functions/functionbase.h ../../functions/functionparser.h
|
||||||
init.o: ../../core/plugindata.h ../../templates/htmltextstream.h
|
|
||||||
init.o: ../../functions/adduser.h ../../functions/cat.h
|
init.o: ../../functions/adduser.h ../../functions/cat.h
|
||||||
init.o: ../../functions/chmod.h ../../functions/privchanger.h
|
init.o: ../../functions/chmod.h ../../functions/privchanger.h
|
||||||
init.o: ../../functions/chown.h ../../functions/ckeditor.h
|
init.o: ../../functions/chown.h ../../functions/ckeditor.h
|
||||||
init.o: ../../functions/cp.h ../../functions/createthread.h
|
init.o: ../../functions/cp.h ../../functions/default.h
|
||||||
init.o: ../../functions/default.h ../../functions/download.h
|
init.o: ../../functions/download.h ../../functions/emacs.h
|
||||||
init.o: ../../functions/emacs.h ../../functions/last.h
|
init.o: ../../functions/last.h ../../functions/login.h
|
||||||
init.o: ../../functions/login.h ../../functions/logout.h ../../functions/ln.h
|
init.o: ../../functions/logout.h ../../functions/ln.h ../../functions/ls.h
|
||||||
init.o: ../../functions/ls.h ../../functions/mkdir.h ../../functions/mv.h
|
init.o: ../../functions/mkdir.h ../../functions/mv.h ../../functions/node.h
|
||||||
init.o: ../../functions/node.h ../../functions/priv.h
|
init.o: ../../functions/priv.h ../../functions/reload.h ../../functions/rm.h
|
||||||
init.o: ../../functions/reload.h ../../functions/rm.h ../../functions/run.h
|
init.o: ../../functions/run.h ../../functions/specialdefault.h
|
||||||
init.o: ../../functions/specialdefault.h ../../functions/stat.h
|
init.o: ../../functions/stat.h ../../functions/subject.h
|
||||||
init.o: ../../functions/subject.h ../../functions/funthread.h
|
|
||||||
init.o: ../../functions/template.h ../../functions/tinymce.h
|
init.o: ../../functions/template.h ../../functions/tinymce.h
|
||||||
init.o: ../../functions/uname.h ../../functions/upload.h
|
init.o: ../../functions/uname.h ../../functions/upload.h
|
||||||
init.o: ../../functions/uptime.h ../../functions/who.h ../../functions/vim.h
|
init.o: ../../functions/uptime.h ../../functions/who.h ../../functions/vim.h
|
||||||
init.o: ../../core/htmlfilter.h ../../functions/functionbase.h
|
init.o: ../../core/htmlfilter.h ../../templates/templates.h
|
||||||
init.o: ../../core/synchro.h editticket.h createticket.h showtickets.h
|
|
||||||
init.o: ../../core/log.h ../../core/plugin.h ../../core/pluginmsg.h
|
|
||||||
init.o: ../../core/system.h ../../core/sessionmanager.h
|
|
||||||
init.o: ../../core/sessioncontainer.h ../../templates/templates.h
|
|
||||||
init.o: ../../templates/patterncacher.h ../../templates/ckeditorgetparser.h
|
init.o: ../../templates/patterncacher.h ../../templates/ckeditorgetparser.h
|
||||||
init.o: ../../core/httpsimpleparser.h ../../core/log.h
|
init.o: ../../core/httpsimpleparser.h ../../core/log.h
|
||||||
init.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
init.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
||||||
init.o: sessiondata.h ../../core/plugindata.h
|
init.o: templates.h
|
||||||
sessiondata.o: sessiondata.h ../../core/plugindata.h ticket.h
|
reply.o: reply.h ../../functions/functionbase.h ../../core/item.h
|
||||||
showtickets.o: showtickets.h tdb.h ticket.h ../../db/dbbase.h
|
reply.o: ../../db/db.h ../../db/dbbase.h ../../db/dbconn.h
|
||||||
showtickets.o: ../../db/dbconn.h ../../db/dbtextstream.h
|
reply.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
|
||||||
showtickets.o: ../../core/textstream.h ../../core/misc.h ../../core/item.h
|
reply.o: ../../core/item.h ../../core/error.h ../../core/log.h
|
||||||
showtickets.o: ../../core/error.h ../../core/log.h ../../core/textstream.h
|
reply.o: ../../core/textstream.h ../../db/dbitemquery.h
|
||||||
showtickets.o: ticketinfo.h ticketparser.h ticketconf.h ../../core/item.h
|
reply.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
|
||||||
showtickets.o: ../../core/system.h ../../core/dirs.h
|
reply.o: ../../core/dircontainer.h ../../core/ugcontainer.h
|
||||||
showtickets.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
|
reply.o: ../../core/request.h ../../core/requesttypes.h ../../core/session.h
|
||||||
showtickets.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
|
reply.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
|
||||||
showtickets.o: ../../core/user.h ../../core/group.h ../../core/thread.h
|
reply.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h
|
||||||
showtickets.o: ../../core/dircontainer.h ../../core/ugcontainer.h
|
reply.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
|
||||||
showtickets.o: ../../core/request.h ../../notify/notify.h
|
reply.o: ../../core/config.h ../../core/system.h ../../core/dirs.h
|
||||||
showtickets.o: ../../notify/notifypool.h ../../templates/locale.h
|
reply.o: ../../core/dircontainer.h ../../core/request.h ../../notify/notify.h
|
||||||
showtickets.o: ../../core/confparser.h ../../templates/misc.h
|
reply.o: ../../notify/notifypool.h ../../templates/locale.h
|
||||||
showtickets.o: ../../templates/localefilter.h ../../templates/locale.h
|
reply.o: ../../core/confparser.h ../../templates/misc.h
|
||||||
showtickets.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
|
reply.o: ../../templates/localefilter.h ../../templates/locale.h
|
||||||
showtickets.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
|
reply.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
|
||||||
showtickets.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
|
reply.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
|
||||||
showtickets.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
|
reply.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
|
||||||
showtickets.o: ../../notify/notifythread.h ../../core/basethread.h
|
reply.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
|
||||||
showtickets.o: ../../core/synchro.h ../../notify/templatesnotify.h
|
reply.o: ../../notify/notifythread.h ../../core/basethread.h
|
||||||
showtickets.o: ../../core/config.h ../../core/users.h ../../core/user.h
|
reply.o: ../../core/synchro.h ../../notify/templatesnotify.h
|
||||||
showtickets.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
|
reply.o: ../../core/users.h ../../core/ugcontainer.h
|
||||||
showtickets.o: ../../core/mounts.h ../../core/mount.h ../../core/error.h
|
reply.o: ../../core/lastcontainer.h ../../core/mounts.h ../../core/mount.h
|
||||||
showtickets.o: ../../core/mountparser.h ../../core/config.h
|
reply.o: ../../core/mountparser.h ../../core/users.h ../../core/groups.h
|
||||||
showtickets.o: ../../core/confparser.h ../../core/htmlfilter.h
|
reply.o: ../../core/group.h ../../core/loadavg.h ../../core/thumb.h
|
||||||
showtickets.o: ../../core/users.h ../../core/groups.h ../../core/group.h
|
reply.o: ../../core/basethread.h ../../core/synchro.h tdb.h thread.h
|
||||||
showtickets.o: ../../core/rebus.h ../../core/loadavg.h ../../core/thumb.h
|
reply.o: ../../db/dbbase.h threadinfo.h ../../functions/functions.h
|
||||||
showtickets.o: ../../core/basethread.h ../../functions/functions.h
|
reply.o: ../../functions/functionbase.h ../../functions/functionparser.h
|
||||||
showtickets.o: ../../functions/functionbase.h
|
reply.o: ../../functions/adduser.h ../../functions/cat.h
|
||||||
showtickets.o: ../../functions/functionparser.h ../../core/request.h
|
reply.o: ../../functions/chmod.h ../../functions/privchanger.h
|
||||||
showtickets.o: ../../core/requesttypes.h ../../core/session.h
|
reply.o: ../../functions/chown.h ../../functions/ckeditor.h
|
||||||
showtickets.o: ../../core/plugindata.h ../../templates/htmltextstream.h
|
reply.o: ../../functions/cp.h ../../functions/default.h
|
||||||
showtickets.o: ../../functions/adduser.h ../../functions/cat.h
|
reply.o: ../../functions/download.h ../../functions/emacs.h
|
||||||
showtickets.o: ../../functions/chmod.h ../../functions/privchanger.h
|
reply.o: ../../functions/last.h ../../functions/login.h
|
||||||
showtickets.o: ../../functions/chown.h ../../functions/ckeditor.h
|
reply.o: ../../functions/logout.h ../../functions/ln.h ../../functions/ls.h
|
||||||
showtickets.o: ../../functions/cp.h ../../functions/createthread.h
|
reply.o: ../../functions/mkdir.h ../../functions/mv.h ../../functions/node.h
|
||||||
showtickets.o: ../../functions/default.h ../../functions/download.h
|
reply.o: ../../functions/priv.h ../../functions/reload.h ../../functions/rm.h
|
||||||
showtickets.o: ../../functions/emacs.h ../../functions/last.h
|
reply.o: ../../functions/run.h ../../functions/specialdefault.h
|
||||||
showtickets.o: ../../functions/login.h ../../functions/logout.h
|
reply.o: ../../functions/stat.h ../../functions/subject.h
|
||||||
showtickets.o: ../../functions/ln.h ../../functions/ls.h
|
reply.o: ../../functions/template.h ../../functions/tinymce.h
|
||||||
showtickets.o: ../../functions/mkdir.h ../../functions/mv.h
|
reply.o: ../../functions/uname.h ../../functions/upload.h
|
||||||
showtickets.o: ../../functions/node.h ../../functions/priv.h
|
reply.o: ../../functions/uptime.h ../../functions/who.h ../../functions/vim.h
|
||||||
showtickets.o: ../../functions/reload.h ../../functions/rm.h
|
reply.o: ../../core/htmlfilter.h ../../core/misc.h ../../core/plugin.h
|
||||||
showtickets.o: ../../functions/run.h ../../functions/specialdefault.h
|
reply.o: pluginmsg.h ../../core/system.h ../../core/sessionmanager.h
|
||||||
showtickets.o: ../../functions/stat.h ../../functions/subject.h
|
reply.o: ../../core/sessioncontainer.h ../../templates/templates.h
|
||||||
showtickets.o: ../../functions/funthread.h ../../functions/template.h
|
reply.o: ../../templates/patterncacher.h ../../templates/ckeditorgetparser.h
|
||||||
showtickets.o: ../../functions/tinymce.h ../../functions/uname.h
|
reply.o: ../../core/httpsimpleparser.h ../../core/log.h
|
||||||
showtickets.o: ../../functions/upload.h ../../functions/uptime.h
|
reply.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
||||||
showtickets.o: ../../functions/who.h ../../functions/vim.h
|
showthreads.o: showthreads.h ../../functions/functionbase.h ../../core/item.h
|
||||||
showtickets.o: ../../core/htmlfilter.h ../../functions/functionbase.h
|
showthreads.o: ../../db/db.h ../../db/dbbase.h ../../db/dbconn.h
|
||||||
showtickets.o: ../../core/synchro.h
|
showthreads.o: ../../db/dbtextstream.h ../../core/textstream.h
|
||||||
tdb.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
|
showthreads.o: ../../core/misc.h ../../core/item.h ../../core/error.h
|
||||||
tdb.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
|
showthreads.o: ../../core/log.h ../../core/textstream.h
|
||||||
tdb.o: ../../core/item.h ../../core/error.h ../../core/log.h
|
showthreads.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
|
||||||
|
showthreads.o: ../../core/user.h ../../core/group.h ../../core/dircontainer.h
|
||||||
|
showthreads.o: ../../core/ugcontainer.h ../../core/request.h
|
||||||
|
showthreads.o: ../../core/requesttypes.h ../../core/session.h
|
||||||
|
showthreads.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
|
||||||
|
showthreads.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h
|
||||||
|
showthreads.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
|
||||||
|
showthreads.o: ../../core/config.h ../../core/system.h ../../core/dirs.h
|
||||||
|
showthreads.o: ../../core/dircontainer.h ../../core/request.h
|
||||||
|
showthreads.o: ../../notify/notify.h ../../notify/notifypool.h
|
||||||
|
showthreads.o: ../../templates/locale.h ../../core/confparser.h
|
||||||
|
showthreads.o: ../../templates/misc.h ../../templates/localefilter.h
|
||||||
|
showthreads.o: ../../templates/locale.h ../../../ezc/src/ezc.h
|
||||||
|
showthreads.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
|
||||||
|
showthreads.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
|
||||||
|
showthreads.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
|
||||||
|
showthreads.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
|
||||||
|
showthreads.o: ../../core/basethread.h ../../core/synchro.h
|
||||||
|
showthreads.o: ../../notify/templatesnotify.h ../../core/users.h
|
||||||
|
showthreads.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
|
||||||
|
showthreads.o: ../../core/mounts.h ../../core/mount.h
|
||||||
|
showthreads.o: ../../core/mountparser.h ../../core/users.h
|
||||||
|
showthreads.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
|
||||||
|
showthreads.o: ../../core/thumb.h ../../core/basethread.h
|
||||||
|
showthreads.o: ../../core/synchro.h tdb.h thread.h ../../db/dbbase.h
|
||||||
|
showthreads.o: threadinfo.h
|
||||||
|
tdb.o: tdb.h thread.h ../../db/dbbase.h ../../core/error.h ../../core/log.h
|
||||||
tdb.o: ../../core/textstream.h ../../core/log.h
|
tdb.o: ../../core/textstream.h ../../core/log.h
|
||||||
|
templates.o: threadinfo.h thread.h ../../core/item.h ../../core/system.h
|
||||||
|
templates.o: ../../core/dirs.h ../../core/item.h ../../core/dircontainer.h
|
||||||
|
templates.o: ../../db/db.h ../../db/dbbase.h ../../db/dbconn.h
|
||||||
|
templates.o: ../../db/dbtextstream.h ../../core/textstream.h
|
||||||
|
templates.o: ../../core/misc.h ../../core/error.h ../../core/log.h
|
||||||
|
templates.o: ../../core/textstream.h ../../db/dbitemquery.h
|
||||||
|
templates.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
|
||||||
|
templates.o: ../../core/dircontainer.h ../../core/ugcontainer.h
|
||||||
|
templates.o: ../../core/request.h ../../notify/notify.h
|
||||||
|
templates.o: ../../notify/notifypool.h ../../templates/locale.h
|
||||||
|
templates.o: ../../core/confparser.h ../../templates/misc.h
|
||||||
|
templates.o: ../../templates/localefilter.h ../../templates/locale.h
|
||||||
templates.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
|
templates.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
|
||||||
templates.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
|
templates.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
|
||||||
templates.o: ../../core/item.h ../../../ezc/src/functions.h
|
templates.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
|
||||||
templates.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
|
templates.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
|
||||||
templates.o: ticketinfo.h ticket.h ticketparser.h ticketconf.h
|
|
||||||
templates.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
|
|
||||||
templates.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
|
|
||||||
templates.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
|
|
||||||
templates.o: ../../core/user.h ../../core/group.h ../../core/thread.h
|
|
||||||
templates.o: ../../core/dircontainer.h ../../core/ugcontainer.h
|
|
||||||
templates.o: ../../core/log.h ../../core/textstream.h ../../core/request.h
|
|
||||||
templates.o: ../../notify/notify.h ../../notify/notifypool.h
|
|
||||||
templates.o: ../../templates/locale.h ../../core/confparser.h
|
|
||||||
templates.o: ../../templates/misc.h ../../templates/localefilter.h
|
|
||||||
templates.o: ../../templates/locale.h ../../templates/htmltextstream.h
|
|
||||||
templates.o: ../../notify/notifythread.h ../../core/basethread.h
|
templates.o: ../../notify/notifythread.h ../../core/basethread.h
|
||||||
templates.o: ../../core/synchro.h ../../notify/templatesnotify.h
|
templates.o: ../../core/synchro.h ../../notify/templatesnotify.h
|
||||||
templates.o: ../../core/textstream.h ../../core/misc.h ../../core/config.h
|
templates.o: ../../core/config.h ../../core/users.h ../../core/user.h
|
||||||
templates.o: ../../core/users.h ../../core/user.h ../../core/ugcontainer.h
|
templates.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
|
||||||
templates.o: ../../core/lastcontainer.h ../../core/mounts.h
|
templates.o: ../../core/mounts.h ../../core/mount.h ../../core/error.h
|
||||||
templates.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
|
templates.o: ../../core/mountparser.h ../../core/config.h
|
||||||
templates.o: ../../core/config.h ../../core/confparser.h
|
templates.o: ../../core/confparser.h ../../core/htmlfilter.h
|
||||||
templates.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
|
templates.o: ../../core/users.h ../../core/groups.h ../../core/group.h
|
||||||
templates.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
|
templates.o: ../../core/rebus.h ../../core/loadavg.h ../../core/thumb.h
|
||||||
templates.o: ../../core/thumb.h ../../core/basethread.h
|
templates.o: ../../core/basethread.h reply.h ../../functions/functionbase.h
|
||||||
templates.o: ../../functions/functions.h ../../functions/functionbase.h
|
templates.o: ../../core/request.h ../../core/requesttypes.h
|
||||||
templates.o: ../../functions/functionparser.h ../../core/request.h
|
templates.o: ../../core/session.h ../../core/plugindata.h
|
||||||
templates.o: ../../core/requesttypes.h ../../core/session.h
|
templates.o: ../../templates/htmltextstream.h ../../core/synchro.h tdb.h
|
||||||
templates.o: ../../core/plugindata.h ../../templates/htmltextstream.h
|
templates.o: ../../db/dbbase.h funthread.h createthread.h showthreads.h
|
||||||
|
templates.o: ../../core/misc.h ../../core/plugin.h pluginmsg.h
|
||||||
|
templates.o: ../../core/system.h ../../core/sessionmanager.h
|
||||||
|
templates.o: ../../core/sessioncontainer.h ../../functions/functions.h
|
||||||
|
templates.o: ../../functions/functionbase.h ../../functions/functionparser.h
|
||||||
templates.o: ../../functions/adduser.h ../../functions/cat.h
|
templates.o: ../../functions/adduser.h ../../functions/cat.h
|
||||||
templates.o: ../../functions/chmod.h ../../functions/privchanger.h
|
templates.o: ../../functions/chmod.h ../../functions/privchanger.h
|
||||||
templates.o: ../../functions/chown.h ../../functions/ckeditor.h
|
templates.o: ../../functions/chown.h ../../functions/ckeditor.h
|
||||||
templates.o: ../../functions/cp.h ../../functions/createthread.h
|
templates.o: ../../functions/cp.h ../../functions/default.h
|
||||||
templates.o: ../../functions/default.h ../../functions/download.h
|
templates.o: ../../functions/download.h ../../functions/emacs.h
|
||||||
templates.o: ../../functions/emacs.h ../../functions/last.h
|
templates.o: ../../functions/last.h ../../functions/login.h
|
||||||
templates.o: ../../functions/login.h ../../functions/logout.h
|
templates.o: ../../functions/logout.h ../../functions/ln.h
|
||||||
templates.o: ../../functions/ln.h ../../functions/ls.h
|
templates.o: ../../functions/ls.h ../../functions/mkdir.h
|
||||||
templates.o: ../../functions/mkdir.h ../../functions/mv.h
|
templates.o: ../../functions/mv.h ../../functions/node.h
|
||||||
templates.o: ../../functions/node.h ../../functions/priv.h
|
templates.o: ../../functions/priv.h ../../functions/reload.h
|
||||||
templates.o: ../../functions/reload.h ../../functions/rm.h
|
templates.o: ../../functions/rm.h ../../functions/run.h
|
||||||
templates.o: ../../functions/run.h ../../functions/specialdefault.h
|
templates.o: ../../functions/specialdefault.h ../../functions/stat.h
|
||||||
templates.o: ../../functions/stat.h ../../functions/subject.h
|
templates.o: ../../functions/subject.h ../../functions/template.h
|
||||||
templates.o: ../../functions/funthread.h ../../functions/template.h
|
|
||||||
templates.o: ../../functions/tinymce.h ../../functions/uname.h
|
templates.o: ../../functions/tinymce.h ../../functions/uname.h
|
||||||
templates.o: ../../functions/upload.h ../../functions/uptime.h
|
templates.o: ../../functions/upload.h ../../functions/uptime.h
|
||||||
templates.o: ../../functions/who.h ../../functions/vim.h
|
templates.o: ../../functions/who.h ../../functions/vim.h
|
||||||
templates.o: ../../core/htmlfilter.h tdb.h ../../db/dbbase.h
|
templates.o: ../../core/htmlfilter.h ../../templates/templates.h
|
||||||
templates.o: ../../db/dbconn.h ../../db/dbtextstream.h ../../core/error.h
|
templates.o: ../../templates/patterncacher.h
|
||||||
templates.o: editticket.h ../../functions/functionbase.h ../../core/synchro.h
|
|
||||||
templates.o: createticket.h ../../core/misc.h ../../core/plugin.h
|
|
||||||
templates.o: ../../core/pluginmsg.h ../../core/system.h
|
|
||||||
templates.o: ../../core/sessionmanager.h ../../core/sessioncontainer.h
|
|
||||||
templates.o: ../../templates/templates.h ../../templates/patterncacher.h
|
|
||||||
templates.o: ../../templates/ckeditorgetparser.h
|
templates.o: ../../templates/ckeditorgetparser.h
|
||||||
templates.o: ../../core/httpsimpleparser.h ../../core/log.h
|
templates.o: ../../core/httpsimpleparser.h ../../core/log.h
|
||||||
templates.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
templates.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
||||||
templates.o: sessiondata.h ../../core/plugindata.h
|
threadinfo.o: threadinfo.h thread.h ../../core/item.h ../../core/system.h
|
||||||
ticketconf.o: ticketconf.h
|
threadinfo.o: ../../core/dirs.h ../../core/item.h ../../core/dircontainer.h
|
||||||
ticketinfo.o: ticketinfo.h ticket.h ticketparser.h ticketconf.h
|
threadinfo.o: ../../db/db.h ../../db/dbbase.h ../../db/dbconn.h
|
||||||
ticketinfo.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
|
threadinfo.o: ../../db/dbtextstream.h ../../core/textstream.h
|
||||||
ticketinfo.o: ../../core/item.h ../../core/dircontainer.h ../../db/db.h
|
threadinfo.o: ../../core/misc.h ../../core/error.h ../../core/log.h
|
||||||
ticketinfo.o: ../../db/dbbase.h ../../db/dbitemquery.h
|
threadinfo.o: ../../core/textstream.h ../../db/dbitemquery.h
|
||||||
ticketinfo.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
|
threadinfo.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
|
||||||
ticketinfo.o: ../../core/thread.h ../../core/dircontainer.h
|
threadinfo.o: ../../core/dircontainer.h ../../core/ugcontainer.h
|
||||||
ticketinfo.o: ../../core/ugcontainer.h ../../core/log.h
|
threadinfo.o: ../../core/request.h ../../notify/notify.h
|
||||||
ticketinfo.o: ../../core/textstream.h ../../core/request.h
|
threadinfo.o: ../../notify/notifypool.h ../../templates/locale.h
|
||||||
ticketinfo.o: ../../notify/notify.h ../../notify/notifypool.h
|
threadinfo.o: ../../core/confparser.h ../../templates/misc.h
|
||||||
ticketinfo.o: ../../templates/locale.h ../../core/confparser.h
|
threadinfo.o: ../../templates/localefilter.h ../../templates/locale.h
|
||||||
ticketinfo.o: ../../templates/misc.h ../../templates/localefilter.h
|
threadinfo.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
|
||||||
ticketinfo.o: ../../templates/locale.h ../../../ezc/src/ezc.h
|
threadinfo.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
|
||||||
ticketinfo.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
|
threadinfo.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
|
||||||
ticketinfo.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
|
threadinfo.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
|
||||||
ticketinfo.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
|
threadinfo.o: ../../notify/notifythread.h ../../core/basethread.h
|
||||||
ticketinfo.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
|
threadinfo.o: ../../core/synchro.h ../../notify/templatesnotify.h
|
||||||
ticketinfo.o: ../../core/basethread.h ../../core/synchro.h
|
threadinfo.o: ../../core/config.h ../../core/users.h ../../core/user.h
|
||||||
ticketinfo.o: ../../notify/templatesnotify.h ../../core/textstream.h
|
threadinfo.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
|
||||||
ticketinfo.o: ../../core/misc.h ../../core/config.h ../../core/users.h
|
threadinfo.o: ../../core/mounts.h ../../core/mount.h ../../core/error.h
|
||||||
ticketinfo.o: ../../core/user.h ../../core/ugcontainer.h
|
threadinfo.o: ../../core/mountparser.h ../../core/config.h
|
||||||
ticketinfo.o: ../../core/lastcontainer.h ../../core/mounts.h
|
threadinfo.o: ../../core/confparser.h ../../core/htmlfilter.h
|
||||||
ticketinfo.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
|
threadinfo.o: ../../core/users.h ../../core/groups.h ../../core/group.h
|
||||||
ticketinfo.o: ../../core/config.h ../../core/confparser.h
|
threadinfo.o: ../../core/rebus.h ../../core/loadavg.h ../../core/thumb.h
|
||||||
ticketinfo.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
|
threadinfo.o: ../../core/basethread.h
|
||||||
ticketinfo.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
|
|
||||||
ticketinfo.o: ../../core/thumb.h ../../core/basethread.h
|
|
||||||
ticketinfo.o: ../../functions/functions.h ../../functions/functionbase.h
|
|
||||||
ticketinfo.o: ../../functions/functionparser.h ../../core/request.h
|
|
||||||
ticketinfo.o: ../../core/requesttypes.h ../../core/session.h
|
|
||||||
ticketinfo.o: ../../core/plugindata.h ../../templates/htmltextstream.h
|
|
||||||
ticketinfo.o: ../../functions/adduser.h ../../functions/cat.h
|
|
||||||
ticketinfo.o: ../../functions/chmod.h ../../functions/privchanger.h
|
|
||||||
ticketinfo.o: ../../functions/chown.h ../../functions/ckeditor.h
|
|
||||||
ticketinfo.o: ../../functions/cp.h ../../functions/createthread.h
|
|
||||||
ticketinfo.o: ../../functions/default.h ../../functions/download.h
|
|
||||||
ticketinfo.o: ../../functions/emacs.h ../../functions/last.h
|
|
||||||
ticketinfo.o: ../../functions/login.h ../../functions/logout.h
|
|
||||||
ticketinfo.o: ../../functions/ln.h ../../functions/ls.h
|
|
||||||
ticketinfo.o: ../../functions/mkdir.h ../../functions/mv.h
|
|
||||||
ticketinfo.o: ../../functions/node.h ../../functions/priv.h
|
|
||||||
ticketinfo.o: ../../functions/reload.h ../../functions/rm.h
|
|
||||||
ticketinfo.o: ../../functions/run.h ../../functions/specialdefault.h
|
|
||||||
ticketinfo.o: ../../functions/stat.h ../../functions/subject.h
|
|
||||||
ticketinfo.o: ../../functions/funthread.h ../../functions/template.h
|
|
||||||
ticketinfo.o: ../../functions/tinymce.h ../../functions/uname.h
|
|
||||||
ticketinfo.o: ../../functions/upload.h ../../functions/uptime.h
|
|
||||||
ticketinfo.o: ../../functions/who.h ../../functions/vim.h
|
|
||||||
ticketinfo.o: ../../core/htmlfilter.h tdb.h ../../db/dbbase.h
|
|
||||||
ticketinfo.o: ../../db/dbconn.h ../../db/dbtextstream.h ../../core/error.h
|
|
||||||
ticketinfo.o: ../../core/log.h ../../core/misc.h sessiondata.h
|
|
||||||
ticketinfo.o: ../../core/plugindata.h
|
|
||||||
ticketparser.o: ticketparser.h ticketconf.h ../../core/log.h
|
|
||||||
ticketparser.o: ../../core/misc.h
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
o = createticket.o editticket.o funticket.o init.o sessiondata.o showtickets.o tdb.o templates.o ticketconf.o ticketinfo.o ticketparser.o
|
o = createthread.o funthread.o init.o reply.o showthreads.o tdb.o templates.o threadinfo.o
|
||||||
|
|
|
@ -9,11 +9,14 @@
|
||||||
|
|
||||||
#include "createthread.h"
|
#include "createthread.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
#include "functions/functions.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Thread
|
namespace Thread
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
CreateThread::CreateThread()
|
CreateThread::CreateThread()
|
||||||
{
|
{
|
||||||
fun.url = L"createthread";
|
fun.url = L"createthread";
|
||||||
|
@ -21,127 +24,65 @@ CreateThread::CreateThread()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CreateThread::SetTDb(TDb * ptdb)
|
||||||
|
{
|
||||||
|
tdb = ptdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateThread::SetThreadInfo(ThreadInfo * pthread_info)
|
||||||
|
{
|
||||||
|
thread_info = pthread_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// returning true if we can create a thread in the current directory
|
// returning true if we can create a thread in the current directory
|
||||||
bool CreateThread::HasAccess(bool check_root)
|
|
||||||
{
|
|
||||||
if( request->dir_tab.empty() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( request->is_item )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( !system->HasWriteAccess(*request->dir_tab.back()) )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( !system->mounts.pmount || system->mounts.pmount->type != system->mounts.MountTypeThread() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( !check_root && request->session && request->session->puser && request->session->puser->super_user )
|
|
||||||
// super can create thread regardless of the restrictcreatethread option
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if( !system->mounts.pmount->IsPar(system->mounts.MountParCreatethreadOn()) )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if( system->mounts.pmount->IsArg(system->mounts.MountParCreatethreadOn(), request->dir_tab.size()) )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool CreateThread::HasAccess()
|
bool CreateThread::HasAccess()
|
||||||
{
|
{
|
||||||
return HasAccess(false);
|
if( request->is_item || !system->HasWriteAccess(*request->dir_tab.back()) )
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool CreateThread::FunCreateThreadCheckAbuse()
|
|
||||||
{
|
|
||||||
if( !system->rebus.CheckRebus() )
|
|
||||||
{
|
|
||||||
request->status = WINIX_ERR_INCORRECT_REBUS;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
functions->CheckGetPostTimes();
|
if( system->mounts.pmount->type != thread_info->mount_type_thread )
|
||||||
|
|
||||||
if( request->session->spam_score > 0 )
|
|
||||||
{
|
|
||||||
request->status = WINIX_ERR_SPAM;
|
|
||||||
log << log1 << "Content: ignoring due to suspected spamming" << logend;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CreateThread::ReadThread()
|
|
||||||
{
|
|
||||||
thread.parent_id = request->dir_tab.back()->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CreateThread::AddThread()
|
|
||||||
{
|
|
||||||
thread.dir_id = request->dir_tab.back()->id;
|
|
||||||
thread.closed = false;
|
|
||||||
thread.items = 1;
|
|
||||||
thread.last_item = request->item; // set by PostFunEmacsAdd()
|
|
||||||
|
|
||||||
request->status = db->AddThread(thread);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CreateThread::PostFunCreateThreadLogAndRedirect()
|
|
||||||
{
|
|
||||||
if( request->status == WINIX_ERR_OK )
|
|
||||||
{
|
|
||||||
log << log2 << "Content: added a new thread" << logend;
|
|
||||||
system->RedirectToLastDir();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log << log1 << "Content: problem with adding a new thread, error code: "
|
|
||||||
<< request->status << logend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CreateThread::MakePost()
|
void CreateThread::MakePost()
|
||||||
{
|
{
|
||||||
functions->ReadItem(request->item, Item::dir);
|
request->item.Clear();
|
||||||
|
functions->ReadItem(request->item, Item::file);
|
||||||
functions->SetUser(request->item);
|
functions->SetUser(request->item);
|
||||||
ReadThread();
|
functions->PrepareUrl(request->item);
|
||||||
request->item.privileges = 0777; // !! tymczasowo 777 aby wszyscy mogli wysylac posty
|
|
||||||
|
|
||||||
if( !FunCreateThreadCheckAbuse() )
|
|
||||||
{
|
|
||||||
functions->ReadItemContentWithType(request->item); // for correctly displaying the form
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
request->status = system->dirs.AddDirectory(request->item, true, 0, WINIX_NOTIFY_CODE_THREAD_ADD);
|
|
||||||
|
|
||||||
if( request->status == WINIX_ERR_OK )
|
|
||||||
{
|
|
||||||
functions->ReadItemContentWithType(request->item);
|
|
||||||
request->item.type = Item::file;
|
|
||||||
request->item.privileges = 0644; // !! tymczasowo
|
|
||||||
request->item.parent_id = request->dir_tab.back()->id;
|
request->item.parent_id = request->dir_tab.back()->id;
|
||||||
|
request->item.privileges = 0644; // !! tymczasowo
|
||||||
|
|
||||||
|
if( functions->CheckAbuse() )
|
||||||
|
return;
|
||||||
|
|
||||||
request->status = system->AddFile(request->item);
|
request->status = system->AddFile(request->item);
|
||||||
|
|
||||||
if( request->status == WINIX_ERR_OK )
|
if( request->status == WINIX_ERR_OK )
|
||||||
AddThread();
|
{
|
||||||
|
thread.Clear();
|
||||||
|
thread.file_id = request->item.id;
|
||||||
|
request->status = tdb->AddThread(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
PostFunCreateThreadLogAndRedirect();
|
if( request->status == WINIX_ERR_OK )
|
||||||
|
{
|
||||||
|
log << log2 << "CreateThread: added a new thread" << logend;
|
||||||
|
system->RedirectTo(request->item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log << log1 << "CreateThread: problem with adding a new thread, error code: "
|
||||||
|
<< request->status << logend;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
#define headerfile_winix_plugins_thread_createthread
|
#define headerfile_winix_plugins_thread_createthread
|
||||||
|
|
||||||
#include "functions/functionbase.h"
|
#include "functions/functionbase.h"
|
||||||
|
#include "tdb.h"
|
||||||
|
#include "threadinfo.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Thread
|
namespace Thread
|
||||||
|
@ -23,18 +24,18 @@ class CreateThread : public FunctionBase
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CreateThread();
|
CreateThread();
|
||||||
bool HasAccess(bool check_root);
|
|
||||||
bool HasAccess();
|
bool HasAccess();
|
||||||
void MakePost();
|
void MakePost();
|
||||||
|
|
||||||
|
void SetTDb(TDb * ptdb);
|
||||||
|
void SetThreadInfo(ThreadInfo * pthread_info);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
TDb * tdb;
|
||||||
|
ThreadInfo * thread_info;
|
||||||
Thread thread;
|
Thread thread;
|
||||||
|
|
||||||
bool FunCreateThreadCheckAbuse();
|
|
||||||
void ReadThread();
|
|
||||||
void AddThread();
|
|
||||||
void PostFunCreateThreadLogAndRedirect();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,72 +18,73 @@ namespace Thread
|
||||||
FunThread::FunThread()
|
FunThread::FunThread()
|
||||||
{
|
{
|
||||||
fun.url = L"thread";
|
fun.url = L"thread";
|
||||||
Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FunThread::SetTDb(TDb * ptdb)
|
||||||
|
{
|
||||||
|
tdb = ptdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FunThread::SetThreadInfo(ThreadInfo * pthread_info)
|
||||||
|
{
|
||||||
|
thread_info = pthread_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool FunThread::HasAccess()
|
bool FunThread::HasAccess()
|
||||||
{
|
{
|
||||||
return !request->is_item;
|
if( !request->is_item )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( system->mounts.pmount->type != thread_info->mount_type_thread )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FunThread::Clear()
|
|
||||||
|
|
||||||
|
void FunThread::PrepareThread(long file_id)
|
||||||
{
|
{
|
||||||
thread.Clear();
|
thread_info->Clear();
|
||||||
thread_tab.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//request->status = tdb->GetThreadByFileId(file_id, thread);
|
||||||
|
|
||||||
void FunThread::CreateSortIndexByDate()
|
request->status = tdb->GetAnswers(file_id, id_tab);
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
for(i = 0; i < thread_tab.size() ; ++i)
|
if( !id_tab.empty() )
|
||||||
{
|
{
|
||||||
Item * pdir = system->dirs.GetDir(thread_tab[i].dir_id);
|
DbItemQuery iq;
|
||||||
|
|
||||||
if( pdir )
|
if( system->mounts.pmount->IsArg(thread_info->mount_par_thread, L"sort_desc") )
|
||||||
thread_tab[i].sort = (unsigned long)Time(pdir->date_creation);
|
iq.sort_asc = false;
|
||||||
else
|
|
||||||
thread_tab[i].sort = 0;
|
iq.WhereIdIn(id_tab);
|
||||||
|
iq.WhereType(Item::file);
|
||||||
|
iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
||||||
|
|
||||||
|
db->GetItems(thread_info->item_tab, iq);
|
||||||
|
|
||||||
|
thread_info->item_sort_tab.resize(thread_info->item_tab.size());
|
||||||
|
|
||||||
|
// thread_info.item_tab is already sorted (by the database)
|
||||||
|
for(size_t i=0 ; i<thread_info->item_tab.size() ; ++i)
|
||||||
|
thread_info->item_sort_tab[i] = &thread_info->item_tab[i];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
system->CheckAccessToItems(thread_info->item_tab);
|
||||||
|
|
||||||
bool FunThread::FunThreadSort(const Thread & t1, const Thread & t2)
|
|
||||||
{
|
|
||||||
return t1.sort > t2.sort;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FunThread::MakeGet()
|
void FunThread::MakeGet()
|
||||||
{
|
{
|
||||||
is_thread = (db->GetThreadByDirId(request->dir_tab.back()->id, thread) == WINIX_ERR_OK);
|
PrepareThread(request->item.id);
|
||||||
|
|
||||||
DbItemQuery iq;
|
|
||||||
|
|
||||||
if( system->mounts.pmount->IsArg(system->mounts.MountParThread(), L"sort_desc") )
|
|
||||||
iq.sort_asc = false;
|
|
||||||
|
|
||||||
iq.WhereParentId(request->dir_tab.back()->id);
|
|
||||||
iq.WhereType(Item::file);
|
|
||||||
iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
|
||||||
|
|
||||||
db->GetItems(request->item_tab, iq);
|
|
||||||
db->GetThreads(request->dir_tab.back()->id, thread_tab);
|
|
||||||
|
|
||||||
system->CheckAccessToItems(request->item_tab);
|
|
||||||
|
|
||||||
CreateSortIndexByDate();
|
|
||||||
std::sort(thread_tab.begin(), thread_tab.end(), FunThreadSort);
|
|
||||||
|
|
||||||
Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -11,7 +11,9 @@
|
||||||
#define headerfile_winix_plugins_thread_funthread
|
#define headerfile_winix_plugins_thread_funthread
|
||||||
|
|
||||||
#include "functions/functionbase.h"
|
#include "functions/functionbase.h"
|
||||||
#include "core/thread.h"
|
#include "tdb.h"
|
||||||
|
#include "threadinfo.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Thread
|
namespace Thread
|
||||||
|
@ -25,17 +27,16 @@ public:
|
||||||
FunThread();
|
FunThread();
|
||||||
bool HasAccess();
|
bool HasAccess();
|
||||||
void MakeGet();
|
void MakeGet();
|
||||||
|
void PrepareThread(long file_id);
|
||||||
|
|
||||||
// current thread (if exists)
|
void SetTDb(TDb * ptdb);
|
||||||
bool is_thread;
|
void SetThreadInfo(ThreadInfo * pthread_info);
|
||||||
Thread thread;
|
|
||||||
std::vector<Thread> thread_tab;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static bool FunThreadSort(const Thread & t1, const Thread & t2);
|
TDb * tdb;
|
||||||
void CreateSortIndexByDate();
|
ThreadInfo * thread_info;
|
||||||
void Clear();
|
std::vector<long> id_tab;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,16 +8,22 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tdb.h"
|
#include "tdb.h"
|
||||||
|
#include "reply.h"
|
||||||
#include "funthread.h"
|
#include "funthread.h"
|
||||||
#include "createthread.h"
|
#include "createthread.h"
|
||||||
#include "showthreads.h"
|
#include "showthreads.h"
|
||||||
#include "core/log.h"
|
#include "core/log.h"
|
||||||
#include "core/plugin.h"
|
#include "core/plugin.h"
|
||||||
|
#include "pluginmsg.h"
|
||||||
|
#include "templates.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" void Init(PluginInfo &);
|
extern "C" void Init(PluginInfo &);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Thread
|
namespace Thread
|
||||||
{
|
{
|
||||||
const wchar_t plugin_name[] = L"thread";
|
const wchar_t plugin_name[] = L"thread";
|
||||||
|
@ -25,15 +31,19 @@ const wchar_t plugin_name[] = L"thread";
|
||||||
TDb tdb;
|
TDb tdb;
|
||||||
ThreadInfo thread_info;
|
ThreadInfo thread_info;
|
||||||
|
|
||||||
|
Reply fun_reply;
|
||||||
FunThread fun_thread;
|
FunThread fun_thread;
|
||||||
CreateThread fun_create_thread;
|
CreateThread fun_create_thread;
|
||||||
ShowThreads fun_show_threads;
|
ShowThreads fun_show_threads;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AddFunctions(PluginInfo & info)
|
void AddFunctions(PluginInfo & info)
|
||||||
{
|
{
|
||||||
|
info.functions->Add(fun_reply);
|
||||||
info.functions->Add(fun_thread);
|
info.functions->Add(fun_thread);
|
||||||
info.functions->Add(fun_create_thread);
|
info.functions->Add(fun_create_thread);
|
||||||
|
info.functions->Add(fun_show_threads);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,87 +63,104 @@ void AddMounts(PluginInfo & info)
|
||||||
{
|
{
|
||||||
Mounts & m = info.system->mounts;
|
Mounts & m = info.system->mounts;
|
||||||
|
|
||||||
ticket_info.mount_type_thread = m.AddMountType(L"thread");
|
thread_info.mount_type_thread = m.AddMountType(L"thread");
|
||||||
ticket_info.mount_par_thread_enable = m.AddMountPar(L"thread_enable");
|
thread_info.mount_par_thread = m.AddMountPar(L"thread");
|
||||||
|
thread_info.mount_par_thread_dir = m.AddMountPar(L"thread_dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ProcessRequest(PluginInfo & info)
|
|
||||||
{
|
|
||||||
if( info.request->function == &info.functions->fun_reload )
|
|
||||||
{
|
|
||||||
if( info.request->IsParam(L"tickets") )
|
|
||||||
ticket_info.ReadTicketConf();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void RemoveThread(PluginInfo & i)
|
void RemoveThread(PluginInfo & i)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InitTicket(PluginInfo & info)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AddNotifyTemplate(PluginInfo & info)
|
void AddNotifyTemplate(PluginInfo & info)
|
||||||
{
|
{
|
||||||
ticket_info.template_index = info.system->notify.AddTemplate(L"notify_email_thread.txt");
|
thread_info.template_index = info.system->notify.AddTemplate(L"notify_email_thread.txt");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SetSortTab(PluginInfo & info)
|
||||||
|
{
|
||||||
|
if( !info.p1 )
|
||||||
|
{
|
||||||
|
log << log1 << "Thread: sort_tab pointer is not set" << logend;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef std::vector<Item*> SortTab;
|
||||||
|
SortTab * psort_tab = reinterpret_cast<SortTab*>(info.p1);
|
||||||
|
|
||||||
|
thread_info.item_sort_tab = *psort_tab;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ReadThreads(PluginInfo & info)
|
||||||
|
{
|
||||||
|
fun_show_threads.ReadThreads();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SetSortTabIndex(PluginInfo & info)
|
||||||
|
{
|
||||||
|
thread_sort_tab(info.l1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PrepareThread(PluginInfo & info)
|
||||||
|
{
|
||||||
|
fun_thread.PrepareThread(info.l1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
void AddEzcFunctions(PluginInfo & info);
|
|
||||||
|
|
||||||
} // namespace Thread
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Init(PluginInfo & info)
|
void Init(PluginInfo & info)
|
||||||
{
|
{
|
||||||
using namespace Ticket;
|
using namespace Thread;
|
||||||
|
|
||||||
plugin.Assign(WINIX_CREATE_FUNCTIONS, AddFunctions);
|
plugin.Assign(WINIX_CREATE_FUNCTIONS, AddFunctions);
|
||||||
plugin.Assign(WINIX_SELECT_DEFAULT_FUNCTION, SelectDefaultFunction);
|
plugin.Assign(WINIX_SELECT_DEFAULT_FUNCTION, SelectDefaultFunction);
|
||||||
plugin.Assign(WINIX_ADD_MOUNTS, AddMounts);
|
plugin.Assign(WINIX_ADD_MOUNTS, AddMounts);
|
||||||
plugin.Assign(WINIX_FILE_REMOVED, RemoveThread);
|
plugin.Assign(WINIX_FILE_REMOVED, RemoveThread);
|
||||||
plugin.Assign(WINIX_PLUGIN_INIT, InitTicket);
|
|
||||||
plugin.Assign(WINIX_NOTIFY_ADD_TEMPLATE, AddNotifyTemplate);
|
plugin.Assign(WINIX_NOTIFY_ADD_TEMPLATE, AddNotifyTemplate);
|
||||||
|
|
||||||
plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions);
|
plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions);
|
||||||
plugin.Assign(WINIX_PROCESS_REQUEST, ProcessRequest);
|
|
||||||
|
// for other plugins
|
||||||
|
plugin.Assign(WINIX_PL_THREAD_SET_SORTTAB, SetSortTab);
|
||||||
|
plugin.Assign(WINIX_PL_THREAD_READ_THREADS, ReadThreads);
|
||||||
|
plugin.Assign(WINIX_PL_THREAD_SET_SORTTAB_INDEX, SetSortTabIndex);
|
||||||
|
plugin.Assign(WINIX_PL_THREAD_PREPARE_THREAD, PrepareThread);
|
||||||
|
|
||||||
tdb.SetConn(info.db->GetConn());
|
tdb.SetConn(info.db->GetConn());
|
||||||
tdb.LogQueries(info.config->log_db_query);
|
tdb.LogQueries(info.config->log_db_query);
|
||||||
|
|
||||||
ticket_info.SetDb(info.db);
|
// thread_info and fun_show_threads are used in 'ticket' plugins too
|
||||||
ticket_info.SetTDb(&tdb);
|
thread_info.SetSystem(info.system);
|
||||||
ticket_info.SetConfig(info.config);
|
thread_info.plugin_id = info.plugin_id;
|
||||||
ticket_info.SetSystem(info.system);
|
|
||||||
ticket_info.SetRequest(info.request);
|
|
||||||
ticket_info.SetFunctions(info.functions);
|
|
||||||
ticket_info.plugin_id = info.plugin_id;
|
|
||||||
|
|
||||||
fun_ticket.SetTDb(&tdb);
|
fun_reply.SetTDb(&tdb);
|
||||||
fun_ticket.SetTicketInfo(&ticket_info);
|
fun_reply.SetThreadInfo(&thread_info);
|
||||||
|
|
||||||
fun_edit_ticket.SetTDb(&tdb);
|
fun_thread.SetTDb(&tdb);
|
||||||
fun_edit_ticket.SetTicketInfo(&ticket_info);
|
fun_thread.SetThreadInfo(&thread_info);
|
||||||
|
|
||||||
fun_create_ticket.SetTDb(&tdb);
|
fun_create_thread.SetTDb(&tdb);
|
||||||
fun_create_ticket.SetTicketInfo(&ticket_info);
|
fun_create_thread.SetThreadInfo(&thread_info);
|
||||||
|
|
||||||
fun_show_tickets.SetTDb(&tdb);
|
fun_show_threads.SetTDb(&tdb);
|
||||||
fun_show_tickets.SetTicketInfo(&ticket_info);
|
fun_show_threads.SetThreadInfo(&thread_info);
|
||||||
|
|
||||||
info.p1 = (void*)(plugin_name);
|
info.p1 = (void*)(plugin_name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of Winix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef headerfile_winix_plugins_thread_pluginmsg
|
||||||
|
#define headerfile_winix_plugins_thread_pluginmsg
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define WINIX_PL_THREAD_SET_SORTTAB 4000
|
||||||
|
#define WINIX_PL_THREAD_READ_THREADS 4001
|
||||||
|
#define WINIX_PL_THREAD_SET_SORTTAB_INDEX 4002
|
||||||
|
#define WINIX_PL_THREAD_CAN_USE_REPLY 4003
|
||||||
|
#define WINIX_PL_THREAD_PREPARE_THREAD 4004
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,115 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of Winix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "reply.h"
|
||||||
|
#include "functions/functions.h"
|
||||||
|
#include "core/misc.h"
|
||||||
|
#include "core/plugin.h"
|
||||||
|
#include "pluginmsg.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Thread
|
||||||
|
{
|
||||||
|
|
||||||
|
Reply::Reply()
|
||||||
|
{
|
||||||
|
fun.url = L"reply";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Reply::SetTDb(TDb * ptdb)
|
||||||
|
{
|
||||||
|
tdb = ptdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Reply::SetThreadInfo(ThreadInfo * pthread_info)
|
||||||
|
{
|
||||||
|
thread_info = pthread_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Reply::HasAccess()
|
||||||
|
{
|
||||||
|
if( !request->is_item )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Item * dir = thread_info->FindThreadDir();
|
||||||
|
|
||||||
|
if( !dir || !system->HasWriteAccess(*dir) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
plugin.Call(WINIX_PL_THREAD_CAN_USE_REPLY);
|
||||||
|
|
||||||
|
if( plugin.True() > 0 )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if( system->mounts.pmount->type != thread_info->mount_type_thread )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Reply::MakePost()
|
||||||
|
{
|
||||||
|
Item * dir = thread_info->FindThreadDir();
|
||||||
|
|
||||||
|
if( !dir )
|
||||||
|
{
|
||||||
|
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( tdb->GetThreadByFileId(request->item.id, thread) != WINIX_ERR_OK )
|
||||||
|
{
|
||||||
|
thread.Clear();
|
||||||
|
thread.file_id = request->item.id;
|
||||||
|
tdb->AddThread(thread);
|
||||||
|
}
|
||||||
|
|
||||||
|
answer.Clear();
|
||||||
|
answer.url = request->item.url;
|
||||||
|
answer.url += L"_msg_";
|
||||||
|
answer.url += Toa(thread.replies + 1);
|
||||||
|
answer.subject = answer.url;
|
||||||
|
functions->ReadItem(answer, Item::file);
|
||||||
|
functions->SetUser(answer);
|
||||||
|
functions->PrepareUrl(answer);
|
||||||
|
answer.parent_id = dir->id;
|
||||||
|
answer.privileges = 0644; // !! tymczasowo
|
||||||
|
|
||||||
|
if( functions->CheckAbuse() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
request->status = system->AddFile(answer);
|
||||||
|
|
||||||
|
if( request->status == WINIX_ERR_OK )
|
||||||
|
request->status = tdb->EditThreadAddItem(request->item.id, answer.id);
|
||||||
|
|
||||||
|
|
||||||
|
if( request->status == WINIX_ERR_OK )
|
||||||
|
{
|
||||||
|
log << log2 << "Reply: added an answer in a thread" << logend;
|
||||||
|
system->RedirectTo(request->item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log << log1 << "Reply: problem with adding an answer, error code: "
|
||||||
|
<< request->status << logend;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of Winix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef headerfile_winix_plugins_thread_reply
|
||||||
|
#define headerfile_winix_plugins_thread_reply
|
||||||
|
|
||||||
|
#include "functions/functionbase.h"
|
||||||
|
#include "tdb.h"
|
||||||
|
#include "threadinfo.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Thread
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
class Reply : public FunctionBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
Reply();
|
||||||
|
bool HasAccess();
|
||||||
|
void MakePost();
|
||||||
|
|
||||||
|
void SetTDb(TDb * ptdb);
|
||||||
|
void SetThreadInfo(ThreadInfo * pthread_info);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
TDb * tdb;
|
||||||
|
ThreadInfo * thread_info;
|
||||||
|
Item answer;
|
||||||
|
Thread thread;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
#endif
|
|
@ -7,15 +7,141 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include "showthreads.h"
|
#include "showthreads.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Thread
|
namespace Thread
|
||||||
{
|
{
|
||||||
|
|
||||||
|
ShowThreads::ShowThreads()
|
||||||
|
{
|
||||||
|
fun.url = L"showthreads";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ShowThreads::SetTDb(TDb * ptdb)
|
||||||
|
{
|
||||||
|
tdb = ptdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ShowThreads::SetThreadInfo(ThreadInfo * pthread_info)
|
||||||
|
{
|
||||||
|
thread_info = pthread_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool ShowThreads::HasAccess()
|
||||||
|
{
|
||||||
|
if( request->is_item )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( system->mounts.pmount->type != thread_info->mount_type_thread )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool ShowThreads::Sort::operator()(const Item * item1, const Item * item2)
|
||||||
|
{
|
||||||
|
if( sort_type == 0 )
|
||||||
|
{
|
||||||
|
// sorting by url
|
||||||
|
return item1->url < item2->url;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// sorting by date
|
||||||
|
tm tm1 = item1->date_creation;
|
||||||
|
tm tm2 = item2->date_creation;
|
||||||
|
|
||||||
|
time_t time1 = Time(tm1);
|
||||||
|
time_t time2 = Time(tm2);
|
||||||
|
|
||||||
|
return time1 > time2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ShowThreads::ReadFiles()
|
||||||
|
{
|
||||||
|
// reading files
|
||||||
|
DbItemQuery iq;
|
||||||
|
iq.SetAll(false, false);
|
||||||
|
iq.sel_url = true;
|
||||||
|
iq.sel_subject = true;
|
||||||
|
iq.sel_date = true;
|
||||||
|
iq.sel_user_id = true;
|
||||||
|
iq.sel_group_id = true;
|
||||||
|
iq.sel_guest_name = true;
|
||||||
|
iq.sel_privileges = true;
|
||||||
|
iq.sel_date = true;
|
||||||
|
iq.WhereParentId(request->dir_tab.back()->id);
|
||||||
|
iq.WhereType(Item::file);
|
||||||
|
iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
||||||
|
|
||||||
|
db->GetItems(thread_info->item_tab, iq);
|
||||||
|
system->CheckAccessToItems(thread_info->item_tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ShowThreads::ReadThreads()
|
||||||
|
{
|
||||||
|
// reading threads for the files
|
||||||
|
file_id_tab.resize(thread_info->item_sort_tab.size());
|
||||||
|
|
||||||
|
for(size_t i=0 ; i<thread_info->item_sort_tab.size() ; ++i)
|
||||||
|
file_id_tab[i] = thread_info->item_sort_tab[i]->id;
|
||||||
|
|
||||||
|
tdb->GetThreads(file_id_tab, thread_info->thread_tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ShowThreads::CreatePointers()
|
||||||
|
{
|
||||||
|
// creating a pointers table
|
||||||
|
thread_info->item_sort_tab.resize(thread_info->item_tab.size());
|
||||||
|
|
||||||
|
for(size_t i=0 ; i<thread_info->item_tab.size() ; ++i)
|
||||||
|
thread_info->item_sort_tab[i] = &thread_info->item_tab[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ShowThreads::SortPointers()
|
||||||
|
{
|
||||||
|
int sort_type = 1;
|
||||||
|
|
||||||
|
if( request->ParamValue(L"sort") == L"url" )
|
||||||
|
sort_type = 0;
|
||||||
|
|
||||||
|
std::vector<Item*> & table = thread_info->item_sort_tab;
|
||||||
|
std::sort(table.begin(), table.end(), Sort(this, sort_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ShowThreads::MakeGet()
|
||||||
|
{
|
||||||
|
thread_info->Clear();
|
||||||
|
|
||||||
|
ReadFiles();
|
||||||
|
CreatePointers();
|
||||||
|
SortPointers();
|
||||||
|
ReadThreads();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#define headerfile_winix_plugins_thread_showthreads
|
#define headerfile_winix_plugins_thread_showthreads
|
||||||
|
|
||||||
#include "functions/functionbase.h"
|
#include "functions/functionbase.h"
|
||||||
|
#include "tdb.h"
|
||||||
|
#include "threadinfo.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,11 +24,36 @@ class ShowThreads : public FunctionBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
ShowThreads();
|
||||||
bool HasAccess();
|
bool HasAccess();
|
||||||
void MakePost();
|
void MakeGet();
|
||||||
|
|
||||||
|
void SetTDb(TDb * ptdb);
|
||||||
|
void SetThreadInfo(ThreadInfo * pthread_info);
|
||||||
|
|
||||||
|
void ReadThreads();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
TDb * tdb;
|
||||||
|
ThreadInfo * thread_info;
|
||||||
|
std::vector<long> file_id_tab;
|
||||||
|
|
||||||
|
void ReadFiles();
|
||||||
|
void CreatePointers();
|
||||||
|
void SortPointers();
|
||||||
|
|
||||||
|
struct Sort
|
||||||
|
{
|
||||||
|
ShowThreads * show_threads;
|
||||||
|
int sort_type;
|
||||||
|
Sort(ShowThreads * show, int type) : show_threads(show), sort_type(type) {}
|
||||||
|
bool operator()(const Item * item1, const Item * item2);
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,48 @@ namespace Thread
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Error Db::GetThreadByDirId(long dir_id, Thread & thread)
|
Error TDb::AddThread(const Thread & thread)
|
||||||
|
{
|
||||||
|
query.Clear();
|
||||||
|
query << R("insert into plugins.thread (file_id, replies, last_item, closed) values (")
|
||||||
|
<< thread.file_id
|
||||||
|
<< thread.replies
|
||||||
|
<< thread.last_item_id
|
||||||
|
<< (thread.closed ? 1 : 0 )
|
||||||
|
<< R(");");
|
||||||
|
|
||||||
|
return DoCommand(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void TDb::SetThreadColumns(PGresult * r)
|
||||||
|
{
|
||||||
|
cfile_id = AssertColumn(r, "file_id");
|
||||||
|
creplies = AssertColumn(r, "replies");
|
||||||
|
cclosed = AssertColumn(r, "closed");
|
||||||
|
clast_item = AssertColumn(r, "last_item");
|
||||||
|
cdate_modification = AssertColumn(r, "date_modification");
|
||||||
|
cuser_id = AssertColumn(r, "user_id");
|
||||||
|
cguest = AssertColumn(r, "guest_name");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TDb::SetThread(PGresult * r, int col, Thread & thread)
|
||||||
|
{
|
||||||
|
thread.file_id = AssertValueLong(r, col, cfile_id);
|
||||||
|
thread.replies = AssertValueLong(r, col, creplies);
|
||||||
|
thread.closed = AssertValueBool(r, col, cclosed);
|
||||||
|
thread.last_item_id = AssertValueLong(r, col, clast_item);
|
||||||
|
thread.last_item_date_modification = AssertValueTm(r, col, cdate_modification);
|
||||||
|
thread.last_item_user_id = AssertValueLong(r, col, cuser_id);
|
||||||
|
AssertValueWide(r, col, cguest, thread.last_item_guest_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Error TDb::GetThreadByFileId(long file_id, Thread & thread)
|
||||||
{
|
{
|
||||||
PGresult * r = 0;
|
PGresult * r = 0;
|
||||||
Error status = WINIX_ERR_OK;
|
Error status = WINIX_ERR_OK;
|
||||||
|
@ -25,10 +66,10 @@ Error Db::GetThreadByDirId(long dir_id, Thread & thread)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
query.Clear();
|
query.Clear();
|
||||||
query << R("select thread.id, thread.parent_id, thread.dir_id, thread.closed, thread.items, "
|
query << R("select thread.file_id, thread.replies, thread.closed, thread.last_item, "
|
||||||
"thread.last_item, item.date_modification, item.user_id "
|
"item.date_modification, item.user_id, item.guest_name "
|
||||||
"from core.thread left join core.item on thread.last_item = item.id "
|
"from plugins.thread left join core.item on thread.last_item = item.id "
|
||||||
"where thread.dir_id = ") << dir_id << R(";");
|
"where thread.file_id = ") << file_id << R(";");
|
||||||
|
|
||||||
r = AssertQuery(query);
|
r = AssertQuery(query);
|
||||||
AssertResult(r, PGRES_TUPLES_OK);
|
AssertResult(r, PGRES_TUPLES_OK);
|
||||||
|
@ -36,29 +77,13 @@ Error Db::GetThreadByDirId(long dir_id, Thread & thread)
|
||||||
int rows = Rows(r);
|
int rows = Rows(r);
|
||||||
|
|
||||||
if( rows > 1 )
|
if( rows > 1 )
|
||||||
log << log1 << "Db: there is more than one thread with dir_id: " << dir_id << logend;
|
log << log1 << "ThreadDb: there is more than one thread with file_id: " << file_id << logend;
|
||||||
else
|
else
|
||||||
if( rows == 0 )
|
if( rows == 0 )
|
||||||
throw Error(WINIX_ERR_NO_THREAD);
|
throw Error(WINIX_ERR_NO_THREAD);
|
||||||
|
|
||||||
int cid = AssertColumn(r, "id");
|
SetThreadColumns(r);
|
||||||
int cparent_id = AssertColumn(r, "parent_id");
|
SetThread(r, 0, thread);
|
||||||
int cdir_id = AssertColumn(r, "dir_id");
|
|
||||||
int cclosed = AssertColumn(r, "closed");
|
|
||||||
int citems = AssertColumn(r, "items");
|
|
||||||
int clast_item = AssertColumn(r, "last_item");
|
|
||||||
|
|
||||||
int cdate_modification = PQfnumber(r, "date_modification"); // !! tych kolumn mo¿e nie byæ? czemu PQfnumber a nie AssertColumn?
|
|
||||||
int cuser_id = PQfnumber(r, "user_id");
|
|
||||||
|
|
||||||
thread.id = AssertValueLong(r, 0, cid);
|
|
||||||
thread.parent_id = AssertValueLong(r, 0, cparent_id);
|
|
||||||
thread.dir_id = AssertValueLong(r, 0, cdir_id);
|
|
||||||
thread.closed = AssertValueLong(r, 0, cclosed) == 0 ? false : true;
|
|
||||||
thread.items = AssertValueLong(r, 0, citems);
|
|
||||||
thread.last_item.id = AssertValueLong(r, 0, clast_item);
|
|
||||||
thread.last_item.date_modification = AssertValueTm(r, 0, cdate_modification);
|
|
||||||
thread.last_item.user_id = AssertValueLong(r, 0, cuser_id);
|
|
||||||
}
|
}
|
||||||
catch(const Error & e)
|
catch(const Error & e)
|
||||||
{
|
{
|
||||||
|
@ -72,49 +97,36 @@ return status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Error Db::GetThreads(long parent_id, std::vector<Thread> & thread_tab)
|
Error TDb::GetThreads(const std::vector<long> & file_id_tab, std::vector<Thread> & thread_tab)
|
||||||
{
|
{
|
||||||
PGresult * r = 0;
|
PGresult * r = 0;
|
||||||
Error status = WINIX_ERR_OK;
|
Error status = WINIX_ERR_OK;
|
||||||
|
thread_tab.clear();
|
||||||
|
|
||||||
|
if( file_id_tab.empty() )
|
||||||
|
return status;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
CreateIdList(file_id_tab, list_id);
|
||||||
|
|
||||||
|
// should be sorted by file_id (is used in binary search later)
|
||||||
query.Clear();
|
query.Clear();
|
||||||
query << R("select thread.id, thread.parent_id, thread.dir_id, thread.closed, "
|
query << R("select thread.file_id, thread.replies, thread.closed, thread.last_item, "
|
||||||
"thread.items, thread.last_item, item.date_modification, item.user_id, item.guest_name "
|
"item.date_modification, item.user_id, item.guest_name "
|
||||||
"from core.thread left join core.item on thread.last_item = item.id "
|
"from plugins.thread left join core.item on thread.last_item = item.id "
|
||||||
"where thread.parent_id = ") << parent_id << R(" order by date_modification asc;");
|
"where thread.file_id in ") << R(list_id) << R(" order by file_id asc;");
|
||||||
|
|
||||||
r = AssertQuery(query);
|
r = AssertQuery(query);
|
||||||
AssertResult(r, PGRES_TUPLES_OK);
|
AssertResult(r, PGRES_TUPLES_OK);
|
||||||
|
|
||||||
int rows = Rows(r);
|
int rows = Rows(r);
|
||||||
Thread thread;
|
SetThreadColumns(r);
|
||||||
|
|
||||||
int cid = AssertColumn(r, "id");
|
|
||||||
int cparent_id = AssertColumn(r, "parent_id");
|
|
||||||
int cdir_id = AssertColumn(r, "dir_id");
|
|
||||||
int cclosed = AssertColumn(r, "closed");
|
|
||||||
int citems = AssertColumn(r, "items");
|
|
||||||
int clast_item = AssertColumn(r, "last_item");
|
|
||||||
int cdate_modification = PQfnumber(r, "date_modification"); // !! czemu tutaj jest pqfnumber zamiast assertcolumn?
|
|
||||||
int cuser_id = PQfnumber(r, "user_id");
|
|
||||||
int cguest_name = PQfnumber(r, "guest_name");
|
|
||||||
|
|
||||||
|
|
||||||
for(int i=0 ; i<rows ; ++i)
|
for(int i=0 ; i<rows ; ++i)
|
||||||
{
|
{
|
||||||
thread.id = AssertValueLong(r, i, cid);
|
SetThread(r, i, thread_temp);
|
||||||
thread.parent_id = AssertValueLong(r, i, cparent_id);
|
thread_tab.push_back(thread_temp);
|
||||||
thread.dir_id = AssertValueLong(r, i, cdir_id);
|
|
||||||
thread.closed = AssertValueLong(r, i, cclosed) == 0 ? false : true;
|
|
||||||
thread.items = AssertValueLong(r, i, citems);
|
|
||||||
thread.last_item.id = AssertValueLong(r, i, clast_item);
|
|
||||||
thread.last_item.date_modification = AssertValueTm(r, i, cdate_modification);
|
|
||||||
thread.last_item.user_id = AssertValueLong(r, i, cuser_id);
|
|
||||||
thread.last_item.guest_name = AssertValueWide(r, i, cguest_name);
|
|
||||||
|
|
||||||
thread_tab.push_back(thread);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(const Error & e)
|
catch(const Error & e)
|
||||||
|
@ -129,82 +141,76 @@ return status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Error TDb::GetAnswers(long file_id, std::vector<long> & answer_id_tab)
|
||||||
|
|
||||||
Error Db::AddThread(Thread & thread)
|
|
||||||
{
|
{
|
||||||
PGresult * r = 0;
|
PGresult * r = 0;
|
||||||
Error status = WINIX_ERR_OK;
|
Error status = WINIX_ERR_OK;
|
||||||
|
answer_id_tab.clear();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
query.Clear();
|
query.Clear();
|
||||||
query << R("insert into core.thread (parent_id, dir_id, closed, items, last_item) values (")
|
query << R("select answer_id from plugins.thread_files "
|
||||||
<< thread.parent_id
|
"where file_id = ") << file_id << R(";");
|
||||||
<< thread.dir_id
|
|
||||||
<< (thread.closed ? 1 : 0 )
|
r = AssertQuery(query);
|
||||||
<< thread.items
|
AssertResult(r, PGRES_TUPLES_OK);
|
||||||
<< thread.last_item.id
|
|
||||||
|
int rows = Rows(r);
|
||||||
|
answer_id_tab.resize(rows);
|
||||||
|
|
||||||
|
for(int i=0 ; i<rows ; ++i)
|
||||||
|
answer_id_tab[i] = AssertValueLong(r, i, 0);
|
||||||
|
}
|
||||||
|
catch(const Error & e)
|
||||||
|
{
|
||||||
|
status = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearResult(r);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Error TDb::EditThreadAddItem(long file_id, long item_id)
|
||||||
|
{
|
||||||
|
query.Clear();
|
||||||
|
query << R("insert into plugins.thread_files (file_id, answer_id) values (")
|
||||||
|
<< file_id
|
||||||
|
<< item_id
|
||||||
<< R(");");
|
<< R(");");
|
||||||
|
|
||||||
r = AssertQuery(query);
|
Error status = DoCommand(query);
|
||||||
AssertResult(r, PGRES_COMMAND_OK);
|
|
||||||
|
|
||||||
thread.id = AssertCurrval("core.thread_id_seq");
|
if( status != WINIX_ERR_OK )
|
||||||
}
|
return status;
|
||||||
catch(const Error & e)
|
|
||||||
{
|
|
||||||
status = e;
|
|
||||||
}
|
|
||||||
|
|
||||||
ClearResult(r);
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Error Db::EditThreadAddItem(long dir_id, long item_id)
|
|
||||||
{
|
|
||||||
PGresult * r = 0;
|
|
||||||
Error status = WINIX_ERR_OK;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
query.Clear();
|
query.Clear();
|
||||||
query << R("update core.thread set (last_item, items) = (")
|
query << R("update plugins.thread set (last_item, replies) = (")
|
||||||
<< item_id
|
<< item_id
|
||||||
<< R(", items+1) where dir_id=")
|
<< R(", replies+1) where file_id=")
|
||||||
<< dir_id
|
<< file_id
|
||||||
<< R(";");
|
<< R(";");
|
||||||
|
|
||||||
r = AssertQuery(query);
|
return DoCommand(query);
|
||||||
AssertResult(r, PGRES_COMMAND_OK);
|
|
||||||
}
|
|
||||||
catch(const Error & e)
|
|
||||||
{
|
|
||||||
status = e;
|
|
||||||
}
|
|
||||||
|
|
||||||
ClearResult(r);
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Error Db::EditThreadRemoveItem(long dir_id)
|
long TDb::FindLastItem(long file_id)
|
||||||
{
|
{
|
||||||
PGresult * r = 0;
|
PGresult * r = 0;
|
||||||
Error status = WINIX_ERR_OK;
|
Error status = WINIX_ERR_OK;
|
||||||
|
long last_item_id = -1;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
long last_item_id = -1;
|
|
||||||
|
|
||||||
query.Clear();
|
query.Clear();
|
||||||
query << R("select id from core.item where parent_id=")
|
query << R("select id from plugins.thread_files left join core.item on item.id=answer_id where file_id=")
|
||||||
<< dir_id
|
<< file_id
|
||||||
<< R(" order by date_creation desc limit 1;");
|
<< R(" order by date_creation desc limit 1;");
|
||||||
|
|
||||||
r = AssertQuery(query);
|
r = AssertQuery(query);
|
||||||
|
@ -212,18 +218,6 @@ Error Db::EditThreadRemoveItem(long dir_id)
|
||||||
|
|
||||||
if( Rows(r) == 1 )
|
if( Rows(r) == 1 )
|
||||||
last_item_id = AssertValueLong(r, 0, 0);
|
last_item_id = AssertValueLong(r, 0, 0);
|
||||||
|
|
||||||
ClearResult(r);
|
|
||||||
|
|
||||||
query.Clear();
|
|
||||||
query << R("update core.thread set (items, last_item) = (items-1,")
|
|
||||||
<< last_item_id
|
|
||||||
<< R(") where dir_id=")
|
|
||||||
<< dir_id
|
|
||||||
<< R(";");
|
|
||||||
|
|
||||||
r = AssertQuery(query);
|
|
||||||
AssertResult(r, PGRES_COMMAND_OK);
|
|
||||||
}
|
}
|
||||||
catch(const Error & e)
|
catch(const Error & e)
|
||||||
{
|
{
|
||||||
|
@ -232,13 +226,92 @@ Error Db::EditThreadRemoveItem(long dir_id)
|
||||||
|
|
||||||
ClearResult(r);
|
ClearResult(r);
|
||||||
|
|
||||||
|
return last_item_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Error TDb::EditThreadRemoveItem(long item_id)
|
||||||
|
{
|
||||||
|
PGresult * r1 = 0;
|
||||||
|
PGresult * r2 = 0;
|
||||||
|
Error status = WINIX_ERR_OK;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// selecting files which have item_id as an answer
|
||||||
|
query.Clear();
|
||||||
|
query << R("select file_id from plugins.thread_files where answer_id = ")
|
||||||
|
<< item_id
|
||||||
|
<< R(";");
|
||||||
|
|
||||||
|
r1 = AssertQuery(query);
|
||||||
|
AssertResult(r1, PGRES_TUPLES_OK);
|
||||||
|
|
||||||
|
int rows = Rows(r1);
|
||||||
|
file_id_tab.resize(rows);
|
||||||
|
|
||||||
|
for(int i=0 ; i<rows ; ++i)
|
||||||
|
file_id_tab[i] = AssertValueLong(r1, i, 0);
|
||||||
|
|
||||||
|
// deleting those answers
|
||||||
|
query.Clear();
|
||||||
|
query << R("delete from plugins.thread_files where answer_id = ")
|
||||||
|
<< item_id
|
||||||
|
<< R(";");
|
||||||
|
|
||||||
|
r2 = AssertQuery(query);
|
||||||
|
AssertResult(r2, PGRES_COMMAND_OK);
|
||||||
|
|
||||||
|
rows = AffectedRows(r2);
|
||||||
|
|
||||||
|
if( rows > 0 )
|
||||||
|
log << log2 << "ThreadDb: deleted " << rows << " rows from plugins.thread_files" << logend;
|
||||||
|
|
||||||
|
// setting new last_items to the files
|
||||||
|
status = EditThreadRecalcFiles(file_id_tab);
|
||||||
|
}
|
||||||
|
catch(const Error & e)
|
||||||
|
{
|
||||||
|
status = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearResult(r1);
|
||||||
|
ClearResult(r2);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Error TDb::EditThreadRecalcFiles(const std::vector<long> & file_id_tab)
|
||||||
|
{
|
||||||
|
for(size_t i=0 ; i<file_id_tab.size() ; ++i)
|
||||||
|
{
|
||||||
|
long file_id = file_id_tab[i];
|
||||||
|
long last_item_id = FindLastItem(file_id);
|
||||||
|
|
||||||
Error Db::RemoveThread(long dir_id)
|
query.Clear();
|
||||||
|
query << R("update plugins.thread set (replies, last_item) = (replies-1,")
|
||||||
|
<< last_item_id
|
||||||
|
<< R(") where file_id=")
|
||||||
|
<< file_id
|
||||||
|
<< R(";");
|
||||||
|
|
||||||
|
Error status = DoCommand(query);
|
||||||
|
|
||||||
|
if( status != WINIX_ERR_OK )
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
return WINIX_ERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Error TDb::RemoveThread(long file_id)
|
||||||
{
|
{
|
||||||
PGresult * r = 0;
|
PGresult * r = 0;
|
||||||
Error status = WINIX_ERR_OK;
|
Error status = WINIX_ERR_OK;
|
||||||
|
@ -246,7 +319,7 @@ Error Db::RemoveThread(long dir_id)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
query.Clear();
|
query.Clear();
|
||||||
query << R("delete from core.thread where dir_id=") << dir_id << R(";");
|
query << R("delete from plugins.thread where file_id=") << file_id << R(";");
|
||||||
|
|
||||||
r = AssertQuery(query);
|
r = AssertQuery(query);
|
||||||
AssertResult(r, PGRES_COMMAND_OK);
|
AssertResult(r, PGRES_COMMAND_OK);
|
||||||
|
@ -254,7 +327,20 @@ Error Db::RemoveThread(long dir_id)
|
||||||
long rows = AffectedRows(r);
|
long rows = AffectedRows(r);
|
||||||
|
|
||||||
if( rows > 0 )
|
if( rows > 0 )
|
||||||
log << log2 << "Db: deleted " << rows << " rows from core.thread" << logend;
|
log << log2 << "ThreadDb: deleted " << rows << " rows from plugins.thread" << logend;
|
||||||
|
|
||||||
|
ClearResult(r);
|
||||||
|
|
||||||
|
query.Clear();
|
||||||
|
query << R("delete from plugins.thread_files where file_id=") << file_id << R(";");
|
||||||
|
|
||||||
|
r = AssertQuery(query);
|
||||||
|
AssertResult(r, PGRES_COMMAND_OK);
|
||||||
|
|
||||||
|
rows = AffectedRows(r);
|
||||||
|
|
||||||
|
if( rows > 0 )
|
||||||
|
log << log2 << "ThreadDb: deleted " << rows << " rows from plugins.thread_files" << logend;
|
||||||
}
|
}
|
||||||
catch(const Error & e)
|
catch(const Error & e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "ticket.h"
|
#include "thread.h"
|
||||||
#include "db/dbbase.h"
|
#include "db/dbbase.h"
|
||||||
#include "core/error.h"
|
#include "core/error.h"
|
||||||
|
|
||||||
|
@ -25,17 +25,26 @@ class TDb : public DbBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Error AddThread(Thread & thread);
|
Error AddThread(const Thread & thread);
|
||||||
Error GetThreadByDirId(long dir_id, Thread & thread);
|
Error GetThreadByFileId(long file_id, Thread & thread);
|
||||||
Error GetThreads(long parent_id, std::vector<Thread> & thread_tab);
|
Error GetThreads(const std::vector<long> & file_id_tab, std::vector<Thread> & thread_tab);
|
||||||
Error EditThreadAddItem(long dir_id, long item_id);
|
Error GetAnswers(long file_id, std::vector<long> & answer_id_tab);
|
||||||
Error EditThreadRemoveItem(long dir_id);
|
Error EditThreadAddItem(long file_id, long item_id);
|
||||||
Error RemoveThread(long dir_id);
|
Error EditThreadRemoveItem(long file_id);
|
||||||
|
Error RemoveThread(long file_id);
|
||||||
|
long FindLastItem(long file_id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
DbTextStream query;
|
DbTextStream query;
|
||||||
|
std::wstring list_id;
|
||||||
|
int cfile_id, creplies, cclosed, clast_item, cdate_modification, cuser_id, cguest;
|
||||||
|
Thread thread_temp;
|
||||||
|
std::vector<long> file_id_tab;
|
||||||
|
|
||||||
|
void SetThreadColumns(PGresult * r);
|
||||||
|
void SetThread(PGresult * r, int col, Thread & thread);
|
||||||
|
Error EditThreadRecalcFiles(const std::vector<long> & file_id_tab);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,15 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "templates.h"
|
#include "threadinfo.h"
|
||||||
#include "misc.h"
|
#include "reply.h"
|
||||||
|
#include "funthread.h"
|
||||||
|
#include "createthread.h"
|
||||||
|
#include "showthreads.h"
|
||||||
#include "core/request.h"
|
#include "core/request.h"
|
||||||
#include "core/misc.h"
|
#include "core/misc.h"
|
||||||
|
#include "core/plugin.h"
|
||||||
|
#include "templates/templates.h"
|
||||||
#include "functions/functions.h"
|
#include "functions/functions.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,188 +27,497 @@ using TemplatesFunctions::system;
|
||||||
|
|
||||||
|
|
||||||
extern ThreadInfo thread_info;
|
extern ThreadInfo thread_info;
|
||||||
|
extern Reply fun_reply;
|
||||||
extern FunThread fun_thread;
|
extern FunThread fun_thread;
|
||||||
extern CreateThread fun_create_thread;
|
extern CreateThread fun_create_thread;
|
||||||
extern ShowThreads fun_show_threads;
|
extern ShowThreads fun_show_threads;
|
||||||
|
|
||||||
|
|
||||||
|
static size_t item_sort_index;
|
||||||
|
static HtmlTextStream item_run_content;
|
||||||
|
static EzcGen ezc_generator;
|
||||||
|
static bool has_thread;
|
||||||
|
static size_t thread_index;
|
||||||
|
|
||||||
void thread_is(Info & i)
|
|
||||||
|
|
||||||
|
// binary search for file_id in thread_tab (thread_tab must be sorted by id)
|
||||||
|
bool FindThread(const std::vector<Thread> & thread_tab, long file_id, size_t & thread_index)
|
||||||
{
|
{
|
||||||
i.res = functions->fun_thread.is_thread;
|
if( thread_tab.empty() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
size_t o1 = 0;
|
||||||
|
size_t o2 = thread_tab.size() - 1;
|
||||||
|
|
||||||
|
if( thread_tab[o1].file_id == file_id )
|
||||||
|
{
|
||||||
|
thread_index = o1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( file_id < thread_tab[o1].file_id )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( thread_tab[o2].file_id == file_id )
|
||||||
|
{
|
||||||
|
thread_index = o2;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( file_id > thread_tab[o2].file_id )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
while( o1 + 1 < o2 )
|
||||||
|
{
|
||||||
|
thread_index = (o1 + o2) / 2;
|
||||||
|
|
||||||
|
if( thread_tab[thread_index].file_id == file_id )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if( thread_tab[thread_index].file_id < file_id )
|
||||||
|
o1 = thread_index;
|
||||||
|
else
|
||||||
|
o2 = thread_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool thread_sort_tab(size_t sort_index)
|
||||||
|
{
|
||||||
|
bool res;
|
||||||
|
|
||||||
|
item_sort_index = sort_index;
|
||||||
|
res = item_sort_index < thread_info.item_sort_tab.size();
|
||||||
|
has_thread = false;
|
||||||
|
|
||||||
|
if( res )
|
||||||
|
{
|
||||||
|
long file_id = thread_info.item_sort_tab[item_sort_index]->id;
|
||||||
|
has_thread = FindThread(thread_info.thread_tab, file_id, thread_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab(Info & i)
|
||||||
|
{
|
||||||
|
i.res = thread_sort_tab(i.iter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_id(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.out << thread_info.item_sort_tab[item_sort_index]->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_subject(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.out << thread_info.item_sort_tab[item_sort_index]->subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
void thread_sort_tab_subject_noescape(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.out << R(thread_info.item_sort_tab[item_sort_index]->subject);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_content(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.out << thread_info.item_sort_tab[item_sort_index]->content;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_content_noescape(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.out << R(thread_info.item_sort_tab[item_sort_index]->content);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_print_content(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index >= thread_info.item_sort_tab.size() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::wstring & content = thread_info.item_sort_tab[item_sort_index]->content;
|
||||||
|
Item::ContentType type = thread_info.item_sort_tab[item_sort_index]->content_type;
|
||||||
|
|
||||||
|
item_print_content(i.out, content, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_privileges(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.out << "0" << Toa(thread_info.item_sort_tab[item_sort_index]->privileges, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_dir(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
std::wstring path;
|
||||||
|
|
||||||
|
if( system->dirs.MakePath(thread_info.item_sort_tab[item_sort_index]->parent_id, path) )
|
||||||
|
i.out << path;
|
||||||
|
else
|
||||||
|
i.out << "/the path does not exist/"; // !! do konfiga
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_url(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.out << thread_info.item_sort_tab[item_sort_index]->url;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_link(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
i.out << config->base_url;
|
||||||
|
thread_sort_tab_dir(i);
|
||||||
|
thread_sort_tab_url(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_can_read(Info & i)
|
||||||
|
|
||||||
static size_t thread_tab_index;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void thread_tab(Info & i)
|
|
||||||
{
|
{
|
||||||
thread_tab_index = i.iter;
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
i.res = thread_tab_index < functions->fun_thread.thread_tab.size();
|
if( system->HasReadAccess(*thread_info.item_sort_tab[item_sort_index]) )
|
||||||
|
i.res = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void thread_tab_url(Info & i)
|
void thread_sort_tab_can_write(Info & i)
|
||||||
{
|
{
|
||||||
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
{
|
i.res = system->HasWriteAccess(*thread_info.item_sort_tab[item_sort_index]);
|
||||||
Item * dir = system->dirs.GetDir( functions->fun_thread.thread_tab[thread_tab_index].dir_id );
|
}
|
||||||
|
|
||||||
if( dir )
|
|
||||||
|
void thread_sort_tab_user(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
{
|
{
|
||||||
i.out << dir->url;
|
User * puser = system->users.GetUser(thread_info.item_sort_tab[item_sort_index]->user_id);
|
||||||
|
print_user_name(i, puser, thread_info.item_sort_tab[item_sort_index]->guest_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_modification_user(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
User * puser = system->users.GetUser(thread_info.item_sort_tab[item_sort_index]->modification_user_id);
|
||||||
|
print_user_name(i, puser, thread_info.item_sort_tab[item_sort_index]->guest_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_users_different(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
i.res = (thread_info.item_sort_tab[item_sort_index]->user_id != thread_info.item_sort_tab[item_sort_index]->modification_user_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_group(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
long group_id = thread_info.item_sort_tab[item_sort_index]->group_id;
|
||||||
|
Group * pgroup = system->groups.GetGroup(group_id);
|
||||||
|
|
||||||
|
if( pgroup )
|
||||||
|
i.out << pgroup->name;
|
||||||
|
else
|
||||||
|
i.out << group_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_date_creation(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
tm rtm = system->LocalTime(thread_info.item_sort_tab[item_sort_index]->date_creation);
|
||||||
|
i.out << DateToStr(rtm.tm_year + 1900, rtm.tm_mon + 1, rtm.tm_mday, rtm.tm_hour, rtm.tm_min, rtm.tm_sec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_date_modification(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
tm rtm = system->LocalTime(thread_info.item_sort_tab[item_sort_index]->date_modification);
|
||||||
|
i.out << DateToStr(rtm.tm_year + 1900, rtm.tm_mon + 1, rtm.tm_mday, rtm.tm_hour, rtm.tm_min, rtm.tm_sec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_date_creation_nice(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
print_date_nice(i, thread_info.item_sort_tab[item_sort_index]->date_creation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_date_modification_nice(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
print_date_nice(i, thread_info.item_sort_tab[item_sort_index]->date_modification);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_dates_equal(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
tm * ptm1 = &thread_info.item_sort_tab[item_sort_index]->date_creation;
|
||||||
|
tm * ptm2 = &thread_info.item_sort_tab[item_sort_index]->date_modification;
|
||||||
|
|
||||||
|
i.res = ptm1->tm_year == ptm2->tm_year &&
|
||||||
|
ptm1->tm_mon == ptm2->tm_mon &&
|
||||||
|
ptm1->tm_mday == ptm2->tm_mday &&
|
||||||
|
ptm1->tm_hour == ptm2->tm_hour &&
|
||||||
|
ptm1->tm_min == ptm2->tm_min &&
|
||||||
|
ptm1->tm_sec == ptm2->tm_sec;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_run(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
if( system->HasReadExecAccess(*thread_info.item_sort_tab[item_sort_index]) )
|
||||||
|
{
|
||||||
|
Ezc::Pattern * p = pattern_cacher.GetPattern(*thread_info.item_sort_tab[item_sort_index]);
|
||||||
|
|
||||||
|
item_run_content.Clear();
|
||||||
|
ezc_generator.Generate(item_run_content, *p);
|
||||||
|
|
||||||
|
item_print_content(i.out, item_run_content.Str(), thread_info.item_sort_tab[item_sort_index]->content_type);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
i.out << "<!-- unknown directory -->"; // !! do konfiga
|
i.out << "<!-- run: permission denied -->";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void thread_tab_subject(Info & i)
|
|
||||||
{
|
|
||||||
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
|
|
||||||
{
|
|
||||||
Item * dir = system->dirs.GetDir( functions->fun_thread.thread_tab[thread_tab_index].dir_id );
|
|
||||||
|
|
||||||
if( dir )
|
void thread_sort_tab_has_static_file(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
{
|
{
|
||||||
if( !dir->subject.empty() )
|
i.res = thread_info.item_sort_tab[item_sort_index]->file_type != WINIX_ITEM_FILETYPE_NONE &&
|
||||||
i.out << dir->subject;
|
!thread_info.item_sort_tab[item_sort_index]->file_path.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_has_thumb(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.res = thread_info.item_sort_tab[item_sort_index]->has_thumb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_type_is_dir(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.res = thread_info.item_sort_tab[item_sort_index]->type == Item::dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_type_is_file(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.res = thread_info.item_sort_tab[item_sort_index]->type == Item::file;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_type_is_symlink(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.res = thread_info.item_sort_tab[item_sort_index]->type == Item::symlink;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_is_link_to(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.res = !thread_info.item_sort_tab[item_sort_index]->link_to.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_link_to(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.out << thread_info.item_sort_tab[item_sort_index]->link_to;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_is_link_redirect(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
i.res = thread_info.item_sort_tab[item_sort_index]->link_redirect == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_has_thread(Info & i)
|
||||||
|
{
|
||||||
|
i.res = has_thread;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_replies(Info & i)
|
||||||
|
{
|
||||||
|
if( has_thread && thread_index < thread_info.thread_tab.size() )
|
||||||
|
i.out << thread_info.thread_tab[thread_index].replies;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_last_item_date_modification_nice(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
if( has_thread && thread_index < thread_info.thread_tab.size() )
|
||||||
|
{
|
||||||
|
Thread & thread = thread_info.thread_tab[thread_index];
|
||||||
|
|
||||||
|
if( thread.last_item_id != -1 )
|
||||||
|
print_date_nice(i, thread.last_item_date_modification);
|
||||||
else
|
else
|
||||||
i.out << dir->url;
|
print_date_nice(i, thread_info.item_sort_tab[item_sort_index]->date_modification);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void thread_sort_tab_last_item_user(Info & i)
|
||||||
|
{
|
||||||
|
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||||
|
{
|
||||||
|
if( has_thread && thread_index < thread_info.thread_tab.size() )
|
||||||
|
{
|
||||||
|
Thread & thread = thread_info.thread_tab[thread_index];
|
||||||
|
|
||||||
|
if( thread.last_item_id != -1 )
|
||||||
|
{
|
||||||
|
User * puser = system->users.GetUser(thread.last_item_user_id);
|
||||||
|
print_user_name(i, puser, thread.last_item_guest_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
i.out << "<!-- unknown subject -->"; // !! do konfiga
|
User * puser = system->users.GetUser(thread_info.item_sort_tab[item_sort_index]->user_id);
|
||||||
|
print_user_name(i, puser, thread_info.item_sort_tab[item_sort_index]->guest_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void thread_tab_answers(Info & i)
|
void thread_can_reply(Info & i)
|
||||||
{
|
{
|
||||||
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
|
i.res = fun_reply.HasAccess();
|
||||||
{
|
|
||||||
long a = functions->fun_thread.thread_tab[thread_tab_index].items;
|
|
||||||
|
|
||||||
// the first is created by the author
|
|
||||||
// we count only the rest
|
|
||||||
if( a > 0 )
|
|
||||||
--a;
|
|
||||||
|
|
||||||
i.out << a;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void thread_tab_author(Info & i)
|
|
||||||
{
|
|
||||||
bool unknown = true;
|
|
||||||
|
|
||||||
|
|
||||||
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
|
|
||||||
{
|
|
||||||
Item * dir = system->dirs.GetDir( functions->fun_thread.thread_tab[thread_tab_index].dir_id );
|
|
||||||
|
|
||||||
if( dir )
|
|
||||||
{
|
|
||||||
User * puser = system->users.GetUser(dir->user_id);
|
|
||||||
unknown = false;
|
|
||||||
|
|
||||||
if( puser )
|
|
||||||
i.out << puser->name;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
i.out << "~";
|
|
||||||
|
|
||||||
if( !dir->guest_name.empty() )
|
|
||||||
i.out << dir->guest_name;
|
|
||||||
else
|
|
||||||
i.out << "guest"; // !! dodac do konfiga
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if( unknown )
|
|
||||||
{
|
|
||||||
i.out << "<!-- unknown user -->";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void thread_tab_last_item_date_modification(Info & i)
|
|
||||||
{
|
|
||||||
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
|
|
||||||
if( functions->fun_thread.thread_tab[thread_tab_index].last_item.id != -1 )
|
|
||||||
i.out << DateToStr( &functions->fun_thread.thread_tab[thread_tab_index].last_item.date_modification );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void thread_tab_last_item_date_modification_nice(Info & i)
|
|
||||||
{
|
|
||||||
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
|
|
||||||
if( functions->fun_thread.thread_tab[thread_tab_index].last_item.id != -1 )
|
|
||||||
print_date_nice(i, functions->fun_thread.thread_tab[thread_tab_index].last_item.date_modification);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void thread_tab_last_item_user(Info & i)
|
|
||||||
{
|
|
||||||
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
|
|
||||||
{
|
|
||||||
if( functions->fun_thread.thread_tab[thread_tab_index].last_item.id != -1 )
|
|
||||||
{
|
|
||||||
User * puser = system->users.GetUser( functions->fun_thread.thread_tab[thread_tab_index].last_item.user_id );
|
|
||||||
|
|
||||||
if( puser )
|
|
||||||
i.out << puser->name;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
i.out << "~";
|
|
||||||
|
|
||||||
if( !functions->fun_thread.thread_tab[thread_tab_index].last_item.guest_name.empty() )
|
|
||||||
i.out << functions->fun_thread.thread_tab[thread_tab_index].last_item.guest_name;
|
|
||||||
else
|
|
||||||
i.out << "guest"; // !! dodac do konfiga
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void thread_can_create(Info & i)
|
void thread_can_create(Info & i)
|
||||||
{
|
{
|
||||||
i.res = functions->fun_createthread.HasAccess(true);
|
i.res = fun_create_thread.HasAccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AddEzcFunctions(PluginInfo & info)
|
void AddEzcFunctions(PluginInfo & info)
|
||||||
{
|
{
|
||||||
using TemplatesFunctions::EzcFun;
|
using TemplatesFunctions::EzcFun;
|
||||||
EzcFun * fun = reinterpret_cast<EzcFun*>(info.p1);
|
EzcFun * fun = reinterpret_cast<EzcFun*>(info.p1);
|
||||||
|
|
||||||
fun->Insert("thread_is", thread_is);
|
fun->Insert("thread_sort_tab", thread_sort_tab);
|
||||||
fun->Insert("thread_tab", thread_tab);
|
fun->Insert("thread_sort_tab_id", thread_sort_tab_id);
|
||||||
fun->Insert("thread_tab_url", thread_tab_url);
|
fun->Insert("thread_sort_tab_subject", thread_sort_tab_subject);
|
||||||
fun->Insert("thread_tab_subject", thread_tab_subject);
|
fun->Insert("thread_sort_tab_subject_noescape", thread_sort_tab_subject_noescape);
|
||||||
fun->Insert("thread_tab_author", thread_tab_author);
|
fun->Insert("thread_sort_tab_content", thread_sort_tab_content);
|
||||||
fun->Insert("thread_tab_answers", thread_tab_answers);
|
fun->Insert("thread_sort_tab_content_noescape", thread_sort_tab_content_noescape);
|
||||||
fun->Insert("thread_tab_last_item_date_modification", thread_tab_last_item_date_modification);
|
fun->Insert("thread_sort_tab_print_content", thread_sort_tab_print_content);
|
||||||
fun->Insert("thread_tab_last_item_date_modification_nice", thread_tab_last_item_date_modification_nice);
|
fun->Insert("thread_sort_tab_privileges", thread_sort_tab_privileges);
|
||||||
fun->Insert("thread_tab_last_item_user", thread_tab_last_item_user);
|
fun->Insert("thread_sort_tab_dir", thread_sort_tab_dir);
|
||||||
fun->Insert("thread_can_create", thread_can_create);
|
fun->Insert("thread_sort_tab_url", thread_sort_tab_url);
|
||||||
|
fun->Insert("thread_sort_tab_link", thread_sort_tab_link);
|
||||||
|
fun->Insert("thread_sort_tab_can_read", thread_sort_tab_can_read);
|
||||||
|
fun->Insert("thread_sort_tab_can_write", thread_sort_tab_can_write);
|
||||||
|
fun->Insert("thread_sort_tab_user", thread_sort_tab_user);
|
||||||
|
fun->Insert("thread_sort_tab_modification_user", thread_sort_tab_modification_user);
|
||||||
|
fun->Insert("thread_sort_tab_users_different", thread_sort_tab_users_different);
|
||||||
|
fun->Insert("thread_sort_tab_group", thread_sort_tab_group);
|
||||||
|
fun->Insert("thread_sort_tab_date_creation", thread_sort_tab_date_creation);
|
||||||
|
fun->Insert("thread_sort_tab_date_modification", thread_sort_tab_date_modification);
|
||||||
|
fun->Insert("thread_sort_tab_date_creation_nice", thread_sort_tab_date_creation_nice);
|
||||||
|
fun->Insert("thread_sort_tab_date_modification_nice", thread_sort_tab_date_modification_nice);
|
||||||
|
fun->Insert("thread_sort_tab_dates_equal", thread_sort_tab_dates_equal);
|
||||||
|
fun->Insert("thread_sort_tab_run", thread_sort_tab_run);
|
||||||
|
fun->Insert("thread_sort_tab_has_static_file", thread_sort_tab_has_static_file);
|
||||||
|
fun->Insert("thread_sort_tab_has_thumb", thread_sort_tab_has_thumb);
|
||||||
|
fun->Insert("thread_sort_tab_type_is_dir", thread_sort_tab_type_is_dir);
|
||||||
|
fun->Insert("thread_sort_tab_type_is_file", thread_sort_tab_type_is_file);
|
||||||
|
fun->Insert("thread_sort_tab_type_is_symlink", thread_sort_tab_type_is_symlink);
|
||||||
|
fun->Insert("thread_sort_tab_is_link_to", thread_sort_tab_is_link_to);
|
||||||
|
fun->Insert("thread_sort_tab_link_to", thread_sort_tab_link_to);
|
||||||
|
fun->Insert("thread_sort_tab_is_link_redirect", thread_sort_tab_is_link_redirect);
|
||||||
|
|
||||||
|
fun->Insert("thread_sort_tab_has_thread", thread_sort_tab_has_thread);
|
||||||
|
fun->Insert("thread_sort_tab_replies", thread_sort_tab_replies);
|
||||||
|
fun->Insert("thread_sort_tab_last_item_date_modification_nice", thread_sort_tab_last_item_date_modification_nice);
|
||||||
|
fun->Insert("thread_sort_tab_last_item_user", thread_sort_tab_last_item_user);
|
||||||
|
|
||||||
|
fun->Insert("thread_can_reply", thread_can_reply);
|
||||||
|
fun->Insert("thread_can_create", thread_can_create);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of Winix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef headerfile_winix_plugins_thread_templates
|
||||||
|
#define headerfile_winix_plugins_thread_templates
|
||||||
|
|
||||||
|
#include "core/plugin.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Thread
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
bool thread_sort_tab(size_t sort_index);
|
||||||
|
|
||||||
|
|
||||||
|
void AddEzcFunctions(PluginInfo & info);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#define headerfile_winix_plugins_thread_thread
|
#define headerfile_winix_plugins_thread_thread
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Thread
|
namespace Thread
|
||||||
|
@ -24,36 +25,32 @@ class Thread
|
||||||
public:
|
public:
|
||||||
|
|
||||||
long file_id;
|
long file_id;
|
||||||
|
long replies;
|
||||||
//long parent_id;
|
|
||||||
|
|
||||||
long dir_id;
|
|
||||||
bool closed;
|
bool closed;
|
||||||
|
|
||||||
// how many items there are inside
|
// the last file in a thread
|
||||||
long items;
|
long last_item_id;
|
||||||
|
tm last_item_date_modification;
|
||||||
|
long last_item_user_id;
|
||||||
|
std::wstring last_item_guest_name;
|
||||||
|
|
||||||
// last item in the directory (this variable is mainly for reading)
|
|
||||||
// at the moment only used: id, date_modification, user_id
|
|
||||||
Item last_item;
|
|
||||||
|
|
||||||
// used when sorting
|
|
||||||
unsigned long sort;
|
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
id = parent_id = dir_id = -1;
|
file_id = -1;
|
||||||
last_item.Clear();
|
|
||||||
closed = false;
|
closed = false;
|
||||||
items = 0;
|
replies = 0;
|
||||||
sort = 0;
|
last_item_id = -1;
|
||||||
|
last_item_user_id = -1;
|
||||||
|
memset(&last_item_date_modification, 0, sizeof(tm));
|
||||||
|
last_item_guest_name.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread()
|
Thread()
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of Winix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "threadinfo.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Thread
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
void ThreadInfo::SetSystem(System * psystem)
|
||||||
|
{
|
||||||
|
system = psystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ThreadInfo::Clear()
|
||||||
|
{
|
||||||
|
item_tab.clear();
|
||||||
|
thread_tab.clear();
|
||||||
|
item_sort_tab.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Item * ThreadInfo::FindThreadDir()
|
||||||
|
{
|
||||||
|
const std::wstring & dir_str = system->mounts.pmount->FirstArg(mount_par_thread_dir);
|
||||||
|
|
||||||
|
if( dir_str.empty() )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
int res = system->FollowAllLinks(dir_str, out_dir_tab, out_item);
|
||||||
|
|
||||||
|
if( res != 0 )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return out_dir_tab.back();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,23 +10,62 @@
|
||||||
#ifndef headerfile_winix_plugins_thread_threadinfo
|
#ifndef headerfile_winix_plugins_thread_threadinfo
|
||||||
#define headerfile_winix_plugins_thread_threadinfo
|
#define headerfile_winix_plugins_thread_threadinfo
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include "thread.h"
|
||||||
|
#include "core/item.h"
|
||||||
|
#include "core/system.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Thread
|
namespace Thread
|
||||||
{
|
{
|
||||||
|
|
||||||
|
class ThreadInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
|
||||||
// id of a mount type
|
void SetSystem(System * psystem);
|
||||||
int mount_type_thread;
|
void Clear();
|
||||||
|
Item * FindThreadDir();
|
||||||
// enable a thread in a specific directory
|
|
||||||
int mount_par_thread_enable;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// id of a mount type
|
||||||
|
int mount_type_thread;
|
||||||
|
|
||||||
|
// enable a thread in a specific directory
|
||||||
|
// and set sort type (asc, desc)
|
||||||
|
int mount_par_thread;
|
||||||
|
|
||||||
|
// a special directory in which we store the answers
|
||||||
|
int mount_par_thread_dir;
|
||||||
|
|
||||||
|
// id of the current plugin
|
||||||
|
int plugin_id;
|
||||||
|
|
||||||
|
// files in the current directory
|
||||||
|
// used for 'show_threads' or 'thread' function
|
||||||
|
std::vector<Item> item_tab;
|
||||||
|
|
||||||
|
// additional info to the above files if 'show_threads' is used
|
||||||
|
// sorted by file_id
|
||||||
|
std::vector<Thread> thread_tab;
|
||||||
|
|
||||||
|
// for sorting
|
||||||
|
std::vector<Item*> item_sort_tab;
|
||||||
|
|
||||||
|
// template index for notifications
|
||||||
|
size_t template_index;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
System * system;
|
||||||
|
|
||||||
|
std::vector<Item*> out_dir_tab;
|
||||||
|
Item out_item;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -147,6 +147,13 @@ funticket.o: ../../functions/uname.h ../../functions/upload.h
|
||||||
funticket.o: ../../functions/uptime.h ../../functions/who.h
|
funticket.o: ../../functions/uptime.h ../../functions/who.h
|
||||||
funticket.o: ../../functions/vim.h ../../core/htmlfilter.h
|
funticket.o: ../../functions/vim.h ../../core/htmlfilter.h
|
||||||
funticket.o: ../../functions/functionbase.h ../../core/synchro.h
|
funticket.o: ../../functions/functionbase.h ../../core/synchro.h
|
||||||
|
funticket.o: ../../core/plugin.h ../../core/pluginmsg.h ../../core/system.h
|
||||||
|
funticket.o: ../../core/sessionmanager.h ../../core/sessioncontainer.h
|
||||||
|
funticket.o: ../../templates/templates.h ../../templates/patterncacher.h
|
||||||
|
funticket.o: ../../templates/ckeditorgetparser.h
|
||||||
|
funticket.o: ../../core/httpsimpleparser.h ../../core/log.h
|
||||||
|
funticket.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
||||||
|
funticket.o: ../../plugins/thread/pluginmsg.h
|
||||||
init.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
|
init.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
|
||||||
init.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
|
init.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
|
||||||
init.o: ../../core/item.h ../../core/error.h ../../core/log.h
|
init.o: ../../core/item.h ../../core/error.h ../../core/log.h
|
||||||
|
@ -198,6 +205,8 @@ init.o: ../../templates/patterncacher.h ../../templates/ckeditorgetparser.h
|
||||||
init.o: ../../core/httpsimpleparser.h ../../core/log.h
|
init.o: ../../core/httpsimpleparser.h ../../core/log.h
|
||||||
init.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
init.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
||||||
init.o: sessiondata.h ../../core/plugindata.h
|
init.o: sessiondata.h ../../core/plugindata.h
|
||||||
|
init.o: ../../plugins/thread/showthreads.h ../../plugins/thread/threadinfo.h
|
||||||
|
init.o: ../../plugins/thread/thread.h ../../plugins/thread/pluginmsg.h
|
||||||
sessiondata.o: sessiondata.h ../../core/plugindata.h ticket.h
|
sessiondata.o: sessiondata.h ../../core/plugindata.h ticket.h
|
||||||
showtickets.o: showtickets.h tdb.h ticket.h ../../db/dbbase.h
|
showtickets.o: showtickets.h tdb.h ticket.h ../../db/dbbase.h
|
||||||
showtickets.o: ../../db/dbconn.h ../../db/dbtextstream.h
|
showtickets.o: ../../db/dbconn.h ../../db/dbtextstream.h
|
||||||
|
@ -247,7 +256,13 @@ showtickets.o: ../../functions/tinymce.h ../../functions/uname.h
|
||||||
showtickets.o: ../../functions/upload.h ../../functions/uptime.h
|
showtickets.o: ../../functions/upload.h ../../functions/uptime.h
|
||||||
showtickets.o: ../../functions/who.h ../../functions/vim.h
|
showtickets.o: ../../functions/who.h ../../functions/vim.h
|
||||||
showtickets.o: ../../core/htmlfilter.h ../../functions/functionbase.h
|
showtickets.o: ../../core/htmlfilter.h ../../functions/functionbase.h
|
||||||
showtickets.o: ../../core/synchro.h
|
showtickets.o: ../../core/synchro.h ../../plugins/thread/pluginmsg.h
|
||||||
|
showtickets.o: ../../core/plugin.h ../../core/pluginmsg.h ../../core/system.h
|
||||||
|
showtickets.o: ../../core/sessionmanager.h ../../core/sessioncontainer.h
|
||||||
|
showtickets.o: ../../templates/templates.h ../../templates/patterncacher.h
|
||||||
|
showtickets.o: ../../templates/ckeditorgetparser.h
|
||||||
|
showtickets.o: ../../core/httpsimpleparser.h ../../core/log.h
|
||||||
|
showtickets.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
||||||
tdb.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
|
tdb.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
|
||||||
tdb.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
|
tdb.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
|
||||||
tdb.o: ../../core/item.h ../../core/error.h ../../core/log.h
|
tdb.o: ../../core/item.h ../../core/error.h ../../core/log.h
|
||||||
|
@ -308,6 +323,7 @@ templates.o: ../../templates/ckeditorgetparser.h
|
||||||
templates.o: ../../core/httpsimpleparser.h ../../core/log.h
|
templates.o: ../../core/httpsimpleparser.h ../../core/log.h
|
||||||
templates.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
templates.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
||||||
templates.o: sessiondata.h ../../core/plugindata.h
|
templates.o: sessiondata.h ../../core/plugindata.h
|
||||||
|
templates.o: ../../plugins/thread/pluginmsg.h
|
||||||
ticketconf.o: ticketconf.h
|
ticketconf.o: ticketconf.h
|
||||||
ticketinfo.o: ticketinfo.h ticket.h ticketparser.h ticketconf.h
|
ticketinfo.o: ticketinfo.h ticket.h ticketparser.h ticketconf.h
|
||||||
ticketinfo.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
|
ticketinfo.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "funticket.h"
|
#include "funticket.h"
|
||||||
|
#include "core/plugin.h"
|
||||||
|
#include "plugins/thread/pluginmsg.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,6 +49,8 @@ void FunTicket::MakeGet()
|
||||||
ticket_info->ticket = &ticket;
|
ticket_info->ticket = &ticket;
|
||||||
|
|
||||||
tdb->GetTicket(request->item.id, ticket);
|
tdb->GetTicket(request->item.id, ticket);
|
||||||
|
|
||||||
|
plugin.Call(WINIX_PL_THREAD_PREPARE_THREAD, request->item.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
#include "core/log.h"
|
#include "core/log.h"
|
||||||
#include "core/plugin.h"
|
#include "core/plugin.h"
|
||||||
#include "sessiondata.h"
|
#include "sessiondata.h"
|
||||||
|
#include "plugins/thread/showthreads.h"
|
||||||
|
#include "plugins/thread/pluginmsg.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" void Init(PluginInfo &);
|
extern "C" void Init(PluginInfo &);
|
||||||
|
@ -116,6 +119,15 @@ void RemoveSession(PluginInfo & info)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CanUseReply(PluginInfo & info)
|
||||||
|
{
|
||||||
|
if( info.system->mounts.pmount && info.system->mounts.pmount->type == ticket_info.mount_type_ticket )
|
||||||
|
info.res = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// defined in templates.cpp
|
||||||
void AddEzcFunctions(PluginInfo & info);
|
void AddEzcFunctions(PluginInfo & info);
|
||||||
|
|
||||||
} // namespace Ticket
|
} // namespace Ticket
|
||||||
|
@ -137,6 +149,7 @@ using namespace Ticket;
|
||||||
plugin.Assign(WINIX_NOTIFY_ADD_TEMPLATE, AddNotifyTemplate);
|
plugin.Assign(WINIX_NOTIFY_ADD_TEMPLATE, AddNotifyTemplate);
|
||||||
plugin.Assign(WINIX_SESSION_CREATED, CreateSession);
|
plugin.Assign(WINIX_SESSION_CREATED, CreateSession);
|
||||||
plugin.Assign(WINIX_SESSION_REMOVE, RemoveSession);
|
plugin.Assign(WINIX_SESSION_REMOVE, RemoveSession);
|
||||||
|
plugin.Assign(WINIX_PL_THREAD_CAN_USE_REPLY, CanUseReply);
|
||||||
|
|
||||||
tdb.SetConn(info.db->GetConn());
|
tdb.SetConn(info.db->GetConn());
|
||||||
tdb.LogQueries(info.config->log_db_query);
|
tdb.LogQueries(info.config->log_db_query);
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "showtickets.h"
|
#include "showtickets.h"
|
||||||
|
#include "plugins/thread/pluginmsg.h"
|
||||||
|
#include "core/plugin.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,6 +77,11 @@ void ShowTickets::ReadFiles()
|
||||||
iq.sel_url = true;
|
iq.sel_url = true;
|
||||||
iq.sel_subject = true;
|
iq.sel_subject = true;
|
||||||
iq.sel_date = true;
|
iq.sel_date = true;
|
||||||
|
iq.sel_user_id = true;
|
||||||
|
iq.sel_group_id = true;
|
||||||
|
iq.sel_guest_name = true;
|
||||||
|
iq.sel_privileges = true;
|
||||||
|
iq.sel_date = true;
|
||||||
iq.WhereParentId(request->dir_tab.back()->id);
|
iq.WhereParentId(request->dir_tab.back()->id);
|
||||||
iq.WhereType(Item::file);
|
iq.WhereType(Item::file);
|
||||||
iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
||||||
|
@ -87,10 +94,10 @@ void ShowTickets::ReadFiles()
|
||||||
void ShowTickets::ReadTickets()
|
void ShowTickets::ReadTickets()
|
||||||
{
|
{
|
||||||
// reading tickets for the files
|
// reading tickets for the files
|
||||||
file_id_tab.resize(ticket_info->item_tab.size());
|
file_id_tab.resize(ticket_info->item_sort_tab.size());
|
||||||
|
|
||||||
for(size_t i=0 ; i<ticket_info->item_tab.size() ; ++i)
|
for(size_t i=0 ; i<ticket_info->item_sort_tab.size() ; ++i)
|
||||||
file_id_tab[i] = ticket_info->item_tab[i].id;
|
file_id_tab[i] = ticket_info->item_sort_tab[i]->id;
|
||||||
|
|
||||||
tdb->GetTickets(file_id_tab, ticket_info->ticket_tab);
|
tdb->GetTickets(file_id_tab, ticket_info->ticket_tab);
|
||||||
}
|
}
|
||||||
|
@ -111,7 +118,7 @@ void ShowTickets::SortPointers()
|
||||||
{
|
{
|
||||||
int sort_type = 1;
|
int sort_type = 1;
|
||||||
|
|
||||||
if( request->PostVar(L"sort") == L"url" )
|
if( request->ParamValue(L"sort") == L"url" )
|
||||||
sort_type = 0;
|
sort_type = 0;
|
||||||
|
|
||||||
std::vector<Item*> & table = ticket_info->item_sort_tab;
|
std::vector<Item*> & table = ticket_info->item_sort_tab;
|
||||||
|
@ -126,9 +133,12 @@ void ShowTickets::MakeGet()
|
||||||
ticket_info->FindCurrentConf();
|
ticket_info->FindCurrentConf();
|
||||||
|
|
||||||
ReadFiles();
|
ReadFiles();
|
||||||
ReadTickets();
|
|
||||||
CreatePointers();
|
CreatePointers();
|
||||||
SortPointers();
|
SortPointers();
|
||||||
|
ReadTickets();
|
||||||
|
|
||||||
|
plugin.Call(WINIX_PL_THREAD_SET_SORTTAB, &ticket_info->item_sort_tab);
|
||||||
|
plugin.Call(WINIX_PL_THREAD_READ_THREADS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ Error TDb::RemoveTicket(long file_id)
|
||||||
long rows = AffectedRows(r);
|
long rows = AffectedRows(r);
|
||||||
|
|
||||||
if( rows > 0 )
|
if( rows > 0 )
|
||||||
log << log2 << "Db: deleted " << rows << " rows from plugins.ticket" << logend;
|
log << log2 << "TicketDb: deleted " << rows << " rows from plugins.ticket" << logend;
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(const Error & e)
|
catch(const Error & e)
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "functions/functions.h"
|
#include "functions/functions.h"
|
||||||
#include "templates/templates.h"
|
#include "templates/templates.h"
|
||||||
#include "sessiondata.h"
|
#include "sessiondata.h"
|
||||||
|
#include "plugins/thread/pluginmsg.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -139,6 +140,8 @@ void tickets_tab(Info & i)
|
||||||
ticket_index = a;
|
ticket_index = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugin.Call(WINIX_PL_THREAD_SET_SORTTAB_INDEX, item_sort_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ struct Ticket
|
||||||
{
|
{
|
||||||
struct TicketParam
|
struct TicketParam
|
||||||
{
|
{
|
||||||
long file_id;
|
|
||||||
int param;
|
int param;
|
||||||
long int_value; // changed to long (from int)
|
long int_value; // changed to long (from int)
|
||||||
std::wstring str_value;
|
std::wstring str_value;
|
||||||
|
@ -40,6 +39,7 @@ struct Ticket
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
long file_id;
|
||||||
std::vector<TicketParam> par_tab;
|
std::vector<TicketParam> par_tab;
|
||||||
|
|
||||||
// auxiliary object used during sorting
|
// auxiliary object used during sorting
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "tdb.h"
|
#include "tdb.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Ticket
|
namespace Ticket
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
namespace TemplatesFunctions
|
namespace TemplatesFunctions
|
||||||
{
|
{
|
||||||
static BBCODEParser bbcode_parser;
|
static BBCODEParser bbcode_parser;
|
||||||
|
static HtmlTextStream item_run_content;
|
||||||
|
static EzcGen ezc_generator;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,7 +48,7 @@ void item_subject(Info & i)
|
||||||
|
|
||||||
void item_subject_noescape(Info & i)
|
void item_subject_noescape(Info & i)
|
||||||
{
|
{
|
||||||
i.out << request->item.subject;
|
i.out << R(request->item.subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +62,7 @@ void item_content(Info & i)
|
||||||
|
|
||||||
void item_content_noescape(Info & i)
|
void item_content_noescape(Info & i)
|
||||||
{
|
{
|
||||||
i.out << request->item.content;
|
i.out << R(request->item.content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -283,20 +285,19 @@ void item_run(Info & i)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !system->HasReadExecAccess(request->item) )
|
if( system->HasReadExecAccess(request->item) )
|
||||||
{
|
{
|
||||||
i.out << "<!-- run: permission denied -->";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ezc::Pattern * p = pattern_cacher.GetPattern(request->item);
|
Ezc::Pattern * p = pattern_cacher.GetPattern(request->item);
|
||||||
HtmlTextStream item_run_content; // !! zrobic static z tego i tu dac tylko clearowanie
|
|
||||||
|
|
||||||
EzcGen gen;
|
item_run_content.Clear();
|
||||||
//gen.Generate(item_run_content, *p, ezc_functions);
|
ezc_generator.Generate(item_run_content, *p);
|
||||||
gen.Generate(item_run_content, *p);
|
|
||||||
|
|
||||||
item_print_content(i.out, item_run_content.Str(), request->item.content_type);
|
item_print_content(i.out, item_run_content.Str(), request->item.content_type);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i.out << "<!-- run: permission denied -->";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -383,7 +384,7 @@ void item_tab_subject(Info & i)
|
||||||
void item_tab_subject_noescape(Info & i)
|
void item_tab_subject_noescape(Info & i)
|
||||||
{
|
{
|
||||||
if( item_index < request->item_tab.size() )
|
if( item_index < request->item_tab.size() )
|
||||||
i.out << request->item_tab[item_index].subject;
|
i.out << R(request->item_tab[item_index].subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -397,7 +398,7 @@ void item_tab_content(Info & i)
|
||||||
void item_tab_content_noescape(Info & i)
|
void item_tab_content_noescape(Info & i)
|
||||||
{
|
{
|
||||||
if( item_index < request->item_tab.size() )
|
if( item_index < request->item_tab.size() )
|
||||||
i.out << request->item_tab[item_index].content;
|
i.out << R(request->item_tab[item_index].content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -582,20 +583,17 @@ void item_tab_run(Info & i)
|
||||||
{
|
{
|
||||||
if( item_index < request->item_tab.size() )
|
if( item_index < request->item_tab.size() )
|
||||||
{
|
{
|
||||||
if( !system->HasReadExecAccess(request->item) )
|
if( system->HasReadExecAccess(request->item_tab[item_index]) )
|
||||||
|
{
|
||||||
|
Ezc::Pattern * p = pattern_cacher.GetPattern(request->item_tab[item_index]);
|
||||||
|
item_run_content.Clear();
|
||||||
|
ezc_generator.Generate(item_run_content, *p);
|
||||||
|
item_print_content(i.out, item_run_content.Str(), request->item_tab[item_index].content_type);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
i.out << "<!-- run: permission denied -->";
|
i.out << "<!-- run: permission denied -->";
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ezc::Pattern * p = pattern_cacher.GetPattern(request->item_tab[item_index]);
|
|
||||||
HtmlTextStream item_run_content; // !! zrobic static z tego i tu dac tylko clearowanie
|
|
||||||
|
|
||||||
EzcGen gen;
|
|
||||||
//gen.Generate(item_run_content, *p, ezc_functions);
|
|
||||||
gen.Generate(item_run_content, *p);
|
|
||||||
|
|
||||||
item_print_content(i.out, item_run_content.Str(), request->item_tab[item_index].content_type);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,10 @@ void mount_page_arg_is(Info & i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// !! nie potrzebne
|
||||||
void mount_thread_arg_is(Info & i)
|
void mount_thread_arg_is(Info & i)
|
||||||
{
|
{
|
||||||
i.res = system->mounts.pmount->IsArg(system->mounts.MountParThread(), i.par);
|
//i.res = system->mounts.pmount->IsArg(system->mounts.MountParThread(), i.par);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue