Skip to content

Commit

Permalink
Merge branch 'release/1.10.46'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed May 15, 2024
2 parents 0fe28d4 + 85c9404 commit 1c5f763
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v1.10.46
## 05/15/2024

1. [](#improved)
* Used Login's new `site_host` security setting for Admin password reset. Requires Login version `3.7.8+`

# v1.10.45
## 03/18/2024

Expand Down
4 changes: 2 additions & 2 deletions blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Admin Panel
slug: admin
type: plugin
version: 1.10.45
version: 1.10.46
description: Adds an advanced administration panel to manage your site
icon: empire
author:
Expand All @@ -17,7 +17,7 @@ license: MIT
dependencies:
- { name: grav, version: '>=1.7.42' }
- { name: form, version: '>=6.0.1' }
- { name: login, version: '>=3.7.0' }
- { name: login, version: '>=3.7.8' }
- { name: email, version: '>=3.1.6' }
- { name: flex-objects, version: '>=1.2.0' }

Expand Down
10 changes: 9 additions & 1 deletion classes/plugin/Controllers/Login/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,15 @@ public function taskForgot(): ResponseInterface
$fullname = $user->fullname ?: $username;
$author = $config->get('site.author.name', '');
$sitename = $config->get('site.title', 'Website');
$reset_link = $this->getAbsoluteAdminUrl("/reset/u/{$username}/{$token}");
$reset_route = "/reset/u/{$username}/{$token}";

$site_host = $config->get('plugins.login.site_host');
if (!empty($site_host)) {
$admin = $this->getAdmin();
$reset_link = rtrim($site_host, '/') . '/' . trim($admin->base, '/') . '/' . ltrim($reset_route, '/');
} else {
$reset_link = $this->getAbsoluteAdminUrl($reset_route);
}

// For testing only!
//Admin::DEBUG && Admin::addDebugMessage(sprintf('Reset link: %s', $reset_link));
Expand Down

0 comments on commit 1c5f763

Please sign in to comment.