Skip to content

Commit 82e7a68

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

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
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
}

action/login.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function register(EventHandler $controller)
4141
{
4242
global $conf;
4343
if (($conf['authtype'] != 'oauth')
44-
and ($conf['authtype'] == 'authsplit' and $conf['plugin']['authsplit']['primary_authplugin'] != 'oauth')) return;
44+
or ($conf['authtype'] == 'authsplit' and $conf['plugin']['authsplit']['primary_authplugin'] != 'oauth')) return;
4545

4646
$conf['profileconfirm'] = false; // password confirmation doesn't work with oauth only users
4747

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)