1 | <?php |
---|
2 | /** |
---|
3 | * |
---|
4 | * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. |
---|
5 | * |
---|
6 | * http://www.lockon.co.jp/ |
---|
7 | * |
---|
8 | * |
---|
9 | * MyPage |
---|
10 | */ |
---|
11 | |
---|
12 | require_once("../require.php"); |
---|
13 | |
---|
14 | class LC_Page{ |
---|
15 | function LC_Page() { |
---|
16 | $this->tpl_mainpage = 'mypage/index.tpl'; |
---|
17 | $this->tpl_title = 'MY¥Ú¡¼¥¸/¹ØÆþÍúÎò°ìÍ÷'; |
---|
18 | session_cache_limiter('private-no-expire'); |
---|
19 | } |
---|
20 | } |
---|
21 | |
---|
22 | $objPage = new LC_Page(); |
---|
23 | $objView = new SC_MobileView(); |
---|
24 | $objQuery = new SC_Query(); |
---|
25 | $objCustomer = new SC_Customer(); |
---|
26 | // ¥¯¥Ã¥¡¼´ÉÍý¥¯¥é¥¹ |
---|
27 | $objCookie = new SC_Cookie(COOKIE_EXPIRE); |
---|
28 | // ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹ |
---|
29 | $objFormParam = new SC_FormParam(); |
---|
30 | // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ |
---|
31 | lfInitParam(); |
---|
32 | // POSTÃͤμèÆÀ |
---|
33 | $objFormParam->setParam($_POST); |
---|
34 | |
---|
35 | // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ |
---|
36 | $objPage = sfGetPageLayout($objPage, false, "mypage/index.php"); |
---|
37 | |
---|
38 | // ·ÈÂÓüËöID¤¬°ìÃפ¹¤ë²ñ°÷¤¬Â¸ºß¤¹¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ |
---|
39 | $objPage->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId(); |
---|
40 | |
---|
41 | // ¥í¥°¥¤¥ó½èÍý |
---|
42 | if($_POST['mode'] == 'login') { |
---|
43 | $objFormParam->toLower('login_email'); |
---|
44 | $arrErr = $objFormParam->checkError(); |
---|
45 | $arrForm = $objFormParam->getHashArray(); |
---|
46 | |
---|
47 | // ¥¯¥Ã¥¡¼ÊݸȽÄê |
---|
48 | if ($arrForm['login_memory'] == "1" && $arrForm['login_email'] != "") { |
---|
49 | $objCookie->setCookie('login_email', $_POST['login_email']); |
---|
50 | } else { |
---|
51 | $objCookie->setCookie('login_email', ''); |
---|
52 | } |
---|
53 | |
---|
54 | if (count($arrErr) == 0){ |
---|
55 | if($objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) || |
---|
56 | $objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) { |
---|
57 | // ¥í¥°¥¤¥ó¤¬À®¸ù¤·¤¿¾ì¹ç¤Ï·ÈÂÓüËöID¤òÊݸ¤¹¤ë¡£ |
---|
58 | $objCustomer->updateMobilePhoneId(); |
---|
59 | |
---|
60 | // ·ÈÂӤΥ᡼¥ë¥¢¥É¥ì¥¹¤ò¥³¥Ô¡¼¤¹¤ë¡£ |
---|
61 | $objCustomer->updateEmailMobile(); |
---|
62 | |
---|
63 | // ·ÈÂӤΥ᡼¥ë¥¢¥É¥ì¥¹¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç |
---|
64 | if (!$objCustomer->hasValue('email_mobile')) { |
---|
65 | header('Location: ' . gfAddSessionId('../entry/email_mobile.php')); |
---|
66 | exit; |
---|
67 | } |
---|
68 | } else { |
---|
69 | $objQuery = new SC_Query; |
---|
70 | $where = "email = ? AND status = 1 AND del_flg = 0"; |
---|
71 | $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'])); |
---|
72 | |
---|
73 | if($ret > 0) { |
---|
74 | sfDispSiteError(TEMP_LOGIN_ERROR, "", false, "", true); |
---|
75 | } else { |
---|
76 | sfDispSiteError(SITE_LOGIN_ERROR, "", false, "", true); |
---|
77 | } |
---|
78 | } |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|
82 | |
---|
83 | // ¥í¥°¥¤¥ó¥Á¥§¥Ã¥¯ |
---|
84 | if(!$objCustomer->isLoginSuccess()) { |
---|
85 | $objPage->tpl_mainpage = 'mypage/login.tpl'; |
---|
86 | $objView->assignArray($objFormParam->getHashArray()); |
---|
87 | $objView->assignArray(array("arrErr" => $arrErr)); |
---|
88 | }else { |
---|
89 | //¥Þ¥¤¥Ú¡¼¥¸¥È¥Ã¥×¸ÜµÒ¾ðÊóɽ¼¨ÍÑ |
---|
90 | $objPage->CustomerName1 = $objCustomer->getvalue('name01'); |
---|
91 | $objPage->CustomerName2 = $objCustomer->getvalue('name02'); |
---|
92 | } |
---|
93 | |
---|
94 | $objView->assignobj($objPage); //$objpageÆâ¤ÎÁ´¤Æ¤Î¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤òsmarty¤Ë³ÊǼ |
---|
95 | $objView->display(SITE_FRAME); //¥Ñ¥¹¤È¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤Î¸Æ¤Ó½Ð¤·¡¢¼Â¹Ô |
---|
96 | |
---|
97 | //------------------------------------------------------------------------------------------------------------------------- |
---|
98 | /* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */ |
---|
99 | function lfInitParam() { |
---|
100 | global $objFormParam; |
---|
101 | $objFormParam->addParam("µ²±¤¹¤ë", "login_memory", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK")); |
---|
102 | $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹", "login_email", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); |
---|
103 | $objFormParam->addParam("¥Ñ¥¹¥ï¡¼¥É", "login_pass", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); |
---|
104 | } |
---|
105 | ?> |
---|