Exemplo n.º 1
0
 /**
  * Page のプロセス
  * @return void
  */
 public function action()
 {
     /* @var $objCustomer Customer */
     $objCustomer = Application::alias('eccube.customer');
     $customer_id = $objCustomer->getValue('customer_id');
     // mobile用(戻るボタンでの遷移かどうかを判定)
     if (!empty($_POST['return'])) {
         $_REQUEST['mode'] = 'return';
     }
     // パラメーター管理クラス,パラメーター情報の初期化
     $objFormParam = Application::alias('eccube.form_param');
     Application::alias('eccube.helper.customer')->sfCustomerMypageParam($objFormParam);
     $objFormParam->setParam($_POST);
     // POST値の取得
     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 = Utils::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 = Application::alias('eccube.helper.customer')->sfCustomerMypageErrorCheck($objFormParam);
             // 入力エラーなし
             if (empty($this->arrErr)) {
                 //パスワード表示
                 $this->passlen = Utils::sfPassLen(strlen($objFormParam->getValue('password')));
                 $this->tpl_mainpage = 'mypage/change_confirm.tpl';
                 $this->tpl_title = '会員登録(確認ページ)';
                 $this->tpl_subtitle = '会員登録内容変更(確認ページ)';
             }
             break;
             // 会員登録と完了画面
         // 会員登録と完了画面
         case 'complete':
             $this->arrErr = Application::alias('eccube.helper.customer')->sfCustomerMypageErrorCheck($objFormParam);
             // 入力エラーなし
             if (empty($this->arrErr)) {
                 // 会員情報の登録
                 $this->lfRegistCustomerData($objFormParam, $customer_id);
                 //セッション情報を最新の状態に更新する
                 $objCustomer->updateSession();
                 // 完了ページに移動させる。
                 Application::alias('eccube.response')->sendRedirect('change_complete.php');
             }
             break;
             // 確認ページからの戻り
         // 確認ページからの戻り
         case 'return':
             // quiet.
             break;
         default:
             $objFormParam->setParam(Application::alias('eccube.helper.customer')->sfGetCustomerData($customer_id));
             break;
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
Exemplo n.º 2
0
 /**
  * Page のプロセス
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     /* @var $objPurchase PurchaseHelper */
     $objPurchase = Application::alias('eccube.helper.purchase');
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     $objFormParam = Application::alias('eccube.form_param');
     // PC時は規約ページからの遷移でなければエラー画面へ遷移する
     if ($this->lfCheckReferer() === false) {
         Utils::sfDispSiteError(PAGE_ERROR, '', true);
     }
     Application::alias('eccube.helper.customer')->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 = Utils::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 = Application::alias('eccube.helper.customer')->sfCustomerEntryErrorCheck($objFormParam);
             // 入力エラーなし
             if (empty($this->arrErr)) {
                 //パスワード表示
                 $this->passlen = Utils::sfPassLen(strlen($objFormParam->getValue('password')));
                 $this->tpl_mainpage = 'entry/confirm.tpl';
                 $this->tpl_title = '会員登録(確認ページ)';
             }
             break;
         case 'complete':
             //-- 会員登録と完了画面
             $this->arrErr = Application::alias('eccube.helper.customer')->sfCustomerEntryErrorCheck($objFormParam);
             if (empty($this->arrErr)) {
                 $uniqid = $this->lfRegistCustomerData($this->lfMakeSqlVal($objFormParam));
                 $this->lfSendMail($uniqid, $objFormParam->getHashArray());
                 // 仮会員が無効の場合
                 if (CUSTOMER_CONFIRM_MAIL == false) {
                     // ログイン状態にする
                     /* @var $objCustomer Customer */
                     $objCustomer = Application::alias('eccube.customer');
                     $objCustomer->setLogin($objFormParam->getValue('email'));
                 }
                 // 完了ページに移動させる。
                 Application::alias('eccube.response')->sendRedirect('complete.php', array('ci' => Application::alias('eccube.helper.customer')->sfGetCustomerId($uniqid)));
             }
             break;
         case 'return':
             // quiet.
             break;
         default:
             break;
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }