Changeset 11398 for temp/branches/mobile/data/class/SC_Customer.php
- Timestamp:
- 2007/01/19 23:01:05 (20 years ago)
- File:
-
- 1 edited
-
temp/branches/mobile/data/class/SC_Customer.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
temp/branches/mobile/data/class/SC_Customer.php
r5934 r11398 63 63 } 64 64 return false; 65 } 66 67 /** 68 * ·ÈÂÓüËöID¤¬°ìÃפ¹¤ë²ñ°÷¤¬Â¸ºß¤¹¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ 69 * 70 * @return boolean ³ºÅö¤¹¤ë²ñ°÷¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï true¡¢¤½¤ì°Ê³°¤Î¾ì¹ç 71 * ¤Ï false ¤òÊÖ¤¹¡£ 72 */ 73 function checkMobilePhoneId() { 74 if (!isset($_SESSION['mobile']['phone_id'])) { 75 return false; 76 } 77 78 // ·ÈÂÓüËöID¤¬°ìÃפ·¡¢ËÜÅÐÏ¿¤µ¤ì¤¿²ñ°÷¤ò¸¡º÷¤¹¤ë¡£ 79 $sql = 'SELECT count(*) FROM dtb_customer WHERE mobile_phone_id = ? AND del_flg = 0 AND status = 2'; 80 $result = $this->conn->getOne($sql, array($_SESSION['mobile']['phone_id'])); 81 return $result > 0; 82 } 83 84 /** 85 * ·ÈÂÓüËöID¤ò»ÈÍѤ·¤Æ²ñ°÷¤ò¸¡º÷¤·¡¢¥Ñ¥¹¥ï¡¼¥É¤Î¾È¹ç¤ò¹Ô¤¦¡£ 86 * ¥Ñ¥¹¥ï¡¼¥É¤¬¹ç¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¸ÜµÒ¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ 87 * 88 * @param string $pass ¥Ñ¥¹¥ï¡¼¥É 89 * @return boolean ³ºÅö¤¹¤ë²ñ°÷¤¬Â¸ºß¤·¡¢¥Ñ¥¹¥ï¡¼¥É¤¬¹ç¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï true¡¢ 90 * ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï false ¤òÊÖ¤¹¡£ 91 */ 92 function getCustomerDataFromMobilePhoneIdPass($pass) { 93 if (!isset($_SESSION['mobile']['phone_id'])) { 94 return false; 95 } 96 97 // ·ÈÂÓüËöID¤¬°ìÃפ·¡¢ËÜÅÐÏ¿¤µ¤ì¤¿²ñ°÷¤ò¸¡º÷¤¹¤ë¡£ 98 $sql = 'SELECT * FROM dtb_customer WHERE mobile_phone_id = ? AND del_flg = 0 AND status = 2'; 99 @list($data) = $this->conn->getAll($sql, array($_SESSION['mobile']['phone_id'])); 100 101 // ¥Ñ¥¹¥ï¡¼¥É¤¬¹ç¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¸ÜµÒ¾ðÊó¤òcustomer_data¤Ë³ÊǼ¤·¤Ætrue¤òÊÖ¤¹¡£ 102 if (sha1($pass . ':' . AUTH_MAGIC) == @$data['password']) { 103 $this->customer_data = $data; 104 $this->startSession(); 105 return true; 106 } 107 return false; 108 } 109 110 /** 111 * ·ÈÂÓüËöID¤òÅÐÏ¿¤¹¤ë¡£ 112 * 113 * @return void 114 */ 115 function updateMobilePhoneId() { 116 if (!isset($_SESSION['mobile']['phone_id'])) { 117 return; 118 } 119 120 if ($this->customer_data['mobile_phone_id'] == $_SESSION['mobile']['phone_id']) { 121 return; 122 } 123 124 $objQuery = new SC_Query; 125 $sqlval = array('mobile_phone_id' => $_SESSION['mobile']['phone_id']); 126 $where = 'customer_id = ? AND del_flg = 0 AND status = 2'; 127 $objQuery->update('dtb_customer', $sqlval, $where, array($this->customer_data['customer_id'])); 128 129 $this->customer_data['mobile_phone_id'] = $_SESSION['mobile']['phone_id']; 65 130 } 66 131
Note: See TracChangeset
for help on using the changeset viewer.
