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:
2012-10-17 19:52:55 +00:00
parent 8aa6f08e08
commit 53b4175d00
3 changed files with 26 additions and 1 deletions

View File

@@ -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();