How would I go about getting PgAdmin 4 running in server mode to behave more 
like PhpPgAdmin where the configured database connections are set up once in 
the server's configuration, and individual database users only need to use 
their database credentials to connect, rather than requiring separate web login 
accounts?

For example, one can edit the configuration file for PhpPgAdmin:

  phpPgAdmin/conf/config.inc.php

to not require a login to the web server:

$conf['extra_login_security'] = false;

and define the configured databases like so:

$conf['servers'][0]['desc'] = 'First Database';
$conf['servers'][0]['host'] = 'pgserver1.mydomain.com';
$conf['servers'][0]['port'] = 5432;
$conf['servers'][0]['sslmode'] = 'allow';
$conf['servers'][0]['defaultdb'] = 'template1';

$conf['servers'][1]['desc'] = 'Second Database';
$conf['servers'][1]['host'] = 'pgserver2.mydomain.com';
$conf['servers'][1]['port'] = 5432;
$conf['servers'][1]['sslmode'] = 'allow';
$conf['servers'][1]['defaultdb'] = 'template1';

Why would I want to do this?

First, I don't want to have to maintain two login accounts per user, and 
second, I want to pre-configure the database configurations for our less-savvy 
users in our controlled network environment.

Would this functionality require substantial code changes to PgAdmin 4 or could 
it be achieved via an add-on module?

Note: If I turn on SERVER_MODE for PhpAdmin 4 after first running the setup for 
Desktop mode, all the web client sessions I point at the server attempt to use 
the same database user login.  That certainly is not what I want for a 
multi-user application. This is with the server running as a web application in 
a Python environment. Perhaps it behaves differently when run as WSGI 
application under Apache?

Thanks.
Scott Langley
Systems Analyst/Programmer
Statistical Center for HIV/AIDS Research and Prevention (SCHARP)
Fred Hutchinson Cancer Research Center
Seattle, Washington

slang...@scharp.org
(206) 667-5117
Fax (206) 667-4812

Reply via email to