Skip to content

Commit 2ba0701

Browse files
committed
Adding db manager configuration option.
1 parent ef4d1ae commit 2ba0701

File tree

3 files changed

+596
-1445
lines changed

3 files changed

+596
-1445
lines changed

main/admin/db.php

Lines changed: 570 additions & 1433 deletions
Large diffs are not rendered by default.

main/admin/index.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/**
88
* Code
99
*/
10+
1011
// Language files that need to be included.
1112
$language_file = array('admin', 'tracking','coursebackup');
1213

@@ -228,9 +229,20 @@
228229
$items[] = array('url'=>'filler.php', 'label' => get_lang('DataFiller'));
229230
}
230231
$items[] = array('url'=>'archive_cleanup.php', 'label' => get_lang('ArchiveDirCleanup'));
231-
if (api_get_setting('server_type') === 'test') {
232-
$items[] = array('url'=>'system_management.php', 'label' => get_lang('SystemManagement'));
233-
}
232+
if (api_get_setting('server_type') === 'test') {
233+
$items[] = array('url'=>'system_management.php', 'label' => get_lang('SystemManagement'));
234+
}
235+
236+
if (isset($_configuration['db_manager_enabled']) &&
237+
$_configuration['db_manager_enabled'] == true &&
238+
api_is_global_platform_admin()
239+
) {
240+
$host = $_configuration['db_host'];
241+
$username = $_configuration['db_user'];
242+
$databaseName = $_configuration['main_database'];
243+
244+
$items[] = array('url'=>"db.php?username=$username&db=$databaseName&server=$host", 'label' => get_lang('Database Manager'));
245+
}
234246

235247
$blocks['settings']['items'] = $items;
236248
$blocks['settings']['extra'] = null;

main/install/configuration.dist.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Virtual campus configuration
77
*
88
* This file contains a list of variables that can be modified by the campus
9-
* site's server administrator. Pay attention when changing these variables,
9+
* site's server administrator. Pay attention when changing these variables,
1010
* some changes may cause Chamilo to stop working.
1111
* If you changed some settings and want to restore them, please have a look at
1212
* configuration.dist.php. That file is an exact copy of the config file at
@@ -15,13 +15,13 @@
1515

1616
/**
1717
* $_configuration define only the bare essential variables
18-
* for configuring the platform (paths, database connections, ...).
18+
* for configuring the platform (paths, database connections, ...).
1919
* Changing a $_configuration variable CAN generally break the installation.
20-
* Besides the $_configuration, a $_settings array also exists, that
20+
* Besides the $_configuration, a $_settings array also exists, that
2121
* contains variables that can be changed and will not break the platform.
22-
* These optional settings are defined in the database, now
22+
* These optional settings are defined in the database, now
2323
* (table settings_current).
24-
* example: $_configuration['tracking_enabled'] (assuming that the install
24+
* example: $_configuration['tracking_enabled'] (assuming that the install
2525
* script creates the necessary tables anyway).
2626
*/
2727

@@ -55,6 +55,8 @@
5555
// User Personal Database (where all the personal stuff of the user is stored
5656
// (personal agenda items, course sorting)
5757
$_configuration['user_personal_database']='{DATABASE_PERSONAL}';
58+
// Enable access to database management for platform admins.
59+
$_configuration['db_manager_enabled'] = false;
5860

5961
/**
6062
* Directory settings
@@ -79,7 +81,7 @@
7981
$_configuration['db_admin_path'] = '';
8082

8183
/**
82-
*
84+
*
8385
* Login modules settings
8486
*/
8587
// CAS IMPLEMENTATION
@@ -103,7 +105,7 @@
103105
// $extAuthSource["external_login"]["updateUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/updateUser.php";
104106

105107
/**
106-
*
108+
*
107109
* Hosting settings - Allows you to set limits to the Chamilo portal when
108110
* hosting it for a third party. These settings can be overwritten by an
109111
* optionally-loaded extension file with only the settings (no comments).
@@ -124,7 +126,7 @@
124126
$_configuration[1]['hosting_limit_disk_space'] = 0;
125127

126128
/**
127-
* Content Delivery Network (CDN) settings. Only use if you need a separate
129+
* Content Delivery Network (CDN) settings. Only use if you need a separate
128130
* server to serve your static data. If you don't know what a CDN is, you
129131
* don't need it. These settings are for simple Origin Pull CDNs and are
130132
* experimental. Enable only if you really know what you're doing.
@@ -191,4 +193,4 @@
191193
// Boost query on last connection time
192194
//$_configuration['save_user_last_login'] = true;
193195
// Allow course tutors in sessions to add existing students to their session
194-
//$_configuration['allow_tutors_to_assign_students_to_session'] = 'false';
196+
//$_configuration['allow_tutors_to_assign_students_to_session'] = 'false';

0 commit comments

Comments
 (0)