MDL-42668 portfolio_boxnet: Disable the portfolio when non-HTTPS

This commit is contained in:
Frederic Massart
2013-11-07 15:28:34 +08:00
parent 337107fe4b
commit a5a84cc894
2 changed files with 5 additions and 0 deletions
@@ -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';
+3
View File
@@ -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';
}
}