/* Redefine REQUEST_URI if empty (on some webservers...) */ if (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] == '') { $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; } if ($tmp = strpos($_SERVER['REQUEST_URI'], '?')) { $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], 0, $tmp); } $_SERVER['REQUEST_URI'] = str_replace('//', '/', $_SERVER['REQUEST_URI']); define('INSTALL_VERSION', '1.3.2.3'); define('INSTALL_PATH', dirname(__FILE__)); include_once INSTALL_PATH . '/classes/ToolsInstall.php'; define('SETTINGS_FILE', INSTALL_PATH . '/../config/settings.inc.php'); define('DEFINES_FILE', INSTALL_PATH . '/../config/defines.inc.php'); define('INSTALLER__PS_BASE_URI', substr($_SERVER['REQUEST_URI'], 0, -1 * (strlen($_SERVER['REQUEST_URI']) - strrpos($_SERVER['REQUEST_URI'], '/')) - strlen(substr(dirname($_SERVER['REQUEST_URI']), strrpos(dirname($_SERVER['REQUEST_URI']), '/') + 1)))); define('INSTALLER__PS_BASE_URI_ABSOLUTE', 'http://' . ToolsInstall::getHttpHost(false, true) . INSTALLER__PS_BASE_URI); // XML Header header('Content-Type: text/xml'); // Switching method if (isset($_GET['method'])) { switch ($_GET['method']) { case 'checkConfig': include_once 'xml/checkConfig.php'; break; case 'checkDB': include_once 'xml/checkDB.php'; break; case 'createDB': include_once 'xml/createDB.php'; break; case 'checkMail':
<link rel="stylesheet" type="text/css" media="all" href="view.css"/> </head> <body> <p id="php5_nok">PrestaShop requires <b>PHP5 or later</b>, you are currently running: <b>' . phpversion() . '</b><br /> ' . lang('If you do not know how to enable it, use our turnkey solution PrestaBox at') . ' <a href="http://www.prestabox.com">http://www.prestabox.com</a>.</p> </body></html>'; die; } require dirname(__FILE__) . '/../config/autoload.php'; include_once INSTALL_PATH . '/classes/ToolsInstall.php'; include_once INSTALL_PATH . '/classes/GetVersionFromDb.php'; /* Prevent from bad URI parsing when using index.php */ $requestUri = str_replace('index.php', '', $_SERVER['REQUEST_URI']); $tmpBaseUri = substr($requestUri, 0, -1 * (strlen($requestUri) - strrpos($requestUri, '/')) - strlen(substr(substr($requestUri, 0, -1), strrpos(substr($requestUri, 0, -1), "/") + 1))); define('PS_BASE_URI', $tmpBaseUri[strlen($tmpBaseUri) - 1] == '/' ? $tmpBaseUri : $tmpBaseUri . '/'); define('PS_BASE_URI_ABSOLUTE', 'http://' . ToolsInstall::getHttpHost(false, true) . PS_BASE_URI); /* Old version detection */ $oldversion = false; $sameVersions = false; $tooOld = true; $installOfOldVersion = false; if (file_exists(INSTALL_PATH . '/../config/settings.inc.php')) { include INSTALL_PATH . '/../config/settings.inc.php'; $oldversion = _PS_VERSION_; $tooOld = version_compare($oldversion, MINIMUM_VERSION_TO_UPDATE) == -1; $sameVersions = version_compare($oldversion, INSTALL_VERSION) == 0; $installOfOldVersion = version_compare($oldversion, INSTALL_VERSION) == 1; } include INSTALL_PATH . '/classes/LanguagesManager.php'; $lm = new LanguageManager(dirname(__FILE__) . '/langs/list.xml'); $_LANG = array();
* http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <*****@*****.**> * @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 1.4 $ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ include_once INSTALL_PATH . '/classes/ToolsInstall.php'; $smtpChecked = trim($_GET['mailMethod']) == 'smtp'; $smtpServer = $_GET['smtpSrv']; $content = $_GET['testMsg']; $subject = $_GET['testSubject']; $type = 'text/html'; $to = $_GET['testEmail']; $from = 'no-reply@' . ToolsInstall::getHttpHost(false, true); $smtpLogin = $_GET['smtpLogin']; $smtpPassword = $_GET['smtpPassword']; $smtpPort = $_GET['smtpPort']; $smtpEncryption = $_GET['smtpEnc']; $result = ToolsInstall::sendMail($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort, $smtpEncryption); die($result ? '<action result="ok"/>' : '<action result="fail"/>');
if(!$languagesId = Db::getInstance()->ExecuteS('SELECT `id_lang`, `iso_code` FROM `'._DB_PREFIX_.'lang`')) $error['infosLanguages'] = '11'; unset($dbInstance);*/ } // Mail Notification $error['infosNotification'] = ''; if (isFormValid()) { if (isset($_GET['infosNotification']) and $_GET['infosNotification'] == 'on') { include_once INSTALL_PATH . '/classes/ToolsInstall.php'; $smtpChecked = trim($_GET['infosMailMethod']) == 'smtp'; $smtpServer = $_GET['smtpSrv']; $subject = $_GET['infosShop'] . " - " . $_GET['mailSubject']; $type = 'text/html'; $to = $_GET['infosEmail']; $from = "no-reply@" . ToolsInstall::getHttpHost(false, true, true); $smtpLogin = $_GET['smtpLogin']; $smtpPassword = $_GET['smtpPassword']; $smtpPort = $_GET['smtpPort']; //'default','secure' $smtpEncryption = $_GET['smtpEnc']; //"tls","ssl","off" $content = ToolsInstall::getNotificationMail($_GET['infosShop'], INSTALLER__PS_BASE_URI_ABSOLUTE, INSTALLER__PS_BASE_URI_ABSOLUTE . "img/logo.jpg", ToolsInstall::strtoupper($_GET['infosFirstname']), $_GET['infosName'], $_GET['infosPassword'], $_GET['infosEmail']); $result = @ToolsInstall::sendMail($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort, $smtpEncryption); } } //Insert configuration parameters into the database $error['infosInsertSQL'] = ''; if (isFormValid()) { $sqlParams = array(); $sqlParams[] = "INSERT IGNORE INTO " . _DB_PREFIX_ . "configuration (name, value, date_add, date_upd) VALUES ('PS_SHOP_DOMAIN', '" . Tools::getHttpHost() . "', NOW(), NOW())";
public function _modelDo($method) { @set_time_limit(0); @ini_set('max_execution_time', '0'); // setting the memory limit to 128M only if current is lower $memory_limit = ini_get('memory_limit'); if (substr($memory_limit, -1) != 'G' and (substr($memory_limit, -1) == 'M' and substr($memory_limit, 0, -1) < 128 or is_numeric($memory_limit) and intval($memory_limit) < 131072)) { @ini_set('memory_limit', '128M'); } require_once $this->prodRootDir . '/config/autoload.php'; /* Redefine REQUEST_URI if empty (on some webservers...) */ if (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] == '') { $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; } if ($tmp = strpos($_SERVER['REQUEST_URI'], '?')) { $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], 0, $tmp); } $_SERVER['REQUEST_URI'] = str_replace('//', '/', $_SERVER['REQUEST_URI']); define('INSTALL_VERSION', $this->currentParams['install_version']); define('INSTALL_PATH', realpath($this->latestRootDir . DIRECTORY_SEPARATOR . 'install')); define('PS_INSTALLATION_IN_PROGRESS', true); require_once INSTALL_PATH . '/classes/ToolsInstall.php'; define('SETTINGS_FILE', $this->prodRootDir . '/config/settings.inc.php'); define('DEFINES_FILE', $this->prodRootDir . '/config/defines.inc.php'); define('INSTALLER__PS_BASE_URI', substr($_SERVER['REQUEST_URI'], 0, -1 * (strlen($_SERVER['REQUEST_URI']) - strrpos($_SERVER['REQUEST_URI'], '/')) - strlen(substr(dirname($_SERVER['REQUEST_URI']), strrpos(dirname($_SERVER['REQUEST_URI']), '/') + 1)))); define('INSTALLER__PS_BASE_URI_ABSOLUTE', 'http://' . ToolsInstall::getHttpHost(false, true) . INSTALLER__PS_BASE_URI); // XML Header header('Content-Type: text/xml'); // Switching method if (in_array($method, array('doUpgrade', 'createDB', 'checkShopInfos'))) { global $logger; $logger = new FileLogger(); $logger->setFilename($this->prodRootDir . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR . @date('Ymd') . '_installation.log'); } switch ($method) { case 'checkConfig': require_once INSTALL_PATH . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'checkConfig.php'; die; break; case 'checkDB': require_once INSTALL_PATH . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'checkDB.php'; break; case 'createDB': require_once INSTALL_PATH . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'createDB.php'; break; case 'checkMail': require_once INSTALL_PATH . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'checkMail.php'; break; case 'checkShopInfos': require_once INSTALL_PATH . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'checkShopInfos.php'; break; case 'doUpgrade': require_once INSTALL_PATH . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'doUpgrade.php'; break; case 'getVersionFromDb': require_once INSTALL_PATH . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'getVersionFromDb.php'; break; } }