Commit 976b32d9 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add pathtofile config option

parent e7f55c4c
...@@ -64,6 +64,12 @@ $siteoptionform = pieform(array( ...@@ -64,6 +64,12 @@ $siteoptionform = pieform(array(
'collapseifoneoption' => true, 'collapseifoneoption' => true,
'options' => $themeoptions, 'options' => $themeoptions,
), ),
'pathtofile' => array(
'type' => 'text',
'title' => get_string('pathtofile','admin'),
'description' => get_string('pathtofiledescription','admin'),
'defaultvalue' => get_config('pathtofile'),
),
'viruschecking' => array( 'viruschecking' => array(
'type' => 'checkbox', 'type' => 'checkbox',
'title' => get_string('viruschecking','admin'), 'title' => get_string('viruschecking','admin'),
...@@ -108,7 +114,7 @@ function siteoptions_fail(Pieform $form, $field) { ...@@ -108,7 +114,7 @@ function siteoptions_fail(Pieform $form, $field) {
} }
function siteoptions_submit(Pieform $form, $values) { function siteoptions_submit(Pieform $form, $values) {
$fields = array('sitename','language','theme','pathtoclam', $fields = array('sitename','language','theme','pathtofile', 'pathtoclam',
'allowpublicviews','artefactviewinactivitytime'); 'allowpublicviews','artefactviewinactivitytime');
foreach ($fields as $field) { foreach ($fields as $field) {
if (!set_config($field, $values[$field])) { if (!set_config($field, $values[$field])) {
......
...@@ -91,6 +91,8 @@ $string['artefactviewinactivitytimedescription'] = 'The time after which an inac ...@@ -91,6 +91,8 @@ $string['artefactviewinactivitytimedescription'] = 'The time after which an inac
$string['language'] = 'Language'; $string['language'] = 'Language';
$string['pathtoclam'] = 'Path to clam'; $string['pathtoclam'] = 'Path to clam';
$string['pathtoclamdescription'] = 'The filesystem path to clamscan or clamdscan'; $string['pathtoclamdescription'] = 'The filesystem path to clamscan or clamdscan';
$string['pathtofile'] = 'Path to file';
$string['pathtofiledescription'] = 'Filesystem path to the \'file\' program';
$string['sessionlifetime'] = 'Session lifetime'; $string['sessionlifetime'] = 'Session lifetime';
$string['sessionlifetimedescription'] = 'Time in minutes after which an inactive logged in user will be automatically logged out'; $string['sessionlifetimedescription'] = 'Time in minutes after which an inactive logged in user will be automatically logged out';
$string['setsiteoptionsfailed'] = 'Failed setting the %s option'; $string['setsiteoptionsfailed'] = 'Failed setting the %s option';
......
...@@ -790,6 +790,7 @@ ...@@ -790,6 +790,7 @@
<SENTENCES> <SENTENCES>
<SENTENCE TEXT="(field, value) VALUES ('session_timeout', 1800)" /> <SENTENCE TEXT="(field, value) VALUES ('session_timeout', 1800)" />
<SENTENCE TEXT="(field, value) VALUES ('sitename', 'Mahara')" /> <SENTENCE TEXT="(field, value) VALUES ('sitename', 'Mahara')" />
<SENTENCE TEXT="(field, value) VALUES ('pathtofile', '/usr/bin/file')" />
</SENTENCES> </SENTENCES>
</STATEMENT> </STATEMENT>
<STATEMENT NAME="insert event types" TYPE="insert" TABLE="event_type"> <STATEMENT NAME="insert event types" TYPE="insert" TABLE="event_type">
......
...@@ -146,6 +146,11 @@ function xmldb_core_upgrade($oldversion=0) { ...@@ -146,6 +146,11 @@ function xmldb_core_upgrade($oldversion=0) {
$status = $status && create_table($table); $status = $status && create_table($table);
} }
if ($oldversion < 2007011200) {
// Add path to file to the config table
set_config('pathtofile', '/usr/bin/file');
}
return $status; return $status;
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
defined('INTERNAL') || die(); defined('INTERNAL') || die();
$config = new StdClass; $config = new StdClass;
$config->version = 2006122200; $config->version = 2007011200;
$config->release = '0.2'; $config->release = '0.2';
$config->minupgradefrom = 2006121501; $config->minupgradefrom = 2006121501;
$config->minupgraderelease = '0.1 (build tag BUILD_20061215)'; $config->minupgraderelease = '0.1 (build tag BUILD_20061215)';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment