MDL-42668 portfolio_boxnet: Disable the portfolio when non-HTTPS
This commit is contained in:
@@ -32,6 +32,8 @@ $string['existingfolder'] = 'Existing folder to put file(s) into';
|
||||
$string['folderclash'] = 'The folder you asked to create already exists!';
|
||||
$string['foldercreatefailed'] = 'Failed to create your target folder on box.net';
|
||||
$string['folderlistfailed'] = 'Failed to retrieve a folder listing from box.net';
|
||||
$string['missinghttps'] = 'HTTPS required';
|
||||
$string['missinghttps_help'] = 'Box.net will only work with an HTTPS enabled website.';
|
||||
$string['missingoauthkeys'] = 'Missing client ID and secret';
|
||||
$string['missingoauthkeys_help'] = 'There is no client ID or secret configured for this plugin. You can get one of these from Box.net development page.';
|
||||
$string['newfolder'] = 'New folder to put file(s) into';
|
||||
|
||||
@@ -204,8 +204,11 @@ class portfolio_plugin_boxnet extends portfolio_plugin_push_base {
|
||||
}
|
||||
|
||||
public function instance_sanity_check() {
|
||||
global $CFG;
|
||||
if (!$this->get_config('clientid') || !$this->get_config('clientsecret')) {
|
||||
return 'missingoauthkeys';
|
||||
} else if (strpos($CFG->wwwroot, 'https') !== 0) {
|
||||
return 'missinghttps';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user