This plugin provides a simple implementation of registration codes for WordPress.
Users can supply a code when they sign up to your WordPress site in order to set their role to something other than the default role, or to supply them with an additional role on top of the default.
To load the plugin, simply copy the files to your plugin directory, activate it, and use the
draw_registration_code_field function in an action to insert the field in your registration form. Alternately, you can edit the registration form's template to call the function directly. Details will differ depending on your theme. Additional options are available in the included config.php file.
It comes with Buddypress integration out of the box.