From 16fda02f482e124e50440e5e88a8a39d3584bed4 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 22 Jul 2022 14:52:55 +0200 Subject: [PATCH] Added the new user web page classes to the build. They still need binds, so they won't do anything at the moment. --- modules/users/SCsub | 8 ++++++++ modules/users/config.py | 9 +++++++++ modules/users/register_types.cpp | 18 ++++++++++++++++++ .../web/web_nodes/user_settings_web_page.cpp | 2 +- .../web/web_nodes/user_settings_web_page.h | 3 --- .../users/web/web_nodes/user_stats_web_page.h | 6 ------ 6 files changed, 36 insertions(+), 10 deletions(-) diff --git a/modules/users/SCsub b/modules/users/SCsub index 099d987bc..80538fe74 100644 --- a/modules/users/SCsub +++ b/modules/users/SCsub @@ -18,6 +18,14 @@ sources = [ if env['module_web_enabled']: sources.append("web/middleware/user_session_setup_web_server_middleware.cpp") + sources.append("web/web_nodes/user_web_page.cpp") + sources.append("web/web_nodes/user_delete_web_page.cpp") + sources.append("web/web_nodes/user_login_web_page.cpp") + sources.append("web/web_nodes/user_logout_web_page.cpp") + sources.append("web/web_nodes/user_password_reset_web_page.cpp") + sources.append("web/web_nodes/user_register_web_page.cpp") + sources.append("web/web_nodes/user_settings_web_page.cpp") + sources.append("web/web_nodes/user_stats_web_page.cpp") if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes': # Shared lib compilation diff --git a/modules/users/config.py b/modules/users/config.py index c8b82fdbb..46b955246 100644 --- a/modules/users/config.py +++ b/modules/users/config.py @@ -17,6 +17,15 @@ def get_doc_classes(): "UserDB", "UserSessionSetupWebServerMiddleware", + + "UserWebPage", + "UserDeleteWebPage", + "UserLoginWebPage", + "UserLogoutWebPage", + "UserPasswordResetWebPage", + "UserRegisterWebPage", + "UserSettingsWebPage", + "UserStatsWebPage", ] diff --git a/modules/users/register_types.cpp b/modules/users/register_types.cpp index 5ec7a5031..8e6343fd0 100644 --- a/modules/users/register_types.cpp +++ b/modules/users/register_types.cpp @@ -36,6 +36,15 @@ SOFTWARE. #ifdef MODULE_WEB_ENABLED #include "web/middleware/user_session_setup_web_server_middleware.h" + +#include "web/web_nodes/user_delete_web_page.cpp" +#include "web/web_nodes/user_login_web_page.cpp" +#include "web/web_nodes/user_logout_web_page.cpp" +#include "web/web_nodes/user_password_reset_web_page.cpp" +#include "web/web_nodes/user_register_web_page.cpp" +#include "web/web_nodes/user_settings_web_page.cpp" +#include "web/web_nodes/user_stats_web_page.cpp" +#include "web/web_nodes/user_web_page.cpp" #endif UserDB *_user_db = nullptr; @@ -54,6 +63,15 @@ void register_users_types() { #ifdef MODULE_WEB_ENABLED ClassDB::register_class(); + + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); #endif } diff --git a/modules/users/web/web_nodes/user_settings_web_page.cpp b/modules/users/web/web_nodes/user_settings_web_page.cpp index b7bc89dcb..1c80376fb 100644 --- a/modules/users/web/web_nodes/user_settings_web_page.cpp +++ b/modules/users/web/web_nodes/user_settings_web_page.cpp @@ -25,7 +25,7 @@ void UserSettingsWebPage::_handle_request_main(Ref request) { Ref u = request->get_meta("user"); if (u.is_valid()) { - handle_request(u, request); + //handle_request(u, request); return; } diff --git a/modules/users/web/web_nodes/user_settings_web_page.h b/modules/users/web/web_nodes/user_settings_web_page.h index 9ad167a7d..d63505e51 100644 --- a/modules/users/web/web_nodes/user_settings_web_page.h +++ b/modules/users/web/web_nodes/user_settings_web_page.h @@ -17,9 +17,6 @@ class UserSettingsWebPage : public UserWebPage { public: void _handle_request_main(Ref request); - virtual void handle_request(Ref &user, Ref request); - virtual void handle_main_page_request(Ref &user, Ref request); - struct SettingsRequestData { String error_str; diff --git a/modules/users/web/web_nodes/user_stats_web_page.h b/modules/users/web/web_nodes/user_stats_web_page.h index 4ca57cd59..84b1e56c2 100644 --- a/modules/users/web/web_nodes/user_stats_web_page.h +++ b/modules/users/web/web_nodes/user_stats_web_page.h @@ -16,16 +16,10 @@ class UserStatsWebPage : public UserWebPage { GDCLASS(UserStatsWebPage, UserWebPage); public: - virtual void handle_request(Ref &user, Ref request); - virtual void handle_main_page_request(Ref &user, Ref request); - UserStatsWebPage(); ~UserStatsWebPage(); protected: - Ref _login_validator; - Ref _registration_validator; - Ref _profile_validator; }; #endif