discourse/discourse — pull request #964 by chrishunt (2013-06-05 18:23:21+00:00)
Title: Add 'invite only' site setting

Related to [meta/4580/15](http://meta.discourse.org/t/can-discourse-be-configured-to-always-require-login/4580/15)

This adds an 'invite only' site setting that disables user registrations. Currently, users can only be invited into a topic, so this isn't going to be insanely useful yet, but once we add an invite section to admin this setting will be more useful.

I opted to call the setting 'invite only' rather than 'allow registrations' or 'disable registrations' because I think the name 'invite only' does a better job explaining how people can get an account... via invites :smiley: If the setting was called 'disable registrations', it could be a bit confusing how to create a new account.

This is a pretty simple change. We just hide the registration UI and lock down `POST /users/` on the backend just in case someone tries to sneak in.