/**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objCustomer = new SC_Customer();
     // クッキー管理クラス
     $objCookie = new SC_Cookie(COOKIE_EXPIRE);
     // ログイン判定
     if ($objCustomer->isLoginSuccess()) {
         $this->tpl_login = true;
         $this->tpl_user_point = $objCustomer->getValue('point');
         $this->tpl_name1 = $objCustomer->getValue('name01');
         $this->tpl_name2 = $objCustomer->getValue('name02');
     } else {
         // クッキー判定
         $this->tpl_login_email = $objCookie->getCookie('login_email');
         if ($this->tpl_login_email != "") {
             $this->tpl_login_memory = "1";
         }
         // POSTされてきたIDがある場合は優先する。
         if ($_POST['login_email'] != "") {
             $this->tpl_login_email = $_POST['login_email'];
         }
     }
     $this->tpl_disable_logout = $this->lfCheckDisableLogout();
     $objSubView = new SC_SiteView();
     $this->transactionid = $this->getToken();
     $objSubView->assignobj($this);
     $objSubView->display($this->tpl_mainpage);
 }
예제 #2
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objQuery = new SC_Query();
     $objCustomer = new SC_Customer();
     // クッキー管理クラス
     $objCookie = new SC_Cookie(COOKIE_EXPIRE);
     // ログイン判定
     if ($objCustomer->isLoginSuccess()) {
         $this->sendRedirect($this->getLocation("./index.php"));
         exit;
     } else {
         // クッキー判定
         $this->tpl_login_email = $objCookie->getCookie('login_email');
         if ($this->tpl_login_email != "") {
             $this->tpl_login_memory = "1";
         }
         // POSTされてきたIDがある場合は優先する。
         if (isset($_POST['mypage_login_email']) && $_POST['mypage_login_email'] != "") {
             $this->tpl_login_email = $_POST['mypage_login_email'];
         }
     }
     //$objpage内の全てのテンプレート変数をsmartyに格納
     $objView->assignobj($this);
     //パスとテンプレート変数の呼び出し、実行
     $objView->display(SITE_FRAME);
 }
예제 #3
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = null;
     if (defined("MOBILE_SITE") && MOBILE_SITE) {
         $objView = new SC_MobileView();
     } else {
         $objView = new SC_SiteView();
     }
     $objSess = new SC_Session();
     // 店舗基本情報を取得
     $objDb = new SC_Helper_DB_Ex();
     $CONF = $objDb->sf_getBasisData();
     $masterData = new SC_DB_MasterData_Ex();
     $arrReminder = $masterData->getMasterData("mtb_reminder");
     // クッキー管理クラス
     $objCookie = new SC_Cookie(COOKIE_EXPIRE);
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if (!isset($_POST['email'])) {
         $_POST['email'] = "";
     }
     if ($_POST['mode'] == 'mail_check') {
         //メアド入力時
         $_POST['email'] = strtolower($_POST['email']);
         // FIXME DBチェックの前に妥当性チェックするべき
         $sql = "SELECT * FROM dtb_customer WHERE (email = ? OR email_mobile = ?) AND status = 2 AND del_flg = 0";
         $result = $conn->getAll($sql, array($_POST['email'], $_POST['email']));
         // 本会員登録済みの場合
         if (isset($result[0]['reminder']) && $result[0]['reminder']) {
             // 入力emailが存在する
             $_SESSION['forgot']['email'] = $_POST['email'];
             $_SESSION['forgot']['reminder'] = $result[0]['reminder'];
             // ヒミツの答え入力画面
             $this->Reminder = $arrReminder[$_SESSION['forgot']['reminder']];
             $this->tpl_mainpage = 'forgot/secret.tpl';
         } else {
             $sql = "SELECT customer_id FROM dtb_customer WHERE (email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0";
             //仮登録中の確認
             $result = $conn->getAll($sql, array($_POST['email'], $_POST['email']));
             if ($result) {
                 $this->errmsg = "ご入力のemailアドレスは現在仮登録中です。<br>登録の際にお送りしたメールのURLにアクセスし、<br>本会員登録をお願いします。";
             } else {
                 // 登録していない場合
                 $this->errmsg = "ご入力のemailアドレスは登録されていません";
             }
         }
     } elseif ($_POST['mode'] == 'secret_check') {
         //ヒミツの答え入力時
         if ($_SESSION['forgot']['email']) {
             // ヒミツの答えの回答が正しいかチェック
             $sql = "SELECT * FROM dtb_customer WHERE (email = ? OR email_mobile = ?) AND del_flg = 0";
             $result = $conn->getAll($sql, array($_SESSION['forgot']['email'], $_SESSION['forgot']['email']));
             $data = $result[0];
             if ($data['reminder_answer'] === $_POST['input_reminder']) {
                 // ヒミツの答えが正しい
                 // 新しいパスワードを設定する
                 $this->temp_password = GC_Utils_Ex::gfMakePassword(8);
                 if (FORGOT_MAIL == 1) {
                     // メールで変更通知をする
                     $this->lfSendMail($CONF, $_SESSION['forgot']['email'], $data['name01'], $this->temp_password);
                 }
                 // DBを書き換える
                 $sql = "UPDATE dtb_customer SET password = ?, update_date = now() WHERE customer_id = ?";
                 $conn->query($sql, array(sha1($this->temp_password . ":" . AUTH_MAGIC), $data['customer_id']));
                 // 完了画面の表示
                 $this->tpl_mainpage = 'forgot/complete.tpl';
                 // セッション変数の解放
                 $_SESSION['forgot'] = array();
                 unset($_SESSION['forgot']);
             } else {
                 // ヒミツの答えが正しくない
                 $this->Reminder = $arrReminder[$_SESSION['forgot']['reminder']];
                 $this->errmsg = "パスワードを忘れたときの質問に対する回答が正しくありません";
                 $this->tpl_mainpage = 'forgot/secret.tpl';
             }
         } else {
             // アクセス元が不正または、セッション保持期間が切れている
             $this->errmsg = "emailアドレスを再度登録してください。<br />前回の入力から時間が経っていますと、本メッセージが表示される可能性があります。";
         }
     }
     // デフォルト入力
     if ($_POST['email'] != "") {
         // POST値を入力
         $this->tpl_login_email = $_POST['email'];
     } else {
         // クッキー値を入力
         $this->tpl_login_email = $objCookie->getCookie('login_email');
     }
     // モバイルサイトの場合はトークン生成
     if (defined("MOBILE_SITE") && MOBILE_SITE) {
         $this->createMobileToken();
     }
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
예제 #4
0
 /**
  * Page のプロセス(モバイル).
  *
  * @return void
  */
 function mobileProcess()
 {
     $conn = new SC_DBConn();
     $objView = new SC_MobileView();
     $objSiteSess = new SC_SiteSession();
     $objCartSess = new SC_CartSession();
     $objCustomer = new SC_Customer();
     $objCookie = new SC_Cookie();
     $this->objFormParam = new SC_FormParam();
     // フォーム用
     $helperMobile = new SC_Helper_Mobile_Ex();
     $this->lfInitParam();
     // パラメータ情報の初期化
     $this->objFormParam->setParam($_POST);
     // POST値の取得
     // ユーザユニークIDの取得と購入状態の正当性をチェック
     $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
     $this->tpl_uniqid = $uniqid;
     // ログインチェック
     if ($objCustomer->isLoginSuccess(true)) {
         // すでにログインされている場合は、お届け先設定画面に転送
         $this->sendRedirect($this->getLocation('./deliv.php'), true);
         exit;
     }
     // 携帯端末IDが一致する会員が存在するかどうかをチェックする。
     $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId();
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         case 'nonmember_confirm':
             $this->lfSetNonMember($this);
             // ※breakなし
         // ※breakなし
         case 'confirm':
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->objFormParam->toLower('order_mail');
             $this->objFormParam->toLower('order_mail_check');
             $this->arrErr = $this->lfCheckError();
             // 入力エラーなし
             if (count($this->arrErr) == 0) {
                 // DBへのデータ登録
                 $this->lfRegistData($uniqid);
                 // お届け先のコピー
                 $this->lfCopyDeliv($uniqid, $_POST);
                 // 正常に登録されたことを記録しておく
                 $objSiteSess->setRegistFlag();
                 // お支払い方法選択ページへ移動
                 $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true);
                 exit;
             }
             break;
             // 前のページに戻る
         // 前のページに戻る
         case 'return':
             // 確認ページへ移動
             $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true);
             exit;
             break;
         case 'nonmember':
             $this->lfSetNonMember($this);
             // ※breakなし
         // ※breakなし
         default:
             if ($_GET['from'] == 'nonmember') {
                 $this->lfSetNonMember($this);
             }
             // ユーザユニークIDの取得
             $uniqid = $objSiteSess->getUniqId();
             $objQuery = new SC_Query();
             $where = "order_temp_id = ?";
             $arrRet = $objQuery->select("*", "dtb_order_temp", $where, array($uniqid));
             if (empty($arrRet)) {
                 $arrRet = array(array('order_email' => "", 'order_birth' => ""));
             }
             // DB値の取得
             $this->objFormParam->setParam($arrRet[0]);
             $this->objFormParam->setValue('order_email_check', $arrRet[0]['order_email']);
             $this->objFormParam->setDBDate($arrRet[0]['order_birth']);
             break;
     }
     // クッキー判定
     $this->tpl_login_email = $objCookie->getCookie('login_email');
     if ($this->tpl_login_email != "") {
         $this->tpl_login_memory = "1";
     }
     // 選択用日付の取得
     $objDate = new SC_Date(START_BIRTH_YEAR);
     $this->arrYear = $objDate->getYear('', 1950);
     // 日付プルダウン設定
     $this->arrMonth = $objDate->getMonth();
     $this->arrDay = $objDate->getDay();
     if ($this->year == '') {
         $this->year = '----';
     }
     // 入力値の取得
     $this->arrForm = $this->objFormParam->getFormParamList();
     if ($this->arrForm['year']['value'] == "") {
         $this->arrForm['year']['value'] = '----';
     }
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }