Commit cbd30f82 authored by Aaron Wells's avatar Aaron Wells
Browse files

Provide some documentation of the pathtoclam setting

Bug 1078591

Change-Id: Ica1de7ce33d56de4a97f6e0a12dfad6d6591b788
parent ead65656
......@@ -386,6 +386,13 @@ $siteoptionform = array(
'help' => true,
'disabled' => in_array('viruschecking', $OVERRIDDEN),
),
'pathtoclam' => array(
'type' => 'html',
'title' => get_string('pathtoclam', 'admin'),
'description' => get_string('pathtoclamdescription', 'admin'),
'value' => (get_config('pathtoclam') ? get_config('pathtoclam') : get_string('pathtoclamnotset', 'admin')),
'help' => true,
),
'antispam' => array(
'type' => 'select',
'title' => get_string('antispam', 'admin'),
......@@ -760,7 +767,7 @@ function siteoptions_submit(Pieform $form, $values) {
safe_require('artefact', 'file');
ArtefactTypeFolder::change_public_folder_name($oldlanguage, $values['lang']);
}
// submitted sessionlifetime is in minutes; db entry session_timeout is in seconds
if (!set_config('session_timeout', $values['sessionlifetime'] * 60)) {
siteoptions_fail($form, 'sessionlifetime');
......@@ -774,7 +781,13 @@ function siteoptions_submit(Pieform $form, $values) {
if ($values['viruschecking'] == 'on') {
$pathtoclam = escapeshellcmd(trim(get_config('pathtoclam')));
if (!$pathtoclam || !file_exists($pathtoclam) && !is_executable($pathtoclam)) {
if (!$pathtoclam ) {
$form->reply(PIEFORM_ERR, array(
'message' => get_string('clamnotset', 'mahara', $pathtoclam),
'goto' => '/admin/site/options.php',
));
}
else if (!file_exists($pathtoclam) && !is_executable($pathtoclam)) {
$form->reply(PIEFORM_ERR, array(
'message' => get_string('clamlost', 'mahara', $pathtoclam),
'goto' => '/admin/site/options.php',
......
......@@ -337,6 +337,7 @@ $string['onlineuserssideblockmaxusersdescription'] = 'The maximum number of user
$string['country'] = 'Country';
$string['pathtoclam'] = 'Path to ClamAV';
$string['pathtoclamdescription'] = 'The file system path to clamscan or clamdscan';
$string['pathtoclamnotset'] = '(not set)';
$string['registerterms'] = 'Registration agreement';
$string['registertermsdescription'] = "Force users to agree to the terms and conditions before registration. You should edit your site's terms and conditions page before enabling this option.";
$string['licensemetadata'] = 'License metadata';
......
<h3>Path to clam</h3>
<p>The file system path to <code>clamscan</code> or <code>clamdscan</code> for virus checking. It is assumed that a failure of clam to run will mean that a file should be treated as a virus, and a quarantine directory will be automatically set up by your Mahara installation.</p>
<p>The file system path to <code>clamscan</code> or <code>clamdscan</code> for
virus checking. It is assumed that a failure of clam to run will mean that a file
should be treated as a virus, and a quarantine directory will be automatically set
up by your Mahara installation.</p>
<p>For security reasons this setting cannot be changed via the web. You will need to
set it in your <tt>config.php</tt> file, as follows:<p>
<p><tt>$cfg->pathtoclam = '/path/to/your/clamscan';</tt></p>
\ No newline at end of file
......@@ -261,7 +261,7 @@ If you wish to extend your account access or have any questions regarding the ab
Regards, %s site administrator';
$string['accountexpirywarninghtml'] = '<p>Dear %s,</p>
<p>Your account on %s will expire within %s.</p>
<p>We recommend you save the contents of your portfolio using the export tool. Instructions on using this feature may be found within the user guide.</p>
......@@ -689,6 +689,7 @@ $string['clamdeletedfilefailed'] = 'The file could not be deleted.';
$string['clambroken'] = 'Your administrator has enabled virus checking for file uploads but has misconfigured something. Your file upload was NOT successful. Your administrator was notified so they can fix it. Maybe try uploading this file later.';
$string['clamemailsubject'] = '%s :: ClamAV notification';
$string['clamlost'] = 'ClamAV is configured to run on file upload, but the path supplied to ClamAV, %s, is invalid.';
$string['clamnotset'] = 'You have activated virus checking, but have not set a "Path to ClamAV" value. Virus checking will not take effect until you configure the path to ClamAV by adding a $cfg->pathtoclam value to your config.php file.';
$string['clamfailed'] = 'ClamAV has failed to run. The return error message was %s. Here is the output from ClamAV:';
$string['clamunknownerror'] = 'There was an unknown error with ClamAV.';
$string['image'] = 'Image';
......
......@@ -209,10 +209,12 @@ $cfg->imagemaxheight = 1024;
$cfg->maximageresizememory = 104857600;
// paths and arguments for various system commands
$cfg->pathtoaspell = '/usr/bin/aspell';
// The path to the ClamAV executable (clamscan or clamdscan); disabled by default
$cfg->pathtoclam = '';
$cfg->pathtogzip = '/bin/gzip';
$cfg->pathtounzip = '/usr/bin/unzip';
$cfg->pathtozip = '/usr/bin/zip';
$cfg->pathtoaspell = '/usr/bin/aspell';
$cfg->ziprecursearg = '-r';
$cfg->unzipdirarg = '-d';
$cfg->unziplistarg = '-l';
......
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