diff --git a/OAuthManager.php b/OAuthManager.php index b7f0f94..e0912e7 100644 --- a/OAuthManager.php +++ b/OAuthManager.php @@ -253,7 +253,7 @@ protected function processUserData($userdata, $servicename) $localUserInfo['grps'], $userdata['grps'] ?? [], array_keys($helper->listServices(false)), - $auth->getConf('overwrite-groups') + $auth->getOption('overwrite-groups') ); // update user if changed @@ -262,7 +262,7 @@ protected function processUserData($userdata, $servicename) if ($localUserInfo != $userdata && !isset($localUserInfo['protected'])) { $auth->modifyUser($localUser, $userdata); } - } elseif (actionOK('register') || $auth->getConf('register-on-auth')) { + } elseif (actionOK('register') || $auth->getOption('register-on-auth')) { if (!$auth->registerOAuthUser($userdata, $servicename)) { throw new Exception('generic create error'); } diff --git a/action/login.php b/action/login.php index 8bb16f8..3c673b3 100644 --- a/action/login.php +++ b/action/login.php @@ -40,7 +40,8 @@ public function __construct() public function register(EventHandler $controller) { global $conf; - if ($conf['authtype'] != 'oauth') return; + if ($conf['authtype'] != 'oauth') + and ($conf['authtype'] == 'authsplit' and $conf['plugin']['authsplit']['primary_authplugin'] != 'oauth')) return; $conf['profileconfirm'] = false; // password confirmation doesn't work with oauth only users diff --git a/auth.php b/auth.php index 96a4d85..31a7545 100644 --- a/auth.php +++ b/auth.php @@ -195,6 +195,18 @@ public function getLang($id) return $parent->getLang($id); } + /** + * Get an option + * + * @param string $option The name of the wanted option + * + * @return string The option value + */ + public function getOption($option) + { + return $this->getConf($option); + } + /** * Farmer plugin support *