2016-03-13 15:38:34 +08:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @Author: printempw
|
|
|
|
* @Date: 2016-03-13 14:59:32
|
|
|
|
* @Last Modified by: printempw
|
2016-03-18 16:59:20 +08:00
|
|
|
* @Last Modified time: 2016-03-18 16:56:46
|
2016-03-13 15:38:34 +08:00
|
|
|
*/
|
|
|
|
|
2016-03-18 16:59:20 +08:00
|
|
|
class DiscuzDatabase extends AdaptedDatabase
|
2016-03-13 15:38:34 +08:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Discuz's Fucking dynamic salt
|
|
|
|
*/
|
|
|
|
public function encryptPassword($raw_passwd, $username="") {
|
|
|
|
$salt = $this->query("SELECT * FROM ".$this->table_name."
|
2016-03-18 16:47:25 +08:00
|
|
|
WHERE ".$this->column_uname."='$username'")->fetch_array()['salt'];
|
2016-03-13 15:38:34 +08:00
|
|
|
$encrypt = md5(md5($raw_passwd).$salt);
|
|
|
|
return $encrypt;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|