This plugin automatically logs out the user after a period of inactivity. The time period can be configured and it works with BuddyPress.
This plugin automatically logs a user out after a certain period of time of inactivity. It creates new meta data for each WP user and checks that the user hasn't been inactive for too long. If the user has been inactive for too long, then the user is automatically logged out and redirected to a URL of your choice. It tracks the users activity in both the main site and admin area.
You can set the maximum inactivity time and redirect URL by changing the defined constants in the plugin's PHP page - no admin menus are available yet see FAQs.
It's only a single PHP page, so it's easy to alter to work however you'd like it to work.
It works with BuddyPress too.
Let me know if you find a better way of doing this, and I'll update the plugin.