Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
[Documentation] Users have been Orphaned how do i auto add them all to a role?
H00j
✭
I have about 25 pages of users and several random ones have been orphaned is there away i can add them all to a group with out doing everypage manually
Tagged:
0
Best Answer
-
UnderDog MVP
I have no solution, but a couple of MySQL selects to figure out more information:
All users which do not have a Role in the UserRole table:select u.UserID from GDN_User u left join GDN_UserRole ur on u.UserID = ur.UserID where ur.UserID is null;
All users with multiple Roles:
select u.UserID from GDN_User u join GDN_UserRole ur on u.UserID = ur.UserID GROUP BY ur.RoleID ORDER BY ur.RoleID DESC;
edit
Also figure out exactly what you want to do with which type of users.For example : For every user that has role 33 I want him to give only role 8
Every user that has role 27 will only get role 33
etcetera etceteraThere was an error rendering this rich post.
0
Answers
Do you want to switch them all to one user.
or do you want to change the role for a select number of users?
what do you mean 25 pages?
if you have access to phpmyadmin
you could just place a check box next to each userid you want to change the role on on update to the new roleid you want. or you could use mysql.
if you really are changing roles - look in UserRole table.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
You'll need to run a bit of SQL. Check out this discussion.
I agree with what my neighbours above me said and I have something to add. Figure out why you have 25 pages of users without a Role attached. Did you delete a Role? In that case let us know here please :-)
This fixing of the Users' role could be something interesting to enhance a plugin or core functionality :-)
There was an error rendering this rich post.
Sorry i made it unclear, i have 25pages of users, most have a role, however about 15 of the 25 do not. The delete role and migrate to another role button wouldn't work for me so i had to delete without.
Okay from SQL it looks like they are not orphaned they just have multiple role ids, how do i fix this so they only have one?
I have no solution, but a couple of MySQL selects to figure out more information:
All users which do not have a Role in the UserRole table:
All users with multiple Roles:
edit
Also figure out exactly what you want to do with which type of users.
For example : For every user that has role 33 I want him to give only role 8
Every user that has role 27 will only get role 33
etcetera etcetera
There was an error rendering this rich post.