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.

How do I correctly reset my default roles in 2.0.18.4?

HalfCatHalfCat ✭✭
edited September 2012 in Vanilla 2.0 - 2.8

Hey all, I imported from a phpbb 2 forum with the porter plus plugin and everything is looking good except for the fact that the default roles are not set.

So I did my research and read these threads:
http://vanillaforums.org/discussion/19709/default-roles-such-as-guest-have-been-deleted-and-i-dont-know-how-to-fix
http://vanillaforums.org/discussion/14070/change-default-role-in-vanilla-2
http://vanillaforums.org/discussion/19699/documentation-users-have-been-orphaned-how-do-i-auto-add-them-all-to-a-role

However, I was unable to find the answer to this. From the gdn_roles table I found out that my roles' IDs are as follows:

GUEST (not logged in): 223

REGISTERED: 224

MODERATOR: 222

Now, I know how to give these Roles to existing users (via SQL) but how do I set those as default roles so that a guest has the correct permission and a registered user gets automatically his role assigned?

In my config.php I have the line $Configuration['Garden']['Registration']['DefaultRoles'] = 'a:0:{}'; but I have no clue how to modify this so that the corresponding roles are set (or is this somewhere else?).

Comments

  • peregrineperegrine MVP
    edited September 2012

    if it were at all possible I would use the default role ids - you will be much happier in the long run, I think

    http://vanillaforums.org/discussion/comment/157731/#Comment_157731

    you would make changes in your dashboard.

    also what is your registration process.

     Basic  New users fill out a simple form and are granted access immediately.
    Approval    New users are reviewed and approved by an administrator (that's you!).
    Invitation  Existing members send invitations to new members.
    Connect     New users are only registered through SSO plugins.
    

    it might be easier to explain if you mention which one you use.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • HalfCatHalfCat ✭✭
    edited September 2012

    Thanks for your reply.

    I added the Roles with their ids as described in the post you linked. Now, I need to define them as defaults...

    My registration process is Connect (via jsConnect).

  • peregrineperegrine MVP
    edited September 2012
     I don't use Connect.  But I think you could safely (I could be wrong).
    
    remove this
    
    $Configuration['Garden']['Registration']['DefaultRoles'] = 'a:0:{}';
    
    
    e.g. theoretically all you need is something like this.
    
    
    $Configuration['Garden']['Registration']['Method'] = 'Connect';
    $Configuration['Garden']['Registration']['CaptchaPrivateKey'] = '';
    $Configuration['Garden']['Registration']['CaptchaPublicKey'] = '';
    $Configuration['Garden']['Registration']['InviteExpiration'] = '-1 week';
    $Configuration['Garden']['Registration']['ConfirmEmail'] = FALSE; // you could change this to what you want.
    $Configuration['Garden']['Registration']['ConfirmEmailRole'] = '3'; // you could change this to what you want.
    $Configuration['Garden']['Registration']['InviteRoles'] = 'a:6:{i:3;s:1:"0";i:4;s:1:"0";i:8;s:1:"0";i:16;s:1:"0";i:32;s:1:"0";i:33;s:1:"0";}';
    
    
    
    As long as your permissions table is correct you should be fine.
    
    the member role is 8 
    
    You can probably just go into dashboard and just set registration and save, it will automatically set config statements above.
    

    verify permissions for each role
    make sure users are assigned to correct role.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • HalfCatHalfCat ✭✭
    edited September 2012

    Thanks a lot for helping me out on this one. I just fiddled around a bit too and I found out that you can actually define your default roles at

    /index.php?p=/dashboard/role/defaultroles

    Thank you again though!

  • yes, I saw that too.

    applications/dashboard/views/role/defaultroles.php

    Do you know if there is a way to get to "default roles" from the dashboard, i haven't noticed one. But then again I never needed to change things from the default.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • No, I didn't find a way...

  • thanks. It may be used for imports, or forums with special needs.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited September 2012

    just for informational purposes.

    I found it appears in the dashboard if roles are not set

    this is the line it prints..

    You don't have your default roles set up. To correct this problem click here. index.php?p=/dashboard/role/defaultroles

        if you have this in your config.php.
        $Configuration['Garden']['Registration']['DefaultRoles'] = 'a:1:{i:0;s:1:"8";}';
        $Configuration['Garden']['Registration']['ApplicantRoleID'] = '';
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Well, I only got displayed the message "Default roles not set!"

  • another mystery. probably not worth solving if everything else works correctly.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • HalfCatHalfCat ✭✭
    edited September 2012

    Oh snap! It's the translation probably. I'll investigate this further.

    EDIT: Weird. It's not the translation...

  • class.rolecontroller.php:

    sprintf(T('No default roles.', 'You don\'t have your
    default roles set up. To correct this problem click %s.'),

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Hmm, I can't seem to find the second string in the translation. I added it in mine though...

Sign In or Register to comment.