Ignore:
Timestamp:
2011/01/28 16:19:40 (15 years ago)
Author:
eccuore
Message:

#642(共通ロジックの機能向上) mode 取得用の関数を利用するように修正(switchリファクタリングは未対応)

File:
1 edited

Legend:

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

    r19995 r20041  
    3838    /** フォームパラメータの配列 */ 
    3939    var $objFormParam; 
    40      
    41      
     40 
     41 
    4242    // }}} 
    4343    // {{{ functions 
     
    5454        $this->arrJob = $masterData->getMasterData("mtb_job"); 
    5555        $this->arrReminder = $masterData->getMasterData("mtb_reminder"); 
    56          
     56 
    5757        // 生年月日選択肢の取得 
    5858        $objDate = new SC_Date(START_BIRTH_YEAR, date("Y",strtotime("now"))); 
     
    6060        $this->arrMonth = $objDate->getMonth(true); 
    6161        $this->arrDay = $objDate->getDay(true); 
    62          
     62 
    6363        $this->httpCacheControl('nocache'); 
    64          
     64 
    6565        $this->isMobile = Net_UserAgent_Mobile::isMobile(); 
    6666    } 
     
    6868    /** 
    6969     * Page のプロセス. 
    70      *  
     70     * 
    7171     * @return void 
    7272     */ 
     
    7575        $this->sendResponse(); 
    7676    } 
    77      
     77 
    7878    /* パラメータ情報の初期化 */ 
    7979    function lfInitParam() { 
    80                           
     80 
    8181        $this->objFormParam->addParam("お名前(姓)", 'name01', STEXT_LEN, "aKV", array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); 
    8282        $this->objFormParam->addParam("お名前(名)", 'name02', STEXT_LEN, "aKV", array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK")); 
     
    100100        $this->objFormParam->addParam("日", "day", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false); 
    101101        $this->objFormParam->addParam("メールマガジン", "mailmaga_flg", INT_LEN, "n", array("EXIST_CHECK", "NUM_CHECK")); 
    102          
     102 
    103103        if ($this->isMobile === false){ 
    104104            $this->objFormParam->addParam("FAX番号1", 'fax01', TEL_ITEM_LEN, "n", array("SPTAB_CHECK")); 
     
    125125        // PC時は規約ページからの遷移でなければエラー画面へ遷移する 
    126126        $this->lfCheckReferer(); 
    127          
     127 
    128128        // mobile用(戻るボタンでの遷移かどうかを判定) 
    129129        if (!empty($_POST["return"])) { 
    130130            $_POST["mode"] = "return"; 
    131131        } 
    132          
     132 
    133133        // パラメータ管理クラス,パラメータ情報の初期化 
    134134        $this->objFormParam = new SC_FormParam(); 
     
    137137 
    138138        if ($_SERVER["REQUEST_METHOD"] == "POST") { 
    139              
     139 
    140140            //CSRF対策 
    141141            if (!SC_Helper_Session_Ex::isValidToken()) { 
    142142                SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); 
    143143            } 
    144              
     144 
    145145            $this->objFormParam->convParam(); 
    146146            $this->objFormParam->toLower('email'); 
    147147            $this->objFormParam->toLower('email02'); 
    148148            $this->arrForm = $this->objFormParam->getHashArray(); 
    149       
     149 
    150150            //-- 確認 
    151             if ($_POST["mode"] == "confirm") { 
     151            if ($this->getMode() == "confirm") { 
    152152 
    153153                $this->arrErr = $this->lfErrorCheck(); 
    154                  
     154 
    155155                // 入力エラーなし 
    156156                if(count($this->arrErr) == 0) { 
    157                      
     157 
    158158                    $this->list_data = $this->objFormParam->getHashArray(); 
    159                  
     159 
    160160                    //パスワード表示 
    161161                    $passlen = strlen($this->arrForm['password']); 
    162162                    $this->passlen = SC_Utils_Ex::lfPassLen($passlen); 
    163      
     163 
    164164                    $this->tpl_mainpage = 'entry/confirm.tpl'; 
    165165                    $this->tpl_title = '会員登録(確認ページ)'; 
    166166                } 
    167167 
    168             } elseif ($_POST["mode"] == "complete") { 
     168            } elseif ($this->getMode() == "complete") { 
    169169                //-- 会員登録と完了画面 
    170             
     170 
    171171                // 会員情報の登録 
    172172                $this->CONF = $CONF; 
     
    182182                SC_Response_Ex::sendRedirect('complete.php', array("ci" => $customer_id)); 
    183183                exit; 
    184                  
     184 
    185185            } 
    186186        } 
     
    202202    // 会員情報の登録 
    203203    function lfRegistData() { 
    204                  
     204 
    205205        $objQuery = new SC_Query(); 
    206206        $arrRet = $this->objFormParam->getHashArray(); 
    207207        $sqlval = $this->objFormParam->getDbArray(); 
    208          
     208 
    209209        // 登録データの作成 
    210210        $sqlval['birth'] = SC_Utils_Ex::sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']); 
     
    216216            $count = $objQuery->count("dtb_customer", "secret_key = ?", array($uniqid)); 
    217217        } 
    218          
     218 
    219219        // 仮会員登録の場合 
    220220        if(CUSTOMER_CONFIRM_MAIL == true) { 
     
    242242        SC_Helper_Customer_Ex::sfEditCustomerData($sqlval); 
    243243        $objQuery->commit(); 
    244          
     244 
    245245        return $uniqid; 
    246246    } 
    247      
     247 
    248248    function lfSendMail(){ 
    249249        // 完了メール送信 
     
    305305            $objErr->doFunc(array("FAX番号", "fax01", "fax02", "fax03") ,array("TEL_CHECK")); 
    306306        } 
    307          
     307 
    308308        // 現会員の判定 → 現会員もしくは仮登録中は、メアド一意が前提になってるので同じメアドで登録不可 
    309309        $register_user_flg =  SC_Helper_Customer_Ex::sfCheckRegisterUserFromEmail($arrRet["email"]); 
     
    320320        return $objErr->arrErr; 
    321321    } 
    322      
     322 
    323323    function lfCheckReferer(){ 
    324324        /** 
    325325         * 規約ページからの遷移でなければエラー画面へ遷移する 
    326          */  
     326         */ 
    327327        if ($this->isMobile === FALSE 
    328328             && empty($_POST) 
Note: See TracChangeset for help on using the changeset viewer.