diff --git a/app/Config/Routes.php b/app/Config/Routes.php index b58214f..99fda13 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -16,7 +16,7 @@ $routes->post('acs', 'SamlController::acs'); $routes->post('logout', 'SamlController::slo'); $routes->get('metadata', 'SamlController::metadata'); - +$routes->get('auth/msRedirectionHandler', 'AuthController::msRedirectionHandler'); $routes->group('api', ['filter' => 'appSignature'], function ($routes) { @@ -24,7 +24,7 @@ $routes->group('api', ['filter' => 'appSignature'], function ($routes) { $routes->post('auth/login', 'AuthController::login'); $routes->get('auth/oauthClient', 'AuthController::oauthClient'); $routes->post('auth/oauthlogin', 'AuthController::oauthlogin'); -$routes->get('auth/msRedirectionHandler', 'AuthController::msRedirectionHandler'); + // MS OAuth api's $routes->get('auth/mslogin', 'AuthController::mslogin'); diff --git a/app/Helpers/mail_helper.php b/app/Helpers/mail_helper.php index 26f096c..66017ed 100644 --- a/app/Helpers/mail_helper.php +++ b/app/Helpers/mail_helper.php @@ -659,13 +659,15 @@ if (!function_exists('send_email')) { $attachments = []; - $filePath = WRITEPATH . 'pdf/trips/trip_' . $planData['plan_id'] . '.pdf'; - if (!empty($filePath) && file_exists($filePath) && is_readable($filePath)) { - $attachments[] = [ - "content" => base64_encode(file_get_contents($filePath)), - "mime_type" => "application/pdf", - "name" => basename($filePath) - ]; + if (!empty($planData)) { + $filePath = WRITEPATH . 'pdf/trips/trip_' . $planData['plan_id'] . '.pdf'; + if (!empty($filePath) && file_exists($filePath) && is_readable($filePath)) { + $attachments[] = [ + "content" => base64_encode(file_get_contents($filePath)), + "mime_type" => "application/pdf", + "name" => basename($filePath) + ]; + } } $payload = [