webmin / authentic-theme

Official theme for the best server management panel of the 21st Century
https://authentic-theme.com
MIT License
947 stars 163 forks source link

session_login.cgi doesn't print footer #1691

Closed michaelbaisch closed 10 months ago

michaelbaisch commented 10 months ago

Hello,

I wanted to use the Theme Extension feature with script.js to modify the login page. Even though it was mentioned here that is should work, I didn't see any js in the login page.

As far as I can tell the problem is with this line

((!$miniserv::theme_header_captured && !$miniserv::page_capture) && return);

in theme_footer. session_login.cgi doesn't use &header so theme_header is never called and so this is never called

$miniserv::page_capture          = 1;
$miniserv::theme_header_captured = 1;

which would enable actually printing the footer including embed_js_scripts();

Just placing $miniserv::page_capture = 1; before &footer(); is called, in session_login.cgi didn't work for me, also seems like a dirty fix. I'm not sure where this should be fixed.

Greetings

jcameron commented 10 months ago

@iliajie can you take a look at this one?

iliajie commented 10 months ago

Well, this is expected. We don't print script.js in the login page.

michaelbaisch commented 10 months ago

@iliajie, I was just wondering about this because earlier, you specifically mentioned in your comment that it was possible. Also, I believe there are some HTML closing tags missing.

Is this the current intended design? And should we not expect script.js on the login page anytime soon?

iliajie commented 10 months ago

Hello, Michael!

Gosh, you're right! I have reviewed the code, and this appears to be a bug, and certainly not expected! The fix is here https://github.com/webmin/authentic-theme/commit/ca319c226e0a9517b94abc859e2b42695ab19194.

Thank you for the heads up!

michaelbaisch commented 10 months ago

@iliajie, thank you for the quick fix!