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