/**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     switch ($this->getMode()) {
         case 'confirm':
             // トークンを設定
             $this->refusal_transactionid = $this->getRefusalToken();
             $this->tpl_mainpage = 'mypage/refusal_confirm.tpl';
             $this->tpl_subtitle = '退会手続き(確認ページ)';
             break;
         case 'complete':
             // トークン入力チェック
             if (!$this->isValidRefusalToken()) {
                 // エラー画面へ遷移する
                 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
                 SC_Response_Ex::actionExit();
             }
             $objCustomer = new SC_Customer_Ex();
             $this->lfDeleteCustomer($objCustomer->getValue('customer_id'));
             $objCustomer->EndSession();
             SC_Response_Ex::sendRedirect('refusal_complete.php');
             break;
         default:
             if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
                 $this->refusal_transactionid = $this->getRefusalToken();
             }
             break;
     }
 }
 /**
  * アクション.
  */
 function action()
 {
     if (!extension_loaded("dom")) {
         SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "サービス停止中です。(E0001)");
     }
     $objCustomer = new SC_Customer_Ex();
     switch ($this->getMode()) {
         case "logout":
             $objCustomer->EndSession();
             SC_Response_Ex::sendRedirect(HTTP_URL);
             SC_Response_Ex::actionExit();
             break;
         case "pay_cert_for_authory_sold":
             $ammount = $this->getAmmount();
             $this->doPayCertForAuthorySold($this->config, $objCustomer, $ammount);
             break;
         case "pay_cert_for_authory_sold_ok":
             $this->doAuthorySold($this->config, $objCustomer);
             break;
         case "pay_cert_for_authory_sold_ng":
             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "ポイント購入をキャンセルいたしました。");
             break;
         case "cont_bill_cancel":
             $this->doContBillCancel($this->config, $objCustomer);
             break;
         case "pay_cert_for_cont_bill":
             if ($this->device_support) {
                 $this->doPayCertForContBill($this->config, $objCustomer);
             } else {
                 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "非対応端末につき会員登録は中止しました");
             }
             break;
         case "pay_cert_for_cont_bill_ng":
             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "会員登録をキャンセルいたしました。");
             break;
         case "pay_cert_for_cont_bill_ok":
             $this->doAuthorySold($this->config, $objCustomer, false);
             break;
         case "auth_auone":
             $this->doAuthAuone();
             break;
         default:
         case "login_auone":
             $this->doLoginAuone();
             break;
         case "cont_bill_result":
             $this->doContBillResult($this->getAccountDay());
             break;
     }
 }
예제 #3
0
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     switch ($this->getMode()) {
         case 'confirm':
             $this->tpl_mainpage = 'mypage/refusal_confirm.tpl';
             $this->tpl_subtitle = '退会手続き(確認ページ)';
             break;
         case 'complete':
             $objCustomer = new SC_Customer_Ex();
             $this->lfDeleteCustomer($objCustomer->getValue('customer_id'));
             $objCustomer->EndSession();
             SC_Response_Ex::sendRedirect('refusal_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;
     }
 }
예제 #5
0
 function init()
 {
     parent::init();
     $objCustomer = new SC_Customer_Ex();
     if (isset($_GET["sid"]) && isset($_GET["admin"])) {
         $sid = $_REQUEST["sid"];
         $email = $objCustomer->getValue("email");
         $osid = session_id();
         if ($osid != $sid) {
             session_destroy();
             session_id($sid);
             session_start();
         }
         $objCustomer->setLogin($email);
         $get = $_GET;
         unset($get["sid"]);
         SC_Response_Ex::reload($get, true);
     }
     $objQuery = SC_Query_Ex::getSingletonInstance();
     $objProduct = new SC_Product_Ex();
     if (GC_Utils_Ex::isFrontFunction() && $this->skip_load_page_layout == false) {
         $objCustomer = new SC_Customer_Ex();
         // 画面更新毎に情報を更新する
         if ($objCustomer->isLoginSuccess()) {
             // 初回アクセス時に更新
             $objCustomer->updateSession();
             $this->tpl_login = true;
             $this->tpl_point = $objCustomer->getValue("point");
             $this->tpl_customer_id = $objCustomer->getValue("customer_id");
             $this->tpl_first_buy_date = $objCustomer->getValue("first_buy_date");
             $this->tpl_carrier = $objCustomer->getValue("carrier");
             $downloadable_days = $this->arrSiteInfo["downloadable_days"];
             $downloadable_days_unlimited = $this->arrSiteInfo["downloadable_days_unlimited"];
             $date = null;
             if ($downloadable_days_unlimited) {
                 $date = SC_Utils_Ex::sfGetTimestamp(RELEASE_YEAR, 1, 1, false);
                 $date2 = SC_Utils_Ex::sfGetTimestamp(9999, 12, 31, false);
             } else {
                 $xdate = strtotime("-{$downloadable_days} day");
                 $date = SC_Utils_Ex::sfGetTimestamp(date("Y", $xdate), date("m", $xdate), date("d", $xdate), false);
                 $xdate = strtotime("+{$downloadable_days} day");
                 $date2 = SC_Utils_Ex::sfGetTimestamp(date("Y", $xdate), date("m", $xdate), date("d", $xdate), false);
             }
             $this->downloadable_days = $date;
             $this->downloadable_days2 = $date2;
             $objPurchase = new SC_Helper_Purchase_Ex();
             $arrOrderId = $objQuery->getCol("order_id", "dtb_order", "payment_date > ? AND customer_id = ?", array($date, $this->tpl_customer_id));
             $this->arrRedownloadProduct = array();
             foreach ($arrOrderId as $order_id) {
                 $arrOrderDetail = $objPurchase->getOrderDetail($order_id, true);
                 $this->arrRedownloadProduct = array_merge($this->arrRedownloadProduct, $arrOrderDetail);
             }
             // 再ダウンロード可能な商品一覧
             $this->arrRedownloadProduct = SC_Utils_Ex::makeArrayIDToKey("product_id", $this->arrRedownloadProduct);
             foreach ($this->arrRedownloadProduct as $product_id => $row) {
                 $row["product"] = $objProduct->getDetail($product_id);
                 $this->arrRedownloadProduct[$product_id] = $row;
             }
         } else {
             $this->tpl_login = false;
             $this->tpl_point = 0;
             $this->tpl_customer_id = 0;
             $this->tpl_first_buy_date = null;
             $this->tpl_carrier = 9;
             $this->arrRedownloadProduct = array();
         }
         $objDb = new SC_Helper_DB_Ex();
         if ($objDb->sfColumnExists("cp_dtb_customer_transaction", "id")) {
             $where = " customer_id =  ? AND transaction_status =  ? AND continue_account_id IS NOT NULL AND del_flg = 0";
             $arrWhereVal = array($this->tpl_customer_id, 40);
             if ($objQuery->exists("cp_dtb_customer_transaction", $where, $arrWhereVal)) {
                 // OK
             } else {
                 switch (basename(dirname($_SERVER["SCRIPT_NAME"]))) {
                     case "au":
                         break;
                     default:
                         if ($objCustomer->isLoginSuccess()) {
                             $objCustomer->EndSession();
                             SC_Response_Ex::reload();
                         }
                         break;
                 }
             }
         }
         $objCategory = new SC_Helper_Category_Ex();
         $this->arrCommonCategory = $objCategory->getList(true);
         $this->arrCommonCategoryTree = $objCategory->getTree();
         $detect = new Mobile_Detect();
         $script_file = $_SERVER["SCRIPT_NAME"];
         $script_file = ltrim($script_file, "/");
         $script_file2 = str_replace("ios/", "", $script_file);
         if ($detect->is("iOS")) {
             if (file_exists(HTML_REALDIR . "ios/{$script_file}")) {
                 SC_Response_Ex::sendRedirect(HTTP_URL . "ios/{$script_file}", $_GET);
             }
         } elseif (strcmp($script_file, $script_file2) !== 0) {
             SC_Response_Ex::sendRedirect(HTTP_URL . "{$script_file2}", $_GET);
         }
         $_SESSION["is_android"] = $detect->is("AndroidOS");
         if ($detect->isMobile() == false) {
             // NG
             $this->device_support = false;
         } elseif ($detect->is("iOS")) {
             if ($detect->match("iPhone")) {
                 // OK
                 $this->device_support = true;
             } elseif ($detect->match("iPod")) {
                 // NG
                 $this->device_support = false;
             } elseif ($detect->match("iPad")) {
                 // NG
                 $this->device_support = false;
             } else {
                 // NG
                 $this->device_support = false;
             }
             $version = $detect->version("iOS", $detect::VERSION_TYPE_FLOAT);
             if ($version < 6) {
                 // NG
                 $this->device_support = false;
             }
         } elseif ($detect->match("Android") == false) {
             // NG
             $this->device_support = false;
         } elseif (class_exists("SC_DeviceAndroidSelect_Ex", true)) {
             $useragent = array();
             if (preg_match("|.*; ([^;]+) Build/.*|", $_SERVER["HTTP_USER_AGENT"], $useragent)) {
                 $device = new SC_DeviceAndroidSelect_Ex(array("search_device_user_agent_word" => $useragent[1], "search_status" => 1));
                 $this->device_support = $device->exists();
                 $this->tpl_device = $device->getOne();
             }
         } elseif ($detect->match("Android")) {
             // OK
             $this->device_support = true;
         } else {
             // NG
             $this->device_support = false;
         }
     }
     if ($this->device_support) {
         GC_Utils_Ex::gfPrintLog("対応端末:" . $_SERVER['HTTP_USER_AGENT']);
         return;
     } else {
         GC_Utils_Ex::gfPrintLog("非対応端末:" . $_SERVER['HTTP_USER_AGENT']);
         if (is_a($this, "LC_Page_Index")) {
             SC_Response_Ex::sendRedirect(HTTP_URL . "unsupported/index.php");
         } elseif (is_a($this, "LC_Page_Unsupported")) {
             // 非対応端末表示を行わない
             return;
         } elseif (is_a($this, "LC_Page_Entry_Kiyaku")) {
             // 非対応端末表示を行わない
             return;
         } elseif ($this->not_unsupported) {
             // 非対応端末表示を行わない
             return;
         } else {
             SC_Response_Ex::sendRedirect(HTTP_URL . "unsupported/index.php");
         }
     }
 }