Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Delisle <marc@infomarc.info>2015-10-15 19:26:17 +0300
committerMarc Delisle <marc@infomarc.info>2015-10-15 19:26:17 +0300
commitda5e605ba747edb05ea8d001637c9a71005e62f8 (patch)
tree67e5d20b516ea9505db76586abb2bc1fbe95c7f4 /user_password.php
parent57e52527c8bffe551710fa1daf752064cd7d494d (diff)
parentb0f8d1df21ffddc29d6080a0a43afa049442e04f (diff)
Fix merge conflicts
Signed-off-by: Marc Delisle <marc@infomarc.info>
Diffstat (limited to 'user_password.php')
-rw-r--r--user_password.php54
1 files changed, 25 insertions, 29 deletions
diff --git a/user_password.php b/user_password.php
index 269d517111..d1e249edaa 100644
--- a/user_password.php
+++ b/user_password.php
@@ -68,7 +68,7 @@ if (isset($msg)) {
require_once './libraries/display_change_password.lib.php';
-echo PMA_getHtmlForChangePassword($username, $hostname);
+echo PMA_getHtmlForChangePassword('change_pw', $username, $hostname);
exit;
/**
@@ -146,46 +146,40 @@ function PMA_changePassword($password, $message, $change_password_message)
$serverType = PMA\libraries\Util::getServerType();
+ if (isset($_REQUEST['authentication_plugin'])
+ && ! empty($_REQUEST['authentication_plugin'])
+ ) {
+ $orig_auth_plugin = $_REQUEST['authentication_plugin'];
+ } else {
+ $orig_auth_plugin = PMA_getCurrentAuthenticationPlugin(
+ 'change', $username, $hostname
+ );
+ }
+
if ($serverType === 'MySQL'
&& PMA_MYSQL_INT_VERSION >= 50706
) {
-
- if (isset($_REQUEST['authentication_plugin'])
- && ! empty($_REQUEST['authentication_plugin'])
- ) {
- $orig_auth_plugin = $_REQUEST['authentication_plugin'];
- } else {
- $orig_auth_plugin = PMA_getCurrentAuthenticationPlugin(
- 'change', $username, $hostname
- );
- }
-
$sql_query = 'ALTER USER \'' . $username . '\'@\'' . $hostname
. '\' IDENTIFIED WITH ' . $orig_auth_plugin . ' BY '
. (($password == '') ? '\'\'' : '\'***\'');
- } else {
+ } else if (($serverType == 'MySQL'
+ && PMA_MYSQL_INT_VERSION >= 50507)
+ || ($serverType == 'MariaDB'
+ && PMA_MYSQL_INT_VERSION >= 50200)
+ ) {
// For MySQL versions 5.5.7+ and MariaDB versions 5.2+,
// explicitly set value of `old_passwords` so that
// it does not give an error while using
// the PASSWORD() function
- if (($serverType == 'MySQL'
- && PMA_MYSQL_INT_VERSION >= 50507)
- || ($serverType == 'MariaDB'
- && PMA_MYSQL_INT_VERSION >= 50200)
- ) {
- $orig_auth_plugin = PMA_getCurrentAuthenticationPlugin(
- 'change', $username, $hostname
- );
- if ($orig_auth_plugin == 'sha256_password') {
- $value = 2;
- } else {
- $value = 0;
- }
- $GLOBALS['dbi']->tryQuery('SET `old_passwords` = ' . $value . ';');
+ if ($orig_auth_plugin == 'sha256_password') {
+ $value = 2;
+ } else {
+ $value = 0;
}
+ $GLOBALS['dbi']->tryQuery('SET `old_passwords` = ' . $value . ';');
+ }
$sql_query = 'SET password = '
. (($password == '') ? '\'\'' : $hashing_function . '(\'***\')');
- }
PMA_changePassUrlParamsAndSubmitQuery(
$username, $hostname, $password,
$sql_query, $hashing_function, $orig_auth_plugin
@@ -203,7 +197,9 @@ function PMA_changePassword($password, $message, $change_password_message)
*/
function PMA_changePassHashingFunction()
{
- if (PMA_isValid($_REQUEST['pw_hash'], 'identical', 'old')) {
+ if (PMA_isValid(
+ $_REQUEST['authentication_plugin'], 'identical', 'mysql_old_password'
+ )) {
$hashing_function = 'OLD_PASSWORD';
} else {
$hashing_function = 'PASSWORD';