#ifndef USER_CONTROLLER_H #define USER_CONTROLLER_H #include "core/object/reference.h" #include "core/ustring.h" #include "core/containers/vector.h" #include "modules/web/http/web_node.h" class WebServerRequest; class FormValidator; class User; class UserController : public WebNode { GDCLASS(UserController, WebNode); public: void _handle_request_main(Ref request); struct LoginRequestData { String error_str; String uname_val; String pass_val; }; virtual void handle_login_request_default(Ref request); virtual void render_login_request_default(Ref request, LoginRequestData *data); struct RegisterRequestData { String error_str; String uname_val; String email_val; String pass_val; String pass_check_val; }; virtual void handle_register_request_default(Ref request); virtual void render_register_request_default(Ref request, RegisterRequestData *data); virtual void render_register_success(Ref request); virtual void render_already_logged_in_error(Ref request); virtual void render_login_success(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; String uname_val; String email_val; String pass_val; String pass_check_val; }; virtual void handle_settings_request(Ref &user, Ref request); virtual void render_settings_request(Ref &user, Ref request, SettingsRequestData *data); virtual void handle_password_reset_request(Ref &user, Ref request); virtual void handle_logout_request(Ref &user, Ref request); virtual void handle_delete_request(Ref &user, Ref request); UserController(); ~UserController(); protected: Ref _login_validator; Ref _registration_validator; Ref _profile_validator; }; #endif