Ignore:
Timestamp:
2011/01/18 20:06:28 (13 years ago)
Author:
kotani
Message:

#880(mobile/sphoneディレクトリを削除)に対応。(mobile/mypageディレクトリ)

  • モバイルサイトのMYページをPCサイトの動作に合わせる。
  • mobileAction() を削除し、ビジネスロジック統一。
File:
1 edited

Legend:

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

    r19908 r19959  
    3030 * @package Page 
    3131 * @author LOCKON CO.,LTD. 
    32  * @version $Id: LC_Page_Mypage.php 16582 2007-10-29 03:06:29Z nanasess $ 
     32 * @version $Id: $ 
    3333 */ 
    3434class LC_Page_MyPage_Favorite extends LC_Page { 
     
    7474    function action() { 
    7575 
    76         //$objView = new SC_SiteView(); 
    7776        $objQuery = new SC_Query(); 
    7877        $objCustomer = new SC_Customer(); 
    7978         
    8079        // 退会判定用情報の取得 
    81         $this->tpl_login = $objCustomer->isLoginSuccess(); 
     80        $this->tpl_login = $objCustomer->isLoginSuccess(true); 
    8281 
    8382        // ログインチェック 
    84         if(!$objCustomer->isLoginSuccess()) { 
     83        if(!$objCustomer->isLoginSuccess(true)) { 
    8584            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); 
    8685        }else { 
     
    139138        // 入力情報を渡す 
    140139        $this->arrForm = $this->objFormParam->getFormParamList(); 
    141         //$objView->assignobj($this);               //$objpage内の全てのテンプレート変数をsmartyに格納 
    142         //$objView->display(SITE_FRAME);                //パスとテンプレート変数の呼び出し、実行 
    143     } 
    144  
    145     /** 
    146      * モバイルページを初期化する. 
    147      * 
    148      * @return void 
    149      */ 
    150     function mobileInit() { 
    151         $this->init(); 
    152         $this->tpl_mainpage = 'mypage/favorite.tpl'; 
    153         $this->tpl_title = 'MYページ/お気に入り一覧'; 
    154     } 
    155  
    156     /** 
    157      * Page のプロセス(モバイル). 
    158      * 
    159      * @return void 
    160      */ 
    161     function mobileProcess() { 
    162         parent::mobileProcess(); 
    163         $this->mobileAction(); 
    164         $this->sendResponse(); 
    165     } 
    166  
    167     /** 
    168      * Page のAction(モバイル). 
    169      * 
    170      * @return void 
    171      */ 
    172     function mobileAction() { 
    173         //$objView = new SC_MobileView(); 
    174         $objQuery = new SC_Query(); 
    175         $objCustomer = new SC_Customer(); 
    176         // クッキー管理クラス 
    177         $objCookie = new SC_Cookie(COOKIE_EXPIRE); 
    178         // パラメータ管理クラス 
    179         $objFormParam = new SC_FormParam(); 
    180         // パラメータ情報の初期化 
    181         $this->lfInitParamMobile($objFormParam); 
    182         // POST値の取得 
    183         $objFormParam->setParam($_POST); 
    184  
    185         // 携帯端末IDが一致する会員が存在するかどうかをチェックする。 
    186         $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId(); 
    187  
    188         if (!isset($_POST['mode'])) $_POST['mode'] = ""; 
    189  
    190         // ログイン処理 
    191         if($_POST['mode'] == 'login') { 
    192             $objFormParam->toLower('login_email'); 
    193             $arrErr = $objFormParam->checkError(); 
    194             $arrForm =  $objFormParam->getHashArray(); 
    195  
    196             // クッキー保存判定 
    197             if ($arrForm['login_memory'] == "1" && $arrForm['login_email'] != "") { 
    198                 $objCookie->setCookie('login_email', $_POST['login_email']); 
    199             } else { 
    200                 $objCookie->setCookie('login_email', ''); 
    201             } 
    202  
    203             if (count($arrErr) == 0){ 
    204                 if($objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) || 
    205                    $objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) { 
    206                     // ログインが成功した場合は携帯端末IDを保存する。 
    207                     $objCustomer->updateMobilePhoneId(); 
    208  
    209                     /* 
    210                      * email がモバイルドメインでは無く, 
    211                      * 携帯メールアドレスが登録されていない場合 
    212                      */ 
    213                     $objMobile = new SC_Helper_Mobile_Ex(); 
    214                     if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) { 
    215                         if (!$objCustomer->hasValue('email_mobile')) { 
    216                             SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php'); 
    217                         } 
    218                     } 
    219                 } else { 
    220                     $objQuery = new SC_Query; 
    221                     $where = "(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0"; 
    222                     $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email'])); 
    223  
    224                     if($ret > 0) { 
    225                         SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); 
    226                     } else { 
    227                         SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); 
    228                     } 
    229                 } 
    230             } 
    231         } 
    232  
    233         // TODO objViewを分けるので、$thisに置き換える TPLの修正が必須かな? 
    234         /* 
    235          * ログインチェック 
    236          * 携帯メールの登録を必須にする場合は isLoginSuccess(false) にする 
    237          */ 
    238         if(!$objCustomer->isLoginSuccess(true)) { 
    239             $this->tpl_mainpage = 'mypage/login.tpl'; 
    240             $objView->assignArray($objFormParam->getHashArray()); 
    241             if (empty($arrErr)) $arrErr = array(); 
    242             $objView->assignArray(array("arrErr" => $arrErr)); 
    243         }else { 
    244             //マイページトップ顧客情報表示用 
    245             $this->CustomerName1 = $objCustomer->getvalue('name01'); 
    246             $this->CustomerName2 = $objCustomer->getvalue('name02'); 
    247         } 
    248  
    249         //$objView->assignobj($this);               //$objpage内の全てのテンプレート変数をsmartyに格納 
    250         //$objView->display(SITE_FRAME);                //パスとテンプレート変数の呼び出し、実行 
    251  
    252140    } 
    253141 
     
    270158    } 
    271159 
    272     /* パラメータ情報の初期化 */ 
    273     function lfInitParamMobile(&$objFormParam) { 
    274  
    275         $objFormParam->addParam("記憶する", "login_memory", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK")); 
    276         $objFormParam->addParam("メールアドレス", "login_email", MTEXT_LEN, "a", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 
    277         $objFormParam->addParam("パスワード", "login_pass", STEXT_LEN, "a", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 
    278     } 
    279  
    280160    // お気に入り商品削除 
    281161    function lfDeleteFavoriteProduct($customer_id, $product_id) { 
     
    289169        } 
    290170    } 
    291  
    292  
    293  
    294171} 
    295172?> 
Note: See TracChangeset for help on using the changeset viewer.