From a95ce92bd5333c6355274290e92729f81f9d1b59 Mon Sep 17 00:00:00 2001 From: printempw Date: Sun, 12 Jun 2016 11:10:19 +0800 Subject: [PATCH] add support for Phpwind --- admin/options.php | 35 +++++++++++++++++--- libraries/Database/PhpwindDatabase.class.php | 24 ++++++++++++++ 2 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 libraries/Database/PhpwindDatabase.class.php diff --git a/admin/options.php b/admin/options.php index 736a3f71..720d2f21 100644 --- a/admin/options.php +++ b/admin/options.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-03-18 22:50:25 * @Last Modified by: printempw - * @Last Modified time: 2016-06-12 10:23:24 + * @Last Modified time: 2016-06-12 11:09:02 */ require "../libraries/session.inc.php"; if (!$user->is_admin) Utils::redirect('../index.php', '看起来你并不是管理员'); @@ -151,6 +151,7 @@ $db = new Database\Database('users'); + @@ -160,7 +161,7 @@ $db = new Database\Database('users'); - + 密码加密算法 + 对接数据表密码字段 - + 对接数据表 IP 字段 - + @@ -197,6 +198,30 @@ $db = new Database\Database('users'); + +
+
+

如何填写数据对接配置?

+
+ +
+ +
+
+

对接数据表名

+

所需要对接的程序的用户信息数据表,Authme 默认为 `authme`,CrazyLogin 默认为 `crazylogin_accounts`,Discuz 默认为 `pre_ucenter_members`,Phpwind 默认为 `windid_user`。请根据实际情况填写。

+

密码加密算法

+

皮肤站默认为 MD5。Authme 默认为 SHA256,CrazyLogin 为 CrazyCrypt1,Discuz 和 Phpwind 为 SALTED2MD5。没有需要的加密算法?请联系作者。

+

对接数据表用户名字段

+

如果你没有修改插件配置的话,请保持默认(`username`)。CrazyLogin 的话请将此字段改为 `name`。

+

对接数据表密码字段

+

同上,不要瞎球改。默认为 `password`

+

对接数据表 IP 字段

+

CrazyLogin 的话请将此字段改为 `ips`,Discuz 和 Phpwind 请改为 `regip`。

+
+
diff --git a/libraries/Database/PhpwindDatabase.class.php b/libraries/Database/PhpwindDatabase.class.php new file mode 100644 index 00000000..25220558 --- /dev/null +++ b/libraries/Database/PhpwindDatabase.class.php @@ -0,0 +1,24 @@ +select($this->column_uname, $username, null, $this->data_table)['salt']; + $class_name = "Cipher\\".\Option::get('encryption'); + return $class_name::encrypt($raw_passwd, $salt); + } + +}