Only allow specification of a pgpass file if libpq >= 10. Fixes #2768

This commit is contained in:
Murtuza Zabuawala
2017-10-10 09:31:27 +01:00
committed by Dave Page
parent 63103c7a48
commit 2f5a2b2392
6 changed files with 44 additions and 4 deletions

View File

@@ -779,7 +779,7 @@ define('pgadmin.node.server', [
},{
id: 'passfile', label: gettext('Password File'), type: 'text',
group: gettext('Advanced'), mode: ['edit', 'create'],
disabled: 'isConnected', control: Backform.FileControl,
disabled: 'isConnectedWithValidLib', control: Backform.FileControl,
dialog_type: 'select_file', supp_types: ['*']
},{
id: 'passfile', label: gettext('Password File'), type: 'text',
@@ -888,6 +888,14 @@ define('pgadmin.node.server', [
return true;
}
return _.indexOf(SSL_MODES, ssl_mode) == -1;
},
isConnectedWithValidLib: function(model) {
if(model.get('connected')) {
return true;
}
// older version of libpq do not support 'passfile' parameter in
// connect method, valid libpq must have version >= 100000
return pgBrowser.utils.pg_libpq_version < 100000;
}
}),
connection_lost: function(i, resp) {