Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit 248f044

Browse files
Merge branch 'master' of github.com:cosmocode/dokuwiki-plugin-oauth into master
2 parents 656c2b5 + a5b7ee9 commit 248f044

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

auth.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,13 @@ protected function addUser(&$uinfo, $servicename) {
294294
* @return bool|string
295295
*/
296296
protected function getUserByEmail($mail) {
297-
if($this->users === null) $this->_loadUserData();
297+
if($this->users === null){
298+
if(is_callable([$this, '_loadUserData'])) {
299+
$this->_loadUserData();
300+
} else {
301+
$this->loadUserData();
302+
}
303+
}
298304
$mail = strtolower($mail);
299305

300306
foreach($this->users as $user => $uinfo) {
@@ -395,7 +401,7 @@ public function modifyUser($user, $changes) {
395401

396402
if(isset($changes['mail'])) {
397403
$found = $this->getUserByEmail($changes['mail']);
398-
if($found != $user) {
404+
if($found && $found != $user) {
399405
msg($this->getLang('emailduplicate'), -1);
400406
return false;
401407
}

phpoauthlib/src/OAuth/OAuth2/Service/AbstractService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ public function request($path, $method = 'GET', $body = null, array $extraHeader
167167
$uri->addToQuery('apikey', $token->getAccessToken());
168168
} elseif (static::AUTHORIZATION_METHOD_HEADER_BEARER === $this->getAuthorizationMethod()) {
169169
$extraHeaders = array_merge(array('Authorization' => 'Bearer ' . $token->getAccessToken()), $extraHeaders);
170+
} elseif (static::AUTHORIZATION_METHOD_HEADER_TOKEN === $this->getAuthorizationMethod()) {
171+
$extraHeaders = array_merge(array('Authorization' => 'token ' . $token->getAccessToken()), $extraHeaders);
170172
}
171173

172174
$extraHeaders = array_merge($this->getExtraApiHeaders(), $extraHeaders);

phpoauthlib/src/OAuth/OAuth2/Service/GitHub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function getAccessTokenEndpoint()
122122
*/
123123
protected function getAuthorizationMethod()
124124
{
125-
return static::AUTHORIZATION_METHOD_QUERY_STRING;
125+
return static::AUTHORIZATION_METHOD_HEADER_TOKEN;
126126
}
127127

128128
/**

phpoauthlib/src/OAuth/OAuth2/Service/ServiceInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ interface ServiceInterface extends BaseServiceInterface
2323
const AUTHORIZATION_METHOD_QUERY_STRING = 2;
2424
const AUTHORIZATION_METHOD_QUERY_STRING_V2 = 3;
2525
const AUTHORIZATION_METHOD_QUERY_STRING_V3 = 4;
26+
const AUTHORIZATION_METHOD_HEADER_TOKEN = 5;
2627

2728
/**
2829
* Retrieves and stores/returns the OAuth2 access token after a successful authorization.

plugin.info.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
base oauthatlauncher
22
author Ryan Dowling
33
email ryan.dowling@atlauncher.com
4-
date 2019-06-08
4+
date 2020-08-05
55
name oauth plugin for ATLauncher
66
desc oAuth plugin to login via ATLauncher
7-
url https://www.atlauncher.com
7+
url https://atlauncher.com

0 commit comments

Comments
 (0)