From b45b6cb1e529cce32d2f537f0c5d41264c31ac82 Mon Sep 17 00:00:00 2001 From: Refringe Date: Sat, 1 Jun 2024 23:51:22 -0400 Subject: [PATCH] Fixes Logins --- app/Console/Commands/ImportWoltlabData.php | 8 +++- resources/views/navigation-menu.blade.php | 49 +++++++++++----------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/app/Console/Commands/ImportWoltlabData.php b/app/Console/Commands/ImportWoltlabData.php index d6ada15..588ab1e 100644 --- a/app/Console/Commands/ImportWoltlabData.php +++ b/app/Console/Commands/ImportWoltlabData.php @@ -109,7 +109,7 @@ class ImportWoltlabData extends Command 'hub_id' => $wolt->userID, 'name' => $wolt->username, 'email' => mb_convert_case($wolt->email, MB_CASE_LOWER, 'UTF-8'), - 'password' => $wolt->password, + 'password' => $this->cleanPasswordHash($wolt->password), 'created_at' => $registrationDate, 'updated_at' => now('UTC')->toDateTimeString(), ]; @@ -128,6 +128,12 @@ class ImportWoltlabData extends Command $this->info('Total users processed: '.$totalInserted); } + protected function cleanPasswordHash(string $password): string + { + // The WoltLab password hash sometimes? has a prefix of the hash type. We only want the hash. + return str_replace(['Bcrypt:', 'cryptMD5:', 'cryptMD5::'], '', $password); + } + protected function importLicenses(): void { $totalInserted = 0; diff --git a/resources/views/navigation-menu.blade.php b/resources/views/navigation-menu.blade.php index 85ff270..261b36b 100644 --- a/resources/views/navigation-menu.blade.php +++ b/resources/views/navigation-menu.blade.php @@ -19,37 +19,36 @@