progressive web app
This commit is contained in:
parent
b1f85eb050
commit
ae511610ec
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
|
@ -164,6 +164,10 @@ $_SESSION['header'] = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitiona
|
|||
$_SESSION['header'] .= "<html>\n<head>\n";
|
||||
$_SESSION['header'] .= "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . $encoding . "\">\n";
|
||||
$_SESSION['header'] .= "<meta http-equiv=\"pragma\" content=\"no-cache\">\n <meta http-equiv=\"cache-control\" content=\"no-cache\">";
|
||||
$manifestUrl = str_replace('/templates/login.php', '', getCallingURL());
|
||||
$manifestUrl = preg_replace('/http(s)?:\\/\\/([^\\/])+/', '', $manifestUrl);
|
||||
$manifestUrl = preg_replace('/\\?.*/', '', $manifestUrl);
|
||||
$_SESSION['header'] .= '<link rel="manifest" href="' . $manifestUrl . '/templates/manifest.php">';
|
||||
|
||||
/**
|
||||
* Displays the login window.
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
namespace LAM\PWA;
|
||||
/*
|
||||
|
||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||
Copyright (C) 2019 Roland Gruber
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* Manifest for progressive web app.
|
||||
*
|
||||
* @author Roland Gruber
|
||||
* @package tools
|
||||
*/
|
||||
|
||||
/** security functions */
|
||||
include_once(__DIR__ . "/../lib/security.inc");
|
||||
/** common functions */
|
||||
include_once(__DIR__ . "/../lib/account.inc");
|
||||
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
}
|
||||
|
||||
$baseUrl = getCallingURL();
|
||||
$baseUrl = str_replace('/templates/manifest.php', '', $baseUrl);
|
||||
$baseUrl = preg_replace('/\\?.*/', '', $baseUrl);
|
||||
$baseUrl = preg_replace('/http(s)?:\\/\\/([^\\/])+/', '', $baseUrl);
|
||||
|
||||
echo '{
|
||||
"short_name": "LAM",
|
||||
"name": "LDAP Account Manager",
|
||||
"icons": [
|
||||
{
|
||||
"src": "' . $baseUrl . '/graphics/logo_192x192.png",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192"
|
||||
},
|
||||
{
|
||||
"src": "' . $baseUrl . '/graphics/logo_512x512.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
}
|
||||
],
|
||||
"start_url": "' . $baseUrl . '?source=pwa",
|
||||
"display": "standalone"
|
||||
}';
|
Loading…
Reference in New Issue