diff options
Diffstat (limited to 'modules/luci-base/ucode')
-rw-r--r-- | modules/luci-base/ucode/controller/admin/index.uc | 4 | ||||
-rw-r--r-- | modules/luci-base/ucode/dispatcher.uc | 2 | ||||
-rw-r--r-- | modules/luci-base/ucode/template/error500.ut | 2 | ||||
-rw-r--r-- | modules/luci-base/ucode/template/footer.ut | 4 | ||||
-rw-r--r-- | modules/luci-base/ucode/template/header.ut | 6 | ||||
-rw-r--r-- | modules/luci-base/ucode/template/sysauth.ut | 4 | ||||
-rw-r--r-- | modules/luci-base/ucode/template/view.ut | 2 |
7 files changed, 12 insertions, 12 deletions
diff --git a/modules/luci-base/ucode/controller/admin/index.uc b/modules/luci-base/ucode/controller/admin/index.uc index f0f7c7fd4d..d433e1161e 100644 --- a/modules/luci-base/ucode/controller/admin/index.uc +++ b/modules/luci-base/ucode/controller/admin/index.uc @@ -143,8 +143,8 @@ return { if (http.getenv('HTTPS') == 'on') http.header('Set-Cookie', `sysauth_https=; expires=Thu, 01 Jan 1970 01:00:00 GMT; path=${url}`); - - http.header('Set-Cookie', `sysauth_http=; expires=Thu, 01 Jan 1970 01:00:00 GMT; path=${url}`); + else + http.header('Set-Cookie', `sysauth_http=; expires=Thu, 01 Jan 1970 01:00:00 GMT; path=${url}`); } http.redirect(url); diff --git a/modules/luci-base/ucode/dispatcher.uc b/modules/luci-base/ucode/dispatcher.uc index 8717385be2..2cb8cc2f6c 100644 --- a/modules/luci-base/ucode/dispatcher.uc +++ b/modules/luci-base/ucode/dispatcher.uc @@ -582,7 +582,7 @@ function resolve_firstchild(node, session, login_allowed, ctx) { session = is_authenticated(node.auth); let cacl = child.depends?.acl; - let login = login_allowed || child.auth?.login; + let login = !session && (login_allowed || child.auth?.login); if (login || check_acl_depends(cacl, session?.acls?.["access-group"]) != null) { if (child.title && type(child.action) == "object") { diff --git a/modules/luci-base/ucode/template/error500.ut b/modules/luci-base/ucode/template/error500.ut index 39a0eec678..e0d4d48ab7 100644 --- a/modules/luci-base/ucode/template/error500.ut +++ b/modules/luci-base/ucode/template/error500.ut @@ -4,7 +4,7 @@ -#} <!--]]>--><!--'>--><!--">--> -<style type="text/css"> +<style> body { line-height: 1.5; font-size: 14px; diff --git a/modules/luci-base/ucode/template/footer.ut b/modules/luci-base/ucode/template/footer.ut index d0978594f8..0ab06ae0b9 100644 --- a/modules/luci-base/ucode/template/footer.ut +++ b/modules/luci-base/ucode/template/footer.ut @@ -5,7 +5,7 @@ {% const rollback = dispatcher.rollback_pending() %} {% if (rollback || trigger_apply || trigger_revert): %} - <script type="text/javascript"> + <script> document.addEventListener("luci-loaded", function() { {% if (trigger_apply): %} L.ui.changes.apply(true); @@ -19,7 +19,7 @@ {% endif %} {% if (media_error): %} - <script type="text/javascript"> + <script> L.require('ui').then(function(ui) { ui.showIndicator('media_error', _('Theme fallback'), function(ev) { ui.showModal(_('Error loading theme'), [ diff --git a/modules/luci-base/ucode/template/header.ut b/modules/luci-base/ucode/template/header.ut index 7dc3742a9d..81cb411dda 100644 --- a/modules/luci-base/ucode/template/header.ut +++ b/modules/luci-base/ucode/template/header.ut @@ -7,9 +7,9 @@ include(`themes/${theme}/header`); -%} -<script type="text/javascript" src="{{ resource }}/promis.min.js"></script> -<script type="text/javascript" src="{{ resource }}/luci.js"></script> -<script type="text/javascript"> +<script src="{{ resource }}/promis.min.js"></script> +<script src="{{ resource }}/luci.js"></script> +<script> L = new LuCI({{ replace(`${ { media : media, resource : resource, diff --git a/modules/luci-base/ucode/template/sysauth.ut b/modules/luci-base/ucode/template/sysauth.ut index 3c580949bb..7fe6e9d57d 100644 --- a/modules/luci-base/ucode/template/sysauth.ut +++ b/modules/luci-base/ucode/template/sysauth.ut @@ -52,7 +52,7 @@ )); %} -<script type="text/javascript">//<![CDATA[ +<script> var input = document.getElementsByName('luci_password')[0]; if (input) @@ -69,6 +69,6 @@ setTimeout(function() { img.src = '' }, 5000); }); } -//]]></script> +</script> {% include('footer') %} diff --git a/modules/luci-base/ucode/template/view.ut b/modules/luci-base/ucode/template/view.ut index 11ac824290..a8562844ba 100644 --- a/modules/luci-base/ucode/template/view.ut +++ b/modules/luci-base/ucode/template/view.ut @@ -2,7 +2,7 @@ <div id="view"> <div class="spinning">{{ _('Loading view…') }}</div> - <script type="text/javascript"> + <script> L.require('ui').then(function(ui) { ui.instantiateView('{{ view }}'); }); |