From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- .../libraries/classes/Display/ChangePassword.php | 182 +++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 srcs/phpmyadmin/libraries/classes/Display/ChangePassword.php (limited to 'srcs/phpmyadmin/libraries/classes/Display/ChangePassword.php') diff --git a/srcs/phpmyadmin/libraries/classes/Display/ChangePassword.php b/srcs/phpmyadmin/libraries/classes/Display/ChangePassword.php new file mode 100644 index 0000000..a786b6c --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Display/ChangePassword.php @@ -0,0 +1,182 @@ +'; + + $html .= Url::getHiddenInputs(); + + if (strpos($GLOBALS['PMA_PHP_SELF'], 'server_privileges') !== false) { + $html .= '' + . ''; + } + $html .= '
' + . '' . __('Change password') . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . ''; + + $serverType = Util::getServerType(); + $serverVersion = $GLOBALS['dbi']->getVersion(); + $orig_auth_plugin = $serverPrivileges->getCurrentAuthenticationPlugin( + 'change', + $username, + $hostname + ); + + if (($serverType == 'MySQL' + && $serverVersion >= 50507) + || ($serverType == 'MariaDB' + && $serverVersion >= 50200) + ) { + // Provide this option only for 5.7.6+ + // OR for privileged users in 5.5.7+ + if (($serverType == 'MySQL' + && $serverVersion >= 50706) + || ($GLOBALS['dbi']->isSuperuser() && $mode == 'edit_other') + ) { + $auth_plugin_dropdown = $serverPrivileges->getHtmlForAuthPluginsDropdown( + $orig_auth_plugin, + 'change_pw', + 'new' + ); + + $html .= '' + . '' + . '' + . '
' + . '' + . '' + . '
' + . '' + . '' + . '' + . __('Enter:') . '     ' + . '' + . 'Strength: ' + . ' ' + . 'Good' + . '
' . __('Re-type:') . ' ' + . '' + . '
' . __('Password Hashing:') . ''; + $html .= $auth_plugin_dropdown; + $html .= '
'; + + $html .= '' + . Message::notice( + __( + 'This method requires using an \'SSL connection\' ' + . 'or an \'unencrypted connection that encrypts the ' + . 'password using RSA\'; while connecting to the server.' + ) + . Util::showMySQLDocu( + 'sha256-authentication-plugin' + ) + ) + ->getDisplay() + . ''; + } else { + $html .= '' + . ''; + } + } else { + $auth_plugin_dropdown = $serverPrivileges->getHtmlForAuthPluginsDropdown( + $orig_auth_plugin, + 'change_pw', + 'old' + ); + + $html .= '' + . '' . __('Password Hashing:') . ''; + $html .= $auth_plugin_dropdown . '' + . '' + . ''; + } + + $html .= '
' + . '' + . ''; + return $html; + } +} -- cgit