{"id":3435,"date":"2016-12-27T13:28:30","date_gmt":"2016-12-27T05:28:30","guid":{"rendered":"http:\/\/blog.hoyo.idv.tw\/?p=3435"},"modified":"2018-04-23T18:00:22","modified_gmt":"2018-04-23T10:00:22","slug":"joomla-1-5-%e4%bd%bf%e7%94%a8%e8%80%85%e6%89%b9%e6%ac%a1%e6%96%b0%e5%a2%9e","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=3435","title":{"rendered":"Joomla 1.5 \u4f7f\u7528\u8005\u7b2c\u4e09\u65b9 PHP \u7ba1\u7406"},"content":{"rendered":"<h2>\u6279\u6b21\u65b0\u589e<\/h2>\n<p>\u53c3\u8003<\/p>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1904809\/how-can-i-create-a-new-joomla-user-account-from-within-a-script\">How can I create a new Joomla user account from within a script?<\/a><\/li>\n<\/ul>\n<pre class=\"lang:mysql decode:true \">INSERT INTO jos_users( `name`, `username`, `password`, `email`, `usertype`, `gid` )\r\nVALUES( '\u0418\u0432\u0430\u043d\u043e\u0432 \u0418\u0432\u0430\u043d', 'ivanov', md5('12345'), 'ivanov@mail.ru', 'Registered', 18 );\r\n\r\nINSERT INTO jos_core_acl_aro( `section_value`, `value` )\r\nVALUES ( 'users', LAST_INSERT_ID() );\r\n\r\nINSERT INTO jos_core_acl_groups_aro_map( `group_id`, `aro_id` )\r\nVALUES ( 18, LAST_INSERT_ID() );<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\nrequire_once (\"extra01.php\");\r\n\r\nfor( $i=1; $i&lt;=100; $i++ ) {\r\n    \r\n    $password = rand( 234567, 891234 );\r\n    \r\n    $sql = \"INSERT INTO jos_users( `name`, `username`, `password`, `email`, `usertype`, `gid`, registerDate )\r\nVALUES( '\u5916\u5305{$i}', 'out{$i}', md5('{$password}'), 'out{$i}@sly-ha.com.tw', 'Registered', 18, NOW() );\";\r\n    $pre = $PDO-&gt;prepare($sql);\r\n    $pre-&gt;execute();\r\n    \r\n    $userID = $PDO-&gt;lastInsertId();\r\n    \r\n    $sql = \"INSERT INTO jos_core_acl_aro( `section_value`, `value` )\r\nVALUES ( 'users', {$userID} );\";\r\n    $pre = $PDO-&gt;prepare($sql);\r\n    $pre-&gt;execute();\r\n\r\n    $sql = \" INSERT INTO jos_core_acl_groups_aro_map( `group_id`, `aro_id` )\r\nVALUES ( 18, {$PDO-&gt;lastInsertId()} ); \";\r\n    $PDO-&gt;query($sql);\r\n    \r\n    $sql = \" INSERT INTO jos_comprofiler ( id, user_id ) VALUES ( {$userID}, {$userID} ) \";\r\n    $PDO-&gt;query($sql);\r\n\r\n    echo 'out'.$i.' : '.$password.'&lt;br\/&gt;';\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>--<\/p>\n<h2>\u4f7f\u7528\u8005\u767b\u5165\u6aa2\u67e5<\/h2>\n<p>Joomla \u7684\u5bc6\u78bc\u4f7f\u7528 md5() \u52a0\u5bc6\uff0c\u767b\u5165\u5f8c\u6216\u662f\u7531\u7cfb\u7d71\u5efa\u7acb\u7684\u4f7f\u7528\u8005\u6703\u6709\u53e6\u4e00\u500b\u65b9\u5f0f\u5132\u5b58\u5bc6\u78bc<\/p>\n<p>\u4f8b\u5982\u5bc6\u78bc\u662f 123456 \uff0c\u539f\u4f86\u7684 md5() \u662f\u00a0e10adc3949ba59abbe56e057f20f883e<\/p>\n<p>Joomla \u6703\u4e82\u6578\u7522\u751f\u4e00\u500b salt \u503c\u4f86\u548c\u539f\u5bc6\u78bc\u9023\u7d50\u5f8c\uff0c\u91cd\u65b0 md5() \u4f86\u7576\u4f5c\u6700\u5f8c\u5bc6\u78bc<\/p>\n<p>\u4f8b\u5982\u7522\u751f\u4e86\u00a0334u9rih5apoHuW0DqrVICIUvXy3Vsau \u7684 salt \u4e82\u6578\u503c\u4e4b\u5f8c\uff0c\u5bc6\u78bc\u5c31\u662f md('123456334u9rih5apoHuW0DqrVICIUvXy3Vsau') =\u00a0b6a8e243b8e54fe5a55e33fde056c09f<\/p>\n<p>\u8cc7\u6599\u5eab password \u6b04\u4f4d\u5c31\u662f\u00a0<strong>b6a8e243b8e54fe5a55e33fde056c09f:334u9rih5apoHuW0DqrVICIUvXy3Vsau<\/strong><\/p>\n<p>--<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"3435\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;3,365&nbsp;total views<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6279\u6b21\u65b0\u589e \u53c3\u8003 How can...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"3435\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;3,365&nbsp;total views<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[260],"tags":[254],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3435"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3435"}],"version-history":[{"count":5,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3435\/revisions"}],"predecessor-version":[{"id":4511,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3435\/revisions\/4511"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}