mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-13766, test api_key, and remove shared secret in flickr plug-in
This commit is contained in:
parent
dfe23b6e66
commit
621dca51f8
2 changed files with 7 additions and 2 deletions
|
@ -21,6 +21,9 @@ class repository_boxnet extends repository{
|
|||
$reset = optional_param('reset', 0, PARAM_INT);
|
||||
parent::__construct($repositoryid, $context, $options);
|
||||
$this->api_key = $this->get_option('api_key');
|
||||
if (empty($this->api_key)) {
|
||||
throw new repository_exception('invalidapikey', 'repository_boxnet');
|
||||
}
|
||||
$sess_name = 'box_token'.$this->id;
|
||||
// reset session
|
||||
if(!empty($reset)) {
|
||||
|
|
|
@ -17,10 +17,12 @@ class repository_flickr extends repository{
|
|||
public function __construct($repositoryid, $context = SITEID, $options = array()){
|
||||
global $SESSION, $action, $CFG;
|
||||
$options['page'] = optional_param('p', 1, PARAM_INT);
|
||||
$options['secret'] = '7cb2f9d7cf70aebe';
|
||||
parent::__construct($repositoryid, $context, $options);
|
||||
$this->api_key = $this->get_option('api_key');
|
||||
$this->flickr = new phpFlickr($this->api_key, $this->options['secret']);
|
||||
if (empty($this->api_key)) {
|
||||
throw new repository_exception('invalidapikey', 'repository_flickr');
|
||||
}
|
||||
$this->flickr = new phpFlickr($this->api_key);
|
||||
|
||||
$reset = optional_param('reset', 0, PARAM_INT);
|
||||
$sess_name = 'flickrmail'.$this->id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue