Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Oct 24, 2015
2 parents 2fa77c5 + f016df6 commit b965217
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -15,6 +15,7 @@ phpMyAdmin - ChangeLog
- issue #11589 Incorrect parameter in mysqli_fetch_fields()
- issue #11592 Missing headers in zipped export
- issue #11590 Parser: Array to string conversion
- issue #11597 Huge binary log growth on 4.5.x

4.5.1.0 (2015-10-23)
- issue Invalid argument supplied for foreach()
Expand Down
22 changes: 22 additions & 0 deletions libraries/check_user_privileges.lib.php
Expand Up @@ -39,6 +39,22 @@ function PMA_checkRequiredPrivilegesForFlushing()
*/
function PMA_checkRequiredPrivilgesForAdjust()
{
if (PMA\libraries\Util::cacheExists('db_priv')) {
$GLOBALS['db_priv'] = PMA\libraries\Util::cacheGet(
'db_priv'
);
$GLOBALS['col_priv'] = PMA\libraries\Util::cacheGet(
'col_priv'
);
$GLOBALS['table_priv'] = PMA\libraries\Util::cacheGet(
'table_priv'
);
$GLOBALS['proc_priv'] = PMA\libraries\Util::cacheGet(
'proc_priv'
);
return;
}

$privs_available = true;
// FOR DB PRIVS
$select_privs_available = $GLOBALS['dbi']->tryQuery(
Expand Down Expand Up @@ -214,6 +230,12 @@ function PMA_checkRequiredPrivilgesForAdjust()
// Save the value
$GLOBALS['proc_priv'] = $privs_available;

// must also cacheUnset() them in
// libraries/plugins/auth/AuthenticationCookie.class.php
PMA\libraries\Util::cacheSet('proc_priv', $GLOBALS['proc_priv']);
PMA\libraries\Util::cacheSet('table_priv', $GLOBALS['table_priv']);
PMA\libraries\Util::cacheSet('col_priv', $GLOBALS['col_priv']);
PMA\libraries\Util::cacheSet('db_priv', $GLOBALS['db_priv']);
}

/**
Expand Down
5 changes: 5 additions & 0 deletions libraries/plugins/auth/AuthenticationCookie.php
Expand Up @@ -444,6 +444,11 @@ public function authCheck()
Util::cacheUnset('db_to_create');
Util::cacheUnset('dbs_where_create_table_allowed');
Util::cacheUnset('dbs_to_test');
Util::cacheUnset('db_priv');
Util::cacheUnset('col_priv');
Util::cacheUnset('table_priv');
Util::cacheUnset('proc_priv');

$GLOBALS['no_activity'] = true;
$this->authFails();
if (! defined('TESTSUITE')) {
Expand Down

0 comments on commit b965217

Please sign in to comment.