网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > Discuz/SupeSite/X-Space
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Discuz/SupeSite/X-Space 讨论Discuz安装、升级、模板、插件、源代码修改以及使用技巧等。

Reply
 
Thread Tools Display Modes
  #1   IP: 112.87.93.86
Old 2013-12-28, 11:19 AM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default Discuz! X2怎么样批量修改用户密码

今天说下Discuz! X2怎么样批量修改用户密码。

百度 google了很多Discuz! X2怎么样批量修改用户密码相关文章

看了一下一个都不能用。他们的教程写的太简单。对于我们新手来说有点问题。

请教了群里的高手帮我成功批量修改了用户的密码。

今天和大家分享一下批量修改用户密码的方法。

首先打开你的数据库找到---ucenter_members表(---代表你论坛数据库前缩)

编辑 --- ucenter_members
Code:
UPDATE `AAA_ucenter_members` SET password = md5( concat( md5('新密码a'),salt ) ) WHERE `uid` >=用户ID AND `uid` <=用户ID结束;
需要注意的是 AAA代表你数据库前缩 自己修改 用户ID到用户ID结束这个都知道怎么填吧!

填好以上代码后 点击执行。

上面的帖子内容是说修改某个UID段的密码,如果我想要批量修改某个用户组的密码,是不是可以这样进行操作呢? `groupid`='10';为积分为0的用户组

Code:
01.UPDATE `AAA_ucenter_members` SET password = md5( concat( md5('新密码a'),salt ) ) WHERE `groupid`='10';
也可研究下:
Code:
function edit_user($username, $oldpw, $newpw, $email, $ignoreoldpw = 0, $questionid = '', $answer = '') {
                $data = $this->db->fetch_first("SELECT username, uid, password, salt FROM ".UC_DBTABLEPRE."members WHERE username='$username'");

                if($ignoreoldpw) {
                        $isprotected = $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."protectedmembers WHERE uid = '$data[uid]'");
                        if($isprotected) {
                                return -8;
                        }
                }

                if(!$ignoreoldpw && $data['password'] != md5(md5($oldpw).$data['salt'])) {
                        return -1;
                }

                $sqladd = $newpw ? "password='".md5(md5($newpw).$data['salt'])."'" : '';
                $sqladd .= $email ? ($sqladd ? ',' : '')." email='$email'" : '';
                if($questionid !== '') {
                        if($questionid > 0) {
                                $sqladd .= ($sqladd ? ',' : '')." secques='".$this->quescrypt($questionid, $answer)."'";
                        } else {
                                $sqladd .= ($sqladd ? ',' : '')." secques=''";
                        }
                }
                if($sqladd || $emailadd) {
                        $this->db->query("UPDATE ".UC_DBTABLEPRE."members SET $sqladd WHERE username='$username'");
                        return $this->db->affected_rows();
                } else {
                        return -7;
                }
        }
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AdSense 广告在 Discuz! 等其它平台论坛广告展示问题及解决办法 yahoo Google Adsense 0 2009-08-22 01:49 PM
discuz.htm里面的变量$forum[icon]的问题! yahoo Discuz/SupeSite/X-Space 0 2007-03-13 07:16 PM
Discuz!+SupeSite+X-Space相关录像大集合 car Discuz/SupeSite/X-Space 0 2007-02-22 01:36 AM
官方出品 新春风格火热出炉--恭贺新禧 for Discuz! 5.0.0 SupeSite Discuz/SupeSite/X-Space 0 2007-02-22 01:09 AM
Discuz官方logo源代码 car Discuz/SupeSite/X-Space 0 2006-06-26 11:14 AM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 03:46 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.