Changeset 11460 for branches/dev/data/class
- Timestamp:
- 2007/02/28 16:17:07 (19 years ago)
- Location:
- branches/dev/data/class
- Files:
-
- 3 edited
- 4 copied
-
GC_MobileEmoji.php (copied) (copied from temp/branches/mobile/data/class/GC_MobileEmoji.php)
-
GC_MobileImage.php (copied) (copied from temp/branches/mobile/data/class/GC_MobileImage.php)
-
GC_MobileKaraMail.php (copied) (copied from temp/branches/mobile/data/class/GC_MobileKaraMail.php)
-
GC_MobileUserAgent.php (copied) (copied from temp/branches/mobile/data/class/GC_MobileUserAgent.php)
-
SC_CheckError.php (modified) (2 diffs)
-
SC_Customer.php (modified) (5 diffs)
-
SC_FormParam.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/dev/data/class/SC_CheckError.php
r17 r11460 378 378 return; 379 379 } 380 if(strlen($this->arrParam[$value[1]]) > 0 && ! mb_ereg("^ ([¥¡-¥ö]|[¡¼])+$", $this->arrParam[$value[1]])) {380 if(strlen($this->arrParam[$value[1]]) > 0 && ! mb_ereg("^[¥¡-¥ö¦-ß¡¼]+$", $this->arrParam[$value[1]])) { 381 381 $this->arrErr[$value[1]] = "¢¨ " . $value[0] . "¤Ï¥«¥¿¥«¥Ê¤ÇÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£<br />"; 382 382 } … … 780 780 } 781 781 } 782 783 /*¡¡·ÈÂӥ᡼¥ë¥¢¥É¥ì¥¹¤ÎȽÄê¡¡*/ 784 // value[0] = ¹àÌÜ̾ value[1] = ȽÄêÂоݥ᡼¥ë¥¢¥É¥ì¥¹ 785 function MOBILE_EMAIL_CHECK( $value ){ //¡¡¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÀµµ¬É½¸½¤ÇȽÄꤹ¤ë 786 if(isset($this->arrErr[$value[1]])) { 787 return; 788 } 789 if(strlen($this->arrParam[$value[1]]) > 0 && !gfIsMobileMailAddress($this->arrParam[$value[1]])) { 790 $this->arrErr[$value[1]] = "¢¨ " . $value[0] . "¤Ï·ÈÂÓÅÅÏäΤâ¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£<br />"; 791 } 792 } 782 793 } 783 794 ?> -
branches/dev/data/class/SC_Customer.php
r17 r11460 50 50 } 51 51 52 function getCustomerDataFromEmailPass( $pass, $email ) { 52 function getCustomerDataFromEmailPass( $pass, $email, $mobile = false ) { 53 $sql_mobile = $mobile ? ' OR email_mobile ILIKE ?' : ''; 54 $arrValues = array($email); 55 if ($mobile) { 56 $arrValues[] = $email; 57 } 53 58 // ËÜÅÐÏ¿¤µ¤ì¤¿²ñ°÷¤Î¤ß 54 $sql = "SELECT * FROM dtb_customer WHERE email ILIKE ?AND del_flg = 0 AND status = 2";55 $result = $this->conn->getAll($sql, array($email));59 $sql = "SELECT * FROM dtb_customer WHERE (email ILIKE ?" . $sql_mobile . ") AND del_flg = 0 AND status = 2"; 60 $result = $this->conn->getAll($sql, $arrValues); 56 61 $data = $result[0]; 57 62 … … 63 68 } 64 69 return false; 70 } 71 72 /** 73 * ·ÈÂÓüËöID¤¬°ìÃפ¹¤ë²ñ°÷¤¬Â¸ºß¤¹¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ 74 * 75 * @return boolean ³ºÅö¤¹¤ë²ñ°÷¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï true¡¢¤½¤ì°Ê³°¤Î¾ì¹ç 76 * ¤Ï false ¤òÊÖ¤¹¡£ 77 */ 78 function checkMobilePhoneId() { 79 if (!isset($_SESSION['mobile']['phone_id']) || $_SESSION['mobile']['phone_id'] === false) { 80 return false; 81 } 82 83 // ·ÈÂÓüËöID¤¬°ìÃפ·¡¢ËÜÅÐÏ¿¤µ¤ì¤¿²ñ°÷¤ò¸¡º÷¤¹¤ë¡£ 84 $sql = 'SELECT count(*) FROM dtb_customer WHERE mobile_phone_id = ? AND del_flg = 0 AND status = 2'; 85 $result = $this->conn->getOne($sql, array($_SESSION['mobile']['phone_id'])); 86 return $result > 0; 87 } 88 89 /** 90 * ·ÈÂÓüËöID¤ò»ÈÍѤ·¤Æ²ñ°÷¤ò¸¡º÷¤·¡¢¥Ñ¥¹¥ï¡¼¥É¤Î¾È¹ç¤ò¹Ô¤¦¡£ 91 * ¥Ñ¥¹¥ï¡¼¥É¤¬¹ç¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¸ÜµÒ¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ 92 * 93 * @param string $pass ¥Ñ¥¹¥ï¡¼¥É 94 * @return boolean ³ºÅö¤¹¤ë²ñ°÷¤¬Â¸ºß¤·¡¢¥Ñ¥¹¥ï¡¼¥É¤¬¹ç¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï true¡¢ 95 * ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï false ¤òÊÖ¤¹¡£ 96 */ 97 function getCustomerDataFromMobilePhoneIdPass($pass) { 98 if (!isset($_SESSION['mobile']['phone_id']) || $_SESSION['mobile']['phone_id'] === false) { 99 return false; 100 } 101 102 // ·ÈÂÓüËöID¤¬°ìÃפ·¡¢ËÜÅÐÏ¿¤µ¤ì¤¿²ñ°÷¤ò¸¡º÷¤¹¤ë¡£ 103 $sql = 'SELECT * FROM dtb_customer WHERE mobile_phone_id = ? AND del_flg = 0 AND status = 2'; 104 @list($data) = $this->conn->getAll($sql, array($_SESSION['mobile']['phone_id'])); 105 106 // ¥Ñ¥¹¥ï¡¼¥É¤¬¹ç¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¸ÜµÒ¾ðÊó¤òcustomer_data¤Ë³ÊǼ¤·¤Ætrue¤òÊÖ¤¹¡£ 107 if (sha1($pass . ':' . AUTH_MAGIC) == @$data['password']) { 108 $this->customer_data = $data; 109 $this->startSession(); 110 return true; 111 } 112 return false; 113 } 114 115 /** 116 * ·ÈÂÓüËöID¤òÅÐÏ¿¤¹¤ë¡£ 117 * 118 * @return void 119 */ 120 function updateMobilePhoneId() { 121 if (!isset($_SESSION['mobile']['phone_id']) || $_SESSION['mobile']['phone_id'] === false) { 122 return; 123 } 124 125 if ($this->customer_data['mobile_phone_id'] == $_SESSION['mobile']['phone_id']) { 126 return; 127 } 128 129 $objQuery = new SC_Query; 130 $sqlval = array('mobile_phone_id' => $_SESSION['mobile']['phone_id']); 131 $where = 'customer_id = ? AND del_flg = 0 AND status = 2'; 132 $objQuery->update('dtb_customer', $sqlval, $where, array($this->customer_data['customer_id'])); 133 134 $this->customer_data['mobile_phone_id'] = $_SESSION['mobile']['phone_id']; 135 } 136 137 /** 138 * email ¤«¤é email_mobile ¤Ø·ÈÂӤΥ᡼¥ë¥¢¥É¥ì¥¹¤ò¥³¥Ô¡¼¤¹¤ë¡£ 139 * 140 * @return void 141 */ 142 function updateEmailMobile() { 143 // ¤¹¤Ç¤Ë email_mobile ¤ËÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï²¿¤â¤·¤Ê¤¤¡£ 144 if ($this->customer_data['email_mobile'] != '') { 145 return; 146 } 147 148 // email ¤¬·ÈÂӤΥ᡼¥ë¥¢¥É¥ì¥¹¤Ç¤Ï¤Ê¤¤¾ì¹ç¤Ï²¿¤â¤·¤Ê¤¤¡£ 149 if (!gfIsMobileMailAddress($this->customer_data['email'])) { 150 return; 151 } 152 153 // email ¤«¤é email_mobile ¤Ø¥³¥Ô¡¼¤¹¤ë¡£ 154 $objQuery = new SC_Query; 155 $sqlval = array('email_mobile' => $this->customer_data['email']); 156 $where = 'customer_id = ? AND del_flg = 0 AND status = 2'; 157 $objQuery->update('dtb_customer', $sqlval, $where, array($this->customer_data['customer_id'])); 158 159 $this->customer_data['email_mobile'] = $this->customer_data['email']; 65 160 } 66 161 … … 101 196 102 197 // ¥í¥°¥¤¥ó¤ËÀ®¸ù¤·¤Æ¤¤¤ë¤«È½Äꤹ¤ë¡£ 103 function isLoginSuccess( ) {198 function isLoginSuccess($dont_check_email_mobile = false) { 104 199 // ¥í¥°¥¤¥ó»þ¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤ÈDB¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬°ìÃפ·¤Æ¤¤¤ë¾ì¹ç 105 200 if(sfIsInt($_SESSION['customer']['customer_id'])) { … … 107 202 $email = $objQuery->get("dtb_customer", "email", "customer_id = ?", array($_SESSION['customer']['customer_id'])); 108 203 if($email == $_SESSION['customer']['email']) { 204 // ¥â¥Ð¥¤¥ë¥µ¥¤¥È¤Î¾ì¹ç¤Ï·ÈÂӤΥ᡼¥ë¥¢¥É¥ì¥¹¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤³¤È¤â¥Á¥§¥Ã¥¯¤¹¤ë¡£ 205 // ¤¿¤À¤· $dont_check_email_mobile ¤¬ true ¤Î¾ì¹ç¤Ï¥Á¥§¥Ã¥¯¤·¤Ê¤¤¡£ 206 if (defined('MOBILE_SITE') && !$dont_check_email_mobile) { 207 $email_mobile = $objQuery->get("dtb_customer", "email_mobile", "customer_id = ?", array($_SESSION['customer']['customer_id'])); 208 return isset($email_mobile); 209 } 109 210 return true; 110 211 } … … 121 222 function setValue($keyname, $val) { 122 223 $_SESSION['customer'][$keyname] = $val; 224 } 225 226 // ¥Ñ¥é¥á¡¼¥¿¤¬NULL¤«¤É¤¦¤«¤ÎȽÄê 227 function hasValue($keyname) { 228 return isset($_SESSION['customer'][$keyname]); 123 229 } 124 230 -
branches/dev/data/class/SC_FormParam.php
r17 r11460 155 155 case 'DOMAIN_CHECK': 156 156 case 'FILE_NAME_CHECK': 157 case 'MOBILE_EMAIL_CHECK': 157 158 158 159 if(!is_array($this->param[$cnt])) {
Note: See TracChangeset
for help on using the changeset viewer.
