有人知道如何在DNN 9上一次将未经验证的用户的角色转换为已验证的用户吗?
我有超过900个未经验证的用户,并希望他们能让所有的验证,如果可能的话一次。
发布于 2018-06-27 12:16:31
我还没有对此进行测试,但它很可能类似于(要执行的sql)
insert into userroles
(userid, roleid, createdbyuserid,createdondate,lastmodifiedbyuserid,lastmodifiedondate, status)
select userid, 1234, 1,getdate(),1,getdate(),1
from users
where userid not in (Select userid from userroles where roleid=1234 and portalid=0)
您可能还需要执行以下操作来“授权”用户。
update userportals
set authorised = 1
where authorised =0
and portalid = 0
其中1234 (上面替换了两次)是您的注册用户角色的角色is (select * From roles)
假设您正在使用PortalID 0,如果您有多个门户,那么您也希望加入到用户门户,以便仅对适当门户中的用户执行此操作。
首先备份你的数据库,等等。
发布于 2018-06-27 21:18:23
您可以通过使用ForDNN的用户导出/导入工具来完成此操作:https://github.com/fordnn/usersexportimport
您可以将所有或部分用户(即未经验证的用户)导出到csv文件,在电子表格中打开该文件,更改用户角色,然后重新导入。这应该会修改现有用户。
在使用之前进行测试...
https://stackoverflow.com/questions/51045121
复制相似问题