/**
  * 携帯のIDを登録する.
  *
  */
 function updatePhoneId()
 {
     $this->setValue('phone_id', SC_MobileUserAgent::getId());
 }
Пример #2
0
 function lfRegistData($array, $arrRegistColumn, $arrRejectRegistColumn, $confirm_flg, $isMobile = false, $email_mobile = "")
 {
     $objConn = new SC_DbConn();
     // 登録データの生成
     foreach ($arrRegistColumn as $data) {
         if (strlen($array[$data["column"]]) > 0 && !in_array($data["column"], $arrRejectRegistColumn)) {
             $arrRegist[$data["column"]] = $array[$data["column"]];
         }
     }
     // 誕生日が入力されている場合
     if (strlen($array["year"]) > 0) {
         $arrRegist["birth"] = $array["year"] . "/" . $array["month"] . "/" . $array["day"] . " 00:00:00";
     }
     // パスワードの暗号化
     $arrRegist["password"] = sha1($arrRegist["password"] . ":" . AUTH_MAGIC);
     // 仮会員登録の場合
     if ($confirm_flg == true) {
         // 重複しない会員登録キーを発行する。
         $count = 1;
         while ($count != 0) {
             $uniqid = SC_Utils_Ex::sfGetUniqRandomId("t");
             $count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($uniqid));
         }
         switch ($array["mailmaga_flg"]) {
             case 1:
                 $arrRegist["mailmaga_flg"] = 4;
                 break;
             case 2:
                 $arrRegist["mailmaga_flg"] = 5;
                 break;
             default:
                 $arrRegist["mailmaga_flg"] = 6;
                 break;
         }
         $arrRegist["status"] = "1";
         // 仮会員
     } else {
         // 重複しない会員登録キーを発行する。
         $count = 1;
         while ($count != 0) {
             $uniqid = SC_Utils_Ex::sfGetUniqRandomId("r");
             $count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($uniqid));
         }
         $arrRegist["status"] = "2";
         // 本会員
     }
     /*
       secret_keyは、テーブルで重複許可されていない場合があるので、
       本会員登録では利用されないがセットしておく。
     */
     $arrRegist["secret_key"] = $uniqid;
     // 会員登録キー
     $arrRegist["create_date"] = "now()";
     // 作成日
     $arrRegist["update_date"] = "now()";
     // 更新日
     $arrRegist["first_buy_date"] = "";
     // 最初の購入日
     $arrRegist["point"] = $this->CONF["welcome_point"];
     // 入会時ポイント
     if ($isMobile) {
         // 携帯メールアドレス
         $arrRegist['email_mobile'] = $arrRegist['email'];
         //PHONE_IDを取り出す
         $phoneId = SC_MobileUserAgent::getId();
         $arrRegist['mobile_phone_id'] = $phoneId;
     }
     //-- 仮登録実行
     $objConn->query("BEGIN");
     $objQuery = new SC_Query();
     $objQuery->insert("dtb_customer", $arrRegist);
     /* メルマガ会員機能は現在停止中 2007/03/07
     
     
             //-- 非会員でメルマガ登録しているかの判定
             $sql = "SELECT count(*) FROM dtb_customer_mail WHERE email = ?";
             $mailResult = $objConn->getOne($sql, array($arrRegist["email"]));
     
             //-- メルマガ仮登録実行
             $arrRegistMail["email"] = $arrRegist["email"];
             if ($array["mailmaga_flg"] == 1) {
                 $arrRegistMail["mailmaga_flg"] = 4;
             } elseif ($array["mailmaga_flg"] == 2) {
                 $arrRegistMail["mailmaga_flg"] = 5;
             } else {
                 $arrRegistMail["mailmaga_flg"] = 6;
             }
             $arrRegistMail["update_date"] = "now()";
     
             // 非会員でメルマガ登録している場合
             if ($mailResult == 1) {
                 $objQuery->update("dtb_customer_mail", $arrRegistMail, "email = '" .addslashes($arrRegistMail["email"]). "'");
             } else {				// 新規登録の場合
                 $arrRegistMail["create_date"] = "now()";
                 $objQuery->insert("dtb_customer_mail", $arrRegistMail);
             }
         */
     $objConn->query("COMMIT");
     return $uniqid;
 }
Пример #3
0
 /**
  * 携帯端末IDを使用して会員を検索し、パスワードの照合を行う。
  * パスワードが合っている場合は顧客情報を取得する。
  *
  * @param string $pass パスワード
  * @return boolean 該当する会員が存在し、パスワードが合っている場合は true、
  *                 それ以外の場合は false を返す。
  */
 function getCustomerDataFromMobilePhoneIdPass($pass)
 {
     //docomo用にデータを取り出す。
     if (SC_MobileUserAgent::getCarrier() == 'docomo') {
         if ($_SESSION['mobile']['phone_id'] == "" && strlen($_SESSION['mobile']['phone_id']) == 0) {
             $_SESSION['mobile']['phone_id'] = SC_MobileUserAgent::getId();
         }
     }
     if (!isset($_SESSION['mobile']['phone_id']) || $_SESSION['mobile']['phone_id'] === false) {
         return false;
     }
     // 携帯端末IDが一致し、本登録された会員を検索する。
     $sql = 'SELECT * FROM dtb_customer WHERE mobile_phone_id = ? AND del_flg = 0 AND status = 2';
     @(list($data) = $this->conn->getAll($sql, array($_SESSION['mobile']['phone_id'])));
     // パスワードが合っている場合は、顧客情報をcustomer_dataに格納してtrueを返す。
     if (sha1($pass . ':' . AUTH_MAGIC) == @$data['password']) {
         $this->customer_data = $data;
         $this->startSession();
         return true;
     }
     return false;
 }
Пример #4
0
 /**
  * モバイルサイト用のセッション関連の初期処理を行う。
  *
  * @return void
  */
 function lfMobileInitSession()
 {
     // セッションIDの受け渡しにクッキーを使用しない。
     ini_set('session.use_cookies', '0');
     // パラメーターから有効なセッションIDを取得する。
     $sessionId = $this->lfMobileGetSessionId();
     session_start();
     // セッションIDまたはセッションデータが無効な場合は、セッションIDを再生成
     // し、セッションデータを初期化する。
     if ($sessionId === false || !$this->lfMobileValidateSession()) {
         session_regenerate_id();
         $_SESSION = array('mobile' => array('model' => SC_MobileUserAgent::getModel(), 'phone_id' => SC_MobileUserAgent::getId(), 'expires' => time() + MOBILE_SESSION_LIFETIME));
         // 新しいセッションIDを付加してリダイレクトする。
         if ($_SERVER['REQUEST_METHOD'] == 'GET') {
             // GET の場合は同じページにリダイレクトする。
             header('Location: ' . $this->gfAddSessionId());
         } else {
             // GET 以外の場合はトップページへリダイレクトする。
             header('Location: ' . URL_SITE_TOP . '?' . SID);
         }
         exit;
     }
     // 携帯端末IDを取得できた場合はセッションデータに保存する。
     $phoneId = SC_MobileUserAgent::getId();
     if ($phoneId !== false) {
         $_SESSION['mobile']['phone_id'] = $phoneId;
     }
     // セッションの有効期限を更新する。
     $_SESSION['mobile']['expires'] = time() + MOBILE_SESSION_LIFETIME;
 }