From: Michael W. <mw...@ai...> - 2004-11-17 23:14:15
|
Ok, in an attempt to fix the session_login problem of the login showing in two frames, or after relogging in, one frame not refreshing properly...I have the following: in my theme config I have "two" headinclude lines..I don't know if this is legal, but it "appears" to work: headinclude=config.css headinclude=framecheck.inc framecheck.inc has the following in it: <script language="JavaScript" type="text/javascript"> passpage = document.URL if (top.location == self.location) if (! (self.location == "session_login.cgi")) if (document.URL.match("aim_")) top.location.href="/index.cgi?" + passpage </script> index.cgi in the theme contains the following: #!/usr/bin/perl ########################################################################### # # Autors: Deepen V. Dhulla <de...@de...> # Peter N. Hrebicek <pe...@ch...> # ############################################################################ require './web-lib.pl'; &init_config(); $hostname = &get_system_hostname(); $ver = &get_webmin_version(); if ($gconfig{'real_os_type'}) { $ostr = "$gconfig{'real_os_type'} $gconfig{'real_os_version'}"; } else { $ostr = "$gconfig{'os_type'} $gconfig{'os_version'}"; } &PrintHeader(); print <<"EOF"; <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Webmin</title> </head> <!-- <frameset border="0" cols="295, *" frameborder="0"> <frame name="nav" target="main" src="navigate.cgi"> <frame name="content" src="home.cgi"> </frameset> --> <script language="JavaScript" type="text/javascript"> origURL = parent.document.URL contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length) document.write('<frameset border="0" cols=295, *" frameborder="0"><frame src="na vigate.cgi" name="nav" target="main" ><frame src=\"' + contentURL + '\" name="content"><\/fr ameset>') </script> </html> EOF I have modified session.cgi by inserting the following line at line 32: print "<script>\nif (window != window.top) {\n window.top.location = window.location;\n }\n</script>\n"; What it does: session_login.cgi is now always appropriately loaded as top window. Bugs: Ocassionaly the "main" frame becomes the top window. When the session expires, and you click on something, I can here the reload "click" happening for about 10 seconds and can see the URL being modified rapidly for the entire time. Eventually you get to the session_login screen. Any ideas on how to fix this? (I had assumed that sometimes for some reason, the call to &header is not including the javascript..but upon html code inspection it is called, but apparently ignored.) Michael Wray S4F Technologies, Inc. 2448 S. 81st St. Tulsa, OK 74137 http://www.s4f.com mailto:mw...@s4... |