| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * モジュール設定スクリプトをロードする。 |
|---|
| 4 | * GETのクエリにmodule_idを渡す。 |
|---|
| 5 | * |
|---|
| 6 | * 管理画面から呼び出すことを想定しているので、 |
|---|
| 7 | * 認証は外さないこと |
|---|
| 8 | * |
|---|
| 9 | * This file is part of EC-CUBE |
|---|
| 10 | * |
|---|
| 11 | * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. |
|---|
| 12 | * |
|---|
| 13 | * http://www.lockon.co.jp/ |
|---|
| 14 | * |
|---|
| 15 | * This program is free software; you can redistribute it and/or |
|---|
| 16 | * modify it under the terms of the GNU General Public License |
|---|
| 17 | * as published by the Free Software Foundation; either version 2 |
|---|
| 18 | * of the License, or (at your option) any later version. |
|---|
| 19 | * |
|---|
| 20 | * This program is distributed in the hope that it will be useful, |
|---|
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 23 | * GNU General Public License for more details. |
|---|
| 24 | * |
|---|
| 25 | * You should have received a copy of the GNU General Public License |
|---|
| 26 | * along with this program; if not, write to the Free Software |
|---|
| 27 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 28 | */ |
|---|
| 29 | require_once 'require.php'; |
|---|
| 30 | |
|---|
| 31 | // 認証可否の判定 |
|---|
| 32 | SC_Utils::sfIsSuccess(new SC_Session()); |
|---|
| 33 | |
|---|
| 34 | $module_id = isset($_GET['module_id']) ? $_GET['module_id'] : null; |
|---|
| 35 | |
|---|
| 36 | if(!empty($module_id) && is_numeric($module_id)) { |
|---|
| 37 | |
|---|
| 38 | GC_Utils::gfPrintLog("loading module ====> module_id = " . $module_id); |
|---|
| 39 | |
|---|
| 40 | $objQuery = new SC_Query(); |
|---|
| 41 | $arrRet = $objQuery->select("module_code", "dtb_module", "module_id = ?", array($module_id)); |
|---|
| 42 | |
|---|
| 43 | if (isset($arrRet[0]['module_code'])) { |
|---|
| 44 | $config_path = MODULE_PATH . $arrRet[0]['module_code'] . '/config.php'; |
|---|
| 45 | |
|---|
| 46 | if (file_exists($config_path)) { |
|---|
| 47 | require_once $config_path; |
|---|
| 48 | exit; |
|---|
| 49 | } else { |
|---|
| 50 | die("モジュールの取得に失敗しました: $config_path"); |
|---|
| 51 | } |
|---|
| 52 | } else { |
|---|
| 53 | die("モジュールが存在しません: module_id => $module_id"); |
|---|
| 54 | } |
|---|
| 55 | } |
|---|
| 56 | ?> |
|---|