source: branches/version-2_13-dev/data/class/pages/error/LC_Page_Error.php @ 23124

Revision 23124, 7.4 KB checked in by kimoto, 11 years ago (diff)

#2043 typo修正・ソース整形・ソースコメントの改善 for 2.13.0
PHP4的な書き方の修正

  • 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
24require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php';
25
26/**
27 * エラー表示のページクラス
28 *
29 * @package Page
30 * @author LOCKON CO.,LTD.
31 * @version $Id:LC_Page_Error.php 15532 2007-08-31 14:39:46Z nanasess $
32 */
33class LC_Page_Error extends LC_Page_Ex
34{
35    /** エラー種別 */
36    public $type;
37
38    /** SC_SiteSession インスタンス */
39    public $objSiteSess;
40
41    /** TOPへ戻るフラグ */
42    public $return_top = false;
43
44    /** エラーメッセージ */
45    public $err_msg = '';
46
47    /** モバイルサイトの場合 true */
48    public $is_mobile = false;
49
50    /**
51     * Page を初期化する.
52     *
53     * DBエラー発生時, エラーページを表示しようした際の DB 接続を防ぐため,
54     * ここでは, parent::init() を行わない.
55     * @return void
56     */
57    public function init()
58    {
59        $this->tpl_mainpage = 'error.tpl';
60        $this->tpl_title = 'エラー';
61        // ディスプレイクラス生成
62        $this->objDisplay = new SC_Display_Ex();
63
64        $objHelperPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
65        if (is_object($objHelperPlugin)) {
66            // transformでフックしている場合に, 再度エラーが発生するため, コールバックを無効化.
67            $objHelperPlugin->arrRegistedPluginActions = array();
68        }
69
70        // キャッシュから店舗情報取得(DBへの接続は行わない)
71        $this->arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisDataCache(false);
72    }
73
74    /**
75     * Page のプロセス.
76     *
77     * @return void
78     */
79    public function process()
80    {
81        parent::process();
82        $this->action();
83        $this->sendResponse();
84    }
85
86    /**
87     * Page のプロセス。
88     *
89     * @return void
90     */
91    public function action()
92    {
93        SC_Response_Ex::sendHttpStatus(500);
94
95        switch ($this->type) {
96            case PRODUCT_NOT_FOUND:
97                $this->tpl_error='ご指定のページはございません。';
98                SC_Response_Ex::sendHttpStatus(404);
99                break;
100            case PAGE_ERROR:
101                $this->tpl_error='不正なページ移動です。';
102                break;
103            case CART_EMPTY:
104                $this->tpl_error='カートに商品ががありません。';
105                break;
106            case CART_ADD_ERROR:
107                $this->tpl_error='購入処理中は、カートに商品を追加することはできません。';
108                break;
109            case CANCEL_PURCHASE:
110                $this->tpl_error='この手続きは無効となりました。以下の要因が考えられます。<br />・セッション情報の有効期限が切れてる場合<br />・購入手続き中に新しい購入手続きを実行した場合<br />・すでに購入手続きを完了している場合';
111                break;
112            case CATEGORY_NOT_FOUND:
113                $this->tpl_error='ご指定のカテゴリは存在しません。';
114                SC_Response_Ex::sendHttpStatus(404);
115                break;
116            case SITE_LOGIN_ERROR:
117                $this->tpl_error='メールアドレスもしくはパスワードが正しくありません。';
118                break;
119            case TEMP_LOGIN_ERROR:
120                $this->tpl_error='メールアドレスもしくはパスワードが正しくありません。<br />本登録がお済みでない場合は、仮登録メールに記載されている<br />URLより本登録を行ってください。';
121                break;
122            case CUSTOMER_ERROR:
123                $this->tpl_error='不正なアクセスです。';
124                break;
125            case SOLD_OUT:
126                $this->tpl_error='申し訳ございませんが、ご購入の直前で売り切れた商品があります。この手続きは無効となりました。';
127                break;
128            case CART_NOT_FOUND:
129                $this->tpl_error='申し訳ございませんが、カート内の商品情報の取得に失敗しました。この手続きは無効となりました。';
130                break;
131            case LACK_POINT:
132                $this->tpl_error='申し訳ございませんが、ポイントが不足しております。この手続きは無効となりました。';
133                break;
134            case FAVORITE_ERROR:
135                $this->tpl_error='既にお気に入りに追加されている商品です。';
136                break;
137            case EXTRACT_ERROR:
138                $this->tpl_error="ファイルの解凍に失敗しました。\n指定のディレクトリに書き込み権限が与えられていない可能性があります。";
139                break;
140            case FTP_DOWNLOAD_ERROR:
141                $this->tpl_error='ファイルのFTPダウンロードに失敗しました。';
142                break;
143            case FTP_LOGIN_ERROR:
144                $this->tpl_error='FTPログインに失敗しました。';
145                break;
146            case FTP_CONNECT_ERROR:
147                $this->tpl_error='FTPログインに失敗しました。';
148                break;
149            case CREATE_DB_ERROR:
150                $this->tpl_error="DBの作成に失敗しました。\n指定のユーザーには、DB作成の権限が与えられていない可能性があります。";
151                break;
152            case DB_IMPORT_ERROR:
153                $this->tpl_error="データベース構造のインポートに失敗しました。\nsqlファイルが壊れている可能性があります。";
154                break;
155            case FILE_NOT_FOUND:
156                $this->tpl_error='指定のパスに、設定ファイルが存在しません。';
157                break;
158            case WRITE_FILE_ERROR:
159                $this->tpl_error="設定ファイルに書き込めません。\n設定ファイルに書き込み権限を与えてください。";
160                break;
161            case DOWNFILE_NOT_FOUND:
162                $this->tpl_error='ダウンロードファイルが存在しません。<br />申し訳ございませんが、店舗までお問合わせ下さい。';
163                break;
164            case FREE_ERROR_MSG:
165                $this->tpl_error=$this->err_msg;
166                break;
167            default:
168                $this->tpl_error='エラーが発生しました。';
169                break;
170        }
171
172    }
173
174    /**
175     * エラーページではトランザクショントークンの自動検証は行わない
176     */
177    public function doValidToken()
178    {
179        // queit.
180    }
181}
Note: See TracBrowser for help on using the repository browser.