Ignore:
Timestamp:
2009/06/27 20:22:50 (15 years ago)
Author:
Seasoft
Message:
  • #493(MYページでのメールアドレス重複チェックで不具合)を修正。
    • r17579(正式版 r17504 のマージ)により発生したもの。
  • 無駄な処理を削減
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/pages/mypage/LC_Page_Mypage_Change.php

    r18083 r18139  
    272272                                 ); 
    273273 
    274         //---- 登録除外用カラム配列 
    275         $arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02"); 
    276  
    277274        $this->arrForm = $this->lfGetCustomerData(); 
    278275        $this->arrForm['password'] = DEFAULT_PASSWORD; 
     
    282279            //-- POSTデータの引き継ぎ 
    283280            $this->arrForm = array_merge($this->arrForm, $_POST); 
    284  
    285             if (!isset($this->arrForm['year'])) $this->arrForm['year'] = ""; 
    286             if($this->arrForm['year'] == '----') { 
    287                 $this->arrForm['year'] = ''; 
    288             } 
    289  
    290             // emailはすべて小文字で処理 
    291             $this->paramToLower($_POST ); 
    292281 
    293282            //-- 入力データの変換 
     
    431420     */ 
    432421    function checkErrorTotal(&$arrRegistColumn, &$arrMailType, $isMobile = false) { 
    433         //-- 入力データの変換 
    434         $this->arrForm = $_POST; 
    435         $this->arrForm = $this->lfConvertParam($this->arrForm, $arrRegistColumn); 
    436  
    437         // emailはすべて小文字で処理 
    438         $this->paramToLower($arrRegistColumn); 
     422        // 入力データの変換 
     423        $this->arrForm = $this->lfConvertParam($_POST, $arrRegistColumn); 
    439424 
    440425        //エラーチェック 
     
    541526            $val =& $array[$key]; 
    542527             
     528            // string 型以外は変換対象外とする 
     529            if (!is_string($val)) continue; 
     530             
    543531            // 文字変換 
    544             // XXX 文字列のみを変換するようにした方が良い気もする。 
    545532            if (strlen($val) > 0) { 
    546533                $val = mb_convert_kana($val ,$mb_convert_kana_option); 
     534            } 
     535             
     536            // メールアドレスは小文字に変換 
     537            if ($key == 'email' || $key == 'email02' || $key == 'email_mobile' || $key == 'email_mobile02') { 
     538                $val = strtolower($val); 
    547539            } 
    548540        } 
     
    630622    // }}} 
    631623    // {{{ mobile functions 
    632  
    633     /** 
    634      * TODO 
    635      * @deprecated 未使用? 
    636      */ 
    637     function lfRegistDataMobile ($array, $arrRegistColumn, 
    638                                  $arrRejectRegistColumn) { 
    639  
    640         // 仮登録 
    641         foreach ($arrRegistColumn as $data) { 
    642             if (strlen($array[ $data["column"] ]) > 0 && ! in_array($data["column"], $arrRejectRegistColumn)) { 
    643                 $arrRegist[ $data["column"] ] = $array[ $data["column"] ]; 
    644             } 
    645         } 
    646  
    647         // 誕生日が入力されている場合 
    648         if (strlen($array["year"]) > 0 ) { 
    649             $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00"; 
    650         } 
    651  
    652         // パスワードの暗号化 
    653         $arrRegist["password"] = sha1($arrRegist["password"] . ":" . AUTH_MAGIC); 
    654  
    655         $count = 1; 
    656         while ($count != 0) { 
    657             $uniqid = SC_Utils_Ex::sfGetUniqRandomId("t"); 
    658             $count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($uniqid)); 
    659         } 
    660  
    661         $arrRegist["secret_key"] = $uniqid;     // 仮登録ID発行 
    662         $arrRegist["create_date"] = "now()";    // 作成日 
    663         $arrRegist["update_date"] = "now()";    // 更新日 
    664         $arrRegist["first_buy_date"] = "";      // 最初の購入日 
    665  
    666  
    667         //-- 仮登録実行 
    668         $this->objQuery->insert("dtb_customer", $arrRegist); 
    669  
    670         return $uniqid; 
    671     } 
    672  
    673624 
    674625    //エラーチェック 
     
    777728        return $objErr->arrErr; 
    778729    } 
    779  
    780     // 郵便番号から住所の取得 
    781     function lfGetAddress($zipcode) { 
    782         global $arrPref; 
    783  
    784         $conn = new SC_DBconn(ZIP_DSN); 
    785  
    786         // 郵便番号検索文作成 
    787         $zipcode = mb_convert_kana($zipcode ,"n"); 
    788         $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?"; 
    789  
    790         $data_list = $conn->getAll($sqlse, array($zipcode)); 
    791  
    792         // インデックスと値を反転させる。 
    793         $arrREV_PREF = array_flip($arrPref); 
    794  
    795         /* 
    796           総務省からダウンロードしたデータをそのままインポートすると 
    797           以下のような文字列が入っているので 対策する。 
    798           ・(1・19丁目) 
    799           ・以下に掲載がない場合 
    800         */ 
    801         $town =  $data_list[0]['town']; 
    802         $town = ereg_replace("(.*)$","",$town); 
    803         $town = ereg_replace("以下に掲載がない場合","",$town); 
    804         $data_list[0]['town'] = $town; 
    805         $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']]; 
    806  
    807         return $data_list; 
    808     } 
    809  
    810     //顧客情報の取得 
    811     function lfGetCustomerDataMobile(){ 
    812  
    813         //顧客情報取得 
    814         $ret = $this->objQuery->select("*","dtb_customer","customer_id=?", array($this->objCustomer->getValue('customer_id'))); 
    815         $arrForm = $ret[0]; 
    816         //$arrForm['email'] = $arrForm['email_mobile']; 
    817  
    818         //メルマガフラグ取得 
    819         // TODO たぶん未使用 
    820         $arrForm['mailmaga_flg'] = $this->objQuery->get("dtb_customer","mailmaga_flg","email_mobile=?", array($this->objCustomer->getValue('email_mobile'))); 
    821  
    822         //誕生日の年月日取得 
    823         if (isset($arrForm['birth'])){ 
    824             $birth = split(" ", $arrForm["birth"]); 
    825             list($year, $month, $day) = split("-",$birth[0]); 
    826  
    827             $arrForm['year'] = $year; 
    828             $arrForm['month'] = $month; 
    829             $arrForm['day'] = $day; 
    830  
    831         } 
    832         return $arrForm; 
    833     } 
    834  
    835     /** 
    836      * フォームパラメータの内容を小文字に変換する. 
    837      * 
    838      * @param array $arrParam パラメータ名の配列 
    839      * @return void 
    840      */ 
    841     function paramToLower(&$arrParam) { 
    842         foreach ($arrParam as $key => $val) { 
    843             if (!isset($val)) { 
    844                 $this->arrForm[$key] = ""; 
    845             }elseif($key == 'email' || $key == 'email_mobile'){ 
    846                 $this->arrForm[$key] = strtolower($val); 
    847             } 
    848         } 
    849     } 
    850730} 
    851731?> 
Note: See TracChangeset for help on using the changeset viewer.