Merge branch 'QA_4_5'

This commit is contained in:
Deven Bansod 2015-11-26 19:43:32 +05:30
commit 6640fe2877
2 changed files with 33 additions and 30 deletions

View File

@ -26,6 +26,7 @@ phpMyAdmin - ChangeLog
- issue #11687 Delimiter missing while exporting multiple db routines
- issue #11684 mysql_native_password with MariaDB bug
- issue #11693 Flush privileges overusage - related to #11597
- issue #11691 Query was empty on creating User in 4.5.2
4.5.2.0 (2015-11-23)
- issue #11589 Incorrect parameter in mysqli_fetch_fields()

View File

@ -5192,39 +5192,15 @@ function PMA_getSqlQueriesForDisplayAndAddUser($username, $hostname, $password)
$_REQUEST['authentication_plugin']
);
}
// Use 'SET PASSWORD' for pre-5.7.6 MySQL versions
// and pre-5.2.0 MariaDB
// Use 'CREATE USER ... WITH ... AS ..' syntax for
// newer MySQL versions
// and 'CREATE USER ... USING .. VIA ..' syntax for
// newer MariaDB versions
if (($serverType == 'MySQL'
&& PMA_MYSQL_INT_VERSION < 50706)
&& PMA_MYSQL_INT_VERSION >= 50706)
|| ($serverType == 'MariaDB'
&& PMA_MYSQL_INT_VERSION < 50200)
&& PMA_MYSQL_INT_VERSION >= 50200)
) {
if ($_POST['pred_password'] == 'keep') {
$password_set_real = sprintf(
$password_set_stmt,
$slashedUsername,
$slashedHostname,
$slashedPassword
);
} else if ($_POST['pred_password'] == 'none') {
$password_set_real = sprintf(
$password_set_stmt,
$slashedUsername,
$slashedHostname,
null
);
} else {
$hashedPassword = PMA_getHashedPassword($_POST['pma_pw']);
$password_set_real = sprintf(
$password_set_stmt,
$slashedUsername,
$slashedHostname,
$hashedPassword
);
}
} else {
$password_set_real = null;
// Required for binding '%' with '%s'
@ -5270,6 +5246,32 @@ function PMA_getSqlQueriesForDisplayAndAddUser($username, $hostname, $password)
'***'
);
}
} else {
// Use 'SET PASSWORD' syntax for pre-5.7.6 MySQL versions
// and pre-5.2.0 MariaDB versions
if ($_POST['pred_password'] == 'keep') {
$password_set_real = sprintf(
$password_set_stmt,
$slashedUsername,
$slashedHostname,
$slashedPassword
);
} else if ($_POST['pred_password'] == 'none') {
$password_set_real = sprintf(
$password_set_stmt,
$slashedUsername,
$slashedHostname,
null
);
} else {
$hashedPassword = PMA_getHashedPassword($_POST['pma_pw']);
$password_set_real = sprintf(
$password_set_stmt,
$slashedUsername,
$slashedHostname,
$hashedPassword
);
}
}
// add REQUIRE clause