|
@@ -73,9 +73,9 @@ class auth_plugin_macaroons extends auth_plugin_base {
|
73
|
73
|
global $DB, $login, $CFG;
|
74
|
74
|
$placeholders[0] = "/{{firstname}}/";
|
75
|
75
|
$placeholders[1] = "/{{lastname}}/";
|
76
|
|
- if(!empty($_COOKIE['das-macaroon'])) {
|
|
76
|
+ if(!empty($_COOKIE[$this->config->cookie_name])) {
|
77
|
77
|
try {
|
78
|
|
- $m = Macaroon::deserialize($_COOKIE['das-macaroon']);
|
|
78
|
+ $m = Macaroon::deserialize($_COOKIE[$this->config->cookie_name]);
|
79
|
79
|
$v = new Verifier();
|
80
|
80
|
$v->setCallbacks([
|
81
|
81
|
function($a) {
|
|
@@ -205,15 +205,19 @@ class auth_plugin_macaroons extends auth_plugin_base {
|
205
|
205
|
* Processes and stores configuration data for this authentication plugin.
|
206
|
206
|
*/
|
207
|
207
|
function process_config($config) {
|
208
|
|
- if(!isset($config->email_config)) {
|
209
|
|
- $config->email_config = '';
|
|
208
|
+ if(!isset($config->cookie_name)) {
|
|
209
|
+ $config->cookie_name = '';
|
210
|
210
|
}
|
211
|
211
|
if(!isset($config->secret)) {
|
212
|
212
|
$config->secret = '';
|
213
|
213
|
}
|
|
214
|
+ if(!isset($config->email_config)) {
|
|
215
|
+ $config->email_config = '';
|
|
216
|
+ }
|
214
|
217
|
|
215
|
|
- set_config('email_config', $config->email_config, self::COMPONENT_NAME);
|
|
218
|
+ set_config('cookie_name', $config->cookie_name, self::COMPONENT_NAME);
|
216
|
219
|
set_config('secret', $config->secret, self::COMPONENT_NAME);
|
|
220
|
+ set_config('email_config', $config->email_config, self::COMPONENT_NAME);
|
217
|
221
|
return true;
|
218
|
222
|
}
|
219
|
223
|
|