source: branches/version-2_13-dev/data/class/pages/upgrade/LC_Page_Upgrade_Base.php @ 23475

Revision 23475, 2.9 KB checked in by shutta, 10 years ago (diff)

#2488 mtb_ownersstore_ipsの削除
mtb_ownersstore_ipsマスターに関連する部分を全て削除。

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
RevLine 
[16839]1<?php
[20344]2require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php';
[19805]3require_once CLASS_REALDIR . 'pages/upgrade/helper/LC_Upgrade_Helper_Log.php';
4require_once CLASS_REALDIR . 'pages/upgrade/helper/LC_Upgrade_Helper_Json.php';
[16839]5
6/**
7 * オーナーズストアページクラスの基底クラス.
8 *
9 * @package Page
10 * @author LOCKON CO.,LTD.
11 * @version $Id$
12 */
[22856]13class LC_Page_Upgrade_Base extends LC_Page_Ex
[22567]14{
[23057]15    /**
16     * Page を初期化する.
17     *
18     * @return void
19     */
[23124]20    public function init()
[23057]21    {
22        $this->skip_load_page_layout = true;
23        parent::init();
24    }
25
[16839]26    /**
27     * 自動アップデートが有効かどうかを判定する.
28     *
[23124]29     * @param  integer $product_id
[16839]30     * @return boolean
31     */
[23124]32    public function autoUpdateEnable($product_id)
[22567]33    {
[16873]34        $where = 'module_id = ?';
[21750]35        $objQuery =& SC_Query_Ex::getSingletonInstance();
[16839]36        $arrRet = $objQuery->select('auto_update_flg', 'dtb_module', $where, array($product_id));
37
38        if (isset($arrRet[0]['auto_update_flg'])
39        && $arrRet[0]['auto_update_flg'] === '1') {
40            return true;
41        }
42
43        return false;
44    }
45
46    /**
[20970]47     * 配信サーバーへリクエストを送信する.
[16839]48     *
[23124]49     * @param  string        $mode
50     * @param  array         $arrParams 追加パラメーター.連想配列で渡す.
[16839]51     * @return string|object レスポンスボディ|エラー時にはPEAR::Errorオブジェクトを返す.
52     */
[23124]53    public function request($mode, $arrParams = array(), $arrCookies = array())
[22567]54    {
[23141]55        $objReq = new HTTP_Request();
[16839]56        $objReq->setUrl(OSTORE_URL . 'upgrade/index.php');
57        $objReq->setMethod('POST');
[23141]58        $objReq->addPostData('mode', $mode);
[21241]59        foreach ($arrParams as $key => $val) {
[23141]60            $objReq->addPostData($key, $val);
[21241]61        }
[16839]62
63        foreach ($arrCookies as $cookie) {
64            $objReq->addCookie($cookie['name'], $cookie['value']);
65        }
66
[23141]67        $e = $objReq->sendRequest();
[16839]68        if (PEAR::isError($e)) {
69            return $e;
70        } else {
71            return $objReq;
72        }
73    }
74
[23124]75    public function isLoggedInAdminPage()
[22567]76    {
[20449]77        $objSess = new SC_Session_Ex();
[16839]78
79        if ($objSess->isSuccess() === SUCCESS) {
80            return true;
81        }
[22856]82
[16839]83        return false;
84    }
85
86    /**
87     * 予測されにくいランダム値を生成する.
88     *
89     * @return string
90     */
[23124]91    public function createSeed()
[22567]92    {
[16839]93        return sha1(uniqid(rand(), true) . time());
94    }
95
[23124]96    public function getPublicKey()
[22567]97    {
[21750]98        $objQuery =& SC_Query_Ex::getSingletonInstance();
[16839]99        $arrRet = $objQuery->select('*', 'dtb_ownersstore_settings');
[22856]100
[16839]101        return isset($arrRet[0]['public_key'])
102            ? $arrRet[0]['public_key']
103            : null;
104    }
[20336]105
106    /**
107     * オーナーズストアからの POST のため, トークンチェックしない.
108     */
[23124]109    public function doValidToken()
[22567]110    {
[20336]111        // nothing.
112    }
[16839]113}
Note: See TracBrowser for help on using the repository browser.