move creds to env

This commit is contained in:
Paul Spenke
2023-07-10 21:34:23 +08:00
parent cd9dc85420
commit 726d691054
3 changed files with 3 additions and 3 deletions
+2
View File
@@ -8,3 +8,5 @@ database_password = plugi
database_charset = utf8
database_collation = utf8_unicode_ci
database_prefix =
USERNAME = admin
PASSWORD = admin
-2
View File
@@ -41,8 +41,6 @@ return [
'use_login' => true,
'class' => Plugi\Modules\Auth\Auth::class,
'url' => '/admin/auth',
'username' => 'admin',
'password' => 'admin'
],
/*
+1 -1
View File
@@ -15,7 +15,7 @@ class Auth implements AuthContract
{
if (phpb_in_module('auth')) {
if ($action === 'login' && isset($_POST['username']) && isset($_POST['password'])) {
if ($_POST['username'] === phpb_config('auth.username') && $_POST['password'] === phpb_config('auth.password')) {
if ($_POST['username'] === $_ENV['USERNAME'] && $_POST['password'] === $_ENV['PASSWORD']) {
$_SESSION['phpb_logged_in'] = true;
phpb_redirect(phpb_url('website_manager'));
} else {