From 6a24f1ef30964b9c88d7e6391e05499156d14f3e Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 23 Oct 2019 13:45:25 +0900 Subject: [PATCH 01/13] =?UTF-8?q?=E5=AE=9A=E6=95=B0=E3=81=AE=E5=88=9D?= =?UTF-8?q?=E6=9C=9F=E5=80=A4=E3=82=92=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - mtb_constants.php で必要な定数を設定 --- html/install/index.php | 33 ++++++++++++----------------- html/install/templates/complete.tpl | 4 ++-- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/html/install/index.php b/html/install/index.php index dddceab457..0a67490836 100644 --- a/html/install/index.php +++ b/html/install/index.php @@ -32,6 +32,14 @@ define('INSTALL_INFO_URL', 'http://www.ec-cube.net/install_info/index.php'); define("DEFAULT_COUNTRY_ID", 392); +$dir = preg_replace('|install/.*$|', '', $_SERVER['REQUEST_URI']); +$normal_url = 'http://' . $_SERVER['HTTP_HOST'] . $dir; +defined('HTTP_URL') or define('HTTP_URL', $normal_url); +defined('HTTPS_URL') or define('HTTPS_URL', $normal_url); +$url_dir = preg_replace('|^https?://[a-zA-Z0-9_:~=&\?\.\-]+|', '', $normal_url); +defined('ROOT_URLPATH') or define('ROOT_URLPATH', $url_dir); +defined('ADMIN_DIR') or define('ADMIN_DIR', ''); + require_once HTML_REALDIR . HTML2DATA_DIR . 'require_base.php'; ob_start(); // ▲require.php 相当 @@ -625,6 +633,7 @@ function lfDispComplete($objPage) $objPage->tpl_sslurl = $secure_url; //EC-CUBEオフィシャルサイトからのお知らせURL $objPage->install_info_url = INSTALL_INFO_URL; + $objPage->admin_dir = $objWebParam->getValue('admin_dir'); return $objPage; } @@ -633,20 +642,6 @@ function lfInitWebParam($objWebParam) { global $objDb; - if (defined('HTTP_URL')) { - $normal_url = HTTP_URL; - } else { - $dir = preg_replace('|install/.*$|', '', $_SERVER['REQUEST_URI']); - $normal_url = 'http://' . $_SERVER['HTTP_HOST'] . $dir; - } - - if (defined('HTTPS_URL')) { - $secure_url = HTTPS_URL; - } else { - $dir = preg_replace('|install/.*$|', '', $_SERVER['REQUEST_URI']); - $secure_url = 'http://' . $_SERVER['HTTP_HOST'] . $dir; - } - // 店名、管理者メールアドレスを取得する。(再インストール時) if (defined('DEFAULT_DSN')) { $objQuery = new SC_Query(); @@ -706,8 +701,8 @@ function lfInitWebParam($objWebParam) $objWebParam->addParam('管理機能:ディレクトリ', 'admin_dir', ID_MAX_LEN, 'a', array('EXIST_CHECK', 'SPTAB_CHECK', 'ALNUM_CHECK'), $oldAdminDir); $objWebParam->addParam('管理機能:SSL制限', 'admin_force_ssl', 1, 'n', array('SPTAB_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'), $admin_force_ssl); $objWebParam->addParam('管理機能:IP制限', 'admin_allow_hosts', LTEXT_LEN, 'an', array('IP_CHECK', 'MAX_LENGTH_CHECK'), $admin_allow_hosts); - $objWebParam->addParam('URL(通常)', 'normal_url', MTEXT_LEN, '', array('EXIST_CHECK', 'URL_CHECK', 'MAX_LENGTH_CHECK'), $normal_url); - $objWebParam->addParam('URL(セキュア)', 'secure_url', MTEXT_LEN, '', array('EXIST_CHECK', 'URL_CHECK', 'MAX_LENGTH_CHECK'), $secure_url); + $objWebParam->addParam('URL(通常)', 'normal_url', MTEXT_LEN, '', array('EXIST_CHECK', 'URL_CHECK', 'MAX_LENGTH_CHECK'), HTTP_URL); + $objWebParam->addParam('URL(セキュア)', 'secure_url', MTEXT_LEN, '', array('EXIST_CHECK', 'URL_CHECK', 'MAX_LENGTH_CHECK'), HTTPS_URL); $objWebParam->addParam('ドメイン', 'domain', MTEXT_LEN, '', array('MAX_LENGTH_CHECK')); $objWebParam->addParam('メーラーバックエンド', 'mail_backend', STEXT_LEN, 'a', array('MAX_LENGTH_CHECK', 'EXIST_CHECK'), $mail_backend); $objWebParam->addParam('SMTPホスト', 'smtp_host', STEXT_LEN, 'a', array('MAX_LENGTH_CHECK'), $smtp_host); @@ -992,9 +987,6 @@ function lfMakeConfigFile() // 語尾に'/'をつける $secure_url = rtrim($secure_url, '/') . '/'; - // ディレクトリの取得 - $url_dir = preg_replace('|^https?://[a-zA-Z0-9_:~=&\?\.\-]+|', '', $normal_url); - //管理機能SSL制限 if ($objWebParam->getValue('admin_force_ssl') == 1 and strpos($secure_url, 'https://') !== FALSE) { $force_ssl = 'TRUE'; @@ -1047,7 +1039,7 @@ function lfMakeConfigFile() . "define('ECCUBE_INSTALL', 'ON');\n" . "define('HTTP_URL', '" . $normal_url . "');\n" . "define('HTTPS_URL', '" . $secure_url . "');\n" - . "define('ROOT_URLPATH', '" . $url_dir . "');\n" + . "define('ROOT_URLPATH', '" . ROOT_URLPATH . "');\n" . "define('DOMAIN_NAME', '" . $objWebParam->getValue('domain') . "');\n" . "define('DB_TYPE', '" . $objDBParam->getValue('db_type') . "');\n" . "define('DB_USER', '" . $objDBParam->getValue('db_user') . "');\n" @@ -1157,6 +1149,7 @@ function renameAdminDir($adminDir) } $oldAdminDir = SC_Utils_Ex::sfTrimURL(ADMIN_DIR); + $oldAdminDir = $oldAdminDir == '' ? 'admin' : $oldAdminDir; if ($adminDir === $oldAdminDir) { return true; } diff --git a/html/install/templates/complete.tpl b/html/install/templates/complete.tpl index 367648f966..c73c42eb09 100644 --- a/html/install/templates/complete.tpl +++ b/html/install/templates/complete.tpl @@ -31,7 +31,7 @@

EC CUBE インストールが完了しました。

-

管理画面にログインできます。
+

管理画面にログインできます。
先ほど登録したID、パスワードを用いてログインしてください。

@@ -39,7 +39,7 @@
From 77c68cef81ffd7d25de902f6d0cb7e5388e6161c Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Tue, 5 Nov 2019 10:29:01 +0900 Subject: [PATCH 02/13] =?UTF-8?q?admin=5Fdir=20=E3=81=AE=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=8C?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E3=81=AB=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/install/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/install/index.php b/html/install/index.php index 0a67490836..0fc7f87a2d 100644 --- a/html/install/index.php +++ b/html/install/index.php @@ -118,7 +118,7 @@ //入力値のエラーチェック $objPage->arrErr = lfCheckDBError($objDBParam); if (count($objPage->arrErr) == 0) { - if ($err = renameAdminDir($objWebParam->getValue('admin_dir')) !== true) { + if (($err = renameAdminDir($objWebParam->getValue('admin_dir'))) !== true) { $objPage->arrErr['all'] .= $err; $objPage = lfDispStep2($objPage); } else { From a63896f1a1c1d35401805eb11bd8e68a39308ff3 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Tue, 5 Nov 2019 10:31:28 +0900 Subject: [PATCH 03/13] =?UTF-8?q?submit=20=E3=81=8C=E9=87=8D=E8=A4=87?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/install/templates/install_frame.tpl | 2 +- html/install/templates/step0.tpl | 2 +- html/install/templates/step0_1.tpl | 2 +- html/install/templates/step1.tpl | 2 +- html/install/templates/step2.tpl | 2 +- html/install/templates/step3.tpl | 2 +- html/install/templates/step4.tpl | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/html/install/templates/install_frame.tpl b/html/install/templates/install_frame.tpl index 8539eb005d..0d959ed88d 100644 --- a/html/install/templates/install_frame.tpl +++ b/html/install/templates/install_frame.tpl @@ -65,7 +65,7 @@