Пример #1
0
 /**
  * emailアドレスから、登録済み会員や退会済み会員をチェックする
  *
  * XXX CheckError からしか呼び出されず, 本クラスの中で CheckError を呼び出している
  *
  * @param  string  $email メールアドレス
  * @return integer 0:登録可能     1:登録済み   2:再登録制限期間内削除ユーザー  3:自分のアドレス
  */
 public function sfCheckRegisterUserFromEmail($email)
 {
     /* @var $objCustomer Customer */
     $objCustomer = Application::alias('eccube.customer');
     /* @var $objQuery Query*/
     $objQuery = Application::alias('eccube.query');
     // ログインしている場合、すでに登録している自分のemailの場合
     if ($objCustomer->isLoginSuccess(true) && Application::alias('eccube.helper.customer')->sfCustomerEmailDuplicationCheck($objCustomer->getValue('customer_id'), $email)) {
         // 自分のアドレス
         return 3;
     }
     $arrRet = $objQuery->select('email, update_date, del_flg', 'dtb_customer', 'email = ? OR email_mobile = ? ORDER BY del_flg', array($email, $email));
     if (count($arrRet) > 0) {
         // 会員である場合
         if ($arrRet[0]['del_flg'] != '1') {
             // 登録済み
             return 1;
         } else {
             // 退会した会員である場合
             $leave_time = Utils::sfDBDatetoTime($arrRet[0]['update_date']);
             $now_time = time();
             $pass_time = $now_time - $leave_time;
             // 退会から何時間-経過しているか判定する。
             $limit_time = ENTRY_LIMIT_HOUR * 3600;
             if ($pass_time < $limit_time) {
                 // 再登録制限期間内削除ユーザー
                 return 2;
             }
         }
     }
     // 登録可能
     return 0;
 }