source: branches/version-2_13-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Login.php @ 22856

Revision 22856, 3.4 KB checked in by Seasoft, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.13.0)

  • 主に空白・空白行の調整。もう少し整えたいが、一旦現状コミット。
  • 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/frontparts/bloc/LC_Page_FrontParts_Bloc_Ex.php';
25
26/**
27 * ログイン のページクラス.
28 *
29 * @package Page
30 * @author LOCKON CO.,LTD.
31 * @version $Id:LC_Page_FrontParts_Bloc_Login.php 15532 2007-08-31 14:39:46Z nanasess $
32 */
33class LC_Page_FrontParts_Bloc_Login extends LC_Page_FrontParts_Bloc_Ex
34{
35    /**
36     * Page を初期化する.
37     *
38     * @return void
39     */
40    function init()
41    {
42        parent::init();
43        $this->tpl_login = false;
44        $this->tpl_disable_logout = false;
45        $this->httpCacheControl('nocache');
46    }
47
48    /**
49     * Page のプロセス.
50     *
51     * @return void
52     */
53    function process()
54    {
55        $this->action();
56        $this->sendResponse();
57    }
58
59    /**
60     * Page のアクション.
61     *
62     * @return void
63     */
64    function action()
65    {
66        $objCustomer = new SC_Customer_Ex();
67        // クッキー管理クラス
68        $objCookie = new SC_Cookie_Ex();
69
70        // ログイン判定
71        if ($objCustomer->isLoginSuccess()) {
72            $this->tpl_login = true;
73            $this->tpl_user_point = $objCustomer->getValue('point');
74            $this->tpl_name1 = $objCustomer->getValue('name01');
75            $this->tpl_name2 = $objCustomer->getValue('name02');
76        } else {
77            // クッキー判定
78            $this->tpl_login_email = $objCookie->getCookie('login_email');
79            if ($this->tpl_login_email != '') {
80                $this->tpl_login_memory = '1';
81            }
82            // POSTされてきたIDがある場合は優先する。
83            if (isset($_POST['login_email']) && $_POST['login_email'] != '') {
84                $this->tpl_login_email = $_POST['login_email'];
85            }
86        }
87
88        $this->tpl_disable_logout = $this->lfCheckDisableLogout();
89        //スマートフォン版ログアウト処理で不正なページ移動エラーを防ぐ為、トークンをセット
90        $this->transactionid = SC_Helper_Session_Ex::getToken();
91
92
93    }
94
95    /**
96     * デストラクタ.
97     *
98     * @return void
99     */
100    function destroy()
101    {
102        parent::destroy();
103    }
104
105    /**
106     * lfCheckDisableLogout.
107     *
108     * @return boolean
109     */
110    function lfCheckDisableLogout()
111    {
112        $masterData = new SC_DB_MasterData_Ex();
113        $arrDisableLogout = $masterData->getMasterData('mtb_disable_logout');
114
115        $current_page = $_SERVER['SCRIPT_NAME'];
116
117        foreach ($arrDisableLogout as $val) {
118            if ($current_page == $val) {
119                return true;
120            }
121        }
122
123        return false;
124    }
125}
Note: See TracBrowser for help on using the repository browser.