| 1 |
<?php |
| 2 |
namespace LAM\PWA; |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
include_once(__DIR__ . "/../lib/security.inc"); |
| 33 |
|
| 34 |
include_once(__DIR__ . "/../lib/account.inc"); |
| 35 |
|
| 36 |
if (!headers_sent()) { |
| 37 |
header('Content-Type: application/json; charset=utf-8'); |
| 38 |
} |
| 39 |
|
| 40 |
$baseUrl = getCallingURL(); |
| 41 |
if (str_contains($baseUrl, '/templates/manifest.php')) { |
| 42 |
$baseUrl = substr($baseUrl, 0, strpos($baseUrl, '/templates/manifest.php')); |
| 43 |
$urlMatches = []; |
| 44 |
if (preg_match('/http(s)?:\\/\\/[^\\/]+(\\/.*)$/m', $baseUrl, $urlMatches)) { |
| 45 |
$baseUrl = htmlspecialchars($urlMatches[2]); |
| 46 |
} |
| 47 |
else { |
| 48 |
logNewMessage(LOG_ERR,'Unable to get base URL from ' . getCallingURL()); |
| 49 |
exit(); |
| 50 |
} |
| 51 |
} |
| 52 |
else { |
| 53 |
logNewMessage(LOG_ERR, 'Unable to get base URL from ' . getCallingURL()); |
| 54 |
exit(); |
| 55 |
} |
| 56 |
|
| 57 |
echo '{ |
| 58 |
"short_name": "LAM", |
| 59 |
"name": "LDAP Account Manager", |
| 60 |
"description": "LDAP Account Manager is a webfrontend for managing entries stored in an LDAP directory.", |
| 61 |
"icons": [ |
| 62 |
{ |
| 63 |
"src": "' . $baseUrl . '/graphics/logo_192x192.png", |
| 64 |
"type": "image/png", |
| 65 |
"sizes": "192x192" |
| 66 |
}, |
| 67 |
{ |
| 68 |
"src": "' . $baseUrl . '/graphics/logo_512x512.png", |
| 69 |
"type": "image/png", |
| 70 |
"sizes": "512x512" |
| 71 |
} |
| 72 |
], |
| 73 |
"screenshots" : [ |
| 74 |
{ |
| 75 |
"src": "' . $baseUrl . '/graphics/pwa_wide.png", |
| 76 |
"sizes": "1920x1080", |
| 77 |
"type": "image/png", |
| 78 |
"form_factor": "wide" |
| 79 |
}, |
| 80 |
{ |
| 81 |
"src": "' . $baseUrl . '/graphics/pwa_mobile.png", |
| 82 |
"sizes": "1170x2532", |
| 83 |
"type": "image/png", |
| 84 |
"form_factor": "narrow" |
| 85 |
} |
| 86 |
], |
| 87 |
"start_url": "' . $baseUrl . '/templates/login.php", |
| 88 |
"display": "standalone", |
| 89 |
"orientation": "any", |
| 90 |
"theme_color": "#ffffff", |
| 91 |
"background_color": "#ffffff", |
| 92 |
"categories": [ |
| 93 |
"security", |
| 94 |
"utilities" |
| 95 |
] |
| 96 |
}'; |