added: plugin message: WINIX_CHECK_PLUGIN_ACCESS
this message is sent before calling MakePost() or MakeGet() if you return false (which is default) you can prevent the access to the resource git-svn-id: svn://ttmath.org/publicrep/winix/trunk@901 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
19
core/app.cpp
19
core/app.cpp
@@ -275,6 +275,23 @@ size_t locale_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool App::CheckAccessFromPlugins()
|
||||
{
|
||||
PluginRes res = plugin.Call(WINIX_CHECK_PLUGIN_ACCESS);
|
||||
|
||||
if( res.res_false > 0 )
|
||||
{
|
||||
cur.request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
log << log2 << "App: access prevented by a plugin" << logend;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void App::ProcessRequestThrow()
|
||||
{
|
||||
ReadRequest();
|
||||
@@ -459,6 +476,8 @@ void App::Make()
|
||||
if( cur.request->status == WINIX_ERR_OK )
|
||||
functions.CheckFunctionAndSymlink();
|
||||
|
||||
CheckAccessFromPlugins();
|
||||
|
||||
// !! CHECK ME CheckFunctionAndSymlink can set redirect_to
|
||||
// may it should be tested before calling CheckIfNeedSSLredirect?
|
||||
CheckIfNeedSSLredirect();
|
||||
|
Reference in New Issue
Block a user