1 | <?php |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. |
---|
6 | * |
---|
7 | * http://www.lockon.co.jp/ |
---|
8 | * |
---|
9 | * This program is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU General Public License |
---|
11 | * as published by the Free Software Foundation; either version 2 |
---|
12 | * of the License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This program is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
22 | */ |
---|
23 | |
---|
24 | // {{{ requires |
---|
25 | require_once(CLASS_REALDIR . "pages/LC_Page.php"); |
---|
26 | |
---|
27 | /** |
---|
28 | * 会員登録のページクラス. |
---|
29 | * |
---|
30 | * @package Page |
---|
31 | * @author LOCKON CO.,LTD. |
---|
32 | * @version $Id:LC_Page_Entry.php 15532 2007-08-31 14:39:46Z nanasess $ |
---|
33 | */ |
---|
34 | class LC_Page_Entry extends LC_Page { |
---|
35 | |
---|
36 | // }}} |
---|
37 | // {{{ functions |
---|
38 | |
---|
39 | /** |
---|
40 | * Page を初期化する. |
---|
41 | * |
---|
42 | * 以下のプロパティの初期化を行う. |
---|
43 | * - tpl_title |
---|
44 | * - year |
---|
45 | * - arrPref (mtb_pref からマスタデータを取得する) |
---|
46 | * - arrJob (mtb_job からマスタデータを取得する) |
---|
47 | * - arrReminder (mtb_reminder からマスタデータを取得する) |
---|
48 | * - arrYear |
---|
49 | * - arrMonth |
---|
50 | * - arrDay |
---|
51 | * |
---|
52 | * また, クライアント・プロキシのキャッシュ制御を "nocache" に設定する. |
---|
53 | * |
---|
54 | * @return void |
---|
55 | */ |
---|
56 | function init() { |
---|
57 | parent::init(); |
---|
58 | $this->year = ""; |
---|
59 | $masterData = new SC_DB_MasterData_Ex(); |
---|
60 | $this->arrPref = $masterData->getMasterData('mtb_pref'); |
---|
61 | $this->arrJob = $masterData->getMasterData("mtb_job"); |
---|
62 | $this->arrReminder = $masterData->getMasterData("mtb_reminder"); |
---|
63 | |
---|
64 | // 生年月日選択肢の取得 |
---|
65 | $objDate = new SC_Date(START_BIRTH_YEAR, date("Y",strtotime("now"))); |
---|
66 | $this->arrYear = $objDate->getYear('', 1950, ''); |
---|
67 | $this->arrMonth = $objDate->getMonth(true); |
---|
68 | $this->arrDay = $objDate->getDay(true); |
---|
69 | |
---|
70 | $this->httpCacheControl('nocache'); |
---|
71 | |
---|
72 | $this->isMobile = Net_UserAgent_Mobile::isMobile(); |
---|
73 | } |
---|
74 | |
---|
75 | /** |
---|
76 | * Page のプロセス. |
---|
77 | * |
---|
78 | * @return void |
---|
79 | */ |
---|
80 | function process() { |
---|
81 | $this->action(); |
---|
82 | $this->sendResponse(); |
---|
83 | } |
---|
84 | |
---|
85 | /** |
---|
86 | * Page のプロセス. |
---|
87 | * |
---|
88 | * <b>概要</b> |
---|
89 | * |
---|
90 | * 一般ユーザーが個人情報を入力し, 会員登録を行う. |
---|
91 | * 会員登録完了時, ユーザーのメールアドレスと店舗管理者へ会員登録完了 |
---|
92 | * の通知メールを送信し, 登録完了画面へリダイレクトを行う. |
---|
93 | * |
---|
94 | * <b>アクター</b> |
---|
95 | * |
---|
96 | * - 一般ユーザー |
---|
97 | * |
---|
98 | * <b>基本フロー</b> |
---|
99 | * |
---|
100 | * 遷移の際, トランザクショントークンを使用し, 不正な遷移が発生した場合は |
---|
101 | * エラーページを表示する. |
---|
102 | * |
---|
103 | * <ol> |
---|
104 | * <li>入力フォーム($_POST['mode'] == '') |
---|
105 | * <ul> |
---|
106 | * <li>入力チェックがエラーの場合($_POST['mode'] == 'return')</li> |
---|
107 | * <li>$_POST が空かつ, $_SERVER['HTTP_REFERER'] に "kiyaku.php" |
---|
108 | * の文字列が存在しない場合はエラーページを表示する</li> |
---|
109 | * </ul> |
---|
110 | * </li> |
---|
111 | * <li>入力確認画面($_POST['mode'] == 'confirm')</li> |
---|
112 | * <li>登録完了処理($_POST['mode'] == 'complete')</li> |
---|
113 | * <li>登録完了画面へリダイレクトを行う</li> |
---|
114 | * </ol> |
---|
115 | * |
---|
116 | * 仮会員登録が有効な場合, 3 の登録完了画面の前に, 仮会員登録メールを送信し, |
---|
117 | * ユーザーが本会員登録用 URL をクリックした時点で登録を完了する. |
---|
118 | * |
---|
119 | * <b>代替フロー</b> |
---|
120 | * |
---|
121 | * なし |
---|
122 | * |
---|
123 | * <b>特別な要件事項</b> |
---|
124 | * |
---|
125 | * - ユーザーが入力した情報は, 空文字, 改行を削除する. |
---|
126 | * - メールアドレスは, すべて小文字に変換し, DBに格納する. |
---|
127 | * |
---|
128 | * <b>事前条件</b> |
---|
129 | * |
---|
130 | * アクターがシステムに訪問していること. |
---|
131 | * |
---|
132 | * <b>事後条件</b> |
---|
133 | * |
---|
134 | * アクターの会員登録が完了していること. |
---|
135 | * |
---|
136 | * <b>サブユースケース</b> |
---|
137 | * |
---|
138 | * なし |
---|
139 | * |
---|
140 | * <b>使用するスーパーグローバル変数</b> |
---|
141 | * |
---|
142 | * - $_SERVER['PHP_SELF'] |
---|
143 | * - $_SERVER['HTTP_REFERER'] |
---|
144 | * - $_SERVER["REQUEST_METHOD"] |
---|
145 | * - $_POST["name01"] |
---|
146 | * - $_POST["name02"] |
---|
147 | * - $_POST["kana01"] |
---|
148 | * - $_POST["kana02"] |
---|
149 | * - $_POST["zip01"] |
---|
150 | * - $_POST["zip02"] |
---|
151 | * - $_POST["addr01"] |
---|
152 | * - $_POST["addr02"] |
---|
153 | * - $_POST["tel01"] |
---|
154 | * - $_POST["tel02"] |
---|
155 | * - $_POST["tel03"] |
---|
156 | * - $_POST["fax01"] |
---|
157 | * - $_POST["fax02"] |
---|
158 | * - $_POST["fax03"] |
---|
159 | * - $_POST["email"] |
---|
160 | * - $_POST["email02"] |
---|
161 | * - $_POST["password"] |
---|
162 | * - $_POST["password02"] |
---|
163 | * - $_POST["reminder_answer"] |
---|
164 | * - $_POST["mode"]('return', 'confirm', 'complate') |
---|
165 | * |
---|
166 | * @return void |
---|
167 | */ |
---|
168 | function action() { |
---|
169 | $objView = new SC_SiteView(); |
---|
170 | $objCustomer = new SC_Customer(); |
---|
171 | $objDb = new SC_Helper_DB_Ex(); |
---|
172 | $CONF = $objDb->sfGetBasisData(); |
---|
173 | |
---|
174 | // PC時は規約ページからの遷移でなければエラー画面へ遷移する |
---|
175 | $this->lfCheckReferer(); |
---|
176 | |
---|
177 | //---- 登録用カラム配列 |
---|
178 | $arrRegistColumn = array( |
---|
179 | array( "column" => "name01", "convert" => "aKV" ), |
---|
180 | array( "column" => "name02", "convert" => "aKV" ), |
---|
181 | array( "column" => "kana01", "convert" => "CKV" ), |
---|
182 | array( "column" => "kana02", "convert" => "CKV" ), |
---|
183 | array( "column" => "zip01", "convert" => "n" ), |
---|
184 | array( "column" => "zip02", "convert" => "n" ), |
---|
185 | array( "column" => "pref", "convert" => "n" ), |
---|
186 | array( "column" => "addr01", "convert" => "aKV" ), |
---|
187 | array( "column" => "addr02", "convert" => "aKV" ), |
---|
188 | array( "column" => "email", "convert" => "a" ), |
---|
189 | array( "column" => "email02", "convert" => "a" ), |
---|
190 | array( "column" => "email_mobile", "convert" => "a" ), |
---|
191 | array( "column" => "email_mobile02", "convert" => "a" ), |
---|
192 | array( "column" => "tel01", "convert" => "n" ), |
---|
193 | array( "column" => "tel02", "convert" => "n" ), |
---|
194 | array( "column" => "tel03", "convert" => "n" ), |
---|
195 | array( "column" => "fax01", "convert" => "n" ), |
---|
196 | array( "column" => "fax02", "convert" => "n" ), |
---|
197 | array( "column" => "fax03", "convert" => "n" ), |
---|
198 | array( "column" => "sex", "convert" => "n" ), |
---|
199 | array( "column" => "job", "convert" => "n" ), |
---|
200 | array( "column" => "birth", "convert" => "n" ), |
---|
201 | array( "column" => "year", "convert" => "n" ), |
---|
202 | array( "column" => "month", "convert" => "n" ), |
---|
203 | array( "column" => "day", "convert" => "n" ), |
---|
204 | array( "column" => "reminder", "convert" => "n" ), |
---|
205 | array( "column" => "reminder_answer", "convert" => "aKV"), |
---|
206 | array( "column" => "password", "convert" => "a" ), |
---|
207 | array( "column" => "password02", "convert" => "a" ), |
---|
208 | array( "column" => "mailmaga_flg", "convert" => "n" ), |
---|
209 | ); |
---|
210 | |
---|
211 | //---- 登録除外用カラム配列 |
---|
212 | $arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02"); |
---|
213 | |
---|
214 | if ($_SERVER["REQUEST_METHOD"] == "POST") { |
---|
215 | |
---|
216 | //CSRF対策 |
---|
217 | if (!SC_Helper_Session_Ex::isValidToken()) { |
---|
218 | SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); |
---|
219 | } |
---|
220 | |
---|
221 | // 空白・改行の削除 |
---|
222 | foreach ($arrRegistColumn as $item){ |
---|
223 | $_POST["${item["column"]}"] = preg_replace('/^[ \r\n]*(.*?)[ \r\n]*$/u', '$1', $_POST["${item["column"]}"]); |
---|
224 | } |
---|
225 | |
---|
226 | //-- POSTデータの引き継ぎ |
---|
227 | $this->arrForm = $_POST; |
---|
228 | |
---|
229 | // SSL用 |
---|
230 | $this->arrForm['ssl_url'] = rtrim(HTTPS_URL,"/").$_SERVER['PHP_SELF']; |
---|
231 | |
---|
232 | // |
---|
233 | $this->arrForm['email'] = strtolower($this->arrForm['email']); // emailはすべて小文字で処理 |
---|
234 | $this->arrForm['email02'] = strtolower($this->arrForm['email02']); // emailはすべて小文字で処理 |
---|
235 | |
---|
236 | //-- 入力データの変換 |
---|
237 | $this->arrForm = $this->lfConvertParam($this->arrForm, $arrRegistColumn); |
---|
238 | // mobile用 |
---|
239 | if (!empty($_POST["return"])) { |
---|
240 | $_POST["mode"] = "return"; |
---|
241 | } |
---|
242 | |
---|
243 | |
---|
244 | //-- 入力エラーチェック |
---|
245 | $this->arrErr = $this->lfErrorCheck($this->arrForm); |
---|
246 | |
---|
247 | if ($this->arrErr || $_POST["mode"] == "return") { // 入力エラーのチェック |
---|
248 | foreach($arrRegistColumn as $key) { |
---|
249 | $this->$key['column'] = $this->arrForm[$key['column']]; |
---|
250 | } |
---|
251 | } else { |
---|
252 | |
---|
253 | //-- 確認 |
---|
254 | if ($_POST["mode"] == "confirm") { |
---|
255 | foreach($this->arrForm as $key => $val) { |
---|
256 | if ($key != "mode" && $key != "subm" && $key != "transactionid") $this->list_data[ $key ] = $val; |
---|
257 | } |
---|
258 | //パスワード表示 |
---|
259 | $passlen = strlen($this->arrForm['password']); |
---|
260 | $this->passlen = SC_Utils_Ex::lfPassLen($passlen); |
---|
261 | |
---|
262 | $this->tpl_mainpage = 'entry/confirm.tpl'; |
---|
263 | $this->tpl_title = '会員登録(確認ページ)'; |
---|
264 | |
---|
265 | } |
---|
266 | |
---|
267 | //-- 会員登録と完了画面 |
---|
268 | if ($_POST["mode"] == "complete") { |
---|
269 | // 会員情報の登録 |
---|
270 | $this->CONF = $CONF; |
---|
271 | $this->uniqid = $this->lfRegistData ($this->arrForm, $arrRegistColumn, $arrRejectRegistColumn, CUSTOMER_CONFIRM_MAIL); |
---|
272 | |
---|
273 | $this->tpl_mainpage = 'entry/complete.tpl'; |
---|
274 | $this->tpl_title = '会員登録(完了ページ)'; |
---|
275 | |
---|
276 | // 完了メール送信 |
---|
277 | $this->name01 = $_POST['name01']; |
---|
278 | $this->name02 = $_POST['name02']; |
---|
279 | $objMailText = new SC_SiteView(); |
---|
280 | $objMailText->assignobj($this); |
---|
281 | |
---|
282 | $objHelperMail = new SC_Helper_Mail_Ex(); |
---|
283 | $objQuery = new SC_Query(); |
---|
284 | |
---|
285 | // 仮会員が有効の場合 |
---|
286 | if(CUSTOMER_CONFIRM_MAIL == true) { |
---|
287 | $subject = $objHelperMail->sfMakeSubject('会員登録のご確認'); |
---|
288 | $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl"); |
---|
289 | } else { |
---|
290 | $subject = $objHelperMail->sfMakeSubject('会員登録のご完了'); |
---|
291 | $toCustomerMail = $objMailText->fetch("mail_templates/customer_regist_mail.tpl"); |
---|
292 | // ログイン状態にする |
---|
293 | $objCustomer->setLogin($_POST["email"]); |
---|
294 | } |
---|
295 | |
---|
296 | $objMail = new SC_SendMail(); |
---|
297 | $objMail->setItem( |
---|
298 | '' // 宛先 |
---|
299 | , $subject // サブジェクト |
---|
300 | , $toCustomerMail // 本文 |
---|
301 | , $CONF["email03"] // 配送元アドレス |
---|
302 | , $CONF["shop_name"] // 配送元 名前 |
---|
303 | , $CONF["email03"] // reply_to |
---|
304 | , $CONF["email04"] // return_path |
---|
305 | , $CONF["email04"] // Errors_to |
---|
306 | , $CONF["email01"] // Bcc |
---|
307 | ); |
---|
308 | // 宛先の設定 |
---|
309 | $name = $_POST["name01"] . $_POST["name02"] ." 様"; |
---|
310 | $objMail->setTo($_POST["email"], $name); |
---|
311 | $objMail->sendMail(); |
---|
312 | |
---|
313 | // 完了ページに移動させる。 |
---|
314 | $customer_id = $objQuery->get("customer_id", "dtb_customer", "secret_key = ?", array($this->uniqid)); |
---|
315 | SC_Response_Ex::sendRedirect('complete.php', array("ci" => $customer_id)); |
---|
316 | exit; |
---|
317 | |
---|
318 | } |
---|
319 | } |
---|
320 | } |
---|
321 | $this->transactionid = SC_Helper_Session_Ex::getToken(); |
---|
322 | } |
---|
323 | |
---|
324 | /** |
---|
325 | * デストラクタ. |
---|
326 | * |
---|
327 | * @return void |
---|
328 | */ |
---|
329 | function destroy() { |
---|
330 | parent::destroy(); |
---|
331 | } |
---|
332 | |
---|
333 | // }}} |
---|
334 | // {{{ protected functions |
---|
335 | |
---|
336 | // 会員情報の登録 |
---|
337 | function lfRegistData ($array, $arrRegistColumn, $arrRejectRegistColumn, $confirm_flg) { |
---|
338 | |
---|
339 | $objQuery = new SC_Query(); |
---|
340 | |
---|
341 | // 登録データの生成 |
---|
342 | foreach ($arrRegistColumn as $data) { |
---|
343 | if (strlen($array[ $data["column"] ]) > 0 && ! in_array($data["column"], $arrRejectRegistColumn)) { |
---|
344 | $arrRegist[ $data["column"] ] = $array[ $data["column"] ]; |
---|
345 | } |
---|
346 | } |
---|
347 | |
---|
348 | // 誕生日が入力されている場合 |
---|
349 | if (strlen($array["year"]) > 0 ) { |
---|
350 | $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00"; |
---|
351 | } |
---|
352 | |
---|
353 | // パスワードの暗号化 |
---|
354 | $arrRegist["password"] = sha1($arrRegist["password"] . ":" . AUTH_MAGIC); |
---|
355 | |
---|
356 | // 仮会員登録の場合 |
---|
357 | if($confirm_flg == true) { |
---|
358 | // 重複しない会員登録キーを発行する。 |
---|
359 | $count = 1; |
---|
360 | while ($count != 0) { |
---|
361 | $uniqid = SC_Utils_Ex::sfGetUniqRandomId("t"); |
---|
362 | $count = $objQuery->count("dtb_customer", "secret_key = ?", array($uniqid)); |
---|
363 | } |
---|
364 | switch($array["mailmaga_flg"]) { |
---|
365 | case 1: |
---|
366 | $arrRegist["mailmaga_flg"] = 4; |
---|
367 | break; |
---|
368 | case 2: |
---|
369 | $arrRegist["mailmaga_flg"] = 5; |
---|
370 | break; |
---|
371 | default: |
---|
372 | $arrRegist["mailmaga_flg"] = 6; |
---|
373 | break; |
---|
374 | } |
---|
375 | |
---|
376 | $arrRegist["status"] = "1"; // 仮会員 |
---|
377 | } else { |
---|
378 | // 重複しない会員登録キーを発行する。 |
---|
379 | $count = 1; |
---|
380 | while ($count != 0) { |
---|
381 | $uniqid = SC_Utils_Ex::sfGetUniqRandomId("r"); |
---|
382 | $count = $objQuery->count("dtb_customer", "secret_key = ?", array($uniqid)); |
---|
383 | } |
---|
384 | $arrRegist["status"] = "2"; // 本会員 |
---|
385 | } |
---|
386 | |
---|
387 | /* |
---|
388 | secret_keyは、テーブルで重複許可されていない場合があるので、 |
---|
389 | 本会員登録では利用されないがセットしておく。 |
---|
390 | */ |
---|
391 | $arrRegist["secret_key"] = $uniqid; // 会員登録キー |
---|
392 | $arrRegist["create_date"] = "now()"; // 作成日 |
---|
393 | $arrRegist["update_date"] = "now()"; // 更新日 |
---|
394 | $arrRegist["first_buy_date"] = ""; // 最初の購入日 |
---|
395 | $arrRegist["point"] = $this->CONF["welcome_point"]; // 入会時ポイント |
---|
396 | |
---|
397 | if ($this->isMobile) { |
---|
398 | // 携帯メールアドレス |
---|
399 | $arrRegist['email_mobile'] = $arrRegist['email']; |
---|
400 | //PHONE_IDを取り出す |
---|
401 | $phoneId = SC_MobileUserAgent::getId(); |
---|
402 | $arrRegist['mobile_phone_id'] = $phoneId; |
---|
403 | } |
---|
404 | |
---|
405 | //-- 仮登録実行 |
---|
406 | $objQuery->begin(); |
---|
407 | |
---|
408 | $arrRegist['customer_id'] = $objQuery->nextVal('dtb_customer_customer_id'); |
---|
409 | $objQuery->insert("dtb_customer", $arrRegist); |
---|
410 | |
---|
411 | $objQuery->commit(); |
---|
412 | |
---|
413 | return $uniqid; |
---|
414 | } |
---|
415 | |
---|
416 | //---- 取得文字列の変換 |
---|
417 | function lfConvertParam($array, $arrRegistColumn) { |
---|
418 | /* |
---|
419 | * 文字列の変換 |
---|
420 | * K : 「半角(ハンカク)片仮名」を「全角片仮名」に変換 |
---|
421 | * C : 「全角ひら仮名」を「全角かた仮名」に変換 |
---|
422 | * V : 濁点付きの文字を一文字に変換。"K","H"と共に使用します |
---|
423 | * n : 「全角」数字を「半角(ハンカク)」に変換 |
---|
424 | * a : 全角英数字を半角英数字に変換する |
---|
425 | */ |
---|
426 | // カラム名とコンバート情報 |
---|
427 | foreach ($arrRegistColumn as $data) { |
---|
428 | $arrConvList[ $data["column"] ] = $data["convert"]; |
---|
429 | } |
---|
430 | // 文字変換 |
---|
431 | foreach ($arrConvList as $key => $val) { |
---|
432 | // POSTされてきた値のみ変換する。 |
---|
433 | if(isset($array[$key]) && strlen($array[$key]) > 0) { |
---|
434 | $array[$key] = mb_convert_kana($array[$key] ,$val); |
---|
435 | } |
---|
436 | } |
---|
437 | return $array; |
---|
438 | } |
---|
439 | |
---|
440 | //---- 入力エラーチェック |
---|
441 | function lfErrorCheck($array) { |
---|
442 | |
---|
443 | $objErr = new SC_CheckError($array); |
---|
444 | |
---|
445 | $objErr->doFunc(array("お名前(姓)", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); |
---|
446 | $objErr->doFunc(array("お名前(名)", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK")); |
---|
447 | $objErr->doFunc(array("お名前(フリガナ・姓)", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK")); |
---|
448 | $objErr->doFunc(array("お名前(フリガナ・名)", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK")); |
---|
449 | $objErr->doFunc(array("パスワード", 'password', PASSWORD_LEN1, PASSWORD_LEN2), array("EXIST_CHECK", "SPTAB_CHECK" ,"ALNUM_CHECK", "NUM_RANGE_CHECK")); |
---|
450 | $objErr->doFunc(array("パスワード確認用の質問", "reminder") ,array("SELECT_CHECK", "NUM_CHECK")); |
---|
451 | $objErr->doFunc(array("パスワード確認用の質問の答え", "reminder_answer", STEXT_LEN) ,array("EXIST_CHECK","SPTAB_CHECK" , "MAX_LENGTH_CHECK")); |
---|
452 | $objErr->doFunc(array("郵便番号1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK")); |
---|
453 | $objErr->doFunc(array("郵便番号2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK")); |
---|
454 | $objErr->doFunc(array("郵便番号", "zip01", "zip02"), array("ALL_EXIST_CHECK")); |
---|
455 | $objErr->doFunc(array("都道府県", 'pref'), array("SELECT_CHECK","NUM_CHECK")); |
---|
456 | $objErr->doFunc(array("住所1", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); |
---|
457 | $objErr->doFunc(array("住所2", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); |
---|
458 | $objErr->doFunc(array("お電話番号1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" )); |
---|
459 | $objErr->doFunc(array("お電話番号2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" )); |
---|
460 | $objErr->doFunc(array("お電話番号3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" )); |
---|
461 | $objErr->doFunc(array("お電話番号", "tel01", "tel02", "tel03") ,array("TEL_CHECK")); |
---|
462 | $objErr->doFunc(array("性別", "sex") ,array("SELECT_CHECK", "NUM_CHECK")); |
---|
463 | $objErr->doFunc(array("生年月日", "year", "month", "day"), array("CHECK_BIRTHDAY")); |
---|
464 | |
---|
465 | if ($this->isMobile === false){ |
---|
466 | $objErr->doFunc(array('メールアドレス', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK")); |
---|
467 | $objErr->doFunc(array("FAX番号1", 'fax01'), array("SPTAB_CHECK")); |
---|
468 | $objErr->doFunc(array("FAX番号2", 'fax02'), array("SPTAB_CHECK")); |
---|
469 | $objErr->doFunc(array("FAX番号3", 'fax03'), array("SPTAB_CHECK")); |
---|
470 | $objErr->doFunc(array("FAX番号", "fax01", "fax02", "fax03") ,array("TEL_CHECK")); |
---|
471 | $objErr->doFunc(array("メールマガジン", "mailmaga_flg") ,array("SELECT_CHECK", "NUM_CHECK")); |
---|
472 | $objErr->doFunc(array("メールマガジン", 'mailmaga_flg'), array("SELECT_CHECK")); |
---|
473 | $objErr->doFunc(array("パスワード(確認)", 'password02', PASSWORD_LEN1, PASSWORD_LEN2), array("EXIST_CHECK", "SPTAB_CHECK" ,"ALNUM_CHECK", "NUM_RANGE_CHECK")); |
---|
474 | $objErr->doFunc(array('パスワード', 'パスワード(確認)', "password", "password02") ,array("EQUAL_CHECK")); |
---|
475 | $objErr->doFunc(array('メールアドレス(確認)', "email02", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK","SPTAB_CHECK" , "EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK")); |
---|
476 | $objErr->doFunc(array('メールアドレス', 'メールアドレス(確認)', "email", "email02") ,array("EQUAL_CHECK")); |
---|
477 | } |
---|
478 | |
---|
479 | // 現会員の判定 → 現会員もしくは仮登録中は、メアド一意が前提になってるので同じメアドで登録不可 |
---|
480 | if (strlen($array["email"]) > 0) { |
---|
481 | $array["email"] = strtolower($array["email"]); |
---|
482 | $objQuery = new SC_Query(); |
---|
483 | $arrRet = $objQuery->select("email, update_date, del_flg", "dtb_customer","email = ? OR email_mobile = ? ORDER BY del_flg", array($array["email"], $array["email"])); |
---|
484 | |
---|
485 | if(count($arrRet) > 0) { |
---|
486 | if($arrRet[0]['del_flg'] != '1') { |
---|
487 | // 会員である場合 |
---|
488 | if (!isset($objErr->arrErr['email'])) $objErr->arrErr['email'] = ""; |
---|
489 | $objErr->arrErr["email"] .= "※ すでに会員登録で使用されているメールアドレスです。<br />"; |
---|
490 | } else { |
---|
491 | // 退会した会員である場合 |
---|
492 | $leave_time = SC_Utils_Ex::sfDBDatetoTime($arrRet[0]['update_date']); |
---|
493 | $now_time = time(); |
---|
494 | $pass_time = $now_time - $leave_time; |
---|
495 | // 退会から何時間-経過しているか判定する。 |
---|
496 | $limit_time = ENTRY_LIMIT_HOUR * 3600; |
---|
497 | if($pass_time < $limit_time) { |
---|
498 | if (!isset($objErr->arrErr['email'])) $objErr->arrErr['email'] = ""; |
---|
499 | $objErr->arrErr["email"] .= "※ 退会から一定期間の間は、同じメールアドレスを使用することはできません。<br />"; |
---|
500 | } |
---|
501 | } |
---|
502 | } |
---|
503 | } |
---|
504 | return $objErr->arrErr; |
---|
505 | } |
---|
506 | |
---|
507 | //確認ページ用パスワード表示用 |
---|
508 | |
---|
509 | function lfPassLen($passlen){ |
---|
510 | $ret = ""; |
---|
511 | for ($i=0;$i<$passlen;true){ |
---|
512 | $ret.="*"; |
---|
513 | $i++; |
---|
514 | } |
---|
515 | return $ret; |
---|
516 | } |
---|
517 | |
---|
518 | function lfCheckReferer(){ |
---|
519 | /** |
---|
520 | * 規約ページからの遷移でなければエラー画面へ遷移する |
---|
521 | */ |
---|
522 | if ($this->isMobile === FALSE |
---|
523 | && empty($_POST) |
---|
524 | && !preg_match('/kiyaku.php/', basename($_SERVER['HTTP_REFERER'])) |
---|
525 | ) { |
---|
526 | SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); |
---|
527 | } |
---|
528 | } |
---|
529 | |
---|
530 | } |
---|
531 | ?> |
---|