Source for file LC_Page_FrontParts_LoginCheck.php
Documentation is available at LC_Page_FrontParts_LoginCheck.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php';
* TODO mypage/LC_Page_Mypage_LoginCheck と統合
* @author LOCKON CO.,LTD.
* @version $Id:LC_Page_FrontParts_LoginCheck.php 15532 2007-08-31 14:39:46Z nanasess $
$objCustomer = new SC_Customer_Ex();
$objCookie = new SC_Cookie_Ex(COOKIE_EXPIRE);
$objFormParam = new SC_FormParam_Ex();
$objFormParam->setParam($_POST);
switch ($this->getMode()) {
$objFormParam->trimParam();
$objFormParam->toLower('login_email');
$arrErr = $objFormParam->checkError();
if (count($arrErr) > 0) {
if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR);
$arrForm = $objFormParam->getHashArray();
if ($arrForm['login_memory'] == '1' && $arrForm['login_email'] != '') {
$objCookie->setCookie('login_email', $arrForm['login_email']);
$objCookie->setCookie('login_email', '');
if (count($arrErr) == 0) {
if(SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) {
if(!$objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) &&
!$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) {
if(!$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'])) {
if ($loginFailFlag == false) {
if(SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) {
// ログインが成功した場合は携帯端末IDを保存する。
$objCustomer->updateMobilePhoneId();
$objMobile = new SC_Helper_Mobile_Ex();
if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) {
if (!$objCustomer->hasValue('email_mobile')) {
SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php');
if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
echo SC_Utils_Ex::jsonEncode(array('success' => $_POST['url']));
SC_Response_Ex::sendRedirect($_POST['url']);
$arrForm['login_email'] = strtolower($arrForm['login_email']);
$objQuery = SC_Query_Ex::getSingletonInstance();
$where = '(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0';
$ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email']));
// ログインエラー表示 TODO リファクタリング
if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR);
if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR);
SC_Response_Ex::sendRedirect($_POST['url']);
$objCustomer->EndSession();
$mypage_url_search = strpos('.'. $_POST['url'], 'mypage');
if ($mypage_url_search == 2) {
SC_Response_Ex::sendRedirectFromUrlPath('mypage/login.php');
SC_Response_Ex::sendRedirect(HTTP_URL);
* @param SC_FormParam $objFormParam パラメーター管理クラス
$objFormParam->addParam('記憶する', 'login_memory', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
$objFormParam->addParam('メールアドレス', 'login_email', MTEXT_LEN, 'a', array('EXIST_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('パスワード', 'login_pass', PASSWORD_MAX_LEN, '', array('EXIST_CHECK', 'MAX_LENGTH_CHECK'));
* @return string JSON 形式のエラーメッセージ
$msg = "メールアドレスもしくはパスワードが正しくありません。\n本登録がお済みでない場合は、仮登録メールに記載されているURLより本登録を行ってください。";
$msg = "メールアドレスもしくはパスワードが正しくありません。";
return SC_Utils_Ex::jsonEncode(array('login_error' => $msg));
Documentation generated on Fri, 24 Feb 2012 14:02:02 +0900 by Seasoft
|