Skip to:
Content
Pages
Categories
Search
Top
Bottom

setting default role to inactive for new registered users

  • @lucaiz

    Member

    hello all.

    I have tried some search about this but did not find anything.

    I’d need the new users on a bbPress forum to be set to Inactive by default.

    the reason is I need to set up a forum for an experiment in secondary schools. we have to take in account the possibility of rude behavior from people not participating to the experiment.

    the administrator is not likely to be very present on line, so it would be a problem if anybody could just register and start posting indesiderable contents, that could sit there for a while.

    a temporary fix would be setting the default role for users to Inactive (the administrator then has the possibility to verify that the user is really who he say to be). I’ve tried to look into the code, but was not able to figure it out how to do it. hints would be welcomed.

    another option (the one I’m currently adopting) is removing the register function and putting something like “write to this email address if you want to be registered”, then using this plugin to allow administrator to add users:

    http://bbpress.org/plugins/topic/admin-add-user/

    but this is not how really we want it to be. an example of it is the “candidate” system used in vanilla forum: you candidate yourself to be a member of the forum, and if admin agree then you’re in. (why then not using vanilla? because there’s a graphic customization people have worked into, and we are running very short on deadline, say the url is in this morning newspaper… :-) ).

    I’d also be grateful for any other suggestions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @chrishajer

    Participant

    The default role is set in bb-includes/capabilities.php around line 485

    $user->set_role('member');

    This is a job for a plugin, but I haven’t tried to write one yet, so if you were to change that word member to inactive, my guess would be that that would make any new member inactive and then the keymaster would need to edit their role to make them members.

    ACTUALLY – that didn’t work :D

    In bb-includes/pluggable.php, line 361 says this:

    bb_update_usermeta( $user_id, $bb_table_prefix . 'capabilities', array('member' => true) );

    I changed member to inactive there, and now new users are inactive when they first register.

    Like I said, this is really a job for a plugin, but you could probably use this last change temporarily until a proper plugin is written.

    HTH, and be warned this is not a good way of doing it. It should really be a plugin I think.

    @lucaiz

    Member

    many thanks Chris! I have tested your second example (pluggable.php, row 361 etc.) was exactly what I needed!

    I agree with you that a plugin would be nice, and also it would be even nicer to be able to set new users default role somewhere in the admin interface, but for the moment your suggestion just work.

    thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar