Add new option to prevent database listing
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Add new configuration option to prevent database listing
|
||||
* Add warning to wizards
|
||||
* Add server-side icons
|
||||
* Add support for file link to BinaryField
|
||||
|
||||
@@ -87,3 +87,6 @@
|
||||
|
||||
# Enable auto-reload of modules if changed
|
||||
#auto_reload = True
|
||||
|
||||
# Prevent database listing
|
||||
#prevent_dblist = False
|
||||
|
||||
@@ -49,6 +49,7 @@ class ConfigManager(object):
|
||||
'session_timeout': 600,
|
||||
'psyco': False,
|
||||
'auto_reload': True,
|
||||
'prevent_dblist': False,
|
||||
'init': {},
|
||||
'update': {},
|
||||
}
|
||||
|
||||
@@ -69,6 +69,8 @@ def dispatch(host, port, protocol, database_name, user, session, object_type,
|
||||
except Exception:
|
||||
return False
|
||||
elif method == 'list':
|
||||
if CONFIG['prevent_dblist']:
|
||||
raise Exception('AccessDenied')
|
||||
database = Database().connect()
|
||||
try:
|
||||
cursor = database.cursor()
|
||||
|
||||
Reference in New Issue
Block a user