From 4be3f9b33d6cea3d71bf8faf54966280654607dc Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Sun, 25 Aug 2019 20:17:32 -0500 Subject: [PATCH] HaveEsiScope had issues --- app/Library/Esi/Esi.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/Library/Esi/Esi.php b/app/Library/Esi/Esi.php index 333692940..be72b846f 100644 --- a/app/Library/Esi/Esi.php +++ b/app/Library/Esi/Esi.php @@ -42,19 +42,19 @@ class Esi { //Check for an esi scope $check = EsiScope::where(['character_id' => $charId, 'scope' => $scope])->count(); if($check == 0) { - return true; + //Compose a mail to send to the user if the scope is not found + $mail = new EveMail; + $mail->sender = $config['primary']; + $mail->subject = 'W4RP Services - Incorrect ESI Scope'; + $mail->body = "Please register on https://services.w4rp.space with the scope: " . $scope; + $mail->recipient = (int)$charId; + $mail->recipient_type = 'character'; + + ProcessSendEveMailJob::dispatch($mail)->onQueue('mail')->delay(Carbon::now()->addSeconds(5)); + return false; } - $mail = new EveMail; - $mail->sender = $config['primary']; - $mail->subject = 'W4RP Services - Incorrect ESI Scope'; - $mail->body = "Please register on https://services.w4rp.space with the scope: " . $scope; - $mail->recipient = (int)$charId; - $mail->recipient_type = 'character'; - - ProcessSendEveMailJob::dispatch($mail)->onQueue('mail')->delay(Carbon::now()->addSeconds(5)); - - return false; + return true; } public function GetCharacterData($charId) {