Index: /branches/version-2_5-dev/data/class/SC_FormParam.php
===================================================================
--- /branches/version-2_5-dev/data/class/SC_FormParam.php	(revision 19805)
+++ /branches/version-2_5-dev/data/class/SC_FormParam.php	(revision 19854)
@@ -190,4 +190,5 @@
                 case 'KANA_CHECK':
                 case 'URL_CHECK':
+                case 'IP_CHECK':
                 case 'SPTAB_CHECK':
                 case 'ZERO_CHECK':
Index: /branches/version-2_5-dev/data/class/SC_CheckError.php
===================================================================
--- /branches/version-2_5-dev/data/class/SC_CheckError.php	(revision 19805)
+++ /branches/version-2_5-dev/data/class/SC_CheckError.php	(revision 19854)
@@ -585,4 +585,24 @@
         if( strlen($this->arrParam[$value[1]]) > 0 && !ereg( "^https?://+($|[a-zA-Z0-9_~=:&\?\.\/-])+$", $this->arrParam[$value[1]] ) ) {
             $this->arrErr[$value[1]] = "※ " . $value[0] . "を正しく入力してください。<br />";
+        }
+    }
+
+    /*　IPアドレスの判定　*/
+    //  value[0] = 項目名 value[1] = 判定対象IPアドレス文字列
+    function IP_CHECK( $value ){
+        if(isset($this->arrErr[$value[1]])) {
+            return;
+        }
+        //改行コードが含まれている場合には配列に変換
+        $params = str_replace("\r","",$this->arrParam[$value[1]]);
+        if(strpos("\n",$params) === false){
+            $params .= "\n";
+        }
+        $params = explode("\n",$params);
+        foreach($params as $param){
+            $param = trim($param);
+            if(long2ip(ip2long($param)) != trim($param) and !empty($param)) {
+                $this->arrErr[$value[1]] = "※ " . $value[0] . "に正しい形式のIPアドレスを入力してください。<br />";
+            }
         }
     }
Index: /branches/version-2_5-dev/data/class/pages/admin/LC_Page_Admin.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/LC_Page_Admin.php	(revision 19805)
+++ /branches/version-2_5-dev/data/class/pages/admin/LC_Page_Admin.php	(revision 19854)
@@ -44,4 +44,20 @@
     function init() {
         $this->template = MAIN_FRAME;
+        
+        //IP制限チェック
+        if(defined("ADMIN_ALLOW_HOSTS")){
+            $allow_hosts = unserialize(ADMIN_ALLOW_HOSTS);
+            if(array_search($_SERVER["REMOTE_ADDR"],$allow_hosts) === FALSE){
+                SC_Response::sendError("403");
+                exit;
+            }
+        }
+        
+        //SSL制限チェック
+        if(ADMIN_FORCE_SSL == TRUE){
+            if(empty($_SERVER['HTTPS']) AND $_SERVER['SERVER_PORT'] != 443){
+                SC_Response::sendRedirect($SERVER["REQUEST_URI"], $_GET,FALSE, TRUE);
+            }
+        }
 
         // ディスプレイクラス生成
Index: /branches/version-2_5-dev/html/install/templates/step1.tpl
===================================================================
--- /branches/version-2_5-dev/html/install/templates/step1.tpl	(revision 19821)
+++ /branches/version-2_5-dev/html/install/templates/step1.tpl	(revision 19854)
@@ -66,6 +66,33 @@
             <!--{assign var=key value="login_pass"}-->
             <span class="red"><span class="fs12n"><!--{$arrErr[$key]}--></span></span>
-            <input type="password" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|escape}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->;" size="40" class="box40" />
+            <input type="password" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|escape}-->" maxlength="<!--{$smarty.const.ID_MAX_LEN}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->;" size="40" class="box40" />
             <br><span class="fs10">※管理機能にログインするためのパスワードです。</span>
+            </td>
+        </tr>
+        <tr>
+            <td bgcolor="#f2f1ec" width="150"><span class="fs12n">管理画面：ディレクトリ</span><br/><span class="fs10">半角英数字<!--{$smarty.const.ID_MIN_LEN}-->～<!--{$smarty.const.ID_MAX_LEN}-->文字</span></td>
+            <td bgcolor="#ffffff" width="332">
+            <!--{assign var=key value="admin_dir"}-->
+            <span class="red"><span class="fs12n"><!--{$arrErr[$key]}--></span></span>
+            <input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|escape|default:admin}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->;" size="40" class="box40" />
+            <br><span class="fs10">※管理画面のディレクトリ名です。https://[ホスト名].[ドメイン名]/[ショップディレクトリ]/[管理画面]/で管理画面にアクセスする場合の[管理画面]の部分。</span>
+            </td>
+        </tr>
+        <tr>
+            <td bgcolor="#f2f1ec" width="150"><span class="fs12n">管理画面：SSL制限</span><br/><span class="fs10"></td>
+            <td bgcolor="#ffffff" width="332">
+            <!--{assign var=key value="admin_force_ssl"}-->
+            <span class="red"><span class="fs12n"><!--{$arrErr[$key]}--></span></span>
+            <input type="checkbox" name="<!--{$key}-->" id="<!--{$key}-->" value="1" <!--{if $arrForm[$key].value == 1}-->checked="checked"<!--{/if}--> /><label for="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->;" class="fs12n">SSLを強制する。</label>
+            <br><span class="fs10">※管理画面へのアクセスをSSL経由(https)の接続に制限します。</span>
+            </td>
+        </tr>
+        <tr>
+            <td bgcolor="#f2f1ec" width="150"><span class="fs12n">管理画面：IP制限</span><br/><span class="fs10"></td>
+            <td bgcolor="#ffffff" width="332">
+            <!--{assign var=key value="admin_allow_hosts"}-->
+            <span class="red fs12n"><!--{$arrErr[$key]}--></span>
+            <span class="fs10">※管理画面へのアクセスを特定のIPアドレスからの接続のみに制限します。アクセスを許可するIPアドレスを1行づつ入力してください。何も入力しない場合は全てを許可します。</span><br />
+            <textarea name="<!--{$key}-->" class="fs12n box40"><!--{$arrForm[$key].value|escape}--></textarea>
             </td>
         </tr>
Index: /branches/version-2_5-dev/html/install/sql/create_table_mysql.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/create_table_mysql.sql	(revision 19808)
+++ /branches/version-2_5-dev/html/install/sql/create_table_mysql.sql	(revision 19854)
@@ -9,9 +9,9 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (log_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_ownersstore_settings (
     public_key text
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_kiyaku (
@@ -25,5 +25,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (kiyaku_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_holiday (
@@ -38,5 +38,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (holiday_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_zip (
@@ -56,5 +56,5 @@
     flg5 text,
     flg6 text
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_bat_order_daily_age (
@@ -67,5 +67,5 @@
     order_date datetime,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_update (
@@ -85,5 +85,5 @@
     release_date datetime NOT NULL,
     PRIMARY KEY (module_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_baseinfo (
@@ -152,5 +152,5 @@
     downloadable_days numeric DEFAULT 30,
     downloadable_days_unlimited smallint
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_deliv (
@@ -167,5 +167,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (deliv_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_delivtime (
@@ -174,5 +174,5 @@
     deliv_time text NOT NULL,
     PRIMARY KEY (deliv_id, time_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_delivfee (
@@ -182,5 +182,5 @@
     pref smallint,
     PRIMARY KEY (deliv_id, fee_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_payment (
@@ -215,5 +215,5 @@
     memo10 text,
     PRIMARY KEY (payment_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_payment_options (
@@ -222,5 +222,5 @@
     rank int,
     PRIMARY KEY(product_class_id, payment_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_mailtemplate (
@@ -233,5 +233,5 @@
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_send_history (
@@ -250,5 +250,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (send_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_send_customer (
@@ -259,5 +259,5 @@
     send_flag smallint,
     PRIMARY KEY (send_id, customer_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_products (
@@ -308,5 +308,5 @@
     deliv_date_id int,
     PRIMARY KEY (product_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_products_class (
@@ -330,5 +330,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (product_class_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_class (
@@ -341,5 +341,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (class_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_classcategory (
@@ -353,5 +353,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (classcategory_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_class_combination (
@@ -361,5 +361,5 @@
     level int,
     PRIMARY KEY(class_combination_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_category (
@@ -374,5 +374,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (category_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_product_categories (
@@ -381,5 +381,5 @@
     rank int NOT NULL,
     PRIMARY KEY(product_id, category_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_product_status (
@@ -391,5 +391,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY(product_status_id, product_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_bat_order_daily (
@@ -415,5 +415,5 @@
     key_year text NOT NULL,
     key_wday text NOT NULL
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_bat_order_daily_hour (
@@ -432,5 +432,5 @@
     order_date datetime,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_recommend_products (
@@ -443,5 +443,5 @@
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_review (
@@ -461,5 +461,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (review_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_customer_favorite_products (
@@ -468,5 +468,5 @@
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_category_count (
@@ -474,5 +474,5 @@
     product_count int NOT NULL,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_category_total_count (
@@ -480,5 +480,5 @@
     product_count int,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_news (
@@ -496,5 +496,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (news_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_best_products (
@@ -510,5 +510,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (best_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_mail_history (
@@ -521,5 +521,5 @@
     mail_body text,
     PRIMARY KEY (send_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_customer (
@@ -562,5 +562,5 @@
     mailmaga_flg smallint,
     PRIMARY KEY (customer_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_order (
@@ -639,5 +639,5 @@
     memo10 text,
     PRIMARY KEY (order_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_order_temp (
@@ -717,5 +717,5 @@
     memo10 text,
     session text
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_other_deliv (
@@ -735,5 +735,5 @@
     tel03 text,
     PRIMARY KEY (other_deliv_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_order_detail (
@@ -748,5 +748,5 @@
     quantity numeric,
     point_rate numeric
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_member (
@@ -765,5 +765,5 @@
     login_date datetime,
     PRIMARY KEY (member_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_bat_relate_products (
@@ -772,5 +772,5 @@
     customer_id int,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_pagelayout (
@@ -792,5 +792,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (device_type_id, page_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_bloc (
@@ -806,5 +806,5 @@
     PRIMARY KEY (device_type_id, bloc_id),
     UNIQUE (device_type_id, filename)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_blocposition (
@@ -816,5 +816,5 @@
     anywhere smallint DEFAULT 0 NOT NULL,
     PRIMARY KEY (device_type_id, page_id, target_id, bloc_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_csv (
@@ -832,5 +832,5 @@
     error_check_types text,
     PRIMARY KEY (no)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_csv_sql (
@@ -841,5 +841,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (sql_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_templates (
@@ -849,5 +849,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (template_code)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_table_comment (
@@ -857,5 +857,5 @@
     description text,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_maker (
@@ -868,5 +868,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (maker_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_maker_count (
@@ -874,5 +874,5 @@
     product_count int NOT NULL,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_pref (
@@ -881,5 +881,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_permission (
@@ -888,5 +888,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id(32))
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_disable_logout (
@@ -895,5 +895,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_authority (
@@ -902,5 +902,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_work (
@@ -909,5 +909,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_disp (
@@ -916,5 +916,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_class (
@@ -923,5 +923,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_status (
@@ -930,5 +930,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_status_image (
@@ -937,5 +937,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_allowed_tag (
@@ -944,5 +944,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_page_max (
@@ -951,5 +951,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_magazine_type (
@@ -958,5 +958,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_mail_magazine_type (
@@ -965,5 +965,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_recommend (
@@ -972,5 +972,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_taxrule (
@@ -979,5 +979,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_mail_template (
@@ -986,5 +986,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_mail_tpl_path (
@@ -993,5 +993,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_job (
@@ -1000,5 +1000,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_reminder (
@@ -1007,5 +1007,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_sex (
@@ -1014,5 +1014,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_page_rows (
@@ -1021,5 +1021,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_mail_type (
@@ -1028,5 +1028,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_order_status (
@@ -1035,5 +1035,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_product_status_color (
@@ -1042,5 +1042,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_order_status_color (
@@ -1049,5 +1049,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_wday (
@@ -1056,5 +1056,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_delivery_date (
@@ -1063,5 +1063,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_product_list_max (
@@ -1070,5 +1070,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_convenience (
@@ -1077,5 +1077,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_conveni_message (
@@ -1084,5 +1084,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_db (
@@ -1091,5 +1091,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_target (
@@ -1098,5 +1098,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_review_deny_url (
@@ -1105,5 +1105,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_track_back_status (
@@ -1112,5 +1112,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_site_control_track_back (
@@ -1119,5 +1119,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_site_control_affiliate (
@@ -1126,5 +1126,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_mobile_domain (
@@ -1133,5 +1133,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_ownersstore_err (
@@ -1140,5 +1140,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_ownersstore_ips (
@@ -1147,5 +1147,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_constants (
@@ -1155,5 +1155,5 @@
     remarks text,
     PRIMARY KEY (id(64))
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_product_type (
@@ -1162,5 +1162,5 @@
     rank smallint NOT NULL,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE mtb_device_type (
@@ -1169,5 +1169,5 @@
     rank smallint NOT NULL,
     PRIMARY KEY (id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_mobile_ext_session_id (
@@ -1198,5 +1198,5 @@
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_session (
@@ -1206,5 +1206,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (sess_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_site_control (
@@ -1218,5 +1218,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (control_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_trackback (
@@ -1232,5 +1232,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (trackback_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_bkup (
@@ -1239,5 +1239,5 @@
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     PRIMARY KEY (bkup_name)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE TABLE dtb_plugin (
@@ -1250,5 +1250,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (plugin_id)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(64));
@@ -1270,3 +1270,3 @@
     recommend_comment text,
     PRIMARY KEY (table_name, column_name)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
Index: /branches/version-2_5-dev/html/install/index.php
===================================================================
--- /branches/version-2_5-dev/html/install/index.php	(revision 19808)
+++ /branches/version-2_5-dev/html/install/index.php	(revision 19854)
@@ -32,4 +32,5 @@
 $INSTALL_DIR = realpath(dirname( __FILE__));
 require_once(DATA_REALDIR . "module/Request.php");
+require_once(DATA_REALDIR . "install.php");
 
 define("INSTALL_LOG", "./temp/install.log");
@@ -112,5 +113,10 @@
         // 設定ファイルの生成
         lfMakeConfigFile();
-        $objPage = lfDispStep3($objPage);
+        if(!renameAdminDir($objWebParam->getValue('admin_dir'))){
+            $objPage->arrErr["all"] .= "管理者ディレクトリのリネームに失敗しました。権限を確認してください。";
+            $objPage = lfDispStep2($objPage);
+        }else{
+            $objPage = lfDispStep3($objPage);
+        }
     } else {
         $objPage = lfDispStep2($objPage);
@@ -399,4 +405,5 @@
         DATA_REALDIR . "downloads/",
         DATA_REALDIR . "upload/",
+        HTML_REALDIR . "admin/"
     );
 
@@ -646,4 +653,9 @@
         }
     }
+    
+    //管理画面のディレクトリ名を取得（再インストール時）
+    if(defined("ADMIN_DIR")){
+        $admin_dir = ADMIN_DIR;
+    }
 
     $objWebParam->addParam("店名", "shop_name", MTEXT_LEN, "", array("EXIST_CHECK","MAX_LENGTH_CHECK"), $shop_name);
@@ -651,4 +663,7 @@
     $objWebParam->addParam("管理者：ログインID", "login_id", ID_MAX_LEN, "", array("EXIST_CHECK","SPTAB_CHECK", "ALNUM_CHECK"));
     $objWebParam->addParam("管理者：パスワード", "login_pass", ID_MAX_LEN, "", array("EXIST_CHECK","SPTAB_CHECK", "ALNUM_CHECK"));
+    $objWebParam->addParam("管理画面：ディレクトリ", "admin_dir", ID_MAX_LEN, "a", array("EXIST_CHECK","SPTAB_CHECK", "ALNUM_CHECK"),$admin_dir);
+    $objWebParam->addParam("管理画面：SSL制限", "admin_force_ssl", 1, "n", array("SPTAB_CHECK", "NUM_CHECK","MAX_LENGTH_CHECK"));
+    $objWebParam->addParam("管理画面：IP制限", "admin_allow_hosts", LTEXT_LEN, "an", array("IP_CHECK","MAX_LENGTH_CHECK"));
     $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);
@@ -721,5 +736,5 @@
 
     // パスワードのチェック
-    $objErr->doFunc( array("管理者：パスワード",'login_pass',ID_MIN_LEN ,ID_MAX_LEN ) ,array("SPTAB_CHECK" ,"NUM_RANGE_CHECK" ));
+    $objErr->doFunc( array("管理者：パスワード",'login_pass',PASSWORD_LEN1 ,PASSWORD_LEN2 ) ,array("SPTAB_CHECK" ,"NUM_RANGE_CHECK" ));
 
     return $objErr->arrErr;
@@ -902,5 +917,26 @@
 
     $filepath = DATA_REALDIR . "install.php";
-
+    
+    //管理画面SSL制限
+    $force_ssl = FALSE;
+    if($objWebParam->getValue('admin_force_ssl') == 1){
+        $force_ssl = TRUE;
+    }
+    //管理画面IP制限
+    $allow_hosts = array();
+    $hosts = $objWebParam->getValue('admin_allow_hosts');
+    if(!empty($hosts)){
+        $hosts = str_replace("\r","",$hosts);
+        if(strpos("\n",$hosts) === false){
+            $hosts .= "\n";
+        }
+        $hosts = explode("\n",$hosts);
+        foreach($hosts as $key=>$host){
+            $host = trim($host);
+            if(strlen($host) >= 8) {
+                $allow_hosts[] = $host;
+            }
+        }
+    }
     $config_data =
     "<?php\n".
@@ -916,5 +952,10 @@
     "    define ('DB_NAME', '" . $objDBParam->getValue('db_name') . "');\n" .
     "    define ('DB_PORT', '" . $objDBParam->getValue('db_port') .  "');\n" .
-    "?>";
+    "    define ('ADMIN_DIR', '" . $objWebParam->getValue('admin_dir') .  "/');\n" .
+    "    define ('ADMIN_FORCE_SSL', " . $force_ssl .  ");\n";
+    if(count($allow_hosts) > 0){
+        $config_data .= "    define ('ADMIN_ALLOW_HOSTS', '".serialize($allow_hosts)."');\n";
+    }
+    $config_data .= "?>";
 
     if($fp = fopen($filepath,"w")) {
@@ -988,3 +1029,23 @@
                  array("dtb_trackback", "trackback_id"));
 }
+
+
+/**
+ * 管理画面のディレクトリ名の変更
+ *
+ * @param string 設定する管理画面のディレクトリ名
+ */
+function renameAdminDir($admin_dir){
+    $old_dir = "admin/";
+    if(defined("ADMIN_DIR")){
+        $old_dir = ADMIN_DIR;
+    }
+    if(!rename(HTML_REALDIR.$old_dir,HTML_REALDIR.$admin_dir)){
+        return FALSE;
+    }
+    if(!rename(USER_TEMPLATE_REALDIR.$old_dir,USER_TEMPLATE_REALDIR.$admin_dir)){
+        return FALSE;
+    }
+    return TRUE;
+}
 ?>
