define('JPATH_SITE', JPATH_ROOT); define('JPATH_CONFIGURATION', JPATH_ROOT); define('JPATH_LIBRARIES', JPATH_ROOT . DS . 'libraries'); define('JXPATH_BASE', JPATH_BASE . DS . 'includes'); // Make sure that Joomla! is not yet installed if (file_exists(JPATH_CONFIGURATION . DS . 'configuration.php') && filesize(JPATH_CONFIGURATION . DS . 'configuration.php') > 10) { header('Location: ../../index.php'); exit; } // System includes require_once JPATH_LIBRARIES . DS . 'joomla' . DS . 'import.php'; require_once JPATH_BASE . DS . 'installer' . DS . 'helper.php'; // Require the xajax library require_once JXPATH_BASE . DS . 'xajax' . DS . 'xajax.inc.php'; $xajax = new xajax(); $xajax->errorHandlerOn(); $xajax->registerFunction(array('getFtpRoot', 'JAJAXHandler', 'ftproot')); $xajax->registerFunction(array('FTPVerify', 'JAJAXHandler', 'ftpverify')); $xajax->registerFunction(array('instDefault', 'JAJAXHandler', 'sampledata')); JError::setErrorHandling(E_ERROR, 'callback', array('JAJAXHandler', 'handleError')); JError::setErrorHandling(E_WARNING, 'callback', array('JAJAXHandler', 'handleError')); JError::setErrorHandling(E_NOTICE, 'callback', array('JAJAXHandler', 'handleError')); require_once JPATH_SITE . DS . 'libraries' . DS . 'joomla' . DS . 'utilities' . DS . 'compat' . DS . 'compat.php'; /** * AJAX Task handler class * * @static * @package Joomla * @subpackage Installer * @since 1.5 */
/** * Finishes configuration parameters * * @return boolean True if successful * @access public * @since 1.5 */ function mainConfig() { global $mainframe; $vars =& $this->getVars(); // get ftp configuration into registry for use in case of safe mode if ($vars['ftpEnable']) { JInstallationHelper::setFTPCfg($vars); } // Check a few directories are writeable as this may cause issues if (!is_writeable(JPATH_SITE . DS . 'tmp') || !is_writeable(JPATH_SITE . DS . 'installation' . DS . 'sql' . DS . 'migration')) { $vars['dircheck'] = JText::_('Some paths may be unwritable'); } // Require the xajax library require_once JPATH_BASE . DS . 'includes' . DS . 'xajax' . DS . 'xajax.inc.php'; // Instantiate the xajax object and register the function $xajax = new xajax(JURI::base() . 'installer/jajax.php'); $xajax->registerFunction(array('instDefault', 'JAJAXHandler', 'sampledata')); // $xajax->debugOn(); $xajax->errorHandlerOn(); $doc =& JFactory::getDocument(); $doc->addCustomTag($xajax->getJavascript('', 'includes/js/xajax.js', 'includes/js/xajax.js')); // Deal with possible sql script uploads from this stage $vars['loadchecked'] = 0; if (JRequest::getVar('sqlupload', 0, 'post', 'int') == 1) { $vars['sqlresponse'] = JInstallationHelper::uploadSql($vars); $vars['dataloaded'] = '1'; $vars['loadchecked'] = 1; } if (JRequest::getVar('migrationupload', 0, 'post', 'int') == 1 && JRequest::getVar('migrationUploaded', 0, 'post', 'int') == 0) { jexit(print_r(JRequest::getVar('migrationUploaded', 0, 'post', 'int'))); $vars['migresponse'] = JInstallationHelper::uploadSql($vars, true); $vars['dataloaded'] = '1'; $vars['loadchecked'] = 2; } if (JRequest::getVar('migrationUploaded', 0, 'post', 'int') == 1) { $vars['migresponse'] = JInstallationHelper::findMigration($vars); $vars['dataloaded'] = '1'; $vars['loadchecked'] = 2; } // $strip = get_magic_quotes_gpc(); if (isset($vars['siteName'])) { $vars['siteName'] = stripslashes(stripslashes($vars['siteName'])); } $folders = array('administrator/backups', 'administrator/cache', 'administrator/components', 'administrator/language', 'administrator/modules', 'administrator/templates', 'cache', 'components', 'images', 'images/banners', 'images/stories', 'language', 'plugins', 'plugins/content', 'plugins/editors', 'plugins/search', 'plugins/system', 'tmp', 'modules', 'templates'); // Now lets make sure we have permissions set on the appropriate folders // foreach ($folders as $folder) // { // if (!JInstallationHelper::setDirPerms( $folder, $vars )) // { // $lists['folderPerms'][] = $folder; // } // } return true; }