This commit is contained in:
Dennis Eichhorn 2023-09-10 18:58:34 +00:00
parent 17b5457f57
commit 46dc356074
3 changed files with 28 additions and 6 deletions

View File

@ -9,13 +9,13 @@
"l11n": {
"en": {
"subject": "ORW Resource Change",
"body": "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Resource Change</title></head><body style=\"font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5;\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td><table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"600\" style=\"margin: 0 auto; background-color: #ffffff;\"><tr><td style=\"padding: 40px 0; text-align: center;\"><h1 style=\"margin-top: 0; color: #000000; font-size: 24px;\">Resource Change</h1><p style=\"margin-bottom: 20px;\">The resource {resource.url} changed.</p><p style=\"margin-top: 40px;\">This email is sent to you from {owner_email}, if you don't wan't to receive these emails click <a href=\"https://orw.jingga.app/unsubscribe?email={email}&resource={resource.id}\">here</a></p><p style=\"margin-top: 40px;\">Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn</p></td></tr></table></td></tr></table></body></html>",
"bodyalt": "Resource Change\n\nThe resource {resource.url} changed.\n\n\nThis email is sent to you from {owner_email}, if you don't wan't to receive these emails visit https://orw.jingga.app/unsubscribe?email={email}&resource={resource.id}\n\n\nJingga e.K. - www.jingga.app - CEO Dennis Eichhorn"
"body": "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Resource Change</title></head><body style=\"font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5;\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td><table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"600\" style=\"margin: 0 auto; background-color: #ffffff;\"><tr><td style=\"padding: 40px 0; text-align: center;\"><h1 style=\"margin-top: 0; color: #000000; font-size: 24px;\">Resource Change</h1><p style=\"margin-bottom: 20px;\">The resource {resource.url} changed.</p><p style=\"margin-top: 40px;\">This email is sent to you from {owner_email}, if you don't wan't to receive these emails click <a href=\"https://orw.jingga.app/unsubscribe?email={email}&resource={resource.id}\">here</a></p><p style=\"margin-top: 40px;\">Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058</p></td></tr></table></td></tr></table></body></html>",
"bodyalt": "Resource Change\n\nThe resource {resource.url} changed.\n\n\nThis email is sent to you from {owner_email}, if you don't wan't to receive these emails visit https://orw.jingga.app/unsubscribe?email={email}&resource={resource.id}\n\n\nJingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058"
},
"de": {
"subject": "Ressourcenänderung",
"body": "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Ressourcenänderung</title></head><body style=\"font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5;\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td><table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"600\" style=\"margin: 0 auto; background-color: #ffffff;\"><tr><td style=\"padding: 40px 0; text-align: center;\"><h1 style=\"margin-top: 0; color: #000000; font-size: 24px;\">Ressourcenänderung</h1><p style=\"margin-bottom: 20px;\">Die Ressource {resource.url} hat sich geändert.</p><p style=\"margin-top: 40px;\">Diese E-Mail wird Ihnen von {owner_email} gesendet. Wenn Sie diese E-Mails nicht mehr erhalten möchten, klicken Sie <a href=\"https://orw.jingga.app/unsubscribe?email={email}&resource={resource.id}\">hier</a>.</p><p style=\"margin-top: 40px;\">Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn</p></td></tr></table></td></tr></table></body></html>",
"bodyalt": "Ressourcenänderung\n\nDie Ressource {resource.url} hat sich geändert.\n\nDiese E-Mail wird Ihnen von {owner_email} gesendet. Wenn Sie diese E-Mails nicht mehr erhalten möchten, besuchen Sie https://orw.jingga.app/unsubscribe?email={email}&resource={resource.id}\n\n\nJingga e.K. - www.jingga.app - CEO Dennis Eichhorn"
"body": "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Ressourcenänderung</title></head><body style=\"font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5;\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td><table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"600\" style=\"margin: 0 auto; background-color: #ffffff;\"><tr><td style=\"padding: 40px 0; text-align: center;\"><h1 style=\"margin-top: 0; color: #000000; font-size: 24px;\">Ressourcenänderung</h1><p style=\"margin-bottom: 20px;\">Die Ressource {resource.url} hat sich geändert.</p><p style=\"margin-top: 40px;\">Diese E-Mail wird Ihnen von {owner_email} gesendet. Wenn Sie diese E-Mails nicht mehr erhalten möchten, klicken Sie <a href=\"https://orw.jingga.app/unsubscribe?email={email}&resource={resource.id}\">hier</a>.</p><p style=\"margin-top: 40px;\">Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058</p></td></tr></table></td></tr></table></body></html>",
"bodyalt": "Ressourcenänderung\n\nDie Ressource {resource.url} hat sich geändert.\n\nDiese E-Mail wird Ihnen von {owner_email} gesendet. Wenn Sie diese E-Mails nicht mehr erhalten möchten, besuchen Sie https://orw.jingga.app/unsubscribe?email={email}&resource={resource.id}\n\n\nJingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058"
}
},
"send": false

View File

@ -57,6 +57,27 @@ return [
],
],
'^.*/orw/resource/inform.*$' => [
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\ApiController:apiInformCreate',
'verb' => RouteVerb::PUT,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::READ,
'state' => PermissionCategory::RESOURCE,
],
],
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\ApiController:apiInformDelete',
'verb' => RouteVerb::DELETE,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::READ,
'state' => PermissionCategory::RESOURCE,
],
],
],
'^.*/orw/resource/render.*$' => [
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\ApiController:apiResourceRender',

View File

@ -410,8 +410,9 @@ final class ApiController extends Controller
continue;
}
$extension = ($pos = \strrpos($file, '.')) !== false ? \substr($file, $pos + 1) : '';
$possibleExtension = MimeType::mimeToExtension(\mime_content_type($path . '/' . $file));
$extension = ($pos = \strrpos($file, '.')) === false ? '' : \substr($file, $pos + 1);
$mimeContentType = \mime_content_type($path . '/' . $file);
$possibleExtension = MimeType::mimeToExtension($mimeContentType === false ? '' : $mimeContentType);
$newFileName = FileUtils::makeSafeFileName($file);
if ($possibleExtension !== null && $possibleExtension !== $extension) {