X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fajax%2Fajax_installer.php;h=108fd3e9135b6577fc0aac3d6bc6d359b0166e3b;hb=f2b603aed42bfdf7a94611d7bae71fe3a1048890;hp=055d00270adb4890f715c3dcc112cb4113991b5b;hpb=b6a6d0a2c0a0f274b937eb75c413db8fa9b44f9c;p=mailer.git diff --git a/inc/ajax/ajax_installer.php b/inc/ajax/ajax_installer.php index 055d00270a..108fd3e913 100644 --- a/inc/ajax/ajax_installer.php +++ b/inc/ajax/ajax_installer.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -37,7 +37,8 @@ // Some security stuff... if ((!defined('__SECURITY')) || (!isAjaxOutputMode()) || (!isInstallationPhase())) { - die(); + header('HTTP/1.1 403 Forbidden'); + die(json_encode(array('reply_content' => 'Access forbidden'), JSON_FORCE_OBJECT)); } // END - if //----------------------------------------------------------------------------- @@ -56,7 +57,7 @@ function establishAjaxInstallerDatabaseLink () { unsetSqlLinkUp(__FUNCTION__, __LINE__); // Establish link - $linkResource = SQL_CONNECT(getSession('mysql_host'), getSession('mysql_login'), getSession('mysql_password1'), __FUNCTION__, __LINE__); + $linkResource = sqlConnectToDatabase(getSession('mysql_host'), getSession('mysql_login'), getSession('mysql_password1'), __FUNCTION__, __LINE__); // Is this a link resource? if (!is_resource($linkResource)) { @@ -65,7 +66,7 @@ function establishAjaxInstallerDatabaseLink () { } // END - if // Does selecting the database work? - if (!SQL_SELECT_DB(getSession('mysql_dbase'), __FUNCTION__, __LINE__)) { + if (!sqlSelectDatabase(getSession('mysql_dbase'), __FUNCTION__, __LINE__)) { // Could not be selected reportBug(__FUNCTION__, __LINE__, 'Could not select database ' . getSession('mysql_dbase')); } elseif ((!isFileReadable(getSession('base_path') . 'install/tables.sql')) || (!isFileReadable(getSession('base_path') . 'install/menu-'.getLanguage().'.sql'))) { @@ -102,6 +103,7 @@ function doAjaxProcessInstall () { // Again we do a call-back, so generate a function name depending on 'do' $callbackName = 'doAjaxInstaller' . capitalizeUnderscoreString(postRequestElement('do')); + $GLOBALS['ajax_callback_function'] = $callbackName; // Is the call-back function there? if (!function_exists($callbackName)) { @@ -248,7 +250,7 @@ function doAjaxInstallerChangeWarning () { // Is it an extension? if (substr($element, 0, 4) == 'ext_') { // Add row for extension - $OUT .= '
  • {%message=INSTALLER_CHANGED_ELEMENT_EXTENSION=' . str_replace('_', '-', $element) . '%}
  • '; + $OUT .= '
  • {%message,INSTALLER_CHANGED_ELEMENT_EXTENSION=' . str_replace('_', '-', $element) . '%}
  • '; } else { // Add generic row $OUT .= '
  • {--INSTALLER_CHANGED_ELEMENT_' . strtoupper($element) . '--}
  • '; @@ -576,7 +578,7 @@ function doAjaxInstallerStepImportTablesSql () { runFilterChain('run_sqls'); // Close SQL link - SQL_CLOSE(__FUNCTION__, __LINE__); + sqlCloseLink(__FUNCTION__, __LINE__); } // Call-back function to import menu SQL file @@ -600,7 +602,7 @@ function doAjaxInstallerStepImportMenuSql () { runFilterChain('run_sqls'); // Close SQL link - SQL_CLOSE(__FUNCTION__, __LINE__); + sqlCloseLink(__FUNCTION__, __LINE__); } // Call-back function to install some important extensions