From 0d85b55c06c452393fab75aa94de8e94f052a1ea Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 18 Jan 2023 14:35:35 -0500 Subject: [PATCH] Allow file paths with symbols for background --- app/classes/web/ajax_handler.py | 2 +- app/frontend/templates/panel/denied.html | 121 ++++++++++-------- .../templates/panel/panel_config.html | 60 +++++---- app/frontend/templates/public/404.html | 2 +- app/frontend/templates/public/error.html | 2 +- app/frontend/templates/public/login.html | 10 +- app/frontend/templates/public/status.html | 2 +- 7 files changed, 114 insertions(+), 85 deletions(-) diff --git a/app/classes/web/ajax_handler.py b/app/classes/web/ajax_handler.py index 2ce94b1b..149bbaee 100644 --- a/app/classes/web/ajax_handler.py +++ b/app/classes/web/ajax_handler.py @@ -355,7 +355,7 @@ class AjaxHandler(BaseHandler): elif page == "select_photo": if exec_user["superuser"]: - photo = self.get_argument("photo", None) + photo = urllib.parse.unquote(self.get_argument("photo", "")) opacity = self.get_argument("opacity", 100) self.controller.management.set_login_opacity(int(opacity)) if photo == "login_1.jpg": diff --git a/app/frontend/templates/panel/denied.html b/app/frontend/templates/panel/denied.html index f924e553..717c0def 100644 --- a/app/frontend/templates/panel/denied.html +++ b/app/frontend/templates/panel/denied.html @@ -1,69 +1,82 @@ - - - - - Crafty Controller - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
+ + + + + Crafty Controller + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ +
+


-
- -
-
+
-
- +
- - - - - - - - - - - - + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/frontend/templates/panel/panel_config.html b/app/frontend/templates/panel/panel_config.html index 6d1e6000..414ce1c4 100644 --- a/app/frontend/templates/panel/panel_config.html +++ b/app/frontend/templates/panel/panel_config.html @@ -34,8 +34,8 @@ }} {% if data['user_data']['hints'] %} + data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" , + data-placement="top"> {% end %}
  {{ @@ -134,8 +134,8 @@ data['lang']) }} {% if data['user_data']['hints'] %} + data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" , + data-placement="top"> {% end %} @@ -244,18 +244,20 @@ {% raw xsrf_form_html() %}
- +
- +


{{ translate('panelConfig', 'loginBackground', data['lang']) }}

- {% for image in data["backgrounds"] %} {% end %} @@ -271,8 +273,8 @@
- {% for image in data["backgrounds"] %} {% end %} @@ -281,18 +283,23 @@
- +
- +
- Responsive image + Responsive image
- -
@@ -508,10 +522,12 @@ var token = getCookie("_xsrf") let photo = $('#photo').find(":selected").val(); let opacity = $('#modal_opacity').val(); + let enc_photo = encodeURIComponent(photo); + $.ajax({ type: "POST", headers: { 'X-XSRFToken': token }, - url: '/ajax/select_photo?photo=' + photo + '&opacity=' + opacity, + url: '/ajax/select_photo?photo=' + enc_photo + '&opacity=' + opacity, success: function (data) { window.location.reload(); }, diff --git a/app/frontend/templates/public/404.html b/app/frontend/templates/public/404.html index 480fe5cf..c598dd19 100644 --- a/app/frontend/templates/public/404.html +++ b/app/frontend/templates/public/404.html @@ -23,7 +23,7 @@