Ignore:
Timestamp:
2011/08/05 23:14:32 (13 years ago)
Author:
nanasess
bzr:base-revision:
svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_11-dev:21137
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/Smarty/templates/sphone/shopping/index.tpl index.tpl-20101209134550-lsv02w9wikfx9cj3-38
data/class/pages/shopping/LC_Page_Shopping.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping.php
bzr:mapping-version:
v4
bzr:merge:

ohkouchi@loop-az.jp-20110805141016-3y3e7515aj07h3li
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20110805141429-q4uvtjkhv4f7km3u
bzr:revno:
3841
bzr:revprop:branch-nick:
branches/version-2_11-dev
bzr:root:
branches/version-2_11-dev
bzr:testament:

bazaar-ng testament short form 2.1
revision-id: ohkouchi@loop-az.jp-20110805141429-q4uvtjkhv4f7km3u
sha1: 61681cc48b8e8a64c49987149056042bcc8f479e
bzr:text-parents:

data/Smarty/templates/sphone/shopping/index.tpl ohkouchi@loop-az.jp-20110805070326-8029rknyqmbbewny
data/class/pages/shopping/LC_Page_Shopping.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_11-dev:20970
bzr:timestamp:
2011-08-05 23:14:29.957000017 +0900
bzr:user-agent:
bzr2.3.1+bzr-svn1.1.0dev0
Message:

#1413 ログインエラーを alert に

  • TODO リファクタリングしたい...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/pages/shopping/LC_Page_Shopping.php

    r20970 r21138  
    132132                    } 
    133133                } 
    134  
    135                 SC_Response_Ex::sendRedirect( 
    136                         $this->getNextLocation($this->cartKey, $this->tpl_uniqid, 
    137                                                $objCustomer, $objPurchase, 
    138                                                $objSiteSess)); 
     134                // スマートフォンの場合はログイン成功を返す 
     135                elseif (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { 
     136                    echo SC_Utils_Ex::jsonEncode(array('success' =>  
     137                                                $this->getNextLocation($this->cartKey, $this->tpl_uniqid, 
     138                                                                       $objCustomer, $objPurchase, 
     139                                                                       $objSiteSess))); 
     140                    exit; 
     141                } else { 
     142                    SC_Response_Ex::sendRedirect( 
     143                            $this->getNextLocation($this->cartKey, $this->tpl_uniqid, 
     144                                                   $objCustomer, $objPurchase, 
     145                                                   $objSiteSess)); 
     146                } 
    139147                exit; 
    140148            } 
     
    143151                // 仮登録の場合 
    144152                if($this->checkTempCustomer($objFormParam->getValue('login_email'))) { 
    145                     SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); 
    146                     exit; 
     153                    if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { 
     154                        echo $this->lfGetErrorMessage(TEMP_LOGIN_ERROR); 
     155                        exit; 
     156                    } else { 
     157                        SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); 
     158                        exit; 
     159                    } 
    147160                } else { 
    148                     SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); 
    149                     exit; 
     161                    if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { 
     162                        echo $this->lfGetErrorMessage(SITE_LOGIN_ERROR); 
     163                        exit; 
     164                    } else { 
     165                        SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); 
     166                        exit; 
     167                    } 
    150168                } 
    151169            } 
     
    522540        return $count > 0; 
    523541    } 
     542 
     543    /** 
     544     * エラーメッセージを JSON 形式で返す. 
     545     * 
     546     * TODO リファクタリング 
     547     * この関数は主にスマートフォンで使用します. 
     548     * 
     549     * @param integer エラーコード 
     550     * @return string JSON 形式のエラーメッセージ 
     551     * @see LC_PageError 
     552     */ 
     553    function lfGetErrorMessage($error) { 
     554        switch ($error) { 
     555            case TEMP_LOGIN_ERROR: 
     556                $msg = "メールアドレスもしくはパスワードが正しくありません。\n本登録がお済みでない場合は、仮登録メールに記載されているURLより本登録を行ってください。"; 
     557                break; 
     558            case SITE_LOGIN_ERROR: 
     559            default: 
     560                $msg = "メールアドレスもしくはパスワードが正しくありません。"; 
     561        } 
     562        return SC_Utils_Ex::jsonEncode(array('login_error' => $msg)); 
     563    } 
    524564} 
    525565?> 
Note: See TracChangeset for help on using the changeset viewer.