changed all usergroupids in sql - help?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davidallsop
    New Member
    • Oct 2005
    • 25

    changed all usergroupids in sql - help?

    I tried to to move the target users to a new group with this query:

    UPDATE user
    SET usergroupid = X
    AND joindate > UNIX_TIMESTAMP('2007-01-01 00:00:00')

    after contacting the vb support team, I have attempted this and it has changed all my usergroup ids on all my users to '0' or '1' and has also locked me completely out of the admincp (because I am no longer in the admins usergroup.

    I typed this: -


    UPDATE user
    SET usergroupid = 9
    AND joindate > UNIX_TIMESTAMP('2007-01-01 00:00:00')

    What can I do now to get it back - why hasnt this worked?
  • Steve Machol
    Former Customer Support Manager
    • Jul 2000
    • 154488

    #2
    I would never have told you to do anything like this. You should respond to your support ticket and get further guidance from the support staff member who told you to do this.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment

    • Andy Huang
      Senior Member
      • Feb 2004
      • 4602

      #3
      You were in the group of people whose joindate was > than the time stamp provided, so your group got changed... Please upload tools.php from the do_not_upload directory to your admincp folder, and then use it (via your browser) to restore your own administrative access...
      Best Regards,
      Andy Huang

      Comment

      • davidallsop
        New Member
        • Oct 2005
        • 25

        #4
        I registered in 2002, this query was supposed to move ever user registered after 2007.

        Can I not change every usergroupid to a registered usergroup, and then change my own usergroupid on my account to the admin usergroup - then run the after 2007 query to move all users after 2007 again? if so what is the query to move all users registered after 2007 as this one doesnt seem to be working?

        Comment

        • Andy Huang
          Senior Member
          • Feb 2004
          • 4602

          #5
          Theoritically, yes. But I sure hope you've got a backup in advance... Manipulating with the database directly can (and often do) cause problems that cannot be reversed.
          This will set everyone to the group with gorupid X:
          Code:
          UPDATE user
          SET usergroupid = X;
          Then, use the query you got above to update everyone from 2007 onwards.

          Finally, use tools.php to restore your own admin access -- I believe there are other related cache which could make just simply changing group id not work. Delete the tools.php file from server as soon as you're done, as it is a security threat to leave it there. Once you're in, verify everything is working proper.
          Best Regards,
          Andy Huang

          Comment

          • davidallsop
            New Member
            • Oct 2005
            • 25

            #6
            the query above just changed every usergroupid to 1 or 0??

            Comment

            • Andy Huang
              Senior Member
              • Feb 2004
              • 4602

              #7
              You need to replace "X" with the usergroup id, as I mentioned.
              The group you'd want to put people in is probably one of these:
              Registered Users: 2
              Users Awaiting Email Confirmation: 3
              Banned Users: 8

              For yourself, Administrators is 6.
              Best Regards,
              Andy Huang

              Comment

              • davidallsop
                New Member
                • Oct 2005
                • 25

                #8
                Luckily what I said worked out,

                Jake from support changed to this query and it is now fine: -

                UPDATE user
                SET usergroupid = X
                WHERE joindate > UNIX_TIMESTAMP('2007-01-01 00:00:00')

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...