Rename the server 'Change Password' option to 'Change Server Password' (#10035)
The 'Change Password...' option on a server node was ambiguous, because it changes the password of the PostgreSQL role that pgAdmin connects with, yet read as though it might change the pgAdmin login password instead. The menu option and its dialog are now called 'Change Server Password', with the connected role name in the dialog title, and the equivalent option in the user menu becomes 'Change pgAdmin Password', so that the two can no longer be confused with one another. The dialog's own 'User' field was always blank, since the userName prop that showChangeServerPassword passes was never accepted by ChangePasswordContent; it is now wired through, which also makes the existing documentation of that field accurate. The documentation for both dialogs has been updated to match the new names, along with a couple of button names that had drifted. Fixes #9230.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
.. _change_password_dialog:
|
||||
|
||||
*******************************
|
||||
`Change Password Dialog`:index:
|
||||
*******************************
|
||||
**************************************
|
||||
`Change Server Password Dialog`:index:
|
||||
**************************************
|
||||
|
||||
It is a good policy to routinely change your password to protect data, even in
|
||||
what you may consider a 'safe' environment. In the workplace, failure to apply
|
||||
@@ -30,7 +30,9 @@ comprehensive list and they **will not guarantee security**.
|
||||
:alt: Change database password dialog
|
||||
:align: center
|
||||
|
||||
Use the *Change Password* dialog to change your password:
|
||||
Use the *Change Server Password* dialog to change the password of the role that
|
||||
pgAdmin uses to connect to the database server, rather than the password you use
|
||||
to log in to pgAdmin itself:
|
||||
|
||||
* The name displayed in the *User* field is the role for which you are modifying
|
||||
the password; it is the role that is associated with the server connection
|
||||
@@ -39,7 +41,7 @@ Use the *Change Password* dialog to change your password:
|
||||
* Enter the desired password for in the *New Password* field.
|
||||
* Re-enter the new password in the *Confirm Password* field.
|
||||
|
||||
Click the *Save* button to change your password.
|
||||
Click the *Change* button to change your password.
|
||||
|
||||
Click the *Close* button to exit without changing your password.
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
.. _change_user_password:
|
||||
|
||||
************************************
|
||||
`Change User Password Dialog`:index:
|
||||
************************************
|
||||
***************************************
|
||||
`Change pgAdmin Password Dialog`:index:
|
||||
***************************************
|
||||
|
||||
It is a good policy to routinely change your password to protect data, even in
|
||||
what you may consider a 'safe' environment. In the workplace, failure to apply
|
||||
@@ -30,11 +30,12 @@ comprehensive list and they **will not guarantee security**.
|
||||
:alt: Change current user password dialog
|
||||
:align: center
|
||||
|
||||
Use the *Change Password* dialog to change your password:
|
||||
Use the *Change pgAdmin Password* dialog to change the password you use to log
|
||||
in to pgAdmin itself, rather than the password of a database server connection:
|
||||
|
||||
* Enter your existing password in the *Current Password* field.
|
||||
* Enter the desired password for in the *New Password* field.
|
||||
* Re-enter the new password in the *Confirm Password* field.
|
||||
|
||||
Click the *Change Password* button to change your password; click *Close* to
|
||||
exit the dialog.
|
||||
Click the *Change* button to change your password; click *Close* to exit the
|
||||
dialog.
|
||||
|
||||
@@ -72,7 +72,7 @@ following options (in alphabetical order):
|
||||
| | |
|
||||
| 2) *Deploy Cloud Instance*| Click to open the :ref:`Cloud Deployment <cloud_deployment>` dialog to deploy an cloud instance. |
|
||||
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||
| *Change Password...* | Click to open the :ref:`Change Password... <change_password_dialog>` dialog to change your password. |
|
||||
| *Change Server Password...* | Click to open the :ref:`Change Server Password... <change_password_dialog>` dialog to change the server password. |
|
||||
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||
| *Clear Saved Password* | If you have saved the database server password, click to clear the saved password. |
|
||||
| | Enable only when password is already saved. |
|
||||
|
||||
@@ -126,9 +126,9 @@ define('pgadmin.node.server', [
|
||||
},{
|
||||
name: 'change_password', node: 'server', module: this,
|
||||
applies: ['object'], callback: 'change_password',
|
||||
label: gettext('Change Password...'), priority: 10,
|
||||
label: gettext('Change Server Password...'), priority: 10,
|
||||
enable : 'is_connected',data: {
|
||||
data_disabled: gettext('Please connect server to enable change password.'),
|
||||
data_disabled: gettext('Please connect the server to enable Change Server Password.'),
|
||||
},
|
||||
},{
|
||||
name: 'wal_replay_pause', node: 'server', module: this,
|
||||
@@ -364,7 +364,9 @@ define('pgadmin.node.server', [
|
||||
if (res.success && res.data.is_pgpass) {
|
||||
is_pgpass_file_used = true;
|
||||
}
|
||||
showChangeServerPassword(gettext('Change Password'), d, obj, i, is_pgpass_file_used);
|
||||
showChangeServerPassword(
|
||||
gettext('Change Server Password (%s)', d.user.name),
|
||||
d, obj, i, is_pgpass_file_used);
|
||||
}).catch(function(error) {
|
||||
pgAdmin.Browser.notifier.pgRespErrorNotify(error);
|
||||
});
|
||||
|
||||
@@ -121,7 +121,7 @@ define('pgadmin.browser.utils',
|
||||
menus: [
|
||||
{% if auth_only_internal %}
|
||||
{
|
||||
label: '{{ _('Change Password') }}',
|
||||
label: '{{ _('Change pgAdmin Password') }}',
|
||||
type: 'normal',
|
||||
callback: ()=>{
|
||||
pgAdmin.UserManagement.change_password(
|
||||
|
||||
@@ -64,11 +64,11 @@ class ChangePasswordSchema extends BaseUISchema {
|
||||
}
|
||||
|
||||
export default function ChangePasswordContent({getInitData=() => { /*This is intentional (SonarQube)*/ },
|
||||
onSave, onClose, hasCsrfToken=false, showUser=true}) {
|
||||
onSave, onClose, hasCsrfToken=false, showUser=true, userName=''}) {
|
||||
const schema=React.useRef(null);
|
||||
if (!schema.current)
|
||||
schema.current = new ChangePasswordSchema(
|
||||
'', false, hasCsrfToken, showUser
|
||||
userName, false, hasCsrfToken, showUser
|
||||
);
|
||||
|
||||
return <SchemaView
|
||||
@@ -92,5 +92,6 @@ ChangePasswordContent.propTypes = {
|
||||
onClose: PropTypes.func,
|
||||
getInitData: PropTypes.func,
|
||||
hasCsrfToken: PropTypes.bool,
|
||||
showUser: PropTypes.bool
|
||||
showUser: PropTypes.bool,
|
||||
userName: PropTypes.string
|
||||
};
|
||||
|
||||
@@ -205,7 +205,7 @@ export function showChangeServerPassword() {
|
||||
// Notify user to update pgpass file
|
||||
if(isPgPassFileUsed) {
|
||||
pgAdmin.Browser.notifier.alert(
|
||||
gettext('Change Password'),
|
||||
gettext('Change Server Password'),
|
||||
gettext('Please make sure to disconnect the server'
|
||||
+ ' and update the new password in the pgpass file'
|
||||
+ ' before performing any other operation')
|
||||
@@ -228,7 +228,7 @@ export function showChangeServerPassword() {
|
||||
}
|
||||
|
||||
export function showChangeUserPassword(url) {
|
||||
const title = gettext('Change pgAdmin User Password');
|
||||
const title = gettext('Change pgAdmin Password');
|
||||
pgAdmin.Browser.notifier.showModal(title, (onClose) => {
|
||||
return <ChangePasswordContent
|
||||
getInitData={()=>{
|
||||
|
||||
Reference in New Issue
Block a user