Skip to content

Commit 026917c

Browse files
committed
Merge branch 'release/3.8.0'
2 parents 6090d2f + f30b27f commit 026917c

52 files changed

Lines changed: 234 additions & 753 deletions

Some content is hidden

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

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# v3.8.0
2+
## 08/25/2025
3+
4+
1. [](#new)
5+
* PHP 8.4 compatibility
6+
1. [](#improved)
7+
* Updated vendor libraries to latest
8+
* Updated Support links
9+
110
# v3.7.9
211
## 05/15/2024
312

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ The simplest way to create a new user is to simply run the `bin/plugin login new
8585

8686
### Commands
8787

88-
| Command | Arguments | Explination |
88+
| Command | Arguments | Explanation |
8989
|---------------|--------------------------------------|----------------------------|
9090
|`new-user`||Creates a new user (creates file in `user/accounts/`)
9191
|| [ -u, --user=USER ] | The username. |

blueprints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Login
22
slug: login
33
type: plugin
4-
version: 3.7.9
4+
version: 3.8.0
55
testing: false
66
description: Enables user authentication and login screen.
77
icon: sign-in

classes/Email.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Email
1818
* @return void
1919
* @throws \Exception
2020
*/
21-
public static function sendActivationEmail(UserInterface $user, UserInterface $actor = null): void
21+
public static function sendActivationEmail(UserInterface $user, ?UserInterface $actor = null): void
2222
{
2323
$email = $user->email;
2424
$token = (string)$user->get('activation_token', '');
@@ -73,7 +73,7 @@ public static function sendActivationEmail(UserInterface $user, UserInterface $a
7373
* @return void
7474
* @throws \Exception
7575
*/
76-
public static function sendResetPasswordEmail(UserInterface $user, UserInterface $actor = null): void
76+
public static function sendResetPasswordEmail(UserInterface $user, ?UserInterface $actor = null): void
7777
{
7878
$email = $user->email;
7979
$token = (string)$user->get('reset', '');
@@ -125,7 +125,7 @@ public static function sendResetPasswordEmail(UserInterface $user, UserInterface
125125
* @return void
126126
* @throws \Exception
127127
*/
128-
public static function sendWelcomeEmail(UserInterface $user, UserInterface $actor = null): void
128+
public static function sendWelcomeEmail(UserInterface $user, ?UserInterface $actor = null): void
129129
{
130130
if (!$user->email) {
131131
return;
@@ -152,7 +152,7 @@ public static function sendWelcomeEmail(UserInterface $user, UserInterface $acto
152152
* @return void
153153
* @throws \Exception
154154
*/
155-
public static function sendNotificationEmail(UserInterface $user, UserInterface $actor = null): void
155+
public static function sendNotificationEmail(UserInterface $user, ?UserInterface $actor = null): void
156156
{
157157
try {
158158
$to = static::getConfig()->get('plugins.email.to');
@@ -181,7 +181,7 @@ public static function sendNotificationEmail(UserInterface $user, UserInterface
181181
* @return void
182182
* @throws \Exception
183183
*/
184-
public static function sendInvitationEmail(Invitation $invitation, string $message = null, UserInterface $actor = null): void
184+
public static function sendInvitationEmail(Invitation $invitation, ?string $message = null, ?UserInterface $actor = null): void
185185
{
186186
if (!$invitation->email) {
187187
return;
@@ -215,7 +215,7 @@ public static function sendInvitationEmail(Invitation $invitation, string $messa
215215
}
216216
}
217217

218-
protected static function sendEmail(string $template, array $context, array $params, UserInterface $user = null, UserInterface $actor = null): void
218+
protected static function sendEmail(string $template, array $context, array $params, ?UserInterface $user = null, ?UserInterface $actor = null): void
219219
{
220220
$actor = $actor ?? static::getUser();
221221

classes/Events/PageAuthorizeEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PageAuthorizeEvent extends Event
3737
* @param UserInterface $user
3838
* @param Data|null $config
3939
*/
40-
public function __construct(PageInterface $page, UserInterface $user, Data $config = null)
40+
public function __construct(PageInterface $page, UserInterface $user, ?Data $config = null)
4141
{
4242
$this->page = $page;
4343
$this->user = $user;

classes/Login.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public function register(array $data, array $files = [])
311311
* @param string|null $ip
312312
* @return int Return positive number if rate limited, otherwise return 0.
313313
*/
314-
public function checkLoginRateLimit(string $username, string $ip = null): int
314+
public function checkLoginRateLimit(string $username, ?string $ip = null): int
315315
{
316316
$ipKey = $this->getIpKey($ip);
317317
$rateLimiter = $this->getRateLimiter('login_attempts');
@@ -330,7 +330,7 @@ public function checkLoginRateLimit(string $username, string $ip = null): int
330330
* @param string $username
331331
* @param string|null $ip
332332
*/
333-
public function resetLoginRateLimit(string $username, string $ip = null): void
333+
public function resetLoginRateLimit(string $username, ?string $ip = null): void
334334
{
335335
$ipKey = $this->getIpKey($ip);
336336
$rateLimiter = $this->getRateLimiter('login_attempts');
@@ -341,7 +341,7 @@ public function resetLoginRateLimit(string $username, string $ip = null): void
341341
* @param string|null $ip
342342
* @return string
343343
*/
344-
public function getIpKey(string $ip = null): string
344+
public function getIpKey(?string $ip = null): string
345345
{
346346
if (null === $ip) {
347347
$ip = Uri::ip();
@@ -520,7 +520,7 @@ public function sendActivationEmail(UserInterface $user)
520520
* @return bool True if the action was performed.
521521
* @throws \RuntimeException
522522
*/
523-
public function sendInviteEmail(Invitation $invitation, string $message = null, UserInterface $user = null)
523+
public function sendInviteEmail(Invitation $invitation, ?string $message = null, ?UserInterface $user = null)
524524
{
525525
try {
526526
Email::sendInvitationEmail($invitation, $message, $user);
@@ -623,7 +623,7 @@ public function getRateLimiter($context, $maxCount = null, $interval = null)
623623
* @param PageInterface|null $page
624624
* @return PageInterface|null
625625
*/
626-
public function getPage(string $type, string $route = null, PageInterface $page = null): ?PageInterface
626+
public function getPage(string $type, ?string $route = null, ?PageInterface $page = null): ?PageInterface
627627
{
628628
$route = $route ?? $this->getRoute($type, true);
629629
if (null === $route) {
@@ -663,7 +663,7 @@ public function getPage(string $type, string $route = null, PageInterface $page
663663
* @param PageInterface|null $page
664664
* @return PageInterface|null
665665
*/
666-
public function addPage(string $type, string $route = null, PageInterface $page = null): ?PageInterface
666+
public function addPage(string $type, ?string $route = null, ?PageInterface $page = null): ?PageInterface
667667
{
668668
$page = $this->getPage($type, $route, $page);
669669
if (null === $page) {
@@ -685,7 +685,7 @@ public function addPage(string $type, string $route = null, PageInterface $page
685685
* @param bool|null $enabled
686686
* @return string|null Returns route or null if the route has been disabled.
687687
*/
688-
public function getRoute(string $type, bool $enabled = null): ?string
688+
public function getRoute(string $type, ?bool $enabled = null): ?string
689689
{
690690
switch ($type) {
691691
case 'login':
@@ -732,7 +732,7 @@ public function getRoute(string $type, bool $enabled = null): ?string
732732
* @param Data|null $config
733733
* @return bool
734734
*/
735-
public function isUserAuthorizedForPage(UserInterface $user, PageInterface $page, Data $config = null): bool
735+
public function isUserAuthorizedForPage(UserInterface $user, PageInterface $page, ?Data $config = null): bool
736736
{
737737
/** @var PageAuthorizeEvent $event */
738738
$event = $this->grav->dispatchEvent(new PageAuthorizeEvent($page, $user, $config));

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@
1919
}
2020
],
2121
"support": {
22-
"email": "support@example.org",
2322
"issues": "https://github.com/getgrav/grav-plugin-login/issues",
24-
"irc": "https://gitter.im/getgrav/grav",
25-
"forum": "http://getgrav.org/forum",
23+
"chat": "https://getgrav.org/discord",
24+
"forum": "https://getgrav.org/forum",
2625
"docs": "https://github.com/getgrav/grav-plugin-login/blob/master/README.md"
2726
},
2827
"require": {
2928
"php": ">=7.3.6",
3029
"ext-json": "*",
31-
"birke/rememberme": "^1.0",
30+
"mober/rememberme": "^1.0",
3231
"robthree/twofactorauth": "^1.8",
3332
"bacon/bacon-qr-code": "^2.0"
3433
},

composer.lock

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

vendor/autoload.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
echo $err;
1515
}
1616
}
17-
trigger_error(
18-
$err,
19-
E_USER_ERROR
20-
);
17+
throw new RuntimeException($err);
2118
}
2219

2320
require_once __DIR__ . '/composer/autoload_real.php';

vendor/bacon/bacon-qr-code/src/Common/BitMatrix.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class BitMatrix
4646
/**
4747
* @throws InvalidArgumentException if a dimension is smaller than zero
4848
*/
49-
public function __construct(int $width, int $height = null)
49+
public function __construct(int $width, ?int $height = null)
5050
{
5151
if (null === $height) {
5252
$height = $width;
@@ -138,7 +138,7 @@ public function setRegion(int $left, int $top, int $width, int $height) : void
138138
/**
139139
* A fast method to retrieve one row of data from the matrix as a BitArray.
140140
*/
141-
public function getRow(int $y, BitArray $row = null) : BitArray
141+
public function getRow(int $y, ?BitArray $row = null) : BitArray
142142
{
143143
if (null === $row || $row->getSize() < $this->width) {
144144
$row = new BitArray($this->width);

0 commit comments

Comments
 (0)