/**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     // カートが空かどうかを確認する。
     $objCartSess = new SC_CartSession_Ex();
     $arrCartKeys = $objCartSess->getKeys();
     $this->tpl_cart_empty = true;
     foreach ($arrCartKeys as $cart_key) {
         if (count($objCartSess->getCartList($cart_key)) > 0) {
             $this->tpl_cart_empty = false;
             break;
         }
     }
     // メインテンプレートを設定
     if (CUSTOMER_CONFIRM_MAIL == true) {
         // 仮会員登録完了
         $this->tpl_mainpage = 'entry/complete.tpl';
     } else {
         // 本会員登録完了
         SC_Response_Ex::sendRedirectFromUrlPath('regist/complete.php');
     }
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     // 会員管理クラス
     $objCustomer = new SC_Customer_Ex();
     // クッキー管理クラス
     $objCookie = new SC_Cookie_Ex();
     // パラメーター管理クラス
     $objFormParam = new SC_FormParam_Ex();
     // パラメーター情報の初期化
     $this->lfInitParam($objFormParam);
     // リクエスト値をフォームにセット
     $objFormParam->setParam($_POST);
     $url = htmlspecialchars($_POST['url'], ENT_QUOTES);
     // モードによって分岐
     switch ($this->getMode()) {
         case 'login':
             // --- ログイン
             // 入力値のエラーチェック
             $objFormParam->trimParam();
             $objFormParam->toLower('login_email');
             $arrErr = $objFormParam->checkError();
             // エラーの場合はエラー画面に遷移
             if (count($arrErr) > 0) {
                 if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
                     echo $this->lfGetErrorMessage(TEMP_LOGIN_ERROR);
                     SC_Response_Ex::actionExit();
                 } else {
                     SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR);
                     SC_Response_Ex::actionExit();
                 }
             }
             // 入力チェック後の値を取得
             $arrForm = $objFormParam->getHashArray();
             // クッキー保存判定
             if ($arrForm['login_memory'] == '1' && $arrForm['login_email'] != '') {
                 $objCookie->setCookie('login_email', $arrForm['login_email']);
             } else {
                 $objCookie->setCookie('login_email', '');
             }
             // 遷移先の制御
             if (count($arrErr) == 0) {
                 // ログイン処理
                 if ($objCustomer->doLogin($arrForm['login_email'], $arrForm['login_pass'])) {
                     if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) {
                         // ログインが成功した場合は携帯端末IDを保存する。
                         $objCustomer->updateMobilePhoneId();
                         /*
                          * email がモバイルドメインでは無く,
                          * 携帯メールアドレスが登録されていない場合
                          */
                         $objMobile = new SC_Helper_Mobile_Ex();
                         if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) {
                             if (!$objCustomer->hasValue('email_mobile')) {
                                 SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php');
                                 SC_Response_Ex::actionExit();
                             }
                         }
                     }
                     // --- ログインに成功した場合
                     if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
                         echo SC_Utils_Ex::jsonEncode(array('success' => $url));
                     } else {
                         SC_Response_Ex::sendRedirect($url);
                     }
                     SC_Response_Ex::actionExit();
                 } else {
                     // --- ログインに失敗した場合
                     // ブルートフォースアタック対策
                     // ログイン失敗時に遅延させる
                     sleep(LOGIN_RETRY_INTERVAL);
                     $arrForm['login_email'] = strtolower($arrForm['login_email']);
                     $objQuery = SC_Query_Ex::getSingletonInstance();
                     $where = '(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0';
                     $exists = $objQuery->exists('dtb_customer', $where, array($arrForm['login_email'], $arrForm['login_email']));
                     // ログインエラー表示 TODO リファクタリング
                     if ($exists) {
                         if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
                             echo $this->lfGetErrorMessage(TEMP_LOGIN_ERROR);
                             SC_Response_Ex::actionExit();
                         } else {
                             SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR);
                             SC_Response_Ex::actionExit();
                         }
                     } else {
                         if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
                             echo $this->lfGetErrorMessage(SITE_LOGIN_ERROR);
                             SC_Response_Ex::actionExit();
                         } else {
                             SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR);
                             SC_Response_Ex::actionExit();
                         }
                     }
                 }
             } else {
                 // XXX 到達しない?
                 // 入力エラーの場合、元のアドレスに戻す。
                 SC_Response_Ex::sendRedirect($url);
                 SC_Response_Ex::actionExit();
             }
             break;
         case 'logout':
             // --- ログアウト
             // ログイン情報の解放
             $objCustomer->EndSession();
             // 画面遷移の制御
             $mypage_url_search = strpos('.' . $url, 'mypage');
             if ($mypage_url_search == 2) {
                 // マイページログイン中はログイン画面へ移行
                 SC_Response_Ex::sendRedirectFromUrlPath('mypage/login.php');
             } else {
                 // 上記以外の場合、トップへ遷移
                 SC_Response_Ex::sendRedirect(HTTP_URL);
             }
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objLayout = new SC_Helper_PageLayout_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParam($objFormParam, intval($_REQUEST['bloc_cnt']));
     $objFormParam->setParam($_REQUEST);
     $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC);
     $this->page_id = $objFormParam->getValue('page_id', 1);
     switch ($this->getMode()) {
         // 新規ブロック作成
         case 'new_bloc':
             SC_Response_Ex::sendRedirect('bloc.php', array('device_type_id' => $this->device_type_id));
             SC_Response_Ex::actionExit();
             break;
             // 新規ページ作成
         // 新規ページ作成
         case 'new_page':
             SC_Response_Ex::sendRedirect('main_edit.php', array('device_type_id' => $this->device_type_id));
             SC_Response_Ex::actionExit();
             break;
             // プレビュー
         // プレビュー
         case 'preview':
             $this->placingBlocs($objFormParam, true);
             $filename = $this->savePreviewData($this->page_id, $objLayout);
             $_SESSION['preview'] = 'ON';
             SC_Response_Ex::sendRedirectFromUrlPath('preview/' . DIR_INDEX_PATH, array('filename' => $filename));
             SC_Response_Ex::actionExit();
             // 編集実行
         // 編集実行
         case 'confirm':
             $this->placingBlocs($objFormParam);
             $arrQueryString = array('device_type_id' => $this->device_type_id, 'page_id' => $this->page_id, 'msg' => 'on');
             SC_Response_Ex::reload($arrQueryString, true);
             SC_Response_Ex::actionExit();
             break;
             // データ削除処理
         // データ削除処理
         case 'delete':
             //ベースデータでなければファイルを削除
             if ($objLayout->isEditablePage($this->device_type_id, $this->page_id)) {
                 $objLayout->lfDelPageData($this->page_id, $this->device_type_id);
                 SC_Response_Ex::reload(array('device_type_id' => $this->device_type_id), true);
                 SC_Response_Ex::actionExit();
             }
             break;
         default:
             // 完了メッセージ表示
             if (isset($_GET['msg']) && $_GET['msg'] == 'on') {
                 $this->tpl_onload = "alert('登録が完了しました。');";
             }
             break;
     }
     $this->arrBlocs = $this->getLayout($this->device_type_id, $this->page_id, $objLayout);
     $this->bloc_cnt = count($this->arrBlocs);
     // 編集中のページ
     $this->arrPageData = $objLayout->getPageProperties($this->device_type_id, $this->page_id);
     // 編集可能ページ一覧
     $this->arrEditPage = $objLayout->getPageProperties($this->device_type_id, null);
     //サブタイトルを取得
     $this->tpl_subtitle = $this->arrDeviceType[$this->device_type_id] . '>' . $this->tpl_subtitle;
 }
Esempio n. 4
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $this->lfDoLogout();
     // ログイン画面に遷移
     SC_Response_Ex::sendRedirectFromUrlPath(ADMIN_DIR . DIR_INDEX_PATH);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function action()
 {
     $objSiteSess = new SC_SiteSession_Ex();
     $objCartSess = new SC_CartSession_Ex();
     $objCustomer = new SC_Customer_Ex();
     $objCookie = new SC_Cookie_Ex();
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $nonmember_mainpage = 'shopping/nonmember_input.tpl';
     $nonmember_title = 'お客様情報入力';
     $this->tpl_uniqid = $objSiteSess->getUniqId();
     $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess);
     $this->cartKey = $objCartSess->getKey();
     // ログイン済みの場合は次画面に遷移
     if ($objCustomer->isLoginSuccess(true)) {
         SC_Response_Ex::sendRedirect($this->getNextlocation($this->cartKey, $this->tpl_uniqid, $objCustomer, $objPurchase, $objSiteSess));
         SC_Response_Ex::actionExit();
     } else {
         if ($this->cartKey == PRODUCT_TYPE_DOWNLOAD) {
             $msg = 'ダウンロード商品を含むお買い物は、会員登録が必要です。<br/>' . 'お手数ですが、会員登録をお願いします。';
             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, $objSiteSess, false, $msg);
             SC_Response_Ex::actionExit();
         }
     }
     switch ($this->getMode()) {
         // ログイン実行
         case 'login':
             $this->lfInitLoginFormParam($objFormParam);
             $objFormParam->setParam($_POST);
             $objFormParam->trimParam();
             $objFormParam->convParam();
             $objFormParam->toLower('login_email');
             $this->arrErr = $objFormParam->checkError();
             // ログイン判定
             if (SC_Utils_Ex::isBlank($this->arrErr) && $objCustomer->doLogin($objFormParam->getValue('login_email'), $objFormParam->getValue('login_pass'))) {
                 // モバイルサイトで携帯アドレスの登録が無い場合、携帯アドレス登録ページへ遷移
                 if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
                     if (!$objCustomer->hasValue('email_mobile')) {
                         SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php');
                         SC_Response_Ex::actionExit();
                     }
                 } elseif (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
                     echo SC_Utils_Ex::jsonEncode(array('success' => $this->getNextLocation($this->cartKey, $this->tpl_uniqid, $objCustomer, $objPurchase, $objSiteSess)));
                     SC_Response_Ex::actionExit();
                 }
                 SC_Response_Ex::sendRedirect($this->getNextLocation($this->cartKey, $this->tpl_uniqid, $objCustomer, $objPurchase, $objSiteSess));
                 SC_Response_Ex::actionExit();
             } else {
                 // 仮登録の場合
                 if (SC_Helper_Customer_Ex::checkTempCustomer($objFormParam->getValue('login_email'))) {
                     if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
                         echo $this->lfGetErrorMessage(TEMP_LOGIN_ERROR);
                         SC_Response_Ex::actionExit();
                     } else {
                         SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR);
                         SC_Response_Ex::actionExit();
                     }
                 } else {
                     if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) {
                         echo $this->lfGetErrorMessage(SITE_LOGIN_ERROR);
                         SC_Response_Ex::actionExit();
                     } else {
                         SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR);
                         SC_Response_Ex::actionExit();
                     }
                 }
             }
             break;
             // お客様情報登録
         // お客様情報登録
         case 'nonmember_confirm':
             $this->tpl_mainpage = $nonmember_mainpage;
             $this->tpl_title = $nonmember_title;
             $this->lfInitParam($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->lfRegistData($this->tpl_uniqid, $objPurchase, $objCustomer, $objFormParam);
                 $arrParams = $objFormParam->getHashArray();
                 $shipping_id = $arrParams['deliv_check'] == '1' ? 1 : 0;
                 $objPurchase->setShipmentItemTempForSole($objCartSess, $shipping_id);
                 $objSiteSess->setRegistFlag();
                 SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH);
                 SC_Response_Ex::actionExit();
             }
             break;
             // 前のページに戻る
         // 前のページに戻る
         case 'return':
             SC_Response_Ex::sendRedirect(CART_URLPATH);
             SC_Response_Ex::actionExit();
             break;
             // 複数配送ページへ遷移
         // 複数配送ページへ遷移
         case 'multiple':
             // 複数配送先指定が無効な場合はエラー
             if (USE_MULTIPLE_SHIPPING === false) {
                 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
                 SC_Response_Ex::actionExit();
             }
             $this->lfInitParam($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->lfRegistData($this->tpl_uniqid, $objPurchase, $objCustomer, $objFormParam, true);
                 $objSiteSess->setRegistFlag();
                 SC_Response_Ex::sendRedirect(MULTIPLE_URLPATH);
                 SC_Response_Ex::actionExit();
             }
             $this->tpl_mainpage = $nonmember_mainpage;
             $this->tpl_title = $nonmember_title;
             break;
             // お客様情報入力ページの表示
         // お客様情報入力ページの表示
         case 'nonmember':
             $this->tpl_mainpage = $nonmember_mainpage;
             $this->tpl_title = $nonmember_title;
             $this->lfInitParam($objFormParam);
             // ※breakなし
         // ※breakなし
         default:
             // 前のページから戻ってきた場合は, お客様情報入力ページ
             if (isset($_GET['from']) && $_GET['from'] == 'nonmember') {
                 $this->tpl_mainpage = $nonmember_mainpage;
                 $this->tpl_title = $nonmember_title;
                 $this->lfInitParam($objFormParam);
             } else {
                 $this->lfInitLoginFormParam($objFormParam);
             }
             $this->setFormParams($objFormParam, $objPurchase, $this->tpl_uniqid);
             break;
     }
     // 記憶したメールアドレスを取得
     $this->tpl_login_email = $objCookie->getCookie('login_email');
     if (!SC_Utils_Ex::isBlank($this->tpl_login_email)) {
         $this->tpl_login_memory = '1';
     }
     // 入力値の取得
     $this->arrForm = $objFormParam->getFormParamList();
     // 携帯端末IDが一致する会員が存在するかどうかをチェックする。
     if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) {
         $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId();
     }
 }