Joomla批量密码重置!
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Joomla批量密码重置!相关的知识,希望对你有一定的参考价值。
Basic sample courtesy of John Martin @ www.bigspring.co.uk/
<?php /* take the following script and modify the connection details and query to suit your needs */ // function to generate salt function genRandomPassword($length = 32) { $salt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $makepass = ''; for ($i = 0; $i < $length; $i ++) { } return $makepass; } // connection // FILL IN YOUR DATABASE DETAILS HERE $hostname = "yourhost"; $database = "db_name"; $username = "db_user"; $password = "db_pass"; $site = mysql_pconnect($hostname, $username, $password) or trigger_error(mysql_error(),E_USER_ERROR); // run query // QUERY TO RETURN USER IDS OF ALL 'registgered' usertypes (gid = 18) $query = "SELECT * FROM jos_users WHERE gid <= '18'"; echo "You're resetting ". $num_rows ." passwords"; do { //generate salt $salt = genRandomPassword(); // update $query_update = "UPDATE jos_users SET password = '" . md5(stripslashes("NEW-PASSWORD").$salt) .':'.$salt . "' WHERE id = " . $row_result['id']; echo $query_update."<br />"; ?>
以上是关于Joomla批量密码重置!的主要内容,如果未能解决你的问题,请参考以下文章