示例#1
0
 /**
  * 入力エラーチェック
  *
  * @param mixed $array
  * @access private
  * @return array エラーの配列
  */
 public function lfCheckError($array)
 {
     $objErr = new SC_CheckError_Ex($array);
     if (preg_match("/^[[:alnum:]]+\$/", $array['id'])) {
         if (!is_numeric(SC_Helper_Customer_Ex::sfGetCustomerId($array['id'], true))) {
             $objErr->arrErr['id'] = '※ 既に会員登録が完了しているか、無効なURLです。<br>';
         }
     } else {
         $objErr->arrErr['id'] = '無効なURLです。メールに記載されている本会員登録用URLを再度ご確認ください。';
     }
     return $objErr->arrErr;
 }
 /**
  * Page のプロセス
  * @return void
  */
 function action()
 {
     $objFormParam = new SC_FormParam_Ex();
     SC_Helper_Customer_Ex::sfCustomerEntryParam($objFormParam);
     $objFormParam->setParam($_POST);
     $arrForm = $objFormParam->getHashArray();
     // PC時は規約ページからの遷移でなければエラー画面へ遷移する
     if ($this->lfCheckReferer($arrForm, $_SERVER['HTTP_REFERER']) === false) {
         SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
     }
     // mobile用(戻るボタンでの遷移かどうかを判定)
     if (!empty($arrForm['return'])) {
         $_POST['mode'] = 'return';
     }
     switch ($this->getMode()) {
         case 'confirm':
             if (isset($_POST['submit_address'])) {
                 // 入力エラーチェック
                 $this->arrErr = $this->lfCheckError($_POST);
                 // 入力エラーの場合は終了
                 if (count($this->arrErr) == 0) {
                     // 郵便番号検索文作成
                     //                        $zipcode = $_POST['zip01'] . $_POST['zip02'];
                     $zipcode = $_POST['zipcode'];
                     // 郵便番号検索
                     $arrAdsList = SC_Utils_Ex::sfGetAddress($zipcode);
                     // 郵便番号が発見された場合
                     if (!empty($arrAdsList)) {
                         $data['pref'] = $arrAdsList[0]['state'];
                         $data['addr01'] = $arrAdsList[0]['city'] . $arrAdsList[0]['town'];
                         $objFormParam->setParam($data);
                         // 該当無し
                     } else {
                         $this->arrErr['zipcode'] = t('c_* The corresponding address was not found.<br />_01');
                     }
                 }
                 $this->arrForm = $objFormParam->getHashArray();
                 break;
             }
             //-- 確認
             $this->arrErr = SC_Helper_Customer_Ex::sfCustomerEntryErrorCheck($objFormParam);
             $this->arrForm = $objFormParam->getHashArray();
             // 入力エラーなし
             if (empty($this->arrErr)) {
                 //パスワード表示
                 $this->passlen = SC_Utils_Ex::sfPassLen(strlen($this->arrForm['password']));
                 $this->tpl_mainpage = 'entry/confirm.tpl';
                 $this->tpl_title = t('c_Member registration_01');
             }
             break;
         case 'complete':
             //-- 会員登録と完了画面
             $this->arrErr = SC_Helper_Customer_Ex::sfCustomerEntryErrorCheck($objFormParam);
             $this->arrForm = $objFormParam->getHashArray();
             if (empty($this->arrErr)) {
                 $uniqid = $this->lfRegistCustomerData($this->lfMakeSqlVal($objFormParam));
                 $this->lfSendMail($uniqid, $this->arrForm);
                 // 仮会員が無効の場合
                 if (CUSTOMER_CONFIRM_MAIL == false) {
                     // ログイン状態にする
                     $objCustomer = new SC_Customer_Ex();
                     $objCustomer->setLogin($this->arrForm['email']);
                 }
                 // 完了ページに移動させる。
                 SC_Response_Ex::sendRedirect('complete.php', array('ci' => SC_Helper_Customer_Ex::sfGetCustomerId($uniqid)));
             }
             break;
         case 'return':
             $this->arrForm = $objFormParam->getHashArray();
             break;
         default:
             break;
     }
 }
 /**
  * Page のプロセス
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     $objFormParam = new SC_FormParam_Ex();
     // PC時は規約ページからの遷移でなければエラー画面へ遷移する
     if ($this->lfCheckReferer() === false) {
         SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
     }
     SC_Helper_Customer_Ex::sfCustomerEntryParam($objFormParam);
     $objFormParam->setParam($_POST);
     // mobile用(戻るボタンでの遷移かどうかを判定)
     if (!empty($_POST['return'])) {
         $_REQUEST['mode'] = 'return';
     }
     switch ($this->getMode()) {
         case 'confirm':
             if (isset($_POST['submit_address'])) {
                 // 入力エラーチェック
                 $this->arrErr = $this->lfCheckError($_POST);
                 // 入力エラーの場合は終了
                 if (count($this->arrErr) == 0) {
                     // 郵便番号検索文作成
                     $zipcode = $_POST['zip01'] . $_POST['zip02'];
                     // 郵便番号検索
                     $arrAdsList = SC_Utils_Ex::sfGetAddress($zipcode);
                     // 郵便番号が発見された場合
                     if (!empty($arrAdsList)) {
                         $data['pref'] = $arrAdsList[0]['state'];
                         $data['addr01'] = $arrAdsList[0]['city'] . $arrAdsList[0]['town'];
                         $objFormParam->setParam($data);
                         // 該当無し
                     } else {
                         $this->arrErr['zip01'] = '※該当する住所が見つかりませんでした。<br>';
                     }
                 }
                 break;
             }
             //-- 確認
             $this->arrErr = SC_Helper_Customer_Ex::sfCustomerEntryErrorCheck($objFormParam);
             // 入力エラーなし
             if (empty($this->arrErr)) {
                 //パスワード表示
                 $this->passlen = SC_Utils_Ex::sfPassLen(strlen($objFormParam->getValue('password')));
                 $this->tpl_mainpage = 'entry/confirm.tpl';
                 $this->tpl_title = '会員登録(確認ページ)';
             }
             break;
         case 'complete':
             //-- 会員登録と完了画面
             $this->arrErr = SC_Helper_Customer_Ex::sfCustomerEntryErrorCheck($objFormParam);
             if (empty($this->arrErr)) {
                 $uniqid = $this->lfRegistCustomerData($this->lfMakeSqlVal($objFormParam));
                 $this->lfSendMail($uniqid, $objFormParam->getHashArray());
                 // 仮会員が無効の場合
                 if (CUSTOMER_CONFIRM_MAIL == false) {
                     // ログイン状態にする
                     $objCustomer = new SC_Customer_Ex();
                     $objCustomer->setLogin($objFormParam->getValue('email'));
                 }
                 // 完了ページに移動させる。
                 SC_Response_Ex::sendRedirect('complete.php', array('ci' => SC_Helper_Customer_Ex::sfGetCustomerId($uniqid)));
             }
             break;
         case 'return':
             // quiet.
             break;
         default:
             break;
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
 /**
  * 入力エラーチェック
  *
  * @param mixed $array
  * @access private
  * @return array エラーの配列
  */
 function lfCheckError($array)
 {
     $objErr = new SC_CheckError_Ex($array);
     if (preg_match("/^[[:alnum:]]+\$/", $array['id'])) {
         if (!is_numeric(SC_Helper_Customer_Ex::sfGetCustomerId($array['id'], true))) {
             $objErr->arrErr['id'] = t('c_* Member registration is already complete or the URL is invalid.<br />_01');
         }
     } else {
         $objErr->arrErr['id'] = t('c_* The URL is invalid. Check the member registration URL listed in the e-mail._01');
     }
     return $objErr->arrErr;
 }