Commit b80f906c authored by Darryl Hamilton's avatar Darryl Hamilton
Browse files

Add check for working unzip before trying to use it (bug #746079)



Change-Id: I04bca3f7d628c3c8f297846ab6bbc086c44f7954
Signed-off-by: default avatarDarryl Hamilton <darrylh@catalyst.net.nz>
parent 53348d27
......@@ -416,6 +416,11 @@ abstract class ImporterTransport {
return;
}
// check that pathtounzip is valid
if (!is_executable(get_config('pathtounzip'))) {
throw new ImportException($this, get_string('unzipnotinstalled', 'admin'));
}
$command = sprintf('%s %s %s %s',
get_config('pathtounzip'),
escapeshellarg($this->importfile),
......
......@@ -454,6 +454,7 @@ $string['importfilemissinglisting'] = 'The bulk export file is missing a file na
$string['importfilenotafile'] = 'Error during form submission: file was not recognised';
$string['importfilenotreadable'] = 'Error during form submission: file was not readable';
$string['bulkleap2aimportfiledescription'] = 'The zip file on your server containing all exported users (in Leap2A format) along with a CSV listing of usernames';
$string['unzipnotinstalled'] = 'Your system does not have the unzip command, or $cfg->pathtounzip is misconfigured. Please install unzip to enable importing a zipped export file or fix the $cfg->pathtounzip setting.';
$string['importednuserssuccessfully'] = 'Imported %d of %d users successfully';
$string['Import'] = 'Import';
$string['bulkimportdirdoesntexist'] = 'The directory %s does not exist';
......
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