Skip to content

Commit 06acf28

Browse files
author
Tyler Cosgrove
committed
Merge branch 'release/1.4.0'
2 parents 3167a6c + 9e3b997 commit 06acf28

File tree

141 files changed

+260
-18337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+260
-18337
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# v1.4.0
2+
## 12/06/2017
3+
4+
1. [](#bugfix)
5+
* Compatibility fixes with Login plugin v2.5.0 - Messages system
6+
1. [](#improved)
7+
* Updated OAuth library to v0.8.10 [#14](https://github.com/getgrav/grav-plugin-login-oauth/issues/14)
8+
19
# v1.3.1
210
## 09/12/2017
311

@@ -11,7 +19,7 @@
1119
* Added Blacklist and Whitelist support to Google
1220

1321
# v1.2.0
14-
## 12/18/2017
22+
## 1/18/2017
1523

1624
1. [](#new)
1725
* Added LinkedIn provider [#11](https://github.com/getgrav/grav-plugin-login-oauth/pull/11)

blueprints.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Login Plugin OAuth Addon
2-
version: 1.3.1
2+
version: 1.4.0
33
description: Enables login with OAuth accounts. Currently provides Facebook, Google, Twitter, Github, Linkedin
44
icon: sign-in
55
author:
@@ -12,7 +12,7 @@ bugs: https://github.com/getgrav/grav-plugin-login-oauth/issues
1212
license: MIT
1313

1414
dependencies:
15-
- { name: login, version: '>=2.4.1' }
15+
- { name: login, version: '>=2.5.0' }
1616

1717
form:
1818
validation: loose

classes/Controller.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function execute()
8383
{
8484
/** @var \Grav\Common\Language\Language */
8585
$t = $this->grav['language'];
86+
$messages = $this->grav['messages'];
8687
$provider = strtolower($this->action);
8788
$config = $this->grav['config']->get('plugins.login-oauth.providers.' . $this->action, []);
8889

@@ -95,7 +96,7 @@ public function execute()
9596
$this->service = $this->factory->createService($this->action, $credentials, $this->storage, $scope);
9697
}
9798
if (!$this->service || empty($config)) {
98-
$this->login->setMessage($t->translate(['PLUGIN_LOGIN_OAUTH.OAUTH_PROVIDER_NOT_SUPPORTED', $this->action]));
99+
$messages->add($t->translate(['PLUGIN_LOGIN_OAUTH.OAUTH_PROVIDER_NOT_SUPPORTED', $this->action]));
99100

100101
return true;
101102
}
@@ -106,9 +107,9 @@ public function execute()
106107
if (is_bool($authenticated)) {
107108
$this->reset();
108109
if ($authenticated) {
109-
$this->login->setMessage($t->translate('PLUGIN_LOGIN.LOGIN_SUCCESSFUL'));
110+
$messages->add($t->translate('PLUGIN_LOGIN.LOGIN_SUCCESSFUL'));
110111
} else {
111-
$this->login->setMessage($t->translate('PLUGIN_LOGIN.ACCESS_DENIED'));
112+
$messages->add($t->translate('PLUGIN_LOGIN.ACCESS_DENIED'));
112113
}
113114

114115
// Redirect to current URI
@@ -118,7 +119,7 @@ public function execute()
118119
}
119120
$this->setRedirect($redirect);
120121
} elseif (!$this->grav['session']->oauth) {
121-
$this->login->setMessage($t->translate(['PLUGIN_LOGIN_OAUTH.OAUTH_PROVIDER_NOT_SUPPORTED', $this->action]));
122+
$messages->add($t->translate(['PLUGIN_LOGIN_OAUTH.OAUTH_PROVIDER_NOT_SUPPORTED', $this->action]));
122123
}
123124

124125
return true;
@@ -241,6 +242,7 @@ public function oauthGoogle()
241242
return $this->genericOAuthProvider(function () {
242243
/** @var \Grav\Common\Language\Language */
243244
$t = $this->grav['language'];
245+
$messages = $this->grav['messages'];
244246

245247
// Get fullname, email and language
246248
$data = json_decode($this->service->request('userinfo'), true);
@@ -251,7 +253,7 @@ public function oauthGoogle()
251253
$domain = isset($data['hd'])?$data['hd']:'gmail.com';
252254

253255
if ( !in_array($domain, $whitelist) ) {
254-
$this->login->setMessage($t->translate(['PLUGIN_LOGIN_OAUTH.EMAIL_DOMAIN_NOT_PERMITTED', $domain]));
256+
$messages->add($t->translate(['PLUGIN_LOGIN_OAUTH.EMAIL_DOMAIN_NOT_PERMITTED', $domain]));
255257
return null;
256258
}
257259
}
@@ -261,7 +263,7 @@ public function oauthGoogle()
261263
$domain = isset($data['hd'])?$data['hd']:'gmail.com';
262264

263265
if( in_array($domain, $blacklist)) {
264-
$this->login->setMessage($t->translate(['PLUGIN_LOGIN_OAUTH.EMAIL_DOMAIN_NOT_PERMITTED', $domain]));
266+
$messages->add($t->translate(['PLUGIN_LOGIN_OAUTH.EMAIL_DOMAIN_NOT_PERMITTED', $domain]));
265267
return null;
266268
}
267269
}

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/composer/ClassLoader.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,13 @@ private function findFileWithExtension($class, $ext)
374374

375375
$first = $class[0];
376376
if (isset($this->prefixLengthsPsr4[$first])) {
377-
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
378-
if (0 === strpos($class, $prefix)) {
379-
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
377+
$subPath = $class;
378+
while (false !== $lastPos = strrpos($subPath, '\\')) {
379+
$subPath = substr($subPath, 0, $lastPos);
380+
$search = $subPath.'\\';
381+
if (isset($this->prefixDirsPsr4[$search])) {
382+
foreach ($this->prefixDirsPsr4[$search] as $dir) {
383+
$length = $this->prefixLengthsPsr4[$first][$search];
380384
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
381385
return $file;
382386
}

vendor/composer/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Copyright (c) 2016 Nils Adermann, Jordi Boggiano
2+
Copyright (c) Nils Adermann, Jordi Boggiano
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal

vendor/composer/installed.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[
22
{
33
"name": "lusitanian/oauth",
4-
"version": "v0.8.9",
5-
"version_normalized": "0.8.9.0",
4+
"version": "v0.8.10",
5+
"version_normalized": "0.8.10.0",
66
"source": {
77
"type": "git",
88
"url": "https://github.com/Lusitanian/PHPoAuthLib.git",
9-
"reference": "29bda6e176df6c292a9b1c43ae8a44d56a87c30b"
9+
"reference": "09f4af38f17db6938253f4d1b171d537913ac1ed"
1010
},
1111
"dist": {
1212
"type": "zip",
13-
"url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/29bda6e176df6c292a9b1c43ae8a44d56a87c30b",
14-
"reference": "29bda6e176df6c292a9b1c43ae8a44d56a87c30b",
13+
"url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/09f4af38f17db6938253f4d1b171d537913ac1ed",
14+
"reference": "09f4af38f17db6938253f4d1b171d537913ac1ed",
1515
"shasum": ""
1616
},
1717
"require": {
@@ -28,7 +28,7 @@
2828
"predis/predis": "Allows using the Redis storage backend.",
2929
"symfony/http-foundation": "Allows using the Symfony Session storage backend."
3030
},
31-
"time": "2016-02-24T00:20:18+00:00",
31+
"time": "2016-07-12T22:15:40+00:00",
3232
"type": "library",
3333
"extra": {
3434
"branch-alias": {

vendor/lusitanian/oauth/.gitignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

vendor/lusitanian/oauth/.scrutinizer.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

vendor/lusitanian/oauth/.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)