Changeset 16202


Ignore:
Timestamp:
2007/10/01 11:19:53 (16 years ago)
Author:
nanasess
Message:

クラス化対応

Location:
branches/feature-module-update
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/helper/SC_Helper_Mobile.php

    r16138 r16202  
    310310 
    311311        while ($try > 0) { 
    312             $arrValues['token'] = $token = lfGenerateKaraMailToken(); 
     312            $arrValues['token'] = $token = $this->lfGenerateKaraMailToken(); 
    313313 
    314314            $objQuery->insert('dtb_mobile_kara_mail', $arrValues); 
  • branches/feature-module-update/html/mobile/entry/email_mobile.php

    r15532 r16202  
    11<?php 
    2 /** 
    3  *  
     2/* 
    43 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 
    54 * 
    65 * http://www.lockon.co.jp/ 
    7  *  
    8  * モバイルサイト/携帯メール登録 
    96 */ 
    107 
    11 require_once('../require.php'); 
     8// {{{ requires 
     9require_once("../require.php"); 
     10require_once(CLASS_PATH . "page_extends/entry/LC_Page_Entry_EmailMobile_Ex.php"); 
    1211 
    13 class LC_Page { 
    14     function LC_Page() { 
    15         $this->tpl_mainpage = 'entry/email_mobile.tpl'; 
    16         $this->tpl_title = '携帯メール登録'; 
    17         /* 
    18          session_start時のno-cacheヘッダーを抑制することで 
    19          「戻る」ボタン使用時の有効期限切れ表示を抑制する。 
    20          private-no-expire:クライアントのキャッシュを許可する。 
    21         */ 
    22         session_cache_limiter('private-no-expire');      
    23     } 
    24 } 
     12// }}} 
     13// {{{ generate page 
    2514 
    26 $objPage = new LC_Page; 
    27 $objView = new SC_MobileView; 
    28 $objCustomer = new SC_Customer; 
    29 $objFormParam = new SC_FormParam; 
    30  
    31 if (isset($_SESSION['mobile']['kara_mail_from'])) { 
    32     $_SERVER['REQUEST_METHOD'] = 'POST'; 
    33     $_POST['email_mobile'] = $_SESSION['mobile']['kara_mail_from']; 
    34 } 
    35  
    36 lfInitParam($objFormParam); 
    37  
    38 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 
    39     $objFormParam->setParam($_POST); 
    40     $objFormParam->convParam(); 
    41     $objPage->arrErr = lfCheckError($objFormParam, $objCustomer); 
    42  
    43     if (empty($objPage->arrErr)) { 
    44         lfRegister($objFormParam, $objCustomer); 
    45         $objPage->tpl_mainpage = 'entry/email_mobile_complete.tpl'; 
    46         $objPage->tpl_title = '携帯メール登録完了'; 
    47     } 
    48 } 
    49  
    50 // 空メール用のトークンを作成する。 
    51 if (MOBILE_USE_KARA_MAIL) { 
    52     $token = gfPrepareKaraMail('entry/email_mobile.php'); 
    53     if ($token !== false) { 
    54         $objPage->tpl_kara_mail_to = MOBILE_KARA_MAIL_ADDRESS_USER . MOBILE_KARA_MAIL_ADDRESS_DELIMITER . 'entry_' . $token . '@' . MOBILE_KARA_MAIL_ADDRESS_DOMAIN; 
    55     } 
    56 } 
    57  
    58 $objPage->tpl_name = $objCustomer->getValue('name01'); 
    59 $objPage->arrForm = $objFormParam->getFormParamList(); 
    60  
    61 $objView->assignobj($objPage); 
    62 $objView->display(SITE_FRAME); 
    63  
    64 //----------------------------------------------------------------------------------------------------------------------------------- 
    65  
    66 function lfInitParam(&$objFormParam) { 
    67     $objFormParam->addParam('メールアドレス', 'email_mobile', MTEXT_LEN, 'a', 
    68         array('NO_SPTAB', 'EXIST_CHECK', 'MAX_LENGTH_CHECK', 'CHANGE_LOWER', 'EMAIL_CHAR_CHECK', 'MOBILE_EMAIL_CHECK')); 
    69 } 
    70  
    71 function lfCheckError(&$objFormParam, &$objCustomer) { 
    72     $arrRet = $objFormParam->getHashArray(); 
    73     $objErr = new SC_CheckError($arrRet); 
    74     $objErr->arrErr = $objFormParam->checkError(); 
    75  
    76     if (count($objErr->arrErr) > 0) { 
    77         return $objErr->arrErr; 
    78     } 
    79  
    80     $email_mobile = $objFormParam->getValue('email_mobile'); 
    81     $customer_id = $objCustomer->getValue('customer_id'); 
    82     $objQuery = new SC_Query(); 
    83     $arrRet = $objQuery->select('email, email_mobile, update_date, del_flg', 'dtb_customer', '(email ILIKE ? OR email_mobile ILIKE ?) AND customer_id <> ? ORDER BY del_flg', array($email_mobile, $email_mobile, $customer_id)); 
    84  
    85     if (count($arrRet) > 0) { 
    86         if ($arrRet[0]['del_flg'] != '1') { 
    87             // 会員である場合 
    88             $objErr->arrErr['email_mobile'] .= '※ すでに登録されているメールアドレスです。<br>'; 
    89         } else { 
    90             // 退会した会員である場合 
    91             $leave_time = sfDBDatetoTime($arrRet[0]['update_date']); 
    92             $now_time = time(); 
    93             $pass_time = $now_time - $leave_time; 
    94             // 退会から何時間-経過しているか判定する。 
    95             $limit_time = ENTRY_LIMIT_HOUR * 3600; 
    96             if ($pass_time < $limit_time) { 
    97                 $objErr->arrErr['email_mobile'] .= '※ 退会から一定期間の間は、同じメールアドレスを使用することはできません。<br>'; 
    98             } 
    99         } 
    100     } 
    101  
    102     return $objErr->arrErr; 
    103 } 
    104  
    105 function lfRegister(&$objFormParam, &$objCustomer) 
    106 { 
    107     $customer_id = $objCustomer->getValue('customer_id'); 
    108     $email_mobile = $objFormParam->getValue('email_mobile'); 
    109  
    110     $objQuery = new SC_Query(); 
    111     $objQuery->update('dtb_customer', array('email_mobile' => $email_mobile), 'customer_id = ?', array($customer_id)); 
    112  
    113     $objCustomer->setValue('email_mobile', $email_mobile); 
    114 } 
     15$objPage = new LC_Page_Entry_EmailMobile_Ex(); 
     16$objPage->init(); 
     17$objPage->process(); 
     18register_shutdown_function(array($objPage, "destroy")); 
    11519?> 
Note: See TracChangeset for help on using the changeset viewer.