2009-11-16 18:43:23 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2009-11-16 18:43:23 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2010-02-28 22:33:06 +01:00
|
|
|
* Copyright (c) 2008-2010, Tomasz Sowa
|
2009-11-16 18:43:23 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "content.h"
|
|
|
|
#include "../core/request.h"
|
|
|
|
#include "../core/error.h"
|
2010-01-28 16:39:01 +01:00
|
|
|
#include "../core/notify.h"
|
|
|
|
|
2009-11-16 18:43:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
void Content::FunReloadTemplates()
|
|
|
|
{
|
|
|
|
log << log1 << "Content: reloading html templates" << logend;
|
2010-01-28 16:39:01 +01:00
|
|
|
|
2009-11-16 18:43:23 +01:00
|
|
|
templates.ReadTemplates();
|
2010-01-28 16:39:01 +01:00
|
|
|
notify.ReadTemplates(); // make sure that ReadTemplates() is using some kind of locking
|
2009-11-16 18:43:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Content::FunReload()
|
|
|
|
{
|
|
|
|
// !! temporarily only an admin has access
|
|
|
|
|
|
|
|
if( !request.session->puser || !request.session->puser->super_user )
|
|
|
|
{
|
|
|
|
log << log1 << "Content: Only an admin has access to reload function" << logend;
|
2010-02-28 01:08:10 +01:00
|
|
|
request.status = WINIX_ERR_PERMISSION_DENIED;
|
2009-11-16 18:43:23 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( request.IsParam("templates") )
|
|
|
|
FunReloadTemplates();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|