From 763e17f491218eeb972840b4649f651cc5a5dab1 Mon Sep 17 00:00:00 2001 From: johnson-yi <63399474+johnson-yi@users.noreply.github.com> Date: Wed, 24 Feb 2021 06:05:22 +1100 Subject: [PATCH 1/3] Added saml custom setting retrieveParametersFromServer to enable fixing SLO issues with Azure AD (#9187) --- app/Http/Controllers/Auth/SamlController.php | 3 ++- app/Services/Saml.php | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Auth/SamlController.php b/app/Http/Controllers/Auth/SamlController.php index 48c8d05ab8..5a2075daed 100644 --- a/app/Http/Controllers/Auth/SamlController.php +++ b/app/Http/Controllers/Auth/SamlController.php @@ -128,7 +128,8 @@ class SamlController extends Controller public function sls(Request $request) { $auth = $this->saml->getAuth(); - $sloUrl = $auth->processSLO(true, null, null, null, true); + $retrieveParametersFromServer = $this->saml->getSetting('retrieveParametersFromServer', false); + $sloUrl = $auth->processSLO(true, null, $retrieveParametersFromServer, null, true); $errors = $auth->getErrors(); if (!empty($errors)) { diff --git a/app/Services/Saml.php b/app/Services/Saml.php index bb6c24cffb..fa2eb13105 100644 --- a/app/Services/Saml.php +++ b/app/Services/Saml.php @@ -324,6 +324,20 @@ class Saml return $this->_auth; } + /** + * Get a setting. + * + * @author Johnson Yi + * + * @param string|array|int $key + * @param mixed $default + * + * @return void + */ + public function getSetting($key, $default = null) { + return data_get($this->_settings, $key, $default); + } + /** * Gets the SP metadata. The XML representation. * From c3166d491ae368f1a9d32b6c48203cf0b2483f78 Mon Sep 17 00:00:00 2001 From: Oliver Walerys Date: Tue, 23 Feb 2021 17:49:40 -0500 Subject: [PATCH 2/3] [FIX] Lite test email won't use the mail component (#9092) * [FIX] Lite test email won't use the mail component * Revert "[FIX] Lite test email won't use the mail component" This reverts commit 6dab9aa1a8cd4addfc7af65f2f7a2f1a0d6d2531. * Fix check for snipeSettings * Remove random text from message template * Revert "Fix check for snipeSettings" This reverts commit 887dcc7bbc4df199da545950bdee661e4d662a13. * Fix test notification with setupCompleted --- resources/views/notifications/Test.blade.php | 4 ++++ resources/views/vendor/mail/markdown/message.blade.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/views/notifications/Test.blade.php b/resources/views/notifications/Test.blade.php index e4e479846f..0f58a54926 100644 --- a/resources/views/notifications/Test.blade.php +++ b/resources/views/notifications/Test.blade.php @@ -1,7 +1,11 @@ +@if ($setupCompleted = \App\Models\Setting::setupCompleted()) @component('mail::message') +@endif {{ trans('mail.test_mail_text') }} Thanks, Snipe-IT +@if ($setupCompleted) @endcomponent +@endif diff --git a/resources/views/vendor/mail/markdown/message.blade.php b/resources/views/vendor/mail/markdown/message.blade.php index 862611099e..0fcfba938c 100644 --- a/resources/views/vendor/mail/markdown/message.blade.php +++ b/resources/views/vendor/mail/markdown/message.blade.php @@ -45,7 +45,7 @@ Snipe-IT @endif @if ($snipeSettings->privacy_policy_link!='') -{{ trans('admin/settings/general.privacy_policy') }}ldfkgjg +{{ trans('admin/settings/general.privacy_policy') }} @endif @endcomponent From db3f80bb9b20d944e4fe15b57b9da2955326c340 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 24 Feb 2021 09:10:03 -0800 Subject: [PATCH 3/3] Fixed #9198 - added stdout as a log driver --- config/logging.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/logging.php b/config/logging.php index 86641787c0..b57af6ade6 100644 --- a/config/logging.php +++ b/config/logging.php @@ -67,6 +67,12 @@ return [ ], ], + 'stdout' => [ + 'driver' => 'monolog', + 'handler' => StreamHandler::class, + 'with' => [ 'stream' => 'php://stdout', ], + ], + 'syslog' => [ 'driver' => 'syslog', 'level' => env('APP_LOG_LEVEL', 'error'),