diff options
author | Michal Čihař <michal@cihar.com> | 2017-07-17 16:17:41 +0300 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2017-07-17 16:17:41 +0300 |
commit | e471d6b5eb7a23c3d7be4bd461a30b189754e46b (patch) | |
tree | 5e9530e5714810c88b67c0fba73632b65fbffdfd /user_password.php | |
parent | e05d5f4bf4200b16d91d0df676eae6c998a48369 (diff) |
Remove PMA_MYSQL_INT_VERSION from privileges code
This allows us to get rid of runkit dependency on testing this.
Fixes #13484
Signed-off-by: Michal Čihař <michal@cihar.com>
Diffstat (limited to 'user_password.php')
-rw-r--r-- | user_password.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/user_password.php b/user_password.php index de5392d6d2..db415ec641 100644 --- a/user_password.php +++ b/user_password.php @@ -151,6 +151,7 @@ function PMA_changePassword($password, $message, $change_password_message) list($username, $hostname) = $GLOBALS['dbi']->getCurrentUserAndHost(); $serverType = PhpMyAdmin\Util::getServerType(); + $serverVersion = $GLOBALS['dbi']->getVersion(); if (isset($_REQUEST['authentication_plugin']) && ! empty($_REQUEST['authentication_plugin']) @@ -166,15 +167,15 @@ function PMA_changePassword($password, $message, $change_password_message) . (($password == '') ? '\'\'' : $hashing_function . '(\'***\')'); if ($serverType == 'MySQL' - && PMA_MYSQL_INT_VERSION >= 50706 + && $serverVersion >= 50706 ) { $sql_query = 'ALTER USER \'' . $username . '\'@\'' . $hostname . '\' IDENTIFIED WITH ' . $orig_auth_plugin . ' BY ' . (($password == '') ? '\'\'' : '\'***\''); } else if (($serverType == 'MySQL' - && PMA_MYSQL_INT_VERSION >= 50507) + && $serverVersion >= 50507) || ($serverType == 'MariaDB' - && PMA_MYSQL_INT_VERSION >= 50200) + && $serverVersion >= 50200) ) { // For MySQL versions 5.5.7+ and MariaDB versions 5.2+, // explicitly set value of `old_passwords` so that @@ -233,16 +234,17 @@ function PMA_changePassUrlParamsAndSubmitQuery( $err_url = 'user_password.php' . Url::getCommon(); $serverType = PhpMyAdmin\Util::getServerType(); + $serverVersion = $GLOBALS['dbi']->getVersion(); - if ($serverType == 'MySQL' && PMA_MYSQL_INT_VERSION >= 50706) { + if ($serverType == 'MySQL' && $serverVersion >= 50706) { $local_query = 'ALTER USER \'' . $username . '\'@\'' . $hostname . '\'' . ' IDENTIFIED with ' . $orig_auth_plugin . ' BY ' . (($password == '') ? '\'\'' : '\'' . $GLOBALS['dbi']->escapeString($password) . '\''); } else if ($serverType == 'MariaDB' - && PMA_MYSQL_INT_VERSION >= 50200 - && PMA_MYSQL_INT_VERSION < 100100 + && $serverVersion >= 50200 + && $serverVersion < 100100 && $orig_auth_plugin !== '' ) { if ($orig_auth_plugin == 'mysql_native_password') { |