added: plugins_dir to config
small changes in makefiles git-svn-id: svn://ttmath.org/publicrep/winix/trunk@643 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
eec0ddf466
commit
3b655f39e1
34
Makefile
34
Makefile
|
@ -5,16 +5,16 @@ CXX = g++
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef CXXFLAGS
|
ifndef CXXFLAGS
|
||||||
#CXXFLAGS = -fPIC -Wall -pedantic -O2 -I/usr/local/include -I/home/tomek/roboczy/winix -I/home/tomek/roboczy/ezc/src -L/usr/local/lib -DEZC_USE_WINIX_LOGGER
|
CXXFLAGS = -fPIC -Wall -pedantic -O2 -I/usr/local/include -I/home/tomek/roboczy/winix -I/home/tomek/roboczy/ezc/src -L/usr/local/lib -DEZC_USE_WINIX_LOGGER
|
||||||
CXXFLAGS = -fPIC -Wall -pedantic -O0 -g -I/usr/local/include -I/home/tomek/roboczy/winix -I/home/tomek/roboczy/ezc/src -L/usr/local/lib -DEZC_USE_WINIX_LOGGER
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
export CXX
|
export CXX
|
||||||
export CXXFLAGS
|
export CXXFLAGS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
all: winix
|
all: winix
|
||||||
|
|
||||||
winix: FORCE
|
winix: FORCE
|
||||||
|
@ -30,6 +30,7 @@ winix: FORCE
|
||||||
$(CXX) -o winix $(CXXFLAGS) main/*.o /home/tomek/roboczy/winix/winix.so
|
$(CXX) -o winix $(CXXFLAGS) main/*.o /home/tomek/roboczy/winix/winix.so
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@cd core ; $(MAKE) -e clean
|
@cd core ; $(MAKE) -e clean
|
||||||
@cd functions ; $(MAKE) -e clean
|
@cd functions ; $(MAKE) -e clean
|
||||||
|
@ -54,9 +55,24 @@ depend:
|
||||||
@cd ../ezc/src ; $(MAKE) -e depend
|
@cd ../ezc/src ; $(MAKE) -e depend
|
||||||
@cd main ; $(MAKE) -e depend
|
@cd main ; $(MAKE) -e depend
|
||||||
|
|
||||||
#install: all
|
|
||||||
# mkdir -p bin
|
install: all
|
||||||
# rm -f bin/winix.so
|
# binaries
|
||||||
# rm -f bin/winix
|
mkdir -p /usr/local/winix/bin
|
||||||
# cp winix.so bin/
|
mkdir -p /usr/local/winix/lib
|
||||||
# cp winix bin/
|
cp winix.so /usr/local/winix/lib/
|
||||||
|
# use the full path with winix.so (we have to recompile winix with a new path to winix.so)
|
||||||
|
$(CXX) -o /usr/local/winix/bin/winix $(CXXFLAGS) main/*.o /usr/local/winix/lib/winix.so
|
||||||
|
# html templates
|
||||||
|
mkdir -p /usr/local/winix/html
|
||||||
|
cp -rf html/ /usr/local/winix/html/
|
||||||
|
find /usr/local/winix/html/ -type d -name ".svn" | xargs -I foo rm -fr foo
|
||||||
|
# locales
|
||||||
|
mkdir -p /usr/local/winix/locale
|
||||||
|
cp -rf locale/ /usr/local/winix/locale/
|
||||||
|
find /usr/local/winix/locale/ -type d -name ".svn" | xargs -I foo rm -fr foo
|
||||||
|
# plugins
|
||||||
|
mkdir -p /usr/local/winix/plugins
|
||||||
|
find plugins/ -name "*.so" | xargs -I foo cp foo /usr/local/winix/plugins/
|
||||||
|
# removed provileges for others
|
||||||
|
find /usr/local/winix -exec chmod o-r,o-x,o-w "{}" "+"
|
||||||
|
|
|
@ -74,7 +74,7 @@ bool App::CreateFCGISocket()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int s = FCGX_OpenSocket(sock, 10);
|
int s = FCGX_OpenSocket(sock, 100);
|
||||||
|
|
||||||
if( s < 0 )
|
if( s < 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -161,6 +161,8 @@ void Config::AssignValues(bool stdout_is_closed)
|
||||||
editors_html_safe_mode = Bool("editors_html_safe_mode", true);
|
editors_html_safe_mode = Bool("editors_html_safe_mode", true);
|
||||||
editors_html_safe_mode_skip_root = Bool("editors_html_safe_mode_skip_root", true);
|
editors_html_safe_mode_skip_root = Bool("editors_html_safe_mode_skip_root", true);
|
||||||
|
|
||||||
|
plugins_dir = Text("plugins_dir", "/usr/local/winix/plugins");
|
||||||
|
NoLastSlash(plugins_dir);
|
||||||
parser.ListText("plugins", plugin_file);
|
parser.ListText("plugins", plugin_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,13 @@ public:
|
||||||
// if the output is shorter than this value then it will not be compressed
|
// if the output is shorter than this value then it will not be compressed
|
||||||
int compression_page_min_size;
|
int compression_page_min_size;
|
||||||
|
|
||||||
|
// plugins directory
|
||||||
|
// default: /usr/local/winix/plugins
|
||||||
|
std::string plugins_dir;
|
||||||
|
|
||||||
// plugins
|
// plugins
|
||||||
|
// you can provide either a relative path (plugins_dir will be used)
|
||||||
|
// or a full path to a plugin
|
||||||
std::vector<std::string> plugin_file;
|
std::vector<std::string> plugin_file;
|
||||||
|
|
||||||
// should the html code be cleaned by the html filter
|
// should the html code be cleaned by the html filter
|
||||||
|
|
|
@ -109,12 +109,22 @@ return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Plugin::LoadPlugins(const std::vector<std::string> & plugins)
|
void Plugin::LoadPlugins(const std::string & plugins_dir, const std::vector<std::string> & plugins)
|
||||||
{
|
{
|
||||||
size_t i;
|
for(size_t i=0 ; i<plugins.size() ; ++i)
|
||||||
|
{
|
||||||
for(i=0 ; i<plugins.size() ; ++i)
|
if( !plugins[i].empty() && plugins[i][0] == '/' )
|
||||||
LoadPlugin(plugins[i]);
|
{
|
||||||
|
LoadPlugin(plugins[i]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
temp_path = plugins_dir;
|
||||||
|
temp_path += '/';
|
||||||
|
temp_path += plugins[i];
|
||||||
|
LoadPlugin(plugins[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ public:
|
||||||
|
|
||||||
void LoadPlugin(const char * filename);
|
void LoadPlugin(const char * filename);
|
||||||
void LoadPlugin(const std::string & filename);
|
void LoadPlugin(const std::string & filename);
|
||||||
void LoadPlugins(const std::vector<std::string> & plugins);
|
void LoadPlugins(const std::string & plugins_dir, const std::vector<std::string> & plugins);
|
||||||
void UnloadPlugins();
|
void UnloadPlugins();
|
||||||
|
|
||||||
void Call(int message);
|
void Call(int message);
|
||||||
|
@ -167,6 +167,7 @@ private:
|
||||||
Templates * templates;
|
Templates * templates;
|
||||||
SessionManager * session_manager;
|
SessionManager * session_manager;
|
||||||
|
|
||||||
|
std::string temp_path;
|
||||||
|
|
||||||
struct PluginsItem
|
struct PluginsItem
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,8 +21,9 @@ CreateThread::CreateThread()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 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 CreateThread::HasAccess(bool check_root)
|
||||||
{
|
{
|
||||||
if( request->dir_tab.empty() )
|
if( request->dir_tab.empty() )
|
||||||
return false;
|
return false;
|
||||||
|
@ -36,7 +37,7 @@ bool CreateThread::HasAccess()
|
||||||
if( !system->mounts.pmount || system->mounts.pmount->type != Mount::thread )
|
if( !system->mounts.pmount || system->mounts.pmount->type != Mount::thread )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( request->session && request->session->puser && request->session->puser->super_user )
|
if( !check_root && request->session && request->session->puser && request->session->puser->super_user )
|
||||||
// super can create thread regardless of the restrictcreatethread option
|
// super can create thread regardless of the restrictcreatethread option
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -50,6 +51,11 @@ return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool CreateThread::HasAccess()
|
||||||
|
{
|
||||||
|
return HasAccess(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CreateThread::FunCreateThreadCheckAbuse()
|
bool CreateThread::FunCreateThreadCheckAbuse()
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,6 +23,7 @@ class CreateThread : public FunctionBase
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CreateThread();
|
CreateThread();
|
||||||
|
bool HasAccess(bool check_root);
|
||||||
bool HasAccess();
|
bool HasAccess();
|
||||||
void MakePost();
|
void MakePost();
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ void CreateTicket::Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
// returning true if we can create a ticket in the current directory
|
// returning true if we can create a ticket in the current directory
|
||||||
bool CreateTicket::HasAccess()
|
bool CreateTicket::HasAccess(bool check_root)
|
||||||
{
|
{
|
||||||
if( request->dir_tab.empty() )
|
if( request->dir_tab.empty() )
|
||||||
return false;
|
return false;
|
||||||
|
@ -44,7 +44,7 @@ bool CreateTicket::HasAccess()
|
||||||
|
|
||||||
// checking for par_createticket_on mount option
|
// checking for par_createticket_on mount option
|
||||||
|
|
||||||
if( request->session && request->session->puser && request->session->puser->super_user )
|
if( !check_root && request->session && request->session->puser && request->session->puser->super_user )
|
||||||
// super can create tickets regardless of the createticket_on option
|
// super can create tickets regardless of the createticket_on option
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -58,7 +58,10 @@ return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool CreateTicket::HasAccess()
|
||||||
|
{
|
||||||
|
return HasAccess(false);
|
||||||
|
}
|
||||||
|
|
||||||
bool CreateTicket::FunCreateTicketCheckAbuse()
|
bool CreateTicket::FunCreateTicketCheckAbuse()
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,6 +24,7 @@ public:
|
||||||
|
|
||||||
CreateTicket();
|
CreateTicket();
|
||||||
void Clear();
|
void Clear();
|
||||||
|
bool HasAccess(bool check_root);
|
||||||
bool HasAccess();
|
bool HasAccess();
|
||||||
void MakePost();
|
void MakePost();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
[if-one item_is]<h1>{edit}</h1>[else]<h1>{add}</h1>[end]
|
[if-one item_is]<h1>{edit}</h1>[else]<h1>{add}</h1>[end]
|
||||||
|
|
||||||
[include "err_abuse.html"]
|
[include "error.html"]
|
||||||
|
|
||||||
|
|
||||||
<form id="additem" method="post" action="[doc_base_url][dir][if-one item_is][item_url]/[end]ckeditor">
|
<form id="additem" method="post" action="[doc_base_url][dir][if-one item_is][item_url]/[end]ckeditor">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|
|
@ -49,7 +49,7 @@ void signal_term(int)
|
||||||
void print_syntax()
|
void print_syntax()
|
||||||
{
|
{
|
||||||
std::cout << "Syntax:" << std::endl;
|
std::cout << "Syntax:" << std::endl;
|
||||||
std::cout << " cmslu.fcgi config_file" << std::endl;
|
std::cout << " winix config_file" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ int main(int argv, char ** argc)
|
||||||
|
|
||||||
// load plugins before loading sessions - session_manager.LoadSessions()
|
// load plugins before loading sessions - session_manager.LoadSessions()
|
||||||
// because some of the plugins can init its own sessions dates
|
// because some of the plugins can init its own sessions dates
|
||||||
plugin.LoadPlugins(app.config.plugin_file);
|
plugin.LoadPlugins(app.config.plugins_dir, app.config.plugin_file);
|
||||||
|
|
||||||
if( !app.Init() )
|
if( !app.Init() )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -350,6 +350,7 @@ line-height: 1.5em;
|
||||||
|
|
||||||
p.withnext {
|
p.withnext {
|
||||||
margin: 1em 0 0 0;
|
margin: 1em 0 0 0;
|
||||||
|
width: 520px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -173,8 +173,7 @@ void thread_tab_last_item_user(Info & i)
|
||||||
|
|
||||||
void thread_can_create(Info & i)
|
void thread_can_create(Info & i)
|
||||||
{
|
{
|
||||||
//i.res = request->CanCreateThread(true);
|
i.res = functions->fun_createthread.HasAccess(true);
|
||||||
i.res = true; // temporarily
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,7 @@ void ticket_item_print_content(Info & i)
|
||||||
|
|
||||||
void ticket_can_create(Info & i)
|
void ticket_can_create(Info & i)
|
||||||
{
|
{
|
||||||
//i.res = request->CanCreateTicket(true);
|
i.res = functions->fun_createticket.HasAccess(true);
|
||||||
i.res = functions->fun_createticket.HasAccess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue