Reimplemented UserSettingsWebPage.

This commit is contained in:
Relintai 2022-07-23 22:22:08 +02:00
parent a5a327ad35
commit 97dd727ee1
2 changed files with 4 additions and 20 deletions

View File

@ -14,25 +14,11 @@
#include "modules/web/http/web_server_cookie.h"
#include "modules/web/http/web_server_request.h"
void UserSettingsWebPage::_handle_request_main(Ref<WebServerRequest> request) {
if (_web_permission.is_valid()) {
if (_web_permission->activate(request)) {
return;
}
}
void UserSettingsWebPage::_render_index(Ref<WebServerRequest> request) {
Ref<User> user = request->get_meta("user");
if (request->get_session().is_valid()) {
Ref<User> u = request->get_meta("user");
ERR_FAIL_COND(!user.is_valid());
if (u.is_valid()) {
//handle_request(u, request);
return;
}
}
}
void UserSettingsWebPage::handle_settings_request(Ref<User> &user, Ref<WebServerRequest> request) {
SettingsRequestData data;
if (request->get_method() == HTTPServerEnums::HTTP_METHOD_POST) {

View File

@ -15,8 +15,6 @@ class UserSettingsWebPage : public UserWebPage {
GDCLASS(UserSettingsWebPage, UserWebPage);
public:
void _handle_request_main(Ref<WebServerRequest> request);
struct SettingsRequestData {
String error_str;
@ -26,7 +24,7 @@ public:
String pass_check_val;
};
virtual void handle_settings_request(Ref<User> &user, Ref<WebServerRequest> request);
void _render_index(Ref<WebServerRequest> request);
virtual void render_settings_request(Ref<User> &user, Ref<WebServerRequest> request, SettingsRequestData *data);
UserSettingsWebPage();