Skip to content

Commit

Permalink
MDL-42668 portfolio_boxnet: Disable the portfolio when non-HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Nov 7, 2013
1 parent 337107f commit a5a84cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions portfolio/boxnet/lang/en/portfolio_boxnet.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
$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';
Expand Down
3 changes: 3 additions & 0 deletions portfolio/boxnet/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,11 @@ protected function rename_file($fileid, $newname) {
}

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';
}
}

Expand Down

0 comments on commit a5a84cc

Please sign in to comment.