source: branches/version-2_12-dev/data/class/pages/admin/LC_Page_Admin.php @ 22567

Revision 22567, 4.3 KB checked in by shutta, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)
Zend Framework PHP 標準コーディング規約のコーディングスタイルへ準拠。
classおよびfunctionの開始波括弧「{」のスタイルを修正。

  • 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
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 */
23
24// {{{ requires
25require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php';
26
27/**
28 * 管理者ログイン のページクラス.
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id$
33 */
34class LC_Page_Admin extends LC_Page_Ex
35{
36
37    // }}}
38    // {{{ functions
39
40    /**
41     * Page を初期化する.
42     *
43     * @return void
44     */
45    function init()
46    {
47        $this->template = MAIN_FRAME;
48
49        //IP制限チェック
50        $allow_hosts = unserialize(ADMIN_ALLOW_HOSTS);
51        if (is_array($allow_hosts) && count($allow_hosts) > 0) {
52            if (array_search($_SERVER['REMOTE_ADDR'],$allow_hosts) === FALSE) {
53                SC_Utils_Ex::sfDispError(AUTH_ERROR);
54            }
55        }
56
57        //SSL制限チェック
58        if (ADMIN_FORCE_SSL == TRUE) {
59            if (SC_Utils_Ex::sfIsHTTPS() === false) {
60                SC_Response_Ex::sendRedirect($_SERVER['REQUEST_URI'], $_GET, FALSE, TRUE);
61            }
62        }
63
64        $this->tpl_authority = $_SESSION['authority'];
65
66        // ディスプレイクラス生成
67        $this->objDisplay = new SC_Display_Ex();
68
69        // スーパーフックポイントを実行.
70        $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
71        $objPlugin->doAction('LC_Page_preProcess', array($this));
72
73        // トランザクショントークンの検証と生成
74        $this->doValidToken(true);
75        $this->setTokenTo();
76
77        // ローカルフックポイントを実行
78        $parent_class_name = get_parent_class($this);
79        $objPlugin->doAction($parent_class_name . '_action_before', array($this));
80        $class_name = get_class($this);
81        if ($class_name != $parent_class_name) {
82            $objPlugin->doAction($class_name . '_action_before', array($this));
83        }
84    }
85
86    /**
87     * Page のプロセス.
88     *
89     * @return void
90     */
91    function process()
92    {
93    }
94
95    /**
96     * Page のレスポンス送信.
97     *
98     * @return void
99     */
100    function sendResponse()
101    {
102        $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
103        // ローカルフックポイントを実行
104        $parent_class_name = get_parent_class($this);
105        $objPlugin->doAction($parent_class_name . '_action_after', array($this));
106        $class_name = get_class($this);
107        if ($class_name != $parent_class_name) {
108            $objPlugin->doAction($class_name . '_action_after', array($this));
109        }
110
111        // HeadNaviにpluginテンプレートを追加する.
112        $objPlugin->setHeadNaviBlocs($this->arrPageLayout['HeadNavi']);
113
114        // スーパーフックポイントを実行.
115        $objPlugin->doAction('LC_Page_process', array($this));
116
117        $this->objDisplay->prepare($this, true);
118        $this->objDisplay->response->write();
119    }
120
121    /**
122     * デストラクタ.
123     *
124     * @return void
125     */
126    function destroy()
127    {
128        parent::destroy();
129    }
130
131    /**
132     * 前方互換用
133     *
134     * @deprecated 2.12.0 GC_Utils_Ex::gfPrintLog を使用すること
135     */
136    function log($mess, $log_level='Info')
137    {
138        trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING);
139        // ログレベル=Debugの場合は、DEBUG_MODEがtrueの場合のみログ出力する
140        if ($log_level === 'Debug' && DEBUG_MODE === false) {
141            return;
142        }
143
144        // ログ出力
145        GC_Utils_Ex::gfPrintLog($mess, '');
146    }
147
148}
Note: See TracBrowser for help on using the repository browser.