1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Administrative users.

Discussion in 'Troubleshooting and Problems' started by andybond, Aug 14, 2016.

  1. andybond

    andybond Active Member

    Hi ,
    I imported a board. All went well. However I have noticed that a vast majority of the users are in the group administrative.
    Here is the rub though , if I search for members noone appears in the administrative group.

    What is going on ?
  2. andybond

    andybond Active Member

  3. andybond

    andybond Active Member

    I have dug into the MYSql.

    I can see these users have a User_Group_Id of 19.
    It should be 2.

    Anyone generate me some SQL To change these users only ?
  4. andybond

    andybond Active Member

    UPDATE `xf_user` SET `user_group_id` = '2' WHERE `xf_user`.`user_group_id` = 19; ?
  5. Chris D

    Chris D XenForo Developer Staff Member

    That would likely explain it, though I would still be interested in understanding why this might have happened. Which software did you import from? Which importer did you use? Was it the default one or a third party one?

    That query looks like it would do what you want. That said, I would recommend taking a different approach; how many users does this actually affect?

    SELECT COUNT(*) FROM xf_user WHERE user_group_id = 19

    If it only affects a handful of users (which presumably would be the case if it's Admin users) then you should do it via the Admin CP manually. You'll almost certainly experience issues with incorrectly cached permissions doing it automatically in the database.
  6. andybond

    andybond Active Member

    Hi Chris , phpBB , default xen importer.

    Sitting down ? 1063!

    Can I rebuild the user cache once updated in the mySQL ?
    Last edited: Aug 14, 2016
  7. Chris D

    Chris D XenForo Developer Staff Member

    Heh, well that all makes a little bit more sense. So they're not admins at all, hence why you're setting the user group ID to 2 (which is Registered).

    Is there anything else that distinguishes them from the others? For example, do they all have Registered as their secondary group? What about actual Admin users, what groups are they in?

    I'm just wondering if you can use the Batch Update Users function in the Admin CP, search for only users who have a secondary group as Registered, and then set their Primary group to Registered and remove Registered as their secondary group:


    I would say at this point is if even this ends up targeting and breaking any Admin or Moderator users, doing this, and then fixing those fewer users by hand is still going to be preferable to doing manual queries.
  8. andybond

    andybond Active Member

    I have had a play around and I simply cannot differentiate these people with the query tools inbuilt into Xen to manipulate them.
  9. andybond

    andybond Active Member

    If I go with direct SQL manipulation how can I purge the permission cache ?
  10. Chris D

    Chris D XenForo Developer Staff Member

    My point mostly is if these 1063 users should all be in the Registered user group as their primary group, shouldn't all of your other users also be in the same Registered group as their primary group, and other groups just applied via secondary groups? How many other user groups do you actually use as primary groups? Looking at your list of user groups, you only have Administrative, Events and Moderating. If some of the other users have these groups as their primary group, and the Batch Update Users method I mentioned above affects them too, this might not actually be a bad thing. The general recommendation is that everyone should have the base set of permissions set via the primary Registered group, and any additional permissions cumulatively added using secondary groups.

    So, another approach is this:

    Search for all users who are in the Events primary group, change the primary group to Registered and add "Events" as a secondary group.
    Repeat for Moderating and Administrative if applicable.

    Then the only users remaining should be the others which presumably should just only have a single user group, which is "Registered" as their primary group.

    I'm not actually sure there would be a way to properly refresh any permission caches, so the method above is going to be a lot safer.
  11. andybond

    andybond Active Member

    I agree. But something fundamentally went wrong with the 1063 users ! I dont know what ...

    Only the inbuilt one , so registered , administrative , moderator .

    Say for instance a "user" lets call him MandyPond got a bit SQL query happy here , and didnt have the route to go down , that would be bad , right ?

    Ill reset a users password ( with their permission ) and sign in to see what happens ..

Share This Page