Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

changing user role

argie01argie01 New
edited December 2006 in Vanilla 1.0 Help
Hi, I did a migration from SMF to Vanilla 1.0.3. It was fine. The only problem I see is I need to create a new role, and then assign some user to it. But, how can I change the role of a user ? Is there an extension to do it ? I didn't fine anything on "Vanilla Add-ons". Thank you for your help.

Comments

  • Thank you ! but there isn't another more easy way to do it ? I have almost 150 users, and I don't like to edit every profile page :) Regards !
  • Surely you dont need to change all 150 users roles though?
  • If you need to mass edit, you might want to jump into phpmyadmin (or similar) and do the update directly to the database. (BACKUP FIRST)
  • Thank you chuyskywalker, but I really don't have any idea about mysql. So, I don't know how to do an script to modify the database. If you can help with it, I really aprecciate it. Anyway, I have 300 users in my forum, and I need to change 150 of them... Thank you !
  • Is there a way to uniquely identify the 150 users? All regged before X date, or all names being with Y, etc. Something like that?
  • Yes ! most of them use this kind of name: argie_bc or argie_b You see ? there is an underscore in the username.
  • Well, if you are certain that every user in this group has an under score, and that there are NO users who have an underscore that you DONT want in the group, then I can write a query to upgrade them all in one shot.

    However, if there are a few users with the name, say "joe_bob" that you DO NOT want in this new group, it wouldn't work.
  • argie01argie01 New
    edited December 2006
    You're great chuyskywalker ! You just write the script ! I think there are not normal users using the underscore character in their username. Anyway, is there a way to check which user is in a certain role ? Thank you !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • Just go to their account page and it will say their role next to their name.
  • argie01argie01 New
    edited December 2006
    Yes, I know it, but I was thinking about how to do a list showing the roles and the users belonging to each one.
  • For the list of members in each role, go to your search page, click advanced search, then change the pulldown in the bottom form to the role you want to see.
  • argie:

    Read ALL of this BEFORE you do ANY of it.

    First, setup the role that you want all of these people to be.
    Next, know which ID this role is. You can find the ID by going to Settings > Roles & Permissions and hovering your mouse over the "Edit" links. In the status bar, the url will look like this:

    http://site.net/forum/settings.php?PostBackAction=Role&RoleID=3
    That last number (3) is the one you want. Note it.

    Now, you're going to have to jump into some place where you can execute MySQL queries from. PhpMyAdmin comes with most hosting providers. Once you're there, you can use this query:

    UPDATE `database`.`LUM_User` SET RoleID = N WHERE Name LIKE '%_%'
    Repleace N with the role id I had you note a few steps up.
    Replace the term "database" with the name of the database you installed vanilla into. (Keep the ` tick marks around it)

    If you can, I'd recommend doing a backup before you execute this. Just in case.

    Good luck.
  • I run the script. I think there is a problem, because it changed ALL the users role, and not only the username with underscore... Please, take a look a your script. Thank you !!
  • oh.
    fuck.
    right.

    UPDATE `database`.`LUM_User` SET RoleID = N WHERE Name LIKE '%\_%'
    Good thing you made that backup, right?

    I forgot that _ in SQL is the same as . in grep
  • LOL =D
  • Yes, I did the backup :) Anyway, I'm just testing in localhost.... :)
  • Now the sintaxis was fine :) thank you !
This discussion has been closed.