source: branches/comu-ver2/data/class/pages/error/LC_Page_Error.php @ 18140

Revision 18140, 6.8 KB checked in by Seasoft, 15 years ago (diff)

未検出に関するエラー時に HTTP ステータス 404 を返すように改良した。

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