From: <be...@us...> - 2013-02-06 08:37:12
|
Revision: 10997 http://sourceforge.net/p/xoops/svn/10997 Author: beckmi Date: 2013-02-06 08:37:08 +0000 (Wed, 06 Feb 2013) Log Message: ----------- fix for potential lack of rendering css and javascript in Installer on the last screen (culex) Modified Paths: -------------- XoopsCore/branches/2.5.x/2.5.6/docs/changelog.250.txt XoopsCore/branches/2.5.x/2.5.6/htdocs/install/include/install_tpl.php XoopsCore/branches/2.5.x/2.5.6/htdocs/install/page_end.php Modified: XoopsCore/branches/2.5.x/2.5.6/docs/changelog.250.txt =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/docs/changelog.250.txt 2013-02-06 06:13:16 UTC (rev 10996) +++ XoopsCore/branches/2.5.x/2.5.6/docs/changelog.250.txt 2013-02-06 08:37:08 UTC (rev 10997) @@ -8,6 +8,8 @@ - issues with missing xoopscomments table (geekwright/sabahan/Mamba) - bug with using reference for non-variables (geekwright/mamba) - number of users when "all groups" selected was wrong (tatane/mamba) + - fix for potential lack of rendering css and javascript in Installer on the last screen (culex) + Security fixes - XSS/CSRF vulnerability in system/admin/groupperm.php (Dingjie Yang,Qualys/trabis) - XSS/CSRF vulnerability in system/modulesadmin/main.php (Dingjie Yang,Qualys/trabis) Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/install/include/install_tpl.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/install/include/install_tpl.php 2013-02-06 06:13:16 UTC (rev 10996) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/install/include/install_tpl.php 2013-02-06 08:37:08 UTC (rev 10997) @@ -28,7 +28,6 @@ **/ defined('XOOPS_INSTALL') or die('XOOPS Installation wizard die'); - include_once '../language/' . $wizard->language . '/global.php'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> @@ -153,4 +152,49 @@ </div> </div> </body> -</html> \ No newline at end of file +</html> +<script type="text/javascript"> + /** + * Checking url in browser + * if page is install/page_end.php + * use folder rename variables from + * page_end.php to fetch js and css + **/ + var pathArray = window.location.pathname.split( '/' ); + var filename = location.pathname.substring(location.pathname.lastIndexOf('/')+1); + var chkUrl = pathArray[2]+"/"+filename; + if (chkUrl === 'install/page_end.php'){ + //window.location = newinstallurl; + loadjscssfile(newPro, 'js'); + loadjscssfile(newINST, 'js'); + loadjscssfile(newCSS, 'css'); + } else { + // Do nothing + } + +/** + * Load js and css files to header + * + * @param filename Filename based on var using $installer_modified if folder is renamed + * + * @param filetype js=javascript css=cascading style sheat + * + * @return boolean always true + */ +function loadjscssfile(filename, filetype) { + if (filetype == "js") { //if filename is a external JavaScript file + // alert('called'); + var fileref = document.createElement('script'); + fileref.setAttribute("type", "text/javascript"); + fileref.setAttribute("src", filename); + } + else if (filetype == "css") { //if filename is an external CSS file + var fileref = document.createElement("link"); + fileref.setAttribute("rel", "stylesheet"); + fileref.setAttribute("type", "text/css"); + fileref.setAttribute("href", filename); + } + if (typeof fileref != "undefined") + document.getElementsByTagName("head")[0].appendChild(fileref); + } +</script> \ No newline at end of file Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/install/page_end.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/install/page_end.php 2013-02-06 06:13:16 UTC (rev 10996) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/install/page_end.php 2013-02-06 08:37:08 UTC (rev 10997) @@ -34,10 +34,33 @@ $installer_modified = "install_remove_" . uniqid(mt_rand()); register_shutdown_function('install_finalize', $installer_modified); +/** + * Placing folder renamed in $_SESSION + * and echoing to document for use in install_tpl.php + **/ + +$_SESSION['newinstallPRO'] = XOOPS_URL.'/'.$installer_modified.'/js/prototype-1.6.0.3.js'; +$_SESSION['newinstallINST'] = XOOPS_URL.'/'.$installer_modified.'/js/xo-installer.js'; +if (file_exists('language/' . $wizard->language . '/style.css')) { + $_SESSION['newinstallCSS'] = XOOPS_URL.'/'.'language/' . $wizard->language . '/style.css'; + $_SESSION['newinstallCSSDeflt'] = XOOPS_URL.'/'.$installer_modified.'/css/style.css'; +} else { + $_SESSION['newinstallCSSDeflt'] = XOOPS_URL.'/'.$installer_modified.'/css/style.css'; + $_SESSION['newinstallCSS'] = ''; +} + +$js = '<script type="text/javascript">'; +$js .= 'var newPro = '.json_encode($_SESSION["newinstallPRO"]).';'; +$js .= 'var newINST = '.json_encode($_SESSION["newinstallINST"]).';'; +$js .= 'var newCSS = '.json_encode($_SESSION["newinstallCSS"]).';'; +$js .= 'var newCSS = '.json_encode($_SESSION["newinstallCSSDeflt"]).';'; +$js .= '</script>'; +echo $js; + $pageHasForm = false; $content = ""; include "./language/{$wizard->language}/finish.php"; include './include/install_tpl.php'; -?> \ No newline at end of file +?> \ No newline at end of file |