{"id":392,"date":"2016-08-13T08:29:50","date_gmt":"2016-08-13T08:29:50","guid":{"rendered":"http:\/\/www.nywzjs.com\/?p=392"},"modified":"2016-08-13T08:30:22","modified_gmt":"2016-08-13T08:30:22","slug":"%e5%b0%8f%e4%ba%ac%e4%b8%9c%e4%b8%8eucenter%e6%95%b4%e5%90%88%e8%ae%b0%e5%bd%95","status":"publish","type":"post","link":"http:\/\/www.nywzjs.com\/?p=392","title":{"rendered":"\u5c0f\u4eac\u4e1c\u4e0eUCenter\u6574\u5408\u8bb0\u5f55"},"content":{"rendered":"<p>\u8fd9\u4e2a\u4fee\u6539\u8fc7\u7a0b\u53ea\u5b9e\u73b0\u4e86\u5c0f\u4eac\u4e1c\u5230UCenter\u548cDZ\u8bba\u575b\u7684\u540c\u6b65\u6ce8\u518c\uff0c\u540c\u6b65\u4fee\u6539\u5bc6\u7801\uff0c\u540c\u6b65\u767b\u9646[<span style=\"color: #ff0000;\">\u6ca1\u6709\u5236\u4f5c\u540c\u6b65\u9000\u51fa\uff0c\u4f46\u662f\u770b\u61c2\u539f\u7406\u7684\u8bdd\uff0c\u53ef\u4ee5\u5f88\u7b80\u5355\u4fee\u6b63<\/span>]\u3002<\/p>\n<p>1\u3001\u5b89\u88c5UCenter<\/p>\n<p>2\u3001\u5728\u7a0b\u5e8f\u4e0a\u505a\u6574\u5408\uff0cUC\u91cc\u9009\u62e9\u662fEcshop\uff0c\u5c0f\u4eac\u4e1c\u91cc\u9762\u6709\u6574\u5408\u7a0b\u5e8f\uff0c\u76f8\u4e92\u5b89\u88c5\u8bbe\u7f6e\u65b9\u6cd5\u4e00\u822c\u6d41\u7a0b\u5373\u53ef\uff0c\u4e0d\u8bb0\u5f55\u3002<\/p>\n<p>\u9ed8\u8ba4\u6574\u5408\u4ee5\u540e\u7684\u6837\u5b50\u5e94\u8be5\u662f\uff1aA\u3001Ucenter\u540e\u53f0\u663e\u793a\u5e94\u7528\u901a\u4fe1\u6210\u529f\uff1bB\u3001\u5728Dz\u4e2d\u6ce8\u518c\u7684\u7528\u6237\u53ef\u4ee5\u5728\u5c0f\u4eac\u4e1c\u4e2d\u767b\u9646\uff1bC\u3001\u5c0f\u4eac\u4e1c\u4e2d\u65e0\u6cd5\u767b\u9646\uff0c\u663e\u793aSQL\u9519\u8bef\uff1bD\u3001\u5728\u5c0f\u4eac\u4e1c\u4e2d\u65e0\u6cd5\u6ce8\u518c\uff0c\u663e\u793aSQL\u9519\u8bef\uff0c\u6216\u8005\u663e\u793a\u6ce8\u518c\u6210\u529f\u5374\u65e0\u6cd5\u767b\u9646\uff1bE\u3001\u5728\u5c0f\u4eac\u4e1c\u4e2d\u4fee\u6539\u7528\u6237\u5bc6\u7801\u663e\u793a\u6210\u529f\uff0c\u4f46\u662f\u767b\u9646\u65f6\u5374\u9700\u8981\u7528\u8001\u5bc6\u7801\u767b\u9646\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<p>1\u3001\u5728\u5c0f\u4eac\u4e1c\u4e2d\u4e0d\u80fd\u767b\u9646\u7684\u95ee\u9898\uff1a<\/p>\n<p>\u7ecf\u6392\u67e5\uff0c\u5728\u7a0b\u5e8f\u4e2d\u6d89\u53ca\u4e00\u4e2a\u8bed\u53e5\uff1a$this-&gt;field_mobile_phone\uff0c\u5e94\u8be5\u663e\u793a\u7684\u662fECS_USERS\u8868\u7684mobile_phone\u5b57\u6bb5\uff0c\u4f46\u662f\u5374\u662f\u7a7a\u7684\uff0c\uff0c\u6539\u7684\u65b9\u6cd5\u5f88\u7b80\u5355\uff0c\uff0c\u627e\u5230$this-&gt;field_mobile_phone\uff0c\u6539\u6210mobile_phone\u3002<\/p>\n<p>\u8981\u6539\u7684\u5730\u65b9\u6709\uff1a\/includes\/modules\/integrates\/ucenter.php\u6587\u4ef6\u548c\/includes\/modules\/integrates\/integrate.php\u6587\u4ef6\u3002<\/p>\n<p>2\u3001\u5728\u5c0f\u4eac\u4e1c\u4e2d\u4e0d\u80fd\u6ce8\u518c\u7684\u95ee\u9898\uff1a<\/p>\n<p>\u539f\u56e0\u7b80\u5355\u7684\u8ba9\u6ca1\u6cd5\u8bf4\uff0c\u95ee\u9898\u662f\uff1a\u9ed8\u8ba4\u7684\uff0cUCENTER\u6ce8\u518c\u65b0\u7528\u6237\u7528\u7684\u662fadd_user\u51fd\u6570\uff0c\u4f46\u662f\u5728\u5c0f\u4eac\u4e1c\u7684\u6ce8\u518c\u8fc7\u7a0b\u4e2d\uff0c\u8981\u7528\u5230\u7684\u662fadd_user_by_mobile\u548cadd_user_by_email\u51fd\u6570\uff0c\u5728Ucenter.php\u4e2d\u6ca1\u6709\u8fd9\u4e24\u4e2a\u51fd\u6570\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u4eceintegrate.php\u8c03\u7528\uff0c\u800cintegrate.php\u4e2d\u6ca1\u6709UCenter\u7684\u540c\u6b65\u51fd\u6570\u3002\u6240\u4ee5\uff0c\uff0c\u540c\u6b65\u4e0d\u4e86\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a\u5c06integrate.php\u6587\u4ef6\u7684add_user_by_mobile\u548cadd_user_by_email\u51fd\u6570\u590d\u5236\u5230UCENTER.php\u6587\u4ef6\u4e2d\u3002\u5e76\u505a\u4fee\u6539\uff0c\u5c06\u539f\u6709\u7684<\/p>\n<blockquote><p>$sql = \"INSERT INTO \" . $this-&gt;table($this-&gt;user_table) . \" (\" . implode(',', $fields) . \")\" . \" VALUES ('\" . implode(\"', '\", $values) . \"')\";<br \/>\n$this-&gt;db-&gt;query($sql);<br \/>\nif($this-&gt;need_sync)<br \/>\n{<br \/>\n$this-&gt;sync($username, $password);<br \/>\n}<\/p><\/blockquote>\n<p>\u4fee\u6539\u4e3a\uff1a<\/p>\n<blockquote><p>$uid = uc_call(\"uc_user_register\", array($username, $password,$mail));<br \/>\nif ($uid &lt;= 0)<br \/>\n{<br \/>\nif($uid == -1)<br \/>\n{<br \/>\n$this-&gt;error = ERR_INVALID_USERNAME;<br \/>\nreturn false;<br \/>\n}<br \/>\nelseif($uid == -2)<br \/>\n{<br \/>\n$this-&gt;error = ERR_USERNAME_NOT_ALLOW;<br \/>\nreturn false;<br \/>\n}<br \/>\nelseif($uid == -3)<br \/>\n{<br \/>\n$this-&gt;error = ERR_USERNAME_EXISTS;<br \/>\nreturn false;<br \/>\n}<br \/>\nelseif($uid == -4)<br \/>\n{<br \/>\n$this-&gt;error = ERR_INVALID_EMAIL;<br \/>\nreturn false;<br \/>\n}<br \/>\nelseif($uid == -5)<br \/>\n{<br \/>\n$this-&gt;error = ERR_EMAIL_NOT_ALLOW;<br \/>\nreturn false;<br \/>\n}<br \/>\nelseif($uid == -6)<br \/>\n{<br \/>\n$this-&gt;error = ERR_EMAIL_EXISTS;<br \/>\nreturn false;<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\nreturn false;<br \/>\n}<br \/>\n}else{<br \/>\n\/\/EC\u6ce8\u518c<br \/>\n$sql = \"INSERT INTO \" . $this-&gt;table($this-&gt;user_table) . \" (\" . implode(',', $fields) . \")\" . \" VALUES ('\" . implode(\"', '\", $values) . \"')\";<br \/>\n$this-&gt;db-&gt;query($sql);<br \/>\nif($this-&gt;need_sync)<br \/>\n{<br \/>\n$this-&gt;sync($username, $password);<br \/>\n}<br \/>\n}<\/p><\/blockquote>\n<p>\u6ce8\u610f\uff1aI\u3001\u5728$uid = uc_call(\"uc_user_register\", array($username, $password,$mail));\u4e2d\uff0c\u5982\u679c\u662f\u5728add_user_by_mobile\u51fd\u6570\u4e2d\uff0c$mail\u9ed8\u8ba4\u662f\u7a7a\u7684\uff1bII\u3001\u5728add_user_by_mobile\u51fd\u6570\u4e2d\uff0c\u9ed8\u8ba4\u751f\u6210\u7684\u7528\u6237\u540d\u683c\u5f0f\u662fu155????1234\u8fd9\u6837\u683c\u5f0f\u7684\uff0c\u5982\u679c\u7528\u6237\u8bb0\u4e0d\u4f4f\u7684\u8bdd\uff0c\u5efa\u8bae\u6362\u6210\u7eaf\u624b\u673a\u53f7\u3002\u8fd9\u4e00\u53e5\u5728register.php\u4e2d\uff0c\u8bed\u53e5\u662f\uff1a$username = generate_username_by_mobile($mobile_phone);\uff0c\u4fee\u6539\u4e3a$username=$mobile_phone;\u5373\u53ef\u3002<\/p>\n<p>3\u3001\u4fee\u6539\u5bc6\u7801\u4e0d\u80fd\u540c\u6b65<\/p>\n<p>\u8fd9\u4e2a\u662f\u6700\u7b80\u5355\u4e0d\u8fc7\u7684\uff0c\uff0c<\/p>\n<p>\u539f\u56e0\u662f\u5728ucenter.php\u4e2d\uff0c\u9ed8\u8ba4forget_pwd=0\uff0c\u4f46\u662f\u4fee\u6539\u5bc6\u7801\u65f6\u5fc5\u987b\u4e3a1\uff0c\u6240\u4ee5\uff0c\u53ea\u9700\u8981\u6539forget_pwd\u7684\u503c\u5373\u53ef\u3002<\/p>\n<p>\u65b9\u6cd5\uff1a\u4fee\u6539find_password.php\u6587\u4ef6\u4e2d\u7684$result = $GLOBALS['user']-&gt;edit_user(array('username' =&gt; $user['user_name'], 'password' =&gt; $password));\u8bed\u53e5\u4e3a\uff1a$result = $GLOBALS['user']-&gt;edit_user(array('username' =&gt; $user['user_name'], 'password' =&gt; $password)<strong><span style=\"color: #ff0000;\">,1<\/span><\/strong>);<\/p>\n<p>&nbsp;<\/p>\n<p>\u81f3\u6b64\uff0c\u5e94\u8be5\u5c31\u53ef\u4ee5\u4e86\u3002\u6d4b\u8bd5PC\u53ef\u4ee5\u540c\u6b65\u767b\u9646\uff0c\u4f46\u662f\u4e0d\u80fd\u540c\u6b65\u9000\u51fa\uff0c\uff0c\u4f46\u662f\uff0c\u6211\u7528\u7684\u662fAPP\uff0c\uff0c\uff0cPC\u7aef\u540c\u6b65\u767b\u9646\u4e5f\u6ca1\u6709\u6bdb\u7528\uff0c\uff0c\uff0c\uff0c\uff0c\uff0c\uff0c\uff0c<\/p>\n<p>\u6b22\u8fce\u80fd\u8bbf\u95ee\u5230\u7684\u670b\u53cb\u4ea4\u6d41\u5b66\u4e60\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u4e2a\u4fee\u6539\u8fc7\u7a0b\u53ea\u5b9e\u73b0\u4e86\u5c0f\u4eac\u4e1c\u5230UCenter\u548cDZ\u8bba\u575b\u7684\u540c\u6b65\u6ce8\u518c\uff0c\u540c\u6b65\u4fee\u6539\u5bc6\u7801\uff0c\u540c\u6b65\u767b\u9646[\u6ca1\u6709\u5236\u4f5c\u540c\u6b65\u9000\u51fa\uff0c\u4f46\u662f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,11],"tags":[85,102,98],"_links":{"self":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts\/392"}],"collection":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=392"}],"version-history":[{"count":0,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts\/392\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}