fixed: base_url_redirect config option was not read from the config file

and was not used when checking for base url redirect
fixed: return values from plugins should be given in a special structure
       they were remembered in plugin object (ret_false, ret_true)
       and consequently were not thread safe
       now all plugin.Call() methods return PluginRes structure 
       in which there are ret_false and ret_true variables       
changed: small refactoring in AddUser winix function



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@827 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-04-22 13:30:07 +00:00
parent 920290e9dc
commit bcea4f9464
12 changed files with 165 additions and 119 deletions

View File

@@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2011, Tomasz Sowa
* Copyright (c) 2008-2012, Tomasz Sowa
* All rights reserved.
*
*/
@@ -104,6 +104,22 @@ struct PluginInfo
};
/*
this structure tells how many plugins returned true and false
*/
struct PluginRes
{
int res_false;
int res_true;
PluginRes()
{
res_false = 0;
res_true = 0;
}
};
class Plugin
{
@@ -168,36 +184,28 @@ public:
bool HasMessage(int message);
void Call(int message);
void Call(int message, void * p1_);
void Call(int message, void * p1_, void * p2_);
void Call(int message, long l1_);
void Call(int message, long l1_, long l2_);
void Call(int message, void * p1_, long l1_);
void Call(int message, void * p1_, long l1_, long l2_);
void Call(int message, void * p1_, void * p2_, long l1_);
void Call(Session * ses, int message, void * p1_, void * p2_, long l1_, long l2_);
PluginRes Call(int message);
PluginRes Call(int message, void * p1_);
PluginRes Call(int message, void * p1_, void * p2_);
PluginRes Call(int message, long l1_);
PluginRes Call(int message, long l1_, long l2_);
PluginRes Call(int message, void * p1_, long l1_);
PluginRes Call(int message, void * p1_, long l1_, long l2_);
PluginRes Call(int message, void * p1_, void * p2_, long l1_);
PluginRes Call(Session * ses, int message, void * p1_, void * p2_, long l1_, long l2_);
void Call(Session * ses, int message);
void Call(Session * ses, int message, void * p1_);
void Call(Session * ses, int message, void * p1_, void * p2_);
void Call(Session * ses, int message, long l1_);
void Call(Session * ses, int message, long l1_, long l2_);
void Call(Session * ses, int message, void * p1_, long l1_);
void Call(Session * ses, int message, void * p1_, long l1_, long l2_);
void Call(Session * ses, int message, void * p1_, void * p2_, long l1_);
PluginRes Call(Session * ses, int message);
PluginRes Call(Session * ses, int message, void * p1_);
PluginRes Call(Session * ses, int message, void * p1_, void * p2_);
PluginRes Call(Session * ses, int message, long l1_);
PluginRes Call(Session * ses, int message, long l1_, long l2_);
PluginRes Call(Session * ses, int message, void * p1_, long l1_);
PluginRes Call(Session * ses, int message, void * p1_, long l1_, long l2_);
PluginRes Call(Session * ses, int message, void * p1_, void * p2_, long l1_);
// how many plugins there are
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
// you can assign more than one function to a specific message
void Assign(int message, Fun1);
@@ -217,9 +225,6 @@ private:
Synchro * synchro;
SessionManager * session_manager;
int ret_false;
int ret_true;
std::wstring temp_path;
Plugins plugins;