diff --git a/export/csv/export.php b/export/csv/export.php index 3f411cba..a6308921 100755 --- a/export/csv/export.php +++ b/export/csv/export.php @@ -51,7 +51,8 @@ function export_report($report) { } } - $csvexport = new csv_export_writer(); + $csvdelimiter = get_config('block_configurable_reports', 'csvdelimiter'); + $csvexport = new csv_export_writer("$csvdelimiter"); $csvexport->set_filename($filename); foreach ($matrix as $ri => $col) { diff --git a/lang/en/block_configurable_reports.php b/lang/en/block_configurable_reports.php index e9fd3c2c..4e8bfc24 100644 --- a/lang/en/block_configurable_reports.php +++ b/lang/en/block_configurable_reports.php @@ -568,8 +568,12 @@ $string['checksql_execution'] = 'Block Configurable Reports SQL execution'; $string['checksql_execution_ok'] = 'SQL execution is disabled.'; + $string['checksql_execution_warning'] = 'It is recommended to disable SQL execution to avoid execution of arbitrary SQL code in your server.'; $string['checksql_execution_details'] = 'By allowing SQL code execution there is a potential security issue with users adding arbitrary code. SQL code execution should be disable to only allow SQL queries for reading/retreaving data. SQL execution can be disabled in your config.php file by setting $CFG->block_configurable_reports_enable_sql_execution to 0'; +$string['csvdelimiter'] = 'CSV delimiter'; +$string['csvdelimiterinfo'] = 'CSV delimiter: "colon" for ":", "comma" for ",", semicolon for ";", "tab" for "\t" and "cfg" for character configured in "CFG->CSV_DELIMITER" of the config.php file.'; + diff --git a/settings.php b/settings.php index ae3a27f4..5096c259 100755 --- a/settings.php +++ b/settings.php @@ -112,6 +112,13 @@ ) ); + + $settings->add(new admin_setting_configtext('block_configurable_reports/allowedsqlusers', get_string('allowedsqlusers', 'block_configurable_reports'), + get_string('allowedsqlusersinfo', 'block_configurable_reports'), '', PARAM_TEXT)); + // csv delimiters used in get_delimiter() of moodle lib/csvlib.class.php + $csvdelimiteroptions= array('cfg'=>'cfg','colon'=>'colon','comma'=>'comma','semicolon'=>'semicolon','tab'=>'tab'); + $settings->add(new admin_setting_configselect('block_configurable_reports/csvdelimiter', get_string('csvdelimiter', 'block_configurable_reports'), + get_string('csvdelimiterinfo', 'block_configurable_reports'), 'cfg', $csvdelimiteroptions)); $settings->add( new admin_setting_configtext( 'block_configurable_reports/allowedsqlusers', get_string('allowedsqlusers', 'block_configurable_reports'),