Changeset 15306 for branches/rel
- Timestamp:
- 2007/08/17 16:34:06 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/rel/data/class/SC_Customer.php
r12157 r15306 10 10 */ 11 11 class SC_Customer { 12 12 13 13 var $conn; 14 14 var $email; 15 var $customer_data; // ²ñ°÷¾ðÊó 16 15 var $customer_data; // ²ñ°÷¾ðÊó 16 17 17 function SC_Customer( $conn = '', $email = '', $pass = '' ) { 18 18 // ¥»¥Ã¥·¥ç¥ó³«»Ï 19 19 /* startSession¤«¤é°Üư 2005/11/04 ÃæÀî */ 20 20 sfDomainSessionStart(); 21 21 22 22 // DBÀܳ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À® 23 23 $DB_class_name = "SC_DbConn"; … … 30 30 if (class_exists($DB_class_name)){ 31 31 //$DB_class_name¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òºîÀ®¤¹¤ë 32 $this->conn = new SC_DbConn(); 33 } 34 } 35 36 if ( is_object($this->conn) ) { 32 $this->conn = new SC_DbConn(); 33 } 34 } 35 36 if ( is_object($this->conn) ) { 37 37 // Àµ¾ï¤ËDB¤ËÀܳ¤Ç¤¤ë 38 38 if ( $email ){ … … 44 44 exit; 45 45 } 46 46 47 47 if ( strlen($email) > 0 && strlen($pass) > 0 ){ 48 $this->getCustomerDataFromEmailPass( $email, $pass);49 } 50 } 51 48 $this->getCustomerDataFromEmailPass($pass, $email); 49 } 50 } 51 52 52 function getCustomerDataFromEmailPass( $pass, $email, $mobile = false ) { 53 53 $sql_mobile = $mobile ? ' OR email_mobile ILIKE ?' : ''; … … 60 60 $result = $this->conn->getAll($sql, $arrValues); 61 61 $data = $result[0]; 62 62 63 63 // ¥Ñ¥¹¥ï¡¼¥É¤¬¹ç¤Ã¤Æ¤¤¤ì¤Ð¸ÜµÒ¾ðÊó¤òcustomer_data¤Ë¥»¥Ã¥È¤·¤Ætrue¤òÊÖ¤¹ 64 64 if ( sha1($pass . ":" . AUTH_MAGIC) == $data['password'] ){ … … 159 159 $this->customer_data['email_mobile'] = $this->customer_data['email']; 160 160 } 161 161 162 162 // ¥Ñ¥¹¥ï¡¼¥É¤ò³Îǧ¤»¤º¤Ë¥í¥°¥¤¥ó 163 163 function setLogin($email) { … … 169 169 $this->startSession(); 170 170 } 171 171 172 172 // ¥»¥Ã¥·¥ç¥ó¾ðÊó¤òºÇ¿·¤Î¾ðÊó¤Ë¹¹¿·¤¹¤ë 173 173 function updateSession() { … … 178 178 $_SESSION['customer'] = $this->customer_data; 179 179 } 180 180 181 181 // ¥í¥°¥¤¥ó¾ðÊó¤ò¥»¥Ã¥·¥ç¥ó¤ËÅÐÏ¿¤·¡¢¥í¥°¤Ë½ñ¤¹þ¤à 182 182 function startSession() { … … 194 194 gfPrintLog("logout : user=".$this->customer_data['customer_id'] ."\t"."ip=". $_SERVER['REMOTE_HOST'], CUSTOMER_LOG_PATH ); 195 195 } 196 196 197 197 // ¥í¥°¥¤¥ó¤ËÀ®¸ù¤·¤Æ¤¤¤ë¤«È½Äꤹ¤ë¡£ 198 198 function isLoginSuccess($dont_check_email_mobile = false) { … … 213 213 return false; 214 214 } 215 215 216 216 // ¥Ñ¥é¥á¡¼¥¿¤Î¼èÆÀ 217 217 function getValue($keyname) { 218 218 return $_SESSION['customer'][$keyname]; 219 219 } 220 220 221 221 // ¥Ñ¥é¥á¡¼¥¿¤Î¥»¥Ã¥È 222 222 function setValue($keyname, $val) { … … 228 228 return isset($_SESSION['customer'][$keyname]); 229 229 } 230 230 231 231 // ÃÂÀ¸Æü·î¤Ç¤¢¤ë¤«¤É¤¦¤«¤ÎȽÄê 232 232 function isBirthMonth() { … … 234 234 $birth_month = intval($arrRet[1]); 235 235 $now_month = intval(date("m")); 236 236 237 237 if($birth_month == $now_month) { 238 238 return true;
Note: See TracChangeset
for help on using the changeset viewer.