{"id":1465,"date":"2010-02-22T13:47:29","date_gmt":"2010-02-22T05:47:29","guid":{"rendered":"http:\/\/www.inhaoxu.com\/blog\/?p=1465"},"modified":"2010-02-23T11:17:31","modified_gmt":"2010-02-23T03:17:31","slug":"%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0ecshop-%e8%ae%a9%e7%94%a8%e6%88%b7%e5%90%8d%e5%92%8cemail%e9%83%bd%e5%8f%af%e4%bb%a5%e7%99%bb%e9%99%86","status":"publish","type":"post","link":"https:\/\/inhaoxu.com\/blog\/?p=1465","title":{"rendered":"\u5982\u4f55\u5b9e\u73b0ecshop \u8ba9\u7528\u6237\u540d\u548cemail\u90fd\u53ef\u4ee5\u767b\u9646!"},"content":{"rendered":"<table width=\"100%\">\n<tbody>\n<tr>\n<td><span style=\"color: #0000ff;\"><!--more-->\u6539\u52a8\u7248\u672c<\/span>: ecshop 2.7.0<br \/>\n<span style=\"color: #0000ff;\">\u6539\u52a8\u7a0b\u5e8f<\/span>: \/includes\/modules\/integrates\/integrate.php<br \/>\n<span style=\"color: #0000ff;\">\u6539\u52a8\u4ee3\u7801<\/span>:<span style=\"color: #ff0000;\">145<\/span>&#8212;<span style=\"color: #ff0000;\">162<\/span>\u884c\u7684\u7528\u6237\u767b\u9646\u51fd\u6570.\u5982\u4e0b \u00a0\u00a0\u00a0 function login($username, $password)<\/p>\n<p>{<\/p>\n<p>if ($this-&gt;check_user($username, $password) &gt; 0)<\/p>\n<p>{<\/p>\n<p>if ($this-&gt;need_sync)<\/p>\n<p>{<\/p>\n<p>$this-&gt;sync($username,$password);<\/p>\n<p>}<\/p>\n<p>$this-&gt;set_session($username);<\/p>\n<p>$this-&gt;set_cookie($username);<\/p>\n<p>return true;<\/p>\n<p>}<\/p>\n<p>else<\/p>\n<p>{<\/p>\n<p>return false;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>\u6539\u4e3a<\/p>\n<p>function login($username, $password)<\/p>\n<p>{<\/p>\n<p>if(is_email($username))<br \/>\n{<br \/>\n$sql = &#8220;select &#8220;.$this-&gt;field_name.&#8221; from &#8220;.$this-&gt;table($this-&gt;user_table).&#8221; where &#8220;.$this-&gt;field_email.&#8221;='&#8221;.$username.&#8221;&#8216;&#8221;;<br \/>\n$username = $this-&gt;db-&gt;getOne($sql);<br \/>\nif(!$username) return false;<br \/>\n\/\/echo $sql;exit;<br \/>\n}<br \/>\nif ($this-&gt;check_user($username, $password) &gt; 0)<\/p>\n<p>{<\/p>\n<p>if ($this-&gt;need_sync)<\/p>\n<p>{<\/p>\n<p>$this-&gt;sync($username,$password);<\/p>\n<p>}<\/p>\n<p>$this-&gt;set_session($username);<\/p>\n<p>$this-&gt;set_cookie($username);<\/p>\n<p>return true;<\/p>\n<p>}<\/p>\n<p>else<\/p>\n<p>{<\/p>\n<p>return false;<\/p>\n<p>}<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[392,147,534,208,1201,1202,1204,1203],"_links":{"self":[{"href":"https:\/\/inhaoxu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1465"}],"collection":[{"href":"https:\/\/inhaoxu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inhaoxu.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inhaoxu.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inhaoxu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1465"}],"version-history":[{"count":0,"href":"https:\/\/inhaoxu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1465\/revisions"}],"wp:attachment":[{"href":"https:\/\/inhaoxu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inhaoxu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inhaoxu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}