Index: /branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_EchoKey.php
===================================================================
--- /branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_EchoKey.php	(revision 16383)
+++ /branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_EchoKey.php	(revision 16383)
@@ -0,0 +1,111 @@
+<?php
+/*
+ * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ */
+
+// {{{ requires
+require_once CLASS_PATH . 'pages/LC_Page.php';
+
+/**
+ * XXX のページクラス.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $Id$
+ */
+class LC_Page_Upgrade_EchoKey extends LC_Page {
+
+    var $objForm = null;
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init() {
+        parent::init();
+
+        $this->objForm = new SC_FormParam();
+        $this->objForm->addParam('seed', 'seed', '', '', array('EXIST_CHECK', 'ALNUM_CHECK'));
+        $this->objForm->setParam($_POST);
+
+        $this->objJson = new Services_Json;
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process() {
+        $objJSON = new Services_JSON();
+        // リクエストの検証
+        if ($this->isValidRequest() !== true) {
+            // TODO Bad Requestを返すように変更する
+            exit;
+        }
+
+        $public_key = $this->getPublicKey();
+
+        // 認証キーが設定されていない場合
+        if (empty($public_key)) {
+            // TODO データ形式の統一が必要
+            echo serialize('エラーメッセージ');
+            exit;
+        }
+
+        // 認証キー + 配信サーバから送られるランダムな値をsha1()にかけechoする
+        echo $objJSON->encode(array('body' => sha1($public_key . $_POST['seed'])));
+        exit;
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy() {
+        parent::destroy();
+    }
+
+    /**
+     * リクエストの検証
+     *
+     * @param void
+     * @return boolean
+     */
+    function isValidRequest() {
+        // TODO 未実装
+        return true;
+
+    }
+
+    /**
+     * DBから認証キーを取得する
+     * 無い場合はnullを返す
+     *
+     * @param void
+     * @return string|null 認証キー
+     */
+    function getPublicKey() {
+        $table  = 'dtb_application_settings';
+        $col    = 'public_key';
+        $where  = 'application_settings_id = 1';
+
+        $objQuery = new SC_Query();
+
+        $arrRet = $objQuery->select($col, $table, $where);
+
+        if (isset($arrRet[0]['public_key'])) {
+            return $arrRet[0]['public_key'];
+        }
+
+        return null;
+    }
+}
+?>
Index: /branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_Base.php
===================================================================
--- /branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_Base.php	(revision 16383)
+++ /branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_Base.php	(revision 16383)
@@ -0,0 +1,3 @@
+<?php
+
+?>
Index: /branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_ProductsList.php
===================================================================
--- /branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_ProductsList.php	(revision 16383)
+++ /branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_ProductsList.php	(revision 16383)
@@ -0,0 +1,77 @@
+<?php
+/*
+ * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ */
+
+// {{{ requires
+require_once CLASS_PATH . 'pages/LC_Page.php';
+require_once DATA_PATH  . 'module/Services/JSON.php';
+require_once DATA_PATH  . 'module/Request.php';
+
+/**
+ * XXX のページクラス.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $Id$
+ */
+class LC_Page_Upgrade_ProductsList extends LC_Page {
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init() {
+        parent::init();
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process() {
+        $objSess = new SC_Session();
+        if ( $objSess->isSuccess() !== true) {
+            // TODO エラー処理
+        }
+
+        // TODO CSRF対策が必須
+
+        $objReq = new HTTP_Request();
+        $objReq->setUrl('http://cube-shopaccount/upgrade/index.php');
+        $objReq->setMethod('POST');
+        $objReq->addPostData('mode', 'products_list');
+        $objReq->addPostData('site_url', SITE_URL);
+        $objReq->addPostData('ssl_url', SSL_URL);
+
+        if (PEAR::isError($objReq->sendRequest())) {
+            // TODO エラー処理
+        }
+
+        if ($objReq->getResponseCode() !== 200) {
+            // TODO エラー処理
+        }
+
+        echo $objReq->getResponseBody();
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy() {
+        parent::destroy();
+    }
+
+
+    function createResponceHTML() {}
+}
+?>
Index: /branches/feature-module-update/data/Smarty/templates/default/admin/app/index.tpl
===================================================================
--- /branches/feature-module-update/data/Smarty/templates/default/admin/app/index.tpl	(revision 15782)
+++ /branches/feature-module-update/data/Smarty/templates/default/admin/app/index.tpl	(revision 16383)
@@ -6,4 +6,57 @@
  */
 *}-->
+<script type="text/javascript"><!--
+(function() {
+  var eccube = function() {}
+  var ownersstore = function() {
+    this.setup = function() {
+      var $j = jQuery.noConflict();
+      $j("#loading").ajaxStart(function(){
+          $j(this).show();
+      });
+      $j("#loading").ajaxStop(function(){
+          $j(this).hide();
+      });
+    }
+  }
+  eccube.prototype = {
+    ownersstore: new ownersstore()
+  }
+  window.eccube = eccube;
+})();
+    
+    
+    
+
+
+
+function loadList() {
+    var $j = jQuery.noConflict();
+
+    $j("#ownerssore_loading").ajaxStart(function(){
+        $j(this).html("<img src='<!--{$TPL_DIR}-->img/ajax/loading.gif'>").show();
+    });
+    $j("#ownerssore_loading").ajaxStop(function(){
+        $j(this).hide();
+    });
+    
+    $j.post(
+        '<!--{$smarty.const.URL_DIR}-->upgrade/index.php',
+        {mode: 'products_list'},
+        function(resp) {
+            if (resp.body) {
+                $j("#ownersstore_products_list").html(resp.body);
+            } else {
+                $j("#ownersstore_products_list").load(
+                    "<!--{$smarty.const.URL_DIR}-->upgrade/api/error.html"
+                );
+            }
+        },
+        'json'
+    )
+}
+
+//-->
+</script>
 <!--★★メインコンテンツ★★-->
 <table width="878" border="0" cellspacing="0" cellpadding="0" summary=" ">
@@ -46,49 +99,22 @@
 										<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/main_bar.jpg" width="678" height="10" alt=""></td>
 									</tr>
+									<tr><td colspan="3" bgcolor="#ffffff" height="5"></td></tr>
+									<tr>
+									    <td colspan="3" bgcolor="#ffffff" align="center">
+									        <input type="button" onclick="loadList();" value="オーナーズストア購入商品の一覧を取得">
+									    </td>
+									</tr>
+									<tr>
+									    <td colspan="3" bgcolor="#ffffff" height="35" align="center">
+									        <div id="ownerssore_loading"></div>
+									    </td>
+									</tr>
 								</table>
 								<!--サブタイトルここまで-->
 								
-								<table width="678" border="0" cellspacing="0" cellpadding="8" summary=" ">
-									<!--アプリ情報-->
-									<tr bgcolor="#ffffff" class="fs12n">
-									<td width="60"><img src="<!--{$smarty.const.URL_DIR}-->test/logo2.gif"></td>
-									<td width="420"><span class="fs24n"><strong>自動アップデート</storong></span></td>
-									<td width="218">
-										<p>【ステータス】</p>
-										<p>2007/08/09アップデート実行済み</p>
-									</td>
-									</tr>
-									
-									<tr bgcolor="#ffffff" class="fs12n">
-									<td width="60"></td>
-									<td width="400">EC-CUBEを最新に保ちます</td>
-									<td width="218">
-										<input type="button" value="インストール">
-										<input type="button" value="アップデート">
-									</td>
-									</tr>
-									
-									<tr bgcolor="#ffffff"><td colspan="3"><hr></td></tr>
-									
-									<!--アプリ情報-->
-									<tr bgcolor="#ffffff" class="fs12n">
-									<td width="60"><img src="<!--{$smarty.const.URL_DIR}-->test/logo.gif"></td>
-									<td width="400"><span class="fs24n"><strong>AD EBiSタグ埋め込み　1.0.5</storong></span></td>
-									<td width="218">
-										<p>【ステータス】</p>
-										<p>只今、入金待ちです。</p>
-									</td>
-									</tr>
-									
-									<tr bgcolor="#ffffff" class="fs12n">
-									<td width="60"></td>
-									<td width="400">アドエビス（アクセス解析オプションを含む）のタグを<br>自動的に埋め込みます</td>
-									<td width="218">
-										<input type="button" value="インストール">
-										<input type="button" value="アップデート">
-									</td>
-									</tr>
-									
-								</table>
+								<!--購入商品一覧ここから-->
+								<div id="ownersstore_products_list"></div>
+								<!--購入商品一覧ここまで-->
+								
 								</td>
 								<td background="<!--{$TPL_DIR}-->img/contents/main_right.jpg"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="14" height="1" alt=""></td>
Index: /branches/feature-module-update/html/upgrade/index.php
===================================================================
--- /branches/feature-module-update/html/upgrade/index.php	(revision 15532)
+++ /branches/feature-module-update/html/upgrade/index.php	(revision 16383)
@@ -6,57 +6,47 @@
  */
 
-require_once("../require.php");
-
-//ページ管理クラス
-class LC_Page {
-	//コンストラクタ
-	function LC_Page() {
-		//メインテンプレートの指定
-		$this->tpl_mainpage = 'upgrade/index.tpl';
-	}
+if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+    header("HTTP/1.1 400 Bad Request");
+    exit();
 }
 
-$objPage = new LC_Page();
-$objView = new SC_SiteView();
+// {{{ requires
+require_once '../require.php';
+require_once '../admin/require.php';
+require_once DATA_PATH  . 'module/Services/JSON.php';
 
-$con = ftp_connect("localhost");
-$res = ftp_login($con, "osuser", "password");
-if($con != false && $res != false) {
-	//ファイルのダウンロード
-	if($_POST['filename'] != "") {
-		
-		$download_file = DATA_PATH . "module/upload/" . $_POST['filename'];
-		
-		if(ftp_get($con, $download_file, $_POST['filename'], FTP_BINARY)) {
-			ftp_quit($con);
-			//ファイル所有者変更
-			echo "ファイルのダウンロードに成功しました。";
-			sfPrintR(exec("tar zxvf " . $download_file . " ./", $arrRes));
-		} else {
-			echo 'ファイルのダウンロードに失敗しました。';
-		}
-	}
-	
-	//ディレクトリ内の全てのファイルを取得
-	$arrRet = ftp_nlist($con, ".");
-	$i = 0;
-	//必要なファイル情報を取得
-	foreach($arrRet as $val) {
-		if(!ereg("^\.|^\..", $val)) {
-			$arrFile[$i]['filename'] = $val;
-			$arrFile[$i]['date'] = date("Y年m月d日", ftp_mdtm($con, $val));
-			$arrFile[$i]['filesize'] = number_format(ftp_size($con, $val))."Byte";
-			$i++;
-		}
-	}
-	$objPage->arrFile = $arrFile;
+// }}}
+// {{{ generate page
+
+$objPage = lfPageFactory();
+$objPage->init();
+$objPage->process();
+register_shutdown_function(array($objPage, "destroy"));
+
+function lfPageFactory() {
+    $mode = isset($_POST['mode']) ? $_POST['mode'] : '';
+
+    $prefix = 'LC_Page_Upgrade_';
+    $file   = CLASS_PATH . "pages/upgrade/${prefix}";
+    $class  = $prefix;
+
+    switch ($mode) {
+    case 'echo_key':
+        $file  .= 'EchoKey.php';
+        $class .= 'EchoKey';
+        break;
+    case 'products_list':
+        $file  .= 'ProductsList.php';
+        $class .= 'ProductsList';
+        break;
+    default:
+        header("HTTP/1.1 400 Bad Request");
+        exit();
+        break;
+    }
+
+    require_once $file;
+    return new $class;
 }
+?>
 
-$objView->assignobj($objPage);		//変数をテンプレートにアサインする
-$objView->display(SITE_FRAME);		//テンプレートの出力
-
-//-------------------------------------------------------------------------------------------------------
-
-
-
-?>
