-
-
Notifications
You must be signed in to change notification settings - Fork 558
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
remove hard-coded /admin/ path #2461
Conversation
9ae202b
to
b8392c5
Compare
@rdwebdesign I think this PR is up your alley. Is this error perhaps due to recent changes elsewhere which broke CI for the pi-hole repo?
|
Where can I see the errors during linting from my changes to password.php?
|
138c6e2
to
d2678b6
Compare
This error was already fixed on development branch ( You need to base your code (and target your PR) on |
d2678b6
to
8270a7f
Compare
Okay. Updated PR and rebased on (The |
803e119
to
a73d9be
Compare
It would appear that stickler-ci part of the tests is hung or extremely backlogged. |
Once it started, it took 3 seconds. Before it started, it sat almost 30 mins in the queue Anyway, I made the change you requested. |
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
a73d9be
to
d94d86b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. It surprises me that it's taken until php 8 to have handy functions such as str_ends_with
, or even str_contains
I suppose after seeing this SO answer we could do something like:
if ($_SERVER['REQUEST_METHOD'] === 'POST' && strpos($_SERVER['SCRIPT_NAME'], '/login.php) == false) {
header('Location: '.$redirect_url);
exit;
}
But really that's just nitpicking on my part. Happy with code as is
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-web-v5-18-2-and-core-v5-15-1-released/60695/1 |
What does this PR aim to accomplish?:
remove hard-coded /admin/ path; relocatable
This does not change or require any changes to where pi-hole installs AdminLTE, which at the moment is
/var/www/html/admin/
, and accessed viahttp://pi.hole/admin/
, but this change allows an administrator to manually place the files elsewhere, and to allow the same functionality when accessed from an alternative url-path, e.g.http://localhost/pihole/admin/
, a url-path less likely to conflict with an already existing website.This PR uses a suffix match for
/login.php
rather than exact match/admin/login.php
By submitting this pull request, I confirm the following:
git rebase
)