concrete5/concrete5 — pull request #182 by jaredquinn (2011-10-26 15:18:41+00:00)
Title: Limit Concurrent Member Logins 

Provides the ability to limit the number of concurrent logins allowed by Concrete5.

Changes are controlled by config/site.php and the following defintions:

define('ENABLE_CONCURRENT_SESSION_LIMIT', True); # Use concurrent login code
define('CONCURRENT_SESSION_LIFE', 8); # Number of hours to hold a session for
define('CONCURRENT_SESSION_LIMIT', 1); # Default number of concurrent sessions allowed

The admin user (USER_SUPER_ID) is not restricted and will be automatically permitted to log in as many times as requested.

The number of permitted concurrent sessions can be configured on a per-user basis with the addition of a UserAttribute with the handle of 'allowed_sessions' which can be set to the number of permitted concurrent logins (or -1 for Unlimited).

Sessions are determined by PHP Session ID, IP Address and Browser Version.
All must match for a session to continue.

A new database table is required for the sessions. Use the "refresh
database" functionality under Dashboard -> Sitewide Settings -> Refresh
Schema and ensure the 'core database tables' option is ticked.

There is currently no way to remove or view sessions from the Dashboard
interface. This may be added in the near future.

This feature was requested by a client who agreed to allow the changes to be submitted back to the community.