source: temp/branches/mobile/html/mobile/mypage/index.php @ 11457

Revision 11457, 2.9 KB checked in by rebelt, 16 years ago (diff)

修正です。

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