Exemplo n.º 1
0
 /**
  * Page のプロセス(モバイル).
  *
  * @return void
  */
 function mobileProcess()
 {
     $objView = new SC_MobileView();
     $objSiteInfo = $objView->objSiteInfo;
     $objCustomer = new SC_Customer();
     $objDb = new SC_Helper_DB_Ex();
     $this->CONF = $objDb->sf_getBasisData();
     $arrInfo = $objSiteInfo->data;
     //-- 本登録完了のためにメールから接続した場合
     if ($_GET["mode"] == "regist") {
         //-- 入力チェック
         $this->arrErr = $this->lfErrorCheck($_GET);
         if ($this->arrErr) {
             $this->tpl_mainpage = 'regist/error.tpl';
             $this->tpl_title = 'エラー';
         } else {
             $registSecretKey = $this->lfRegistData($_GET);
             //本会員登録(フラグ変更)
             $this->lfSendRegistMail($registSecretKey);
             //本会員登録完了メール送信
             // ログイン済みの状態にする。
             $objQuery = new SC_Query();
             $email = $objQuery->get("dtb_customer", "email", "secret_key = ?", array($registSecretKey));
             $objCustomer->setLogin($email);
             $this->sendRedirect($this->getLocation("./complete.php"), true);
             exit;
         }
         //-- それ以外のアクセスは無効とする
     } else {
         $this->arrErr["id"] = "無効なアクセスです。";
         $this->tpl_mainpage = 'regist/error.tpl';
         $this->tpl_title = 'エラー';
     }
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
 function doLogin($mode, SC_Customer $objCustomer, SC_Query $objQuery)
 {
     $each = false;
     switch ($mode) {
         case "pay_cert_for_authory_sold":
             $each = true;
             break;
         default:
             $each = false;
             break;
     }
     $consumer = $this->getConsumer($objQuery);
     $netUrl = new Net_URL($_SERVER["SCRIPT_NAME"]);
     $netUrl->addQueryString("mode", $this->getMode());
     $responce = $consumer->complete($netUrl->getURL());
     $status = Auth_OpenID_FAILURE;
     if ($responce) {
         $status = $responce->status;
     } else {
         $responce = "null";
     }
     GC_Utils_Ex::gfPrintLog(print_r(compact("consumer", "responce", "status"), true), DEBUG_LOG_REALFILE);
     switch ($status) {
         case Auth_OpenID_CANCEL:
             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "処理を中断しました。");
             break;
         default:
         case Auth_OpenID_FAILURE:
             $this->doLoginAuone($this->getMode());
             $this->sendResponse();
             SC_Response_Ex::actionExit();
             break;
         case Auth_OpenID_SUCCESS:
             $openid = $responce->getDisplayIdentifier();
             $customer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId(null, 'au_open_id=? AND status = 2 AND del_flg = 0', array($openid));
             GC_Utils_Ex::gfPrintLog(print_r($customer, true), DEBUG_LOG_REALFILE);
             if (is_array($customer) && isset($customer["email"])) {
                 $objCustomer->setLogin($customer["email"]);
             } else {
                 GC_Utils_Ex::gfPrintLog(print_r(compact("responce", "status"), true), DEBUG_LOG_REALFILE);
                 if ($each) {
                     // 都度課金時 (ログインルートへ乗せる)
                     SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "未登録または退会済みの会員です。<br/><a href='./login.php'>ログイン・会員登録<a>ボタンより会員登録をしてください。");
                     // ログインへとばすなら
                     // SC_Response_Ex::sendRedirect ( "login.php" );
                     // SC_Response_Ex::actionExit ();
                 } else {
                     // 都度課金時以外
                     SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "未登録または退会済みの会員です。");
                 }
             }
             break;
     }
 }
Exemplo n.º 3
0
 /**
  * Page のプロセス(モバイル).
  *
  * @return void
  */
 function mobileProcess()
 {
     //---- ページ初期設定
     $objDb = new SC_Helper_DB_Ex();
     $objMobile = new SC_Helper_Mobile_Ex();
     $CONF = $objDb->sf_getBasisData();
     // 店舗基本情報
     $objConn = new SC_DbConn();
     $objView = new SC_MobileView();
     $objCustomer = new SC_Customer();
     $objDate = new SC_Date(START_BIRTH_YEAR, date("Y", strtotime("now")));
     // 空メール
     if (isset($_SESSION['mobile']['kara_mail_from'])) {
         $_POST['email'] = $_SESSION['mobile']['kara_mail_from'];
         $this->tpl_kara_mail_from = $_POST['email'];
     } elseif (MOBILE_USE_KARA_MAIL) {
         $token = $objMobile->gfPrepareKaraMail('entry/index.php');
         if ($token !== false) {
             $this->tpl_mainpage = 'entry/mail.tpl';
             $this->tpl_title = '会員登録(空メール)';
             $this->tpl_kara_mail_to = MOBILE_KARA_MAIL_ADDRESS_USER . MOBILE_KARA_MAIL_ADDRESS_DELIMITER . 'entry_' . $token . '@' . MOBILE_KARA_MAIL_ADDRESS_DOMAIN;
             $this->tpl_from_address = $CONF['email03'];
         }
     }
     // レイアウトデザインを取得
     $objLayout = new SC_Helper_PageLayout_Ex();
     $objLayout->sfGetPageLayout($this, false, DEF_LAYOUT);
     //---- 登録用カラム配列
     $arrRegistColumn = array(array("column" => "name01", "convert" => "aKV"), array("column" => "name02", "convert" => "aKV"), array("column" => "kana01", "convert" => "CKV"), array("column" => "kana02", "convert" => "CKV"), array("column" => "zip01", "convert" => "n"), array("column" => "zip02", "convert" => "n"), array("column" => "pref", "convert" => "n"), array("column" => "addr01", "convert" => "aKV"), array("column" => "addr02", "convert" => "aKV"), array("column" => "email", "convert" => "a"), array("column" => "email2", "convert" => "a"), array("column" => "email_mobile", "convert" => "a"), array("column" => "email_mobile2", "convert" => "a"), array("column" => "tel01", "convert" => "n"), array("column" => "tel02", "convert" => "n"), array("column" => "tel03", "convert" => "n"), array("column" => "fax01", "convert" => "n"), array("column" => "fax02", "convert" => "n"), array("column" => "fax03", "convert" => "n"), array("column" => "sex", "convert" => "n"), array("column" => "job", "convert" => "n"), array("column" => "birth", "convert" => "n"), array("column" => "reminder", "convert" => "n"), array("column" => "reminder_answer", "convert" => "aKV"), array("column" => "password", "convert" => "a"), array("column" => "password02", "convert" => "a"), array("column" => "mailmaga_flg", "convert" => "n"));
     //---- 登録除外用カラム配列
     $arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02");
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         //-- POSTデータの引き継ぎ
         $this->arrForm = $_POST;
         if (isset($this->arrForm['year']) && $this->arrForm['year'] == '----') {
             $this->arrForm['year'] = '';
         }
         $this->arrForm['email'] = strtolower($this->arrForm['email']);
         // emailはすべて小文字で処理
         //-- 入力データの変換
         $this->arrForm = $this->lfConvertParam($this->arrForm, $arrRegistColumn);
         // 戻るボタン用処理
         if (!empty($_POST["return"])) {
             switch ($_POST["mode"]) {
                 case "complete":
                     $_POST["mode"] = "set3";
                     break;
                 case "confirm":
                     $_POST["mode"] = "set2";
                     break;
                 default:
                     $_POST["mode"] = "set1";
                     break;
             }
         }
         //-- 入力エラーチェック
         if ($_POST["mode"] == "set1") {
             $this->arrErr = $this->lfErrorCheck1($this->arrForm);
             $this->tpl_mainpage = 'entry/index.tpl';
             $this->tpl_title = '会員登録(1/3)';
         } elseif ($_POST["mode"] == "set2") {
             $this->arrErr = $this->lfErrorCheck2($this->arrForm);
             $this->tpl_mainpage = 'entry/set1.tpl';
             $this->tpl_title = '会員登録(2/3)';
         } else {
             $this->arrErr = $this->lfErrorCheck3($this->arrForm);
             $this->tpl_mainpage = 'entry/set2.tpl';
             $this->tpl_title = '会員登録(3/3)';
         }
         foreach ($this->arrForm as $key => $val) {
             $this->{$key} = $val;
         }
         if ($this->arrErr || !empty($_POST["return"])) {
             // 入力エラーのチェック
             //-- データの設定
             if ($_POST["mode"] == "set1") {
                 $checkVal = array("email", "password", "reminder", "reminder_answer", "name01", "name02", "kana01", "kana02");
             } elseif ($_POST["mode"] == "set2") {
                 $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
             } else {
                 $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mailmaga_flg");
             }
             foreach ($this->arrForm as $key => $val) {
                 if ($key != "mode" && $key != "submit" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) {
                     $this->list_data[$key] = $val;
                 }
             }
         } else {
             //-- テンプレート設定
             if ($_POST["mode"] == "set1") {
                 $this->tpl_mainpage = 'entry/set1.tpl';
                 $this->tpl_title = '会員登録(2/3)';
             } elseif ($_POST["mode"] == "set2") {
                 $this->tpl_mainpage = 'entry/set2.tpl';
                 $this->tpl_title = '会員登録(3/3)';
                 if (@$this->arrForm['pref'] == "" && @$this->arrForm['addr01'] == "" && @$this->arrForm['addr02'] == "") {
                     $address = $this->lfGetAddress($_REQUEST['zip01'] . $_REQUEST['zip02']);
                     $this->pref = @$address[0]['state'];
                     $this->addr01 = @$address[0]['city'] . @$address[0]['town'];
                 }
             } elseif ($_POST["mode"] == "confirm") {
                 //パスワード表示
                 $passlen = strlen($this->arrForm['password']);
                 $this->passlen = $this->lfPassLen($passlen);
                 //メール受け取り
                 if (!isset($this->arrForm['mailmaga_flg'])) {
                     $this->arrForm['mailmaga_flg'] = "";
                 }
                 if (strtolower($this->arrForm['mailmaga_flg']) == "on") {
                     $this->arrForm['mailmaga_flg'] = "2";
                 } else {
                     $this->arrForm['mailmaga_flg'] = "3";
                 }
                 $this->tpl_mainpage = 'entry/confirm.tpl';
                 $this->tpl_title = '会員登録(確認ページ)';
             }
             //-- データ設定
             unset($this->list_data);
             if ($_POST["mode"] == "set1") {
                 $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
             } elseif ($_POST["mode"] == "set2") {
                 $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mailmaga_flg");
             } else {
                 $checkVal = array();
             }
             foreach ($this->arrForm as $key => $val) {
                 if ($key != "mode" && $key != "submit" && $key != "confirm" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) {
                     $this->list_data[$key] = $val;
                 }
             }
             //-- 仮登録と完了画面
             if ($_POST["mode"] == "complete") {
                 // 確認画面で再度エラーチェックを行う。(画面1)
                 $arrErr = $this->lfErrorCheck1($this->arrForm);
                 if (count($arrErr) > 0) {
                     $this->tpl_mainpage = 'entry/index.tpl';
                     $this->tpl_title = '会員登録(1/3)';
                     $this->arrErr = $arrErr;
                     //---- ページ表示
                     $objView->assignobj($this);
                     $objView->display(SITE_FRAME);
                     exit;
                 }
                 // 確認画面で再度エラーチェックを行う。(画面2)
                 $arrErr = $this->lfErrorCheck2($this->arrForm);
                 if (count($arrErr) > 0) {
                     $this->tpl_mainpage = 'entry/set1.tpl';
                     $this->tpl_title = '会員登録(2/3)';
                     $this->arrErr = $arrErr;
                     //---- ページ表示
                     $objView->assignobj($this);
                     $objView->display(SITE_FRAME);
                     exit;
                 }
                 // 確認画面で再度エラーチェックを行う。(画面3)
                 $arrErr = $this->lfErrorCheck3($this->arrForm);
                 if (count($arrErr) > 0) {
                     $this->tpl_mainpage = 'entry/set2.tpl';
                     $this->tpl_title = '会員登録(3/3)';
                     $this->arrErr = $arrErr;
                     //---- ページ表示
                     $objView->assignobj($this);
                     $objView->display(SITE_FRAME);
                     exit;
                 }
                 $this->CONF = $CONF;
                 $this->uniqid = $this->lfRegistData($this->arrForm, $arrRegistColumn, $arrRejectRegistColumn, CUSTOMER_CONFIRM_MAIL, true, $this->arrForm["email"]);
                 // 空メールを受信済みの場合はすぐに本登録完了にする。
                 if (isset($_SESSION['mobile']['kara_mail_from'])) {
                     $param = array("mode" => "regist", "id" => $this->uniqid, session_name() => session_id());
                     $this->sendRedirect($this->getLocation(MOBILE_URL_DIR . "regist/index.php", $param));
                     exit;
                 }
                 $this->tpl_mainpage = 'entry/complete.tpl';
                 $this->tpl_title = '会員登録(完了ページ)';
                 $objMobile->sfMobileSetExtSessionId('id', $this->uniqid, 'regist/index.php');
                 // 仮登録完了メール送信
                 $this->to_name01 = $_POST['name01'];
                 $this->to_name02 = $_POST['name02'];
                 $objMailText = new SC_MobileView();
                 $objMailText->assignobj($this);
                 $objHelperMail = new SC_Helper_Mail_Ex();
                 $objQuery = new SC_Query();
                 // 仮会員が有効の場合
                 if (CUSTOMER_CONFIRM_MAIL == true) {
                     // Moba8パラメーターを保持する場合はカラム追加
                     if (isset($_SESSION['a8'])) {
                         $this->etc_value = "&a8=" . $_SESSION['a8'];
                     }
                     $subject = $objHelperMail->sfMakeSubject($objQuery, $objMailText, $this, '会員登録のご確認');
                     $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl");
                 } else {
                     $subject = $objHelperMail->sfMakesubject($objQuery, $objMailText, $this, '会員登録のご完了');
                     $toCustomerMail = $objMailText->fetch("mail_templates/customer_regist_mail.tpl");
                     // ログイン状態にする
                     $objCustomer->setLogin($_POST["email"]);
                 }
                 $objMail = new SC_SendMail();
                 $objMail->setItem('', $subject, $toCustomerMail, $CONF["email03"], $CONF["shop_name"], $CONF["email03"], $CONF["email04"], $CONF["email04"], $CONF["email01"]);
                 // 宛先の設定
                 $name = $_POST["name01"] . $_POST["name02"] . " 様";
                 $objMail->setTo($_POST["email"], $name);
                 $objMail->sendMail();
                 // 完了ページに移動させる。
                 $this->sendRedirect($this->getLocation("./complete.php"), true);
                 exit;
             }
         }
     }
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }