Extension:On Campus

This is a nearly trivial extension for restricting read access of a particular namespace to a subnet, or to people who are logged in. It is NOT a production-quality extension; you'll need to alter the code to fit it to your own needs. It's plenty secure, just not very flexible, because it matches an IP address against a regular expression instead of a CIDR subnet mask. I'm just sharing it here to save you a few minutes of research. Usage:

1. Make a custom namespace with number 100, and make sure its Talk sibling is 101.

2. Plop this into your extensions/ folder, and call it OnCampus.php:

3. Change the regular expression to test for your particular subnet. A real version of this extension would test the IP address against a subnet mask, but this suited my purposes just fine.

4. Add this to LocalSettings.php: