Ignore:
Timestamp:
2011/02/12 19:44:52 (15 years ago)
Author:
kimoto
Message:

LC_Page_Mypage_LoginCheck削除

  • ログインの処理はLC_Page_FrontParts_LoginCheckですべて行う
  • 最終的にはPageクラスで行うべきではない
Location:
branches/version-2_5-dev/data/class/pages
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/frontparts/LC_Page_FrontParts_LoginCheck.php

    r20116 r20159  
    7070            SC_Utils_Ex::sfDispSiteError(PAGE_ERROR); 
    7171        } 
    72          
     72 
    7373        // 会員管理クラス 
    7474        $objCustomer = new SC_Customer(); 
     
    7777        // パラメータ管理クラス 
    7878        $this->objFormParam = new SC_FormParam(); 
    79          
     79 
    8080        // パラメータ情報の初期化 
    8181        $this->lfInitParam($this->objFormParam); 
    82          
     82 
    8383        // リクエスト値をフォームにセット 
    8484        $this->objFormParam->setParam($this->lfConvertParam($_POST)); 
    85          
     85 
    8686        // モードによって分岐 
    8787        switch ($this->getMode()) { 
    8888        case 'login': 
    8989            // --- ログイン 
    90              
     90 
    9191            // 入力値のエラーチェック 
    9292            $this->objFormParam->toLower('login_email'); 
    9393            $arrErr = $this->objFormParam->checkError(); 
    94              
     94 
    9595            // エラーの場合はエラー画面に遷移 
    9696            if (count($arrErr) > 0) { 
    9797                SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); 
    9898            } 
    99              
     99 
    100100            // 入力チェック後の値を取得 
    101101            $arrForm = $this->objFormParam->getHashArray(); 
    102              
     102 
    103103            // クッキー保存判定 
    104104            if ($arrForm['login_memory'] == '1' && $arrForm['login_email'] != '') { 
     
    107107                $objCookie->setCookie('login_email', ''); 
    108108            } 
    109              
     109 
    110110            // 遷移先の制御 
    111111            if (count($arrErr) == 0) { 
     112                // ログイン判定 
     113                $loginFailFlag = false; 
     114                if(SC_Display::detectDevice() === DEVICE_TYPE_MOBILE) { 
     115                    // モバイルサイト 
     116                    if(!$objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) && 
     117                       !$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) { 
     118                        $loginFailFlag = true; 
     119                    } 
     120                } else { 
     121                    // モバイルサイト以外 
     122                    if(!$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'])) { 
     123                        $loginFailFlag = true; 
     124                    } 
     125                } 
     126 
    112127                // ログイン処理 
    113                 if ($objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) { 
     128                if ($loginFailFlag == false) { 
     129                    if(SC_Display::detectDevice() === DEVICE_TYPE_MOBILE) { 
     130                        // ログインが成功した場合は携帯端末IDを保存する。 
     131                        $objCustomer->updateMobilePhoneId(); 
     132 
     133                        /* 
     134                         * email がモバイルドメインでは無く, 
     135                         * 携帯メールアドレスが登録されていない場合 
     136                         */ 
     137                        $objMobile = new SC_Helper_Mobile_Ex(); 
     138                        if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) { 
     139                            if (!$objCustomer->hasValue('email_mobile')) { 
     140                                SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php'); 
     141                                exit; 
     142                            } 
     143                        } 
     144                    } 
     145 
    114146                    // --- ログインに成功した場合 
    115                     SC_Response_Ex::sendRedirect(HTTP_URL); 
     147                    SC_Response_Ex::sendRedirect($_POST['url']); 
    116148                    exit; 
    117149                } else { 
     
    134166                exit; 
    135167            } 
    136              
     168 
    137169            break; 
    138170        case 'logout': 
    139171            // --- ログアウト 
    140              
     172 
    141173            // ログイン情報の解放 
    142174            $objCustomer->EndSession(); 
     
    151183            } 
    152184            exit; 
    153              
     185 
    154186            break; 
    155187        default: 
    156188            break; 
    157189        } 
    158          
     190 
    159191    } 
    160192 
     
    176208    function lfInitParam(&$objFormParam) { 
    177209        $objFormParam->addParam('記憶する', 'login_memory', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); 
    178         $objFormParam->addParam('メールアドレス', 'login_email', MTEXT_LEN, 'a', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'EMAIL_CHECK', 'NO_SPTAB' ,'EMAIL_CHAR_CHECK')); 
     210        $objFormParam->addParam('メールアドレス', 'login_email', MTEXT_LEN, 'a', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NO_SPTAB' ,'EMAIL_CHAR_CHECK')); 
    179211        $objFormParam->addParam('パスワード', 'login_pass', PASSWORD_LEN1, '', array('EXIST_CHECK')); 
    180212        $objFormParam->addParam('パスワード', 'login_pass1', PASSWORD_LEN1, '', array('EXIST_CHECK', 'MIN_LENGTH_CHECK')); 
  • branches/version-2_5-dev/data/class/pages/mypage/LC_Page_AbstractMypage.php

    r20156 r20159  
    7171 
    7272            // POSTされてきたIDがある場合は優先する。 
    73             if(isset($_POST['mypage_login_email']) 
    74                && $_POST['mypage_login_email'] != "") { 
    75                 $this->tpl_login_email = $_POST['mypage_login_email']; 
     73            if(isset($_POST['login_email']) 
     74               && $_POST['login_email'] != "") { 
     75                $this->tpl_login_email = $_POST['login_email']; 
    7676            } 
    7777 
     
    8080                $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId(); 
    8181            } 
    82             $this->tpl_title    = 'MYページ(ログイン)'; 
    83             $this->tpl_mainpage = 'mypage/login.tpl'; 
     82            $this->tpl_title        = 'MYページ(ログイン)'; 
     83            $this->tpl_mainpage     = 'mypage/login.tpl'; 
     84            $this->transactionid    = SC_Helper_Session_Ex::getToken(); 
    8485 
    8586        } else { 
Note: See TracChangeset for help on using the changeset viewer.