/** * ログインした会員の携帯メールアドレス登録があるかどうか * * ログインした会員の携帯メールアドレスの存在をチェックする * * @param SC_Customer $objCustomer SC_Customer インスタンス * @return boolean 会員の携帯メールアドレス登録がある場合 true */ function hasEmailMobile(&$objCustomer) { $objMobile = new SC_Helper_Mobile_Ex(); if ($objCustomer->hasValue('email_mobile')) { return true; } return false; }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objQuery = new SC_Query(); $objCustomer = new SC_Customer(); // クッキー管理クラス $objCookie = new SC_Cookie(COOKIE_EXPIRE); // パラメータ管理クラス $objFormParam = new SC_FormParam(); // パラメータ情報の初期化 $this->lfInitParam($objFormParam); // POST値の取得 $objFormParam->setParam($_POST); // 携帯端末IDが一致する会員が存在するかどうかをチェックする。 $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId(); if (!isset($_POST['mode'])) { $_POST['mode'] = ""; } // ログイン処理 if ($_POST['mode'] == 'login') { $objFormParam->toLower('login_email'); $arrErr = $objFormParam->checkError(); $arrForm = $objFormParam->getHashArray(); // クッキー保存判定 if ($arrForm['login_memory'] == "1" && $arrForm['login_email'] != "") { $objCookie->setCookie('login_email', $_POST['login_email']); } else { $objCookie->setCookie('login_email', ''); } if (count($arrErr) == 0) { if ($objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) || $objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) { // ログインが成功した場合は携帯端末IDを保存する。 $objCustomer->updateMobilePhoneId(); /* * email がモバイルドメインでは無く, * 携帯メールアドレスが登録されていない場合 */ $objMobile = new SC_Helper_Mobile_Ex(); if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) { if (!$objCustomer->hasValue('email_mobile')) { $this->sendRedirect($this->getLocation("../entry/email_mobile.php"), true); exit; } } } else { $objQuery = new SC_Query(); $where = "(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0"; $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email'])); if ($ret > 0) { SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR, "", false, "", true); } else { SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR, "", false, "", true); } } } } /* * ログインチェック * 携帯メールの登録を必須にする場合は isLoginSuccess(false) にする */ if (!$objCustomer->isLoginSuccess(true)) { $this->tpl_mainpage = 'mypage/login.tpl'; $objView->assignArray($objFormParam->getHashArray()); if (empty($arrErr)) { $arrErr = array(); } $objView->assignArray(array("arrErr" => $arrErr)); } else { //マイページトップ顧客情報表示用 $this->CustomerName1 = $objCustomer->getvalue('name01'); $this->CustomerName2 = $objCustomer->getvalue('name02'); } $objView->assignobj($this); //$objpage内の全てのテンプレート変数をsmartyに格納 $objView->display(SITE_FRAME); //パスとテンプレート変数の呼び出し、実行 }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objSiteSess = new SC_SiteSession(); $objCartSess = new SC_CartSession(); $objCustomer = new SC_Customer(); // クッキー管理クラス $objCookie = new SC_Cookie(COOKIE_EXPIRE); // パラメータ管理クラス $this->objFormParam = new SC_FormParam(); // パラメータ情報の初期化 $this->lfInitParam(); // POST値の取得 $this->lfConvertEmail($_POST["login_email"]); $this->lfConvertLoginPass($_POST["login_pass"]); $this->objFormParam->setParam($_POST); $this->objLoginFormParam = new SC_FormParam(); // ログインフォーム用 $this->lfInitLoginFormParam(); // 初期設定 $this->objLoginFormParam->setParam($_POST); // POST値の取得 // ユーザユニークIDの取得と購入状態の正当性をチェック $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess); $this->tpl_uniqid = $uniqid; if (!isset($_POST['mode'])) { $_POST['mode'] = ""; } // ログインチェック if ($_POST['mode'] != 'login' && !$objCustomer->isLoginSuccess(true)) { // 不正アクセスとみなす SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } switch ($_POST['mode']) { case 'login': $this->objLoginFormParam->toLower('login_email'); $this->arrErr = $this->objLoginFormParam->checkError(); $arrForm = $this->objLoginFormParam->getHashArray(); // クッキー保存判定 if ($arrForm['login_memory'] == "1" && $arrForm['login_email'] != "") { $objCookie->setCookie('login_email', $_POST['login_email']); } else { $objCookie->setCookie('login_email', ''); } if (count($this->arrErr) == 0) { // ログイン判定 if (!$objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) && !$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) { // 仮登録の判定 $objQuery = new SC_Query(); $where = "(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0"; $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email'])); if ($ret > 0) { SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR, "", false, "", true); } else { SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR, "", false, "", true); } } } else { // ログインページに戻る $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_TOP), true); exit; } // ログインが成功した場合は携帯端末IDを保存する。 $objCustomer->updateMobilePhoneId(); /* * 携帯メールアドレスが登録されていない場合は, * 携帯メールアドレス登録画面へ遷移 */ $objMobile = new SC_Helper_Mobile_Ex(); if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) { if (!$objCustomer->hasValue('email_mobile')) { $this->sendRedirect($this->getLocation("../entry/email_mobile.php"), true); exit; } } break; // 削除 // 削除 case 'delete': if (SC_Utils_Ex::sfIsInt($_POST['other_deliv_id'])) { $objQuery = new SC_Query(); $where = "other_deliv_id = ?"; $arrRet = $objQuery->delete("dtb_other_deliv", $where, array($_POST['other_deliv_id'])); $this->objFormParam->setValue('select_addr_id', ''); } break; // 会員登録住所に送る // 会員登録住所に送る case 'customer_addr': // お届け先がチェックされている場合には更新処理を行う if ($_POST['deli'] != "") { // 会員情報の住所を受注一時テーブルに書き込む $this->lfRegistDelivData($uniqid, $objCustomer); // 正常に登録されたことを記録しておく $objSiteSess->setRegistFlag(); // お支払い方法選択ページへ移動 $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true); exit; } else { // エラーを返す $arrErr['deli'] = '※ お届け先を選択してください。'; } break; // 登録済みの別のお届け先に送る // 登録済みの別のお届け先に送る case 'other_addr': // お届け先がチェックされている場合には更新処理を行う if ($_POST['deli'] != "") { if (SC_Utils_Ex::sfIsInt($_POST['other_deliv_id'])) { $objQuery = new SC_Query(); $deliv_count = $objQuery->count("dtb_other_deliv", "customer_id=? and other_deliv_id = ?", array($objCustomer->getValue('customer_id'), $_POST['other_deliv_id'])); if ($deliv_count != 1) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } // 登録済みの別のお届け先を受注一時テーブルに書き込む $this->lfRegistOtherDelivData($uniqid, $objCustomer, $_POST['other_deliv_id']); // 正常に登録されたことを記録しておく $objSiteSess->setRegistFlag(); // お支払い方法選択ページへ移動 $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true); exit; } } else { // エラーを返す $arrErr['deli'] = '※ お届け先を選択してください。'; } break; // 前のページに戻る // 前のページに戻る case 'return': // 確認ページへ移動 $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true); exit; break; default: $objQuery = new SC_Query(); $where = "order_temp_id = ?"; $arrRet = $objQuery->select("*", "dtb_order_temp", $where, array($uniqid)); $this->objFormParam->setParam($arrRet[0]); break; } /** 表示処理 **/ // 会員登録住所の取得 $col = "name01, name02, pref, addr01, addr02, zip01, zip02"; $where = "customer_id = ?"; $objQuery = new SC_Query(); $arrCustomerAddr = $objQuery->select($col, "dtb_customer", $where, array($_SESSION['customer']['customer_id'])); // 別のお届け先住所の取得 $col = "other_deliv_id, name01, name02, pref, addr01, addr02, zip01, zip02"; $objQuery->setorder("other_deliv_id DESC"); $objOtherAddr = $objQuery->select($col, "dtb_other_deliv", $where, array($_SESSION['customer']['customer_id'])); $this->arrAddr = $arrCustomerAddr; $cnt = 1; foreach ($objOtherAddr as $val) { $this->arrAddr[$cnt] = $val; $cnt++; } // 入力値の取得 if (!isset($arrErr)) { $arrErr = array(); } $this->arrForm = $this->objFormParam->getFormParamList(); $this->arrErr = $arrErr; $objView->assignobj($this); $objView->display(SITE_FRAME); }