mirror of
https://github.com/Relintai/wp_saver_rcpp_fw.git
synced 2024-11-18 09:07:21 +01:00
Cleaned up the app class.
This commit is contained in:
parent
481b8b9326
commit
4b53403aec
@ -33,8 +33,6 @@ bool CCMSApplication::is_logged_in(Request *request) {
|
||||
}
|
||||
|
||||
void CCMSApplication::index(Object *instance, Request *request) {
|
||||
ENSURE_LOGIN(request);
|
||||
|
||||
add_menu(request, MENUENTRY_NEWS);
|
||||
|
||||
/*
|
||||
@ -244,7 +242,6 @@ void CCMSApplication::setup_middleware() {
|
||||
}
|
||||
|
||||
void CCMSApplication::migrate() {
|
||||
_rbac_model->migrate();
|
||||
}
|
||||
|
||||
void CCMSApplication::compile_menu() {
|
||||
@ -275,20 +272,10 @@ void CCMSApplication::compile_menu() {
|
||||
CCMSApplication::CCMSApplication() :
|
||||
DWebApplication() {
|
||||
|
||||
_rbac_model = new RBACModel();
|
||||
_rbac_controller = new RBACController();
|
||||
_rbac_controller->initialize();
|
||||
|
||||
_admin_panel = new AdminPanel();
|
||||
_admin_panel->register_admin_controller("rbac", _rbac_controller);
|
||||
|
||||
compile_menu();
|
||||
}
|
||||
|
||||
CCMSApplication::~CCMSApplication() {
|
||||
delete _admin_panel;
|
||||
delete _rbac_controller;
|
||||
delete _rbac_model;
|
||||
}
|
||||
|
||||
std::string CCMSApplication::menu_head = "";
|
||||
|
@ -8,21 +8,6 @@
|
||||
#undef LOG_TRACE
|
||||
#undef LOG_WARN
|
||||
|
||||
#include "modules/list_page/list_page.h"
|
||||
#include "modules/message_page/message_page.h"
|
||||
#include "modules/paged_article/paged_article.h"
|
||||
#include "modules/paged_list/paged_list.h"
|
||||
|
||||
class AdminPanel;
|
||||
class RBACController;
|
||||
class RBACModel;
|
||||
|
||||
#define ENSURE_LOGIN(request) \
|
||||
if (!is_logged_in(request)) { \
|
||||
request->send_redirect("/user/login"); \
|
||||
return; \
|
||||
}
|
||||
|
||||
class CCMSApplication : public DWebApplication {
|
||||
public:
|
||||
enum MenuEntries {
|
||||
@ -64,10 +49,6 @@ public:
|
||||
CCMSApplication();
|
||||
~CCMSApplication();
|
||||
|
||||
AdminPanel *_admin_panel;
|
||||
RBACController *_rbac_controller;
|
||||
RBACModel *_rbac_model;
|
||||
|
||||
static std::string menu_head;
|
||||
static std::string footer;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user