[go: nahoru, domu]

Skip to content

Commit

Permalink
Don't destroy the session if logins are still present. fixes #12301
Browse files Browse the repository at this point in the history
If you are logged-in into multiple database servers, logOut() logs you
out of all of them. This fix will prevent that, and will only destroy
the session when you log out of the last server.

Signed-off-by: Michal Čihař <michal@cihar.com>
Signed-off-by: Harro Verton <wanwizard@wanwizard.eu>
  • Loading branch information
WanWizard authored and nijel committed Apr 28, 2017
1 parent 6e27bc6 commit cde775b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libraries/plugins/AuthenticationPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,17 @@ public function logOut()
$PHP_AUTH_USER = '';
$PHP_AUTH_PW = '';

/* Get a logged-in server count */
$servers = 0;
foreach ($GLOBALS['cfg']['Servers'] as $key => $val) {
if (isset($_COOKIE['pmaAuth-' . $key])) {
$servers++;
}
}

/* delete user's choices that were stored in session */
$_SESSION = array();
if (!defined('TESTSUITE')) {
if ($servers === 0 and ! defined('TESTSUITE')) {
$_SESSION = array();
session_destroy();
}

Expand Down

0 comments on commit cde775b

Please sign in to comment.