Skip to content

Commit ed84dad

Browse files
author
atisne
committed
Make the plugin compliant with authsplit one
OAuth options may be read through authsplit plugin.
1 parent ea77a60 commit ed84dad

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

OAuthManager.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ protected function processUserData($userdata, $servicename)
253253
$localUserInfo['grps'],
254254
$userdata['grps'] ?? [],
255255
array_keys($helper->listServices(false)),
256-
$auth->getConf('overwrite-groups')
256+
$auth->getOption('overwrite-groups')
257257
);
258258

259259
// update user if changed
@@ -262,7 +262,7 @@ protected function processUserData($userdata, $servicename)
262262
if ($localUserInfo != $userdata && !isset($localUserInfo['protected'])) {
263263
$auth->modifyUser($localUser, $userdata);
264264
}
265-
} elseif (actionOK('register') || $auth->getConf('register-on-auth')) {
265+
} elseif (actionOK('register') || $auth->getOption('register-on-auth')) {
266266
if (!$auth->registerOAuthUser($userdata, $servicename)) {
267267
throw new Exception('generic create error');
268268
}

auth.php

+12
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,18 @@ public function getLang($id)
195195
return $parent->getLang($id);
196196
}
197197

198+
/**
199+
* Get an option
200+
*
201+
* @param string $option The name of the wanted option
202+
*
203+
* @return string The option value
204+
*/
205+
public function getOption($option)
206+
{
207+
return $this->getConf($option);
208+
}
209+
198210
/**
199211
* Farmer plugin support
200212
*

0 commit comments

Comments
 (0)