1. Change the string from 'Reset server password" to "Clear Saved Password" and move this sub menu from File to Object menu.

2. Move the "Change Password..." menu from 'File' to 'Object' menu.
RM #3074
pull/14/head
Akshay Joshi 2018-08-03 16:41:01 +05:30
parent 8f45e6fe68
commit e9e8b0b433
11 changed files with 35 additions and 33 deletions

View File

@ -0,0 +1,13 @@
.. _clear_saved_passwords:
******************************
`Clear Saved Passwords`:index:
******************************
Use *Clear Saved Password* functionality to clear the saved password for the database server.
.. image:: images/clear_saved_password.png
*Clear Saved Password* shows in the context menu for the selected server as well as under the *Object* menu on the top menu bar.
**Note:** It will be enabled/visible when the password for the selected database server is already saved.

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

View File

@ -16,14 +16,10 @@ Use the *File* menu to access the following options:
+-------------------------+---------------------------------------------------------------------------------------------------------+
| Option | Action |
+=========================+=========================================================================================================+
| *Change Password...* | Click to open the :ref:`Change Password... <change_password_dialog>` dialog to change your password. |
+-------------------------+---------------------------------------------------------------------------------------------------------+
| *Preferences* | Click to open the :ref:`Preferences <preferences>` dialog to to customize your pgAdmin settings. |
+-------------------------+---------------------------------------------------------------------------------------------------------+
| *Reset Layout* | If you have modified the workspace, click to restore the default layout. |
+-------------------------+---------------------------------------------------------------------------------------------------------+
| *Reset server password* | If you have saved the database server password, click to reset the saved password. |
+-------------------------+---------------------------------------------------------------------------------------------------------+
**The Object Menu**
@ -35,6 +31,11 @@ The *Object* menu is context-sensitive. Use the *Object* menu to access the foll
+------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Option | Action |
+========================+==========================================================================================================================+
| *Change Password...* | Click to open the :ref:`Change Password... <change_password_dialog>` dialog to change your password. |
+------------------------+--------------------------------------------------------------------------------------------------------------------------+
| *Clear Saved Password* | If you have saved the database server password, click to reset the saved password. |
| | Enable only when password is already saved and database server is disconnected. |
+------------------------+--------------------------------------------------------------------------------------------------------------------------+
| *Connect Server...* | Click to open the :ref:`Connect to Server <connect_to_server>` dialog to establish a connection with a server. |
+------------------------+--------------------------------------------------------------------------------------------------------------------------+
| *Create* | Click *Create* to access a context menu that provides context-sensitive selections. |

View File

@ -1,13 +0,0 @@
.. _reset_passwords:
************************
`Reset Passwords`:index:
************************
Use *Reset server password* functionality to reset the saved password for the database server.
.. image:: images/reset_server_password.png
*Reset server password* shows in the context menu for the selected server as well as under the *File* menu on the top menu bar.
**Note:** It will be enabled/visible when the password for the selected database server is already saved.

View File

@ -95,4 +95,4 @@ Use the fields in the *Advanced* tab to configure a connection:
.. toctree::
reset_passwords
clear_saved_passwords

View File

@ -251,7 +251,7 @@ class ServerNode(PGChildNodeView):
'delete': 'pause_wal_replay', 'put': 'resume_wal_replay'
}],
'check_pgpass': [{'get': 'check_pgpass'}],
'reset_server_password': [{'put': 'reset_server_password'}]
'clear_saved_password': [{'put': 'clear_saved_password'}]
})
EXP_IP4 = "^\s*((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\." \
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\." \
@ -1447,7 +1447,7 @@ class ServerNode(PGChildNodeView):
)
)
def reset_server_password(self, gid, sid):
def clear_saved_password(self, gid, sid):
"""
This function is used to remove database server password stored into
the pgAdmin's db file.
@ -1471,14 +1471,14 @@ class ServerNode(PGChildNodeView):
db.session.commit()
except Exception as e:
current_app.logger.error(
"Unable to reset password.\nError: {0}".format(str(e))
"Unable to clear saved password.\nError: {0}".format(str(e))
)
return internal_server_error(errormsg=str(e))
return make_json_response(
success=1,
info=gettext("Reset server password successfully."),
info=gettext("Clear saved password successfully."),
data={'is_password_saved': False}
)

View File

@ -94,8 +94,8 @@ define('pgadmin.node.server', [
icon: 'fa fa-anchor', enable : 'is_applicable',
},{
name: 'change_password', node: 'server', module: this,
applies: ['file'], callback: 'change_password',
label: gettext('Change Password...'),
applies: ['object'], callback: 'change_password',
label: gettext('Change Password...'), priority: 10,
icon: 'fa fa-lock', enable : 'is_connected',
},{
name: 'wal_replay_pause', node: 'server', module: this,
@ -108,12 +108,13 @@ define('pgadmin.node.server', [
category: 'wal_replay_resume', priority: 8, label: gettext('Resume Replay of WAL'),
icon: 'fa fa-play-circle', enable : 'wal_resume_enabled',
},{
name: 'reset_server_password', node: 'server', module: this,
applies: ['file', 'context'], callback: 'reset_server_password',
label: gettext('Reset server password'), icon: 'fa fa-eraser',
name: 'clear_saved_password', node: 'server', module: this,
applies: ['object', 'context'], callback: 'clear_saved_password',
label: gettext('Clear Saved Password'), icon: 'fa fa-eraser',
priority: 11,
enable: function(node) {
if (node && node._type === 'server' &&
node.connected !== true && node.is_password_saved) {
node.is_password_saved) {
return true;
}
return false;
@ -608,8 +609,8 @@ define('pgadmin.node.server', [
});
},
/* Reset stored database server password */
reset_server_password: function(args){
/* Cleat saved database server password */
clear_saved_password: function(args){
var input = args || {},
obj = this,
t = pgBrowser.tree,
@ -620,13 +621,13 @@ define('pgadmin.node.server', [
return false;
Alertify.confirm(
gettext('Reset server password'),
gettext('Clear saved password'),
S(
gettext('Are you sure you want to reset the stored password for server %s?')
gettext('Are you sure you want to clear the saved password for server %s?')
).sprintf(d.label).value(),
function() {
$.ajax({
url: obj.generate_url(i, 'reset_server_password', d, true),
url: obj.generate_url(i, 'clear_saved_password', d, true),
method:'PUT',
})
.done(function(res) {