From 4b53403aece7aab26ab06d79532eb8e1b957df8c Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 19 Nov 2021 22:22:09 +0100 Subject: [PATCH] Cleaned up the app class. --- app/ccms_application.cpp | 13 ------------- app/ccms_application.h | 19 ------------------- 2 files changed, 32 deletions(-) diff --git a/app/ccms_application.cpp b/app/ccms_application.cpp index cb82e6b..4cf89ae 100644 --- a/app/ccms_application.cpp +++ b/app/ccms_application.cpp @@ -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 = ""; diff --git a/app/ccms_application.h b/app/ccms_application.h index 34e3ccd..92bbda5 100644 --- a/app/ccms_application.h +++ b/app/ccms_application.h @@ -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; };