mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added support to disable the auto-discovery of the database servers. Fixes #7039
This commit is contained in:
@@ -782,6 +782,14 @@ ENABLE_PSQL = False
|
||||
##########################################################################
|
||||
ENABLE_BINARY_PATH_BROWSING = False
|
||||
|
||||
#############################################################################
|
||||
# AUTO_DISCOVER_SERVERS setting is used to enable the pgAdmin to discover the
|
||||
# database server automatically on the local machine.
|
||||
# When it is set to False, pgAdmin will not discover servers installed on
|
||||
# the local machine.
|
||||
#############################################################################
|
||||
AUTO_DISCOVER_SERVERS = True
|
||||
|
||||
##########################################################################
|
||||
# Local config settings
|
||||
##########################################################################
|
||||
|
||||
@@ -537,6 +537,12 @@ def create_app(app_name=None):
|
||||
##########################################################################
|
||||
@user_logged_in.connect_via(app)
|
||||
def on_user_logged_in(sender, user):
|
||||
|
||||
# If Auto Discover servers is turned off then return from the
|
||||
# function.
|
||||
if not config.AUTO_DISCOVER_SERVERS:
|
||||
return
|
||||
|
||||
# Keep hold of the user ID
|
||||
user_id = user.id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user