Browse Source

Adding warning when multiple_connection_not_allowed is on see BT#8796

Adding prevent_multiple_simultaneous_login in configuration.dist.php
Julio Montoya 10 years ago
parent
commit
98a218b7d4

+ 3 - 1
main/inc/lib/online.inc.php

@@ -73,7 +73,9 @@ function preventMultipleLogin($userId)
 
                 // Trying double login
                 if (!empty($loginData)) {
-                    api_not_allowed(true, get_lang('MultipleConnectionsAreNotAllow'));
+                    session_regenerate_id();
+                    Session::destroy();
+                    header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=multiple_connection_not_allowed');
                     exit;
                 } else {
                     // First time

+ 3 - 0
main/inc/lib/userportal.lib.php

@@ -359,6 +359,9 @@ class IndexManager
                 case 'blocked_by_captcha':
                     $message = get_lang('AccountBlockedByCaptcha');
                     break;
+                case 'multiple_connection_not_allowed':
+                    $message = get_lang('MultipleConnectionsAreNotAllow');
+                    break;
                 case 'unrecognize_sso_origin':
                     //$message = get_lang('SSOError');
                     break;

+ 2 - 0
main/install/configuration.dist.php

@@ -234,3 +234,5 @@ $_configuration['system_stable']     = NEW_VERSION_STABLE;
 //$_configuration['session_stored_after_n_times'] = 10;
 // Show official code in exercise report list.
 //$_configuration['show_official_code_exercise_result_list'] = false;
+// One connection per user
+//$_configuration['prevent_multiple_simultaneous_login'] = false;