Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the plugin compliant with authsplit one #159

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions OAuthManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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');
}
Expand Down
3 changes: 2 additions & 1 deletion action/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down