MyBB Community Forums

Full Version: Limit Users Who Can Register
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello.

My forum is designed only for people aged 25 and under. For this reason I would like to block people who are aged 26 or above from registering at the forums. Is it possible to set this up?

Thank you in advance for your help Smile
The only thing that actually does a similar thing to that is COPPA. But that prevents people under 13 from registering. If you modified the code which did that then it might be possible but other than that I don't think there is a way.
It does sound doable but I don't know a lot about coding. If anybody does I'm sure COPPA could be modified to make that work.
inc/datahandlers/user.php - line: 398

Change line to this: (It should deny users over 25.)
elseif(($mybb->settings['coppa'] == "deny" || $mybb->settings['coppa'] == "enabled") && $birthday['year'] > (date("Y")+25))

Note that you won't be able to use the standard coppa (under 13) as well plus you'll probably want to change the message that it shows Smile

You can do this by going to inc/languages/english/datahandler_user.lang.php - line: 32.
Then change the string to what you want (something other than 13) Toungue

Also lines 105-107, 115, 116, 124-130 in inc/languages/english/member.lang.php Smile
Hello. First of all, thank you for your help. Sorry it has taken so long to get back to you but I had completely forgotten about this topic - I'm really pleased that I managed to find it.

I have tried the suggested solution and it doesn't seem to work - I can put in a birthdate of 1900 and it still lets me register. Do you know how to make it work, because this is a very important feature for my board.

Thank you Smile
Try this: http://mods.mybb.com/view/date-of-birth-on-registration

In the settings, put the requirement to Required - Full, put the age as 26, and choose what you want to do for the underage (or in this case, overage) action.

Then, in ./inc/plugins/dobonreg.php, on line 290, change the >= to <

Untested, but theoretically it should work.
That's brilliant, it seems to work perfectly. Thank you very much Big Grin
Cool Smile I edited my post to say it wouldn't work, I then realised I tested wrong and put a birthday in that would still get accepted Rolleyes Toungue

You'll also need to change the message in ./inc/languages/english/dobonreg.lang.php to say they're too old to register, as it'll currently say they're too young.
Yup I spotted that, thank you Smile
Hello. I've been using this plugin for a while now and its been great but it doesn't seem to be working recently.

After an upgrade, or a theme change, or something like that, the date of birth field disappeared from my registration form and therefore it couldn't be submitted because no date of birth was entered. I fixed that by deactivating the plugin and activating it again.

The date of birth field is now back on the form however its not working correctly. Its allowing any date of birth to be input and also even allows the form to be submitted with no date of birth included at all.

Do you know how I can get things back to normal? Sad