├── resources ├── modifiers.ini └── images │ ├── favicon.ico │ ├── background.jpg │ ├── logo-G-100.png │ ├── logo-GLPI-100.png │ └── logo-GLPI-250.png ├── .gitignore ├── locales ├── de_DE.mo ├── en_GB.mo ├── it_IT.mo ├── mod.pot ├── it_IT.po ├── en_GB.po └── de_DE.po ├── readme ├── i-vertix.png └── ui-branding.png ├── composer.json ├── COPYRIGHT ├── public ├── css │ └── mod_anonymous.css └── background.php ├── front ├── uibranding.php └── resource.send.php ├── hook.php ├── setup.php ├── README.md ├── src ├── UIBranding.php └── BrandManager.php ├── templates └── uibranding.html.twig ├── composer.lock └── LICENSE.txt /resources/modifiers.ini: -------------------------------------------------------------------------------- 1 | title=GLPI 2 | login=0 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | node_modules/ 3 | tests/files/_logs/*.log 4 | vendor/ 5 | .gh_token 6 | .idea/ -------------------------------------------------------------------------------- /locales/de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Vertix/glpi-modifications/HEAD/locales/de_DE.mo -------------------------------------------------------------------------------- /locales/en_GB.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Vertix/glpi-modifications/HEAD/locales/en_GB.mo -------------------------------------------------------------------------------- /locales/it_IT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Vertix/glpi-modifications/HEAD/locales/it_IT.mo -------------------------------------------------------------------------------- /readme/i-vertix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Vertix/glpi-modifications/HEAD/readme/i-vertix.png -------------------------------------------------------------------------------- /readme/ui-branding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Vertix/glpi-modifications/HEAD/readme/ui-branding.png -------------------------------------------------------------------------------- /resources/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Vertix/glpi-modifications/HEAD/resources/images/favicon.ico -------------------------------------------------------------------------------- /resources/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Vertix/glpi-modifications/HEAD/resources/images/background.jpg -------------------------------------------------------------------------------- /resources/images/logo-G-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Vertix/glpi-modifications/HEAD/resources/images/logo-G-100.png -------------------------------------------------------------------------------- /resources/images/logo-GLPI-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Vertix/glpi-modifications/HEAD/resources/images/logo-GLPI-100.png -------------------------------------------------------------------------------- /resources/images/logo-GLPI-250.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Vertix/glpi-modifications/HEAD/resources/images/logo-GLPI-250.png -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "php": ">=8.2" 4 | }, 5 | "require-dev": { 6 | "glpi-project/tools": "^0.8" 7 | }, 8 | "config": { 9 | "optimize-autoloader": true, 10 | "platform": { 11 | "php": "8.2.99" 12 | }, 13 | "sort-packages": true 14 | }, 15 | "autoload": { 16 | "psr-4": { 17 | "GlpiPlugin\\Mod\\": "src" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------- 2 | UI Branding plugin for GLPI 3 | ------------------------------------------------------------------------- 4 | 5 | LICENSE 6 | 7 | This file is part of UI Branding plugin for GLPI. 8 | 9 | "UI Branding plugin for GLPI" is free software; you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation; either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | "UI Branding plugin for GLPI" is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with "UI Branding plugin for GLPI". If not, see . 21 | ------------------------------------------------------------------------- 22 | @copyright Copyright (C) 2025 by i-Vertix/PGUM. 23 | @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 24 | @link https://github.com/i-Vertix/glpi-modifications 25 | ------------------------------------------------------------------------- -------------------------------------------------------------------------------- /public/css/mod_anonymous.css: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------------------------------- 3 | * UI Branding plugin for GLPI 4 | * ------------------------------------------------------------------------- 5 | * 6 | * LICENSE 7 | * 8 | * This file is part of UI Branding plugin for GLPI. 9 | * 10 | * "UI Branding plugin for GLPI" is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * "UI Branding plugin for GLPI" is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with "UI Branding plugin for GLPI". If not, see . 22 | * ------------------------------------------------------------------------- 23 | * @copyright Copyright (C) 2025 by i-Vertix/PGUM. 24 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 25 | * @link https://github.com/i-Vertix/glpi-modifications 26 | * ------------------------------------------------------------------------- 27 | */ 28 | 29 | .welcome-anonymous { 30 | background: url(../background.php) no-repeat fixed top; 31 | background-size: cover; 32 | } -------------------------------------------------------------------------------- /front/uibranding.php: -------------------------------------------------------------------------------- 1 | . 24 | * ------------------------------------------------------------------------- 25 | * @copyright Copyright (C) 2025 by i-Vertix/PGUM. 26 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 27 | * @link https://github.com/i-Vertix/glpi-modifications 28 | * ------------------------------------------------------------------------- 29 | */ 30 | 31 | use GlpiPlugin\Mod\UIBranding; 32 | 33 | Session::checkRight("config", UPDATE); 34 | 35 | if (Plugin::isPluginActive("mod")) { 36 | $uiBranding = new UIBranding(); 37 | 38 | Session::checkRight("config", UPDATE); 39 | 40 | if (isset($_POST["update"])) { 41 | $uiBranding->save($_POST, $_FILES); 42 | Html::back(); 43 | } else { 44 | Html::header("UI Branding", '', "config", "plugin", "mod"); 45 | $uiBranding->display(); 46 | Html::footer(); 47 | } 48 | } else { 49 | Html::header(__('Setup'), '', "config", "plugin"); 50 | echo "
"; 51 | echo "" . __('Please activate the plugin', 'mod') . "
"; 52 | Html::footer(); 53 | } 54 | -------------------------------------------------------------------------------- /locales/mod.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2025-10-16 23:53+0200\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: templates/uibranding.html.twig 21 | msgid "UI Branding" 22 | msgstr "" 23 | 24 | #: templates/uibranding.html.twig 25 | msgid "Apply Modifications" 26 | msgstr "" 27 | 28 | #: templates/uibranding.html.twig 29 | msgid "Page Title" 30 | msgstr "" 31 | 32 | #: templates/uibranding.html.twig 33 | msgid "Show login background" 34 | msgstr "" 35 | 36 | #: templates/uibranding.html.twig 37 | msgid "Show custom logos" 38 | msgstr "" 39 | 40 | #: templates/uibranding.html.twig 41 | msgid "Show custom favicon" 42 | msgstr "" 43 | 44 | #: templates/uibranding.html.twig 45 | msgid "Custom Images" 46 | msgstr "" 47 | 48 | #: templates/uibranding.html.twig 49 | msgid "Background (min. 1920x1080 - JPG)" 50 | msgstr "" 51 | 52 | #: templates/uibranding.html.twig 53 | msgid "Background" 54 | msgstr "" 55 | 56 | #: templates/uibranding.html.twig 57 | msgid "Small Logo (53x53 - PNG)" 58 | msgstr "" 59 | 60 | #: templates/uibranding.html.twig 61 | msgid "Small Logo" 62 | msgstr "" 63 | 64 | #: templates/uibranding.html.twig 65 | msgid "Medium Logo (100x55 - PNG)" 66 | msgstr "" 67 | 68 | #: templates/uibranding.html.twig 69 | msgid "Medium Logo" 70 | msgstr "" 71 | 72 | #: templates/uibranding.html.twig 73 | msgid "Large Logo (250x138 - PNG)" 74 | msgstr "" 75 | 76 | #: templates/uibranding.html.twig 77 | msgid "Large Logo" 78 | msgstr "" 79 | 80 | #: templates/uibranding.html.twig 81 | msgid "Favicon (16x16 - ICO)" 82 | msgstr "" 83 | 84 | #: templates/uibranding.html.twig 85 | msgid "Favicon" 86 | msgstr "" 87 | 88 | #: front/uibranding.php:51 89 | msgid "Please activate the plugin" 90 | msgstr "" 91 | -------------------------------------------------------------------------------- /front/resource.send.php: -------------------------------------------------------------------------------- 1 | . 24 | * ------------------------------------------------------------------------- 25 | * @copyright Copyright (C) 2025 by i-Vertix/PGUM. 26 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 27 | * @link https://github.com/i-Vertix/glpi-modifications 28 | * ------------------------------------------------------------------------- 29 | */ 30 | 31 | use Glpi\Exception\Http\AccessDeniedHttpException; 32 | use GlpiPlugin\Mod\BrandManager; 33 | use function Safe\readfile; 34 | 35 | if (!Plugin::isPluginActive("mod")) { 36 | throw new AccessDeniedHttpException(); 37 | } 38 | 39 | Session::checkRight("config", UPDATE); 40 | 41 | $key = $_GET['resource'] ?? ''; 42 | if ($key === "" || !isset(BrandManager::IMAGE_RESOURCES[$key]["current"]) || !file_exists(BrandManager::IMAGE_RESOURCES[$key]["current"])) { 43 | throw new AccessDeniedHttpException(); 44 | } 45 | 46 | $file = BrandManager::IMAGE_RESOURCES[$key]["current"]; 47 | 48 | header('Content-Type: ' . Toolbox::getMime($file)); 49 | header('Cache-Control: no-store, no-cache, must-revalidate'); 50 | header('Pragma: no-cache'); 51 | header('Expires: Sun, 30 Jan 1966 06:30:00 GMT'); 52 | header('Content-disposition: filename="' . basename($file) . '"'); 53 | 54 | readfile($file); 55 | -------------------------------------------------------------------------------- /public/background.php: -------------------------------------------------------------------------------- 1 | . 24 | * ------------------------------------------------------------------------- 25 | * @copyright Copyright (C) 2025 by i-Vertix/PGUM. 26 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 27 | * @link https://github.com/i-Vertix/glpi-modifications 28 | * ------------------------------------------------------------------------- 29 | */ 30 | 31 | use Symfony\Component\HttpFoundation\Request; 32 | use Symfony\Component\HttpFoundation\Response; 33 | use Symfony\Component\HttpFoundation\BinaryFileResponse; 34 | use Symfony\Component\HttpFoundation\ResponseHeaderBag; 35 | 36 | $file = GLPI_PLUGIN_DOC_DIR . "/mod/images/background.jpg"; 37 | 38 | if (!file_exists($file)) { 39 | return new Response('Image not found', 404); 40 | } 41 | 42 | // remove existing conflicting headers 43 | if (!headers_sent()) { 44 | header_remove('Pragma'); 45 | header_remove('Expires'); 46 | header_remove('Cache-Control'); 47 | } 48 | 49 | $response = new BinaryFileResponse($file); 50 | $response->setPublic(); 51 | $response->setMaxAge(31536000); 52 | $response->setSharedMaxAge(31536000); 53 | $response->mustRevalidate(); 54 | $response->setEtag(md5_file($file)); 55 | $response->setAutoLastModified(); 56 | $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_INLINE); 57 | $response->isNotModified(Request::createFromGlobals()); 58 | return $response; 59 | -------------------------------------------------------------------------------- /locales/it_IT.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: \n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2025-10-16 23:53+0200\n" 12 | "PO-Revision-Date: 2025-10-16 23:54+0200\n" 13 | "Last-Translator: \n" 14 | "Language-Team: \n" 15 | "Language: it_IT\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "X-Generator: Poedit 3.6\n" 20 | 21 | #: templates/uibranding.html.twig 22 | msgid "UI Branding" 23 | msgstr "UI Branding" 24 | 25 | #: templates/uibranding.html.twig 26 | msgid "Apply Modifications" 27 | msgstr "Applicare le modifiche" 28 | 29 | #: templates/uibranding.html.twig 30 | msgid "Page Title" 31 | msgstr "Titolo Pagina" 32 | 33 | #: templates/uibranding.html.twig 34 | msgid "Show login background" 35 | msgstr "Mostra lo sfondo del login" 36 | 37 | #: templates/uibranding.html.twig 38 | msgid "Show custom logos" 39 | msgstr "Mostra loghi personalizzati" 40 | 41 | #: templates/uibranding.html.twig 42 | msgid "Show custom favicon" 43 | msgstr "Mostra la favicon personalizzata" 44 | 45 | #: templates/uibranding.html.twig 46 | msgid "Custom Images" 47 | msgstr "Immagini personalizzate" 48 | 49 | #: templates/uibranding.html.twig 50 | msgid "Background (min. 1920x1080 - JPG)" 51 | msgstr "Sfondo (min. 1920x1080 - JPG)" 52 | 53 | #: templates/uibranding.html.twig 54 | msgid "Background" 55 | msgstr "Sfondo" 56 | 57 | #: templates/uibranding.html.twig 58 | msgid "Small Logo (53x53 - PNG)" 59 | msgstr "Logo piccolo (53x53 - PNG)" 60 | 61 | #: templates/uibranding.html.twig 62 | msgid "Small Logo" 63 | msgstr "Logo piccolo" 64 | 65 | #: templates/uibranding.html.twig 66 | msgid "Medium Logo (100x55 - PNG)" 67 | msgstr "Logo medio (100x55 - PNG)" 68 | 69 | #: templates/uibranding.html.twig 70 | msgid "Medium Logo" 71 | msgstr "Logo medio" 72 | 73 | #: templates/uibranding.html.twig 74 | msgid "Large Logo (250x138 - PNG)" 75 | msgstr "Logo grande (250x138 - PNG)" 76 | 77 | #: templates/uibranding.html.twig 78 | msgid "Large Logo" 79 | msgstr "Logo grande" 80 | 81 | #: templates/uibranding.html.twig 82 | msgid "Favicon (16x16 - ICO)" 83 | msgstr "Favicon (16x16 - ICO)" 84 | 85 | #: templates/uibranding.html.twig 86 | msgid "Favicon" 87 | msgstr "Favicon" 88 | 89 | #: front/uibranding.php:51 90 | msgid "Please activate the plugin" 91 | msgstr "Per favore attivare il plugin" 92 | -------------------------------------------------------------------------------- /locales/en_GB.po: -------------------------------------------------------------------------------- 1 | # English translations for PACKAGE package. 2 | # Copyright (C) 2025 THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # Automatically generated, 2025. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: PACKAGE VERSION\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-10-16 23:53+0200\n" 11 | "PO-Revision-Date: 2025-10-16 23:53+0200\n" 12 | "Last-Translator: Automatically generated\n" 13 | "Language-Team: none\n" 14 | "Language: en_GB\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #: templates/uibranding.html.twig 21 | msgid "UI Branding" 22 | msgstr "UI Branding" 23 | 24 | #: templates/uibranding.html.twig 25 | msgid "Apply Modifications" 26 | msgstr "Apply Modifications" 27 | 28 | #: templates/uibranding.html.twig 29 | msgid "Page Title" 30 | msgstr "Page Title" 31 | 32 | #: templates/uibranding.html.twig 33 | msgid "Show login background" 34 | msgstr "Show login background" 35 | 36 | #: templates/uibranding.html.twig 37 | msgid "Show custom logos" 38 | msgstr "Show custom logos" 39 | 40 | #: templates/uibranding.html.twig 41 | msgid "Show custom favicon" 42 | msgstr "Show custom favicon" 43 | 44 | #: templates/uibranding.html.twig 45 | msgid "Custom Images" 46 | msgstr "Custom Images" 47 | 48 | #: templates/uibranding.html.twig 49 | msgid "Background (min. 1920x1080 - JPG)" 50 | msgstr "Background (min. 1920x1080 - JPG)" 51 | 52 | #: templates/uibranding.html.twig 53 | msgid "Background" 54 | msgstr "Background" 55 | 56 | #: templates/uibranding.html.twig 57 | msgid "Small Logo (53x53 - PNG)" 58 | msgstr "Small Logo (53x53 - PNG)" 59 | 60 | #: templates/uibranding.html.twig 61 | msgid "Small Logo" 62 | msgstr "Small Logo" 63 | 64 | #: templates/uibranding.html.twig 65 | msgid "Medium Logo (100x55 - PNG)" 66 | msgstr "Medium Logo (100x55 - PNG)" 67 | 68 | #: templates/uibranding.html.twig 69 | msgid "Medium Logo" 70 | msgstr "Medium Logo" 71 | 72 | #: templates/uibranding.html.twig 73 | msgid "Large Logo (250x138 - PNG)" 74 | msgstr "Large Logo (250x138 - PNG)" 75 | 76 | #: templates/uibranding.html.twig 77 | msgid "Large Logo" 78 | msgstr "Large Logo" 79 | 80 | #: templates/uibranding.html.twig 81 | msgid "Favicon (16x16 - ICO)" 82 | msgstr "Favicon (16x16 - ICO)" 83 | 84 | #: templates/uibranding.html.twig 85 | msgid "Favicon" 86 | msgstr "Favicon" 87 | 88 | #: front/uibranding.php:51 89 | msgid "Please activate the plugin" 90 | msgstr "Please activate the plugin" 91 | -------------------------------------------------------------------------------- /locales/de_DE.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: \n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2025-10-16 23:53+0200\n" 12 | "PO-Revision-Date: 2025-10-16 23:55+0200\n" 13 | "Last-Translator: \n" 14 | "Language-Team: \n" 15 | "Language: de_DE\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "X-Generator: Poedit 3.6\n" 20 | 21 | #: templates/uibranding.html.twig 22 | msgid "UI Branding" 23 | msgstr "UI Branding" 24 | 25 | #: templates/uibranding.html.twig 26 | msgid "Apply Modifications" 27 | msgstr "Modifikationen anwenden" 28 | 29 | #: templates/uibranding.html.twig 30 | msgid "Page Title" 31 | msgstr "Seitentitel" 32 | 33 | #: templates/uibranding.html.twig 34 | msgid "Show login background" 35 | msgstr "Login Hintergrund anwenden" 36 | 37 | #: templates/uibranding.html.twig 38 | msgid "Show custom logos" 39 | msgstr "Benutzerdefinierte Logos anzeigen" 40 | 41 | #: templates/uibranding.html.twig 42 | msgid "Show custom favicon" 43 | msgstr "Benutzerdefiniertes Favicon anzeigen" 44 | 45 | #: templates/uibranding.html.twig 46 | msgid "Custom Images" 47 | msgstr "Benutzerdefinierte Bilder" 48 | 49 | #: templates/uibranding.html.twig 50 | msgid "Background (min. 1920x1080 - JPG)" 51 | msgstr "Hintergrund (min. 1920x1080 - JPG)" 52 | 53 | #: templates/uibranding.html.twig 54 | msgid "Background" 55 | msgstr "Hintergrund" 56 | 57 | #: templates/uibranding.html.twig 58 | msgid "Small Logo (53x53 - PNG)" 59 | msgstr "Kleines Logo (53x53 - PNG)" 60 | 61 | #: templates/uibranding.html.twig 62 | msgid "Small Logo" 63 | msgstr "Kleines Logo" 64 | 65 | #: templates/uibranding.html.twig 66 | msgid "Medium Logo (100x55 - PNG)" 67 | msgstr "Größeres Logo (100x55 - PNG)" 68 | 69 | #: templates/uibranding.html.twig 70 | msgid "Medium Logo" 71 | msgstr "Größeres Logo" 72 | 73 | #: templates/uibranding.html.twig 74 | msgid "Large Logo (250x138 - PNG)" 75 | msgstr "Großes Logo (250x138 - PNG)" 76 | 77 | #: templates/uibranding.html.twig 78 | msgid "Large Logo" 79 | msgstr "Großes Logo" 80 | 81 | #: templates/uibranding.html.twig 82 | msgid "Favicon (16x16 - ICO)" 83 | msgstr "Favicon (16x16 - ICO)" 84 | 85 | #: templates/uibranding.html.twig 86 | msgid "Favicon" 87 | msgstr "Favicon" 88 | 89 | #: front/uibranding.php:51 90 | msgid "Please activate the plugin" 91 | msgstr "Bitte aktivieren Sie das Plugin" 92 | -------------------------------------------------------------------------------- /hook.php: -------------------------------------------------------------------------------- 1 | . 24 | * ------------------------------------------------------------------------- 25 | * @copyright Copyright (C) 2025 by i-Vertix/PGUM. 26 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 27 | * @link https://github.com/i-Vertix/glpi-modifications 28 | * ------------------------------------------------------------------------- 29 | */ 30 | 31 | use GlpiPlugin\Mod\BrandManager; 32 | 33 | /** 34 | * Plugin install process 35 | * 36 | * @return boolean 37 | */ 38 | function plugin_mod_install() 39 | { 40 | $brandManager = new BrandManager(); 41 | $brandManager->install(); 42 | return true; 43 | } 44 | 45 | /** 46 | * Plugin uninstall process 47 | * 48 | * @return boolean 49 | */ 50 | function plugin_mod_uninstall() 51 | { 52 | $brandManager = new BrandManager(); 53 | // $brandManager->changeTitle("i-Vertix"); 54 | $brandManager->uninstall(); 55 | return true; 56 | } 57 | 58 | function plugin_mod_activate() 59 | { 60 | $brandManager = new BrandManager(); 61 | $brandManager->changeTitle("i-Vertix"); 62 | foreach (array_keys(BrandManager::IMAGE_RESOURCES) as $resourceName) { 63 | $brandManager->applyResource($resourceName); 64 | } 65 | $brandManager->applyLoginPageModifier(); 66 | } 67 | 68 | function plugin_mod_deactivate() 69 | { 70 | $brandManager = new BrandManager(); 71 | // $brandManager->changeTitle("i-Vertix"); 72 | foreach (array_keys(BrandManager::IMAGE_RESOURCES) as $resourceName) { 73 | $brandManager->restoreResource($resourceName); 74 | } 75 | $brandManager->disableLoginPageModifier(); 76 | } 77 | -------------------------------------------------------------------------------- /setup.php: -------------------------------------------------------------------------------- 1 | . 24 | * ------------------------------------------------------------------------- 25 | * @copyright Copyright (C) 2025 by i-Vertix/PGUM. 26 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 27 | * @link https://github.com/i-Vertix/glpi-modifications 28 | * ------------------------------------------------------------------------- 29 | */ 30 | 31 | use Glpi\Plugin\Hooks; 32 | use GlpiPlugin\Mod\BrandManager; 33 | 34 | const PLUGIN_MOD_VERSION = "11.0.1"; 35 | 36 | function plugin_init_mod() 37 | { 38 | global $PLUGIN_HOOKS, $CFG_GLPI; 39 | 40 | $PLUGIN_HOOKS['config_page']['mod'] = './front/uibranding.php'; 41 | if (Plugin::isPluginActive("mod")) { 42 | $CFG_GLPI["app_name"] = BrandManager::getCurrentTitle(); 43 | if (BrandManager::isLoginPageModified()) { 44 | // little bit hacky - could maybe be obsolete in upcoming versions 45 | // this piece of hard-researched code enables the public/background.php wrapper file to be accessed without user being logged in 46 | \Glpi\Http\Firewall::addPluginStrategyForLegacyScripts("mod", '/^\/background.php$/', \Glpi\Http\Firewall::STRATEGY_NO_CHECK); 47 | 48 | $PLUGIN_HOOKS[Hooks::ADD_CSS_ANONYMOUS_PAGE]["mod"] = "./css/mod_anonymous.css"; 49 | } 50 | } 51 | } 52 | 53 | function plugin_version_mod() 54 | { 55 | global $LANG; 56 | 57 | return array('name' => 'UI Branding', 58 | 'version' => PLUGIN_MOD_VERSION, 59 | 'author' => 'i-Vertix', 60 | 'license' => 'GPLv3', 61 | 'homepage' => 'https://github.com/i-Vertix/glpi-modifications', 62 | 'requirements' => [ 63 | 'glpi' => [ 64 | 'min' => "11.0", 65 | 'max' => "12.0" 66 | ] 67 | ]); 68 | } 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [](https://i-vertix.com) 2 | 3 | # UI Branding GLPI Plugin 4 | 5 | This plugin is used to customize brand-related images of your GLPI instance. 6 | 7 | ## 📋 Functionalities 8 | 9 | - Customization of overall used brand logos (three different logo sizes) 10 | - Customization of the page title (shown in tab) 11 | - Add a background image to the login page 12 | 13 | ## 📌 Information 14 | 15 | This plugin got restructured completely to match GLPI 11 and (hopefully) its successors. 16 | The plugin initially emerged from 17 | [https://github.com/stdonato/glpi-modifications](https://github.com/stdonato/glpi-modifications) 18 | as the original author did continue to support the original plugin. 19 | Since the plugin was forked from the original one, all of its code was rewritten and aligned to new GLPI guidelines. 20 | 21 | This plugin and its maintainers are not connected to the GLPI project. 22 | 23 | ## 📤 Migration from GLPI 10.x 24 | 25 | Since the plugin is very lightweight and does not really do much (no database tables ecc.), we decided to **not have** a 26 | "real" migration (current custom images will be lost). 27 | If you want to reuse your customized images, please create a backup before installing 28 | the new version into the GLPI plugins folder. The images are located in `/plugins/mod/resources`. 29 | Additionally, please **remove the current backup directory** located in `/files/_plugins/mod/backups`. 30 | 31 | ## 🔧 Installation 32 | 33 | > [!IMPORTANT] 34 | > For installation procedures of older versions, please have a look at the readme in the version-corresponding branch! 35 | 36 | 1. Download the latest version 37 | from [https://github.com/i-Vertix/glpi-modifications/releases](https://github.com/i-Vertix/glpi-modifications/releases). 38 | 2. Extract the archive into the GLPI `plugins` folder (when updating, make sure to delete the current `mod` folder 39 | first) 40 | 3. The new folder inside of `plugins` must be named `mod` 41 | 4. All files inside the folder must have at least `read` permissions for your webserver user 42 | 5. The following additional permissions for your webserver user are required for the plugin to work properly: 43 | 44 | - `read/write` permissions on the `/files/_plugins` directory as the plugin will create the directory 45 | `mod` inside of it 46 | - `read/write` permissions on the `/public/pics` directory 47 | - `read/write` permissions on the `/public/pics/favicon.ico` file 48 | - `read/write` permissions on the `/public/pics/logos` directory 49 | - `read/write` permissions on **all files** inside of `/public/pics/logos` directory 50 | - In case you are using SELinux, you must verify that your apache/webserver user has the permission to `chmod` his own files (necessary to uninstall the plugin correctly) 51 | 52 | Here are some prepared commands for you to execute from the **glpi root directory**, presuming your webserver user is 53 | already the owner of all relevant files and directories: 54 | 55 | ```shell 56 | sudo chmod 644 ./public/pics/logos/* 57 | sudo chmod 644 ./public/pics/favicon.ico 58 | ``` 59 | With this command you can disable SELinux for apache/webserver related stuff (to verify): 60 | 61 | ```shell 62 | setsebool -P httpd_unified 1 63 | ``` 64 | 65 | 7. In case you migrated from GLPI 10 and created a backup of your customized images you can now move the image backups 66 | to `./plugins/mod/resources/images` 67 | 8. Log into GLPI with a super-admin account and install the plugin 68 | 9. After the installation is completed, activate the plugin 69 | 70 | ## 👨‍🔧 Use the plugin 71 | 72 | Access the UI Branding page from the *Configure* button on the list item of your plugin page. 73 | 74 | ![UI Branding](./readme/ui-branding.png) 75 | 76 | This is the only page this plugin brings into your GLPI instance. 77 | 78 | In case you want to revert to the original images, deactivate all entries under *Apply Modifications*. 79 | The rest is more or less self-explanatory. 80 | 81 | If you uninstall the plugin or disable it, all backups are restored automatically. 82 | 83 | ## 🗿 Uninstall 84 | 85 | Please uninstall the plugin from the GLPI plugins page before removing any plugin files! 86 | Otherwise, all backups of original files are lost. 87 | We do not take any credit for any loss of original files! 88 | 89 | ## 📢 Notice 90 | 91 | The plugin is and will not be published on the GLPI marketplace. 92 | -------------------------------------------------------------------------------- /src/UIBranding.php: -------------------------------------------------------------------------------- 1 | . 24 | * ------------------------------------------------------------------------- 25 | * @copyright Copyright (C) 2025 by i-Vertix/PGUM. 26 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 27 | * @link https://github.com/i-Vertix/glpi-modifications 28 | * ------------------------------------------------------------------------- 29 | */ 30 | 31 | namespace GlpiPlugin\Mod; 32 | 33 | use Glpi\Application\View\TemplateRenderer; 34 | 35 | if (!defined('GLPI_ROOT')) { 36 | die("Sorry. You can't access directly to this file"); 37 | } 38 | 39 | class UIBranding 40 | { 41 | 42 | /** 43 | * @param array $data 44 | * @param array $files 45 | * @return void 46 | */ 47 | public function save(array $data, array $files): void 48 | { 49 | $brandManager = new BrandManager(); 50 | $backgroundChanged = false; 51 | $logosChanged = false; 52 | $faviconChanged = false; 53 | 54 | if (isset($files['background']['name']) && $files['background']['name'] !== '') { 55 | $backgroundChanged = $brandManager->uploadResource("background", $files['background']); 56 | } 57 | if (isset($files['logo_s']['name']) && $files['logo_s']['name'] !== '') { 58 | $logosChanged = $brandManager->uploadResource("logo_s", $files['logo_s']); 59 | } 60 | if (isset($files['logo_m']['name']) && $files['logo_m']['name'] !== '') { 61 | $logosChanged = $brandManager->uploadResource("logo_m", $files['logo_m']); 62 | } 63 | if (isset($files['logo_l']['name']) && $files['logo_l']['name'] !== '') { 64 | $logosChanged = $brandManager->uploadResource("logo_l", $files['logo_l']); 65 | } 66 | 67 | if (isset($files['favicon']['name']) && $files['favicon']['name'] !== '') { 68 | $faviconChanged = $brandManager->uploadResource("favicon", $files['favicon']); 69 | } 70 | 71 | if (isset($data['show_background'])) { 72 | if ($data['show_background'] === '1') { 73 | // overwrite background if changed or not overwritten yet 74 | if ($backgroundChanged || !$brandManager::isLoginPageModified()) { 75 | $brandManager->applyResource("background"); 76 | } 77 | $brandManager->applyLoginPageModifier(); 78 | } else if ($brandManager::isLoginPageModified()) { 79 | $brandManager->restoreResource("background"); 80 | $brandManager->disableLoginPageModifier(); 81 | } 82 | } else if ($backgroundChanged && $brandManager::isLoginPageModified()) { 83 | $brandManager->applyResource("background"); 84 | } 85 | 86 | if (isset($data['show_custom_logos'])) { 87 | if ($data['show_custom_logos'] === '1') { 88 | // overwrite background if changed or not overwritten yet 89 | if ( 90 | $logosChanged 91 | || !$brandManager::isActiveResourceModified("logo_s") 92 | || !$brandManager::isActiveResourceModified("logo_m") 93 | || !$brandManager::isActiveResourceModified("logo_l") 94 | ) { 95 | $brandManager->applyResource("logo_s"); 96 | $brandManager->applyResource("logo_m"); 97 | $brandManager->applyResource("logo_l"); 98 | } 99 | } else if ( 100 | $brandManager::isActiveResourceModified("logo_s") 101 | || $brandManager::isActiveResourceModified("logo_m") 102 | || $brandManager::isActiveResourceModified("logo_l") 103 | ) { 104 | $brandManager->restoreResource("logo_s"); 105 | $brandManager->restoreResource("logo_m"); 106 | $brandManager->restoreResource("logo_l"); 107 | } 108 | } else if ($logosChanged) { 109 | $brandManager->applyResource("logo_s"); 110 | $brandManager->applyResource("logo_m"); 111 | $brandManager->applyResource("logo_l"); 112 | } 113 | 114 | if (isset($data['show_custom_favicon'])) { 115 | if ($data['show_custom_favicon'] === '1') { 116 | // overwrite background if changed or not overwritten yet 117 | if ($faviconChanged || !$brandManager::isActiveResourceModified("favicon")) { 118 | $brandManager->applyResource("favicon"); 119 | } 120 | } else if ($brandManager::isActiveResourceModified("favicon")) { 121 | $brandManager->restoreResource("favicon"); 122 | } 123 | } else if ($faviconChanged && $brandManager::isActiveResourceModified("favicon")) { 124 | $brandManager->applyResource("favicon"); 125 | } 126 | 127 | if (isset($data['title'])) { 128 | $brandManager->changeTitle($data["title"]); 129 | } 130 | } 131 | 132 | /** 133 | * @return bool 134 | */ 135 | public function display(): bool 136 | { 137 | global $CFG_GLPI; 138 | TemplateRenderer::getInstance()->display('@mod/uibranding.html.twig', [ 139 | "url" => $CFG_GLPI['root_doc'] . "/plugins/mod/front/uibranding.php", 140 | "show_background" => BrandManager::isLoginPageModified(), 141 | "show_custom_logos" => BrandManager::isActiveResourceModified("logo_s") 142 | || BrandManager::isActiveResourceModified("logo_m") 143 | || BrandManager::isActiveResourceModified("logo_l"), 144 | "show_custom_favicon" => BrandManager::isActiveResourceModified("favicon"), 145 | "title" => BrandManager::getCurrentTitle(), 146 | ]); 147 | return true; 148 | } 149 | 150 | } -------------------------------------------------------------------------------- /templates/uibranding.html.twig: -------------------------------------------------------------------------------- 1 | {# 2 | # ------------------------------------------------------------------------- 3 | # UI Branding plugin for GLPI 4 | # ------------------------------------------------------------------------- 5 | # 6 | # LICENSE 7 | # 8 | # This file is part of UI Branding plugin for GLPI. 9 | # 10 | # "UI Branding plugin for GLPI" is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 3 of the License, or 13 | # (at your option) any later version. 14 | # 15 | # "UI Branding plugin for GLPI" is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with "UI Branding plugin for GLPI". If not, see . 22 | # ------------------------------------------------------------------------- 23 | # @copyright Copyright (C) 2025 by i-Vertix/PGUM. 24 | # @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 25 | # @link https://github.com/i-Vertix/glpi-modifications 26 | # ------------------------------------------------------------------------- 27 | #} 28 | 29 | {% import 'components/form/fields_macros.html.twig' as fields %} 30 | 31 |
32 |
33 |
34 |
35 |
36 |
39 | 40 | {{ fields.largeTitle(__('UI Branding', 'mod'), 'ti ti-paint', true) }} 41 |
42 |
43 |
44 |
45 |
46 | {{ fields.smallTitle(__('Apply Modifications', 'mod'), 'ti ti-adjustments') }} 47 | {{ fields.textField('title', title, __('Page Title', 'mod')) }} 48 | {{ fields.dropdownYesNo('show_background', show_background, __('Show login background', 'mod')) }} 49 | {{ fields.dropdownYesNo('show_custom_logos', show_custom_logos, __('Show custom logos', 'mod')) }} 50 | {{ fields.dropdownYesNo('show_custom_favicon', show_custom_favicon, __('Show custom favicon', 'mod')) }} 51 | {{ fields.smallTitle(__('Custom Images', 'mod'), 'ti ti-photo') }} 52 |
53 | 57 |
58 | 60 |
61 |
62 |
63 | {{ __( 66 |
67 |
68 |
69 | 73 |
74 | 76 |
77 |
78 |
79 | {{ __( 82 |
83 |
84 |
85 | 89 |
90 | 92 |
93 |
94 |
95 | {{ __( 98 |
99 |
100 |
101 | 105 |
106 | 108 |
109 |
110 |
111 | {{ __( 114 |
115 |
116 |
117 | 121 |
122 | 124 |
125 |
126 |
127 | {{ __( 130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 | 141 |
142 | 143 |
144 |
145 |
146 |
147 |
148 |
149 | -------------------------------------------------------------------------------- /src/BrandManager.php: -------------------------------------------------------------------------------- 1 | . 24 | * ------------------------------------------------------------------------- 25 | * @copyright Copyright (C) 2025 by i-Vertix/PGUM. 26 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 27 | * @link https://github.com/i-Vertix/glpi-modifications 28 | * ------------------------------------------------------------------------- 29 | */ 30 | 31 | namespace GlpiPlugin\Mod; 32 | 33 | use Session; 34 | use Toolbox; 35 | 36 | if (!defined('GLPI_ROOT')) { 37 | die("Sorry. You can't access directly to this file"); 38 | } 39 | 40 | class BrandManager 41 | { 42 | 43 | public const FILES_DIR = GLPI_PLUGIN_DOC_DIR . "/mod"; 44 | public const BACKUP_DIR = self::FILES_DIR . "/backups"; 45 | public const IMAGES_DIR = self::FILES_DIR . "/images"; 46 | public const RESOURCES_DIR = GLPI_ROOT . "/plugins/mod/resources"; 47 | public const IMAGE_RESOURCES = [ 48 | /* 49 | * Something special about background.jpg: 50 | * (OBSOLETE - FOUND SOLUTION BELOW) 51 | * I tried to figure out several ways to not have to copy this beast into the public pics folder 52 | * but everything I tried did not work out due to the strict routing limitations of GLPI 11. 53 | * In GLPI 11 every php page load goes through the GLPI index/router and dismisses the request if not logged in 54 | * This makes a cache-optimized wrapper php script obsolete. It would have provided the .jpg from the webserver restricted files/_plugins directory. 55 | * There is also available a hook to integrate the plugin into the login page itself (Hooks::DISPLAY_LOGIN) but I did not want to 56 | * base64 encode the background image due to performance concerns (no browser caching of the (large) background image). 57 | * Other than that there is nothing I can actually do. Its not the best option to replace/delete from the glpi/public/pics folder, but here we are... 58 | * glpi/plugins/mod/public could also work out but as glpi does absolutely not want plugins to write in their own directory I keep the glpi/public/pics directory for now 59 | * 60 | * (UPDATE - CURRENT SOLUTION) 61 | * After having a hard time believing there is no such thing as "public" scripts (not logged in) I stumbled upon the GLPI Firewall and the possibility 62 | * to add no_check (no login) strategies for plugin url patterns! 63 | * Currently this is implemented in the plugin_init_mod function inside setup.php. 64 | * I hope this little trick will also be available in future versions lol 65 | * otherwise I need to roll back to my previous solutions :( 66 | * 67 | */ 68 | "background" => [ 69 | "default" => self::RESOURCES_DIR . "/images/background.jpg", 70 | "current" => self::IMAGES_DIR . "/background.jpg", 71 | // "active" => GLPI_ROOT . "/public/pics/plugin_mod_background.jpg", 72 | "accept" => ["jpeg", "jpg"] 73 | ], 74 | "favicon" => [ 75 | "default" => self::RESOURCES_DIR . "/images/favicon.ico", 76 | "current" => self::IMAGES_DIR . "/favicon.ico", 77 | "active" => GLPI_ROOT . "/public/pics/favicon.ico", 78 | "backup" => self::BACKUP_DIR . "/favicon.ico", 79 | "accept" => ["ico"] 80 | ], 81 | "logo_s" => [ 82 | "default" => self::RESOURCES_DIR . "/images/logo-G-100.png", 83 | "current" => self::IMAGES_DIR . "/logo-G-100.png", 84 | "active" => [ 85 | GLPI_ROOT . "/public/pics/logos/logo-G-100-black.png", 86 | GLPI_ROOT . "/public/pics/logos/logo-G-100-grey.png", 87 | GLPI_ROOT . "/public/pics/logos/logo-G-100-white.png", 88 | ], 89 | "backup" => [ 90 | self::BACKUP_DIR . "/logo-G-100-black.png", 91 | self::BACKUP_DIR . "/logo-G-100-grey.png", 92 | self::BACKUP_DIR . "/logo-G-100-white.png", 93 | ], 94 | "accept" => ["png"] 95 | ], 96 | "logo_m" => [ 97 | "default" => self::RESOURCES_DIR . "/images/logo-GLPI-100.png", 98 | "current" => self::IMAGES_DIR . "/logo-GLPI-100.png", 99 | "active" => [ 100 | GLPI_ROOT . "/public/pics/logos/logo-GLPI-100-black.png", 101 | GLPI_ROOT . "/public/pics/logos/logo-GLPI-100-grey.png", 102 | GLPI_ROOT . "/public/pics/logos/logo-GLPI-100-white.png", 103 | ], 104 | "backup" => [ 105 | self::BACKUP_DIR . "/logo-GLPI-100-black.png", 106 | self::BACKUP_DIR . "/logo-GLPI-100-grey.png", 107 | self::BACKUP_DIR . "/logo-GLPI-100-white.png", 108 | ], 109 | "accept" => ["png"] 110 | ], 111 | "logo_l" => [ 112 | "default" => self::RESOURCES_DIR . "/images/logo-GLPI-250.png", 113 | "current" => self::IMAGES_DIR . "/logo-GLPI-250.png", 114 | "active" => [ 115 | GLPI_ROOT . "/public/pics/logos/logo-GLPI-250-black.png", 116 | GLPI_ROOT . "/public/pics/logos/logo-GLPI-250-grey.png", 117 | GLPI_ROOT . "/public/pics/logos/logo-GLPI-250-white.png", 118 | ], 119 | "backup" => [ 120 | self::BACKUP_DIR . "/logo-GLPI-250-black.png", 121 | self::BACKUP_DIR . "/logo-GLPI-250-grey.png", 122 | self::BACKUP_DIR . "/logo-GLPI-250-white.png", 123 | ], 124 | "accept" => ["png"] 125 | ], 126 | ]; 127 | 128 | /** 129 | * @return bool 130 | */ 131 | private static function initModifiers(): bool 132 | { 133 | return copy(self::RESOURCES_DIR . "/modifiers.ini", self::FILES_DIR . "/modifiers.ini"); 134 | } 135 | 136 | /** 137 | * Installs the necessary parts for the plugin. 138 | * 139 | * This method creates required directories for files, backups, and images. 140 | * It also ensures the default image resources are installed and their backups are created. 141 | * Additionally, it installs title modification resources. 142 | * 143 | * @return void 144 | */ 145 | public function install(): void 146 | { 147 | // create directories for files, backup and images 148 | $someDirCreated = false; 149 | if (!file_exists(self::FILES_DIR)) { 150 | if (!mkdir(self::FILES_DIR, 0755) && !is_dir(self::FILES_DIR)) { 151 | die(sprintf('Unable to create plugin directory (%s)', self::FILES_DIR)); 152 | } 153 | $someDirCreated = true; 154 | } 155 | if (!file_exists(self::BACKUP_DIR)) { 156 | if (!mkdir(self::BACKUP_DIR, 0755) && !is_dir(self::BACKUP_DIR)) { 157 | die(sprintf('Unable to create plugin directory (%s)', self::BACKUP_DIR)); 158 | } 159 | $someDirCreated = true; 160 | } 161 | if (!file_exists(self::IMAGES_DIR)) { 162 | if (!mkdir(self::IMAGES_DIR, 0755) && !is_dir(self::IMAGES_DIR)) { 163 | die(sprintf('Unable to create plugin directory (%s)', self::IMAGES_DIR)); 164 | } 165 | $someDirCreated = true; 166 | } 167 | if ($someDirCreated) Session::addMessageAfterRedirect("✅ Created plugin directories"); 168 | 169 | // handle default images 170 | $someResourceInstalled = false; 171 | $someBackupCreated = false; 172 | foreach (self::IMAGE_RESOURCES as $imageResource => $paths) { 173 | if (!file_exists($paths["current"])) { 174 | if (!copy($paths["default"], $paths["current"])) { 175 | die("Unable to install $imageResource resource"); 176 | } 177 | $someResourceInstalled = true; 178 | } 179 | 180 | // create backup 181 | if (isset($paths["backup"], $paths["active"])) { 182 | if (is_array($paths["backup"])) { 183 | foreach ($paths["backup"] as $backupIndex => $backupPath) { 184 | if (!file_exists($backupPath)) { 185 | if (!copy($paths["active"][$backupIndex], $backupPath)) { 186 | die("Unable to backup $imageResource resource ($backupIndex)"); 187 | } 188 | $someBackupCreated = true; 189 | } 190 | } 191 | } else if (!file_exists($paths["backup"])) { 192 | if (!copy($paths["active"], $paths["backup"])) { 193 | die("Unable to backup $imageResource resource"); 194 | } 195 | $someBackupCreated = true; 196 | } 197 | } 198 | } 199 | if ($someResourceInstalled) Session::addMessageAfterRedirect("✅ Installed image resources"); 200 | if ($someBackupCreated) Session::addMessageAfterRedirect("✅ Created backups"); 201 | 202 | if (!file_exists(self::FILES_DIR . "/modifiers.ini")) { 203 | if (!self::initModifiers()) { 204 | die("Unable to install modifiers"); 205 | } 206 | Session::addMessageAfterRedirect("✅ Installed modifiers"); 207 | } 208 | } 209 | 210 | /** 211 | * @return void 212 | */ 213 | public function uninstall(): void 214 | { 215 | foreach (array_keys(self::IMAGE_RESOURCES) as $resourceName) { 216 | $this->restoreResource($resourceName); 217 | } 218 | $this->disableLoginPageModifier(); 219 | Session::addMessageAfterRedirect("♻️ Restored backups"); 220 | // delete files 221 | Toolbox::deleteDir(self::FILES_DIR); 222 | Session::addMessageAfterRedirect("🗑️ Removed resources and backups"); 223 | } 224 | 225 | /** 226 | * Checks if a backup exists for the specified resource. 227 | * 228 | * @param string $resourceName The name of the resource to check for a backup. 229 | * @return bool True if a backup exists for the specified resource, otherwise false. 230 | */ 231 | public static function resourceBackupExists(string $resourceName): bool 232 | { 233 | if (!isset(self::IMAGE_RESOURCES[$resourceName]["backup"])) return false; 234 | if (is_array(self::IMAGE_RESOURCES[$resourceName]["backup"])) { 235 | return file_exists(self::IMAGE_RESOURCES[$resourceName]["backup"][0]); 236 | } else if (file_exists(self::IMAGE_RESOURCES[$resourceName]["backup"])) { 237 | return true; 238 | } 239 | return false; 240 | } 241 | 242 | /** 243 | * Checks if the active resource has been modified. 244 | * 245 | * This method determines whether a resource has been altered by verifying the checksum 246 | * (MD5 hash) of its active file(s) against its backup file(s). If backups do not exist, 247 | * or if checksum values differ, the resource is considered modified. 248 | * 249 | * @param string $resourceName The name of the resource to check. 250 | * 251 | * @return bool Returns true if the resource is modified; otherwise, false. 252 | */ 253 | public static function isActiveResourceModified(string $resourceName): bool 254 | { 255 | if (!isset(self::IMAGE_RESOURCES[$resourceName]["active"], self::IMAGE_RESOURCES[$resourceName]["backup"])) return false; 256 | 257 | if (isset(self::IMAGE_RESOURCES[$resourceName]["backup"])) { 258 | // backups are made - check md5 hash of files 259 | if (is_array(self::IMAGE_RESOURCES[$resourceName]["active"])) { 260 | for ($i = 0, $iMax = count(self::IMAGE_RESOURCES[$resourceName]["active"]); $i < $iMax; $i++) { 261 | // if active file does not exist resource is not modified 262 | if (!file_exists(self::IMAGE_RESOURCES[$resourceName]["active"][$i])) continue; 263 | // if backup file does not exist (user deleted backup folder) we say it is modified 264 | if (!file_exists(self::IMAGE_RESOURCES[$resourceName]["backup"][$i])) return true; 265 | // compare file hashes 266 | if (md5_file(self::IMAGE_RESOURCES[$resourceName]["active"][$i]) !== md5_file(self::IMAGE_RESOURCES[$resourceName]["backup"][$i])) return true; 267 | } 268 | return false; 269 | } else { 270 | if (!file_exists(self::IMAGE_RESOURCES[$resourceName]["active"])) return false; 271 | if (!file_exists(self::IMAGE_RESOURCES[$resourceName]["backup"])) return true; 272 | return md5_file(self::IMAGE_RESOURCES[$resourceName]["active"]) !== md5_file(self::IMAGE_RESOURCES[$resourceName]["backup"]); 273 | } 274 | } else if (is_array(self::IMAGE_RESOURCES[$resourceName]["active"])) { 275 | if (!isset(self::IMAGE_RESOURCES[$resourceName]["active"][0])) return false; 276 | return file_exists(self::IMAGE_RESOURCES[$resourceName]["active"][0]); 277 | } else return file_exists(self::IMAGE_RESOURCES[$resourceName]["active"]); 278 | } 279 | 280 | /** 281 | * Restores the specified resource to its original state. 282 | * 283 | * This method restores a resource by copying backup files to their corresponding active files. If backups 284 | * are not available, the active files are removed instead. 285 | * 286 | * @param string $resourceName The name of the resource to restore. 287 | * 288 | * @return void 289 | */ 290 | public function restoreResource(string $resourceName): void 291 | { 292 | if (!isset(self::IMAGE_RESOURCES[$resourceName]["active"])) return; 293 | if (isset(self::IMAGE_RESOURCES[$resourceName]["backup"])) { 294 | if (is_array(self::IMAGE_RESOURCES[$resourceName]["active"])) { 295 | // restore multiple files 296 | for ($i = 0, $iMax = count(self::IMAGE_RESOURCES[$resourceName]["active"]); $i < $iMax; $i++) { 297 | // skip if backup does not exist 298 | if (!file_exists(self::IMAGE_RESOURCES[$resourceName]["backup"][$i])) continue; 299 | copy(self::IMAGE_RESOURCES[$resourceName]["backup"][$i], self::IMAGE_RESOURCES[$resourceName]["active"][$i]); 300 | } 301 | } else { 302 | // restore a single file 303 | if (!file_exists(self::IMAGE_RESOURCES[$resourceName]["backup"])) return; 304 | copy(self::IMAGE_RESOURCES[$resourceName]["backup"], self::IMAGE_RESOURCES[$resourceName]["active"]); 305 | } 306 | } else if (is_array(self::IMAGE_RESOURCES[$resourceName]["active"])) { 307 | // files have no backup - remove all active files 308 | foreach (self::IMAGE_RESOURCES[$resourceName]["active"] as $activeFile) { 309 | unlink($activeFile); 310 | } 311 | } else { 312 | // file has no backup - remove the active file 313 | unlink(self::IMAGE_RESOURCES[$resourceName]["active"]); 314 | } 315 | } 316 | 317 | /** 318 | * Applies the current version of the resource to its active location. 319 | * 320 | * This method copies the current version of the specified resource to its active file(s), 321 | * overwriting the existing active resource. 322 | * 323 | * @param string $resourceName The name of the resource to apply. 324 | * 325 | * @return void 326 | */ 327 | public function applyResource(string $resourceName): void 328 | { 329 | if (!isset(self::IMAGE_RESOURCES[$resourceName]["active"])) return; 330 | if (is_array(self::IMAGE_RESOURCES[$resourceName]["active"])) { 331 | foreach (self::IMAGE_RESOURCES[$resourceName]["active"] as $activeFile) { 332 | copy(self::IMAGE_RESOURCES[$resourceName]["current"], $activeFile); 333 | } 334 | } else { 335 | copy(self::IMAGE_RESOURCES[$resourceName]["current"], self::IMAGE_RESOURCES[$resourceName]["active"]); 336 | } 337 | } 338 | 339 | /** 340 | * Handles the upload of a resource file. 341 | * 342 | * This method uploads a file resource to a predefined path associated with the resource name. 343 | * It validates the file's type, checks for any upload errors, and ensures the file is moved 344 | * to the correct location if all conditions are met. 345 | * 346 | * @param string $resourceName The name of the resource where the file will be uploaded. 347 | * @param array $file The file data (including 'tmp_name', 'name', 'error', etc.) from the upload. 348 | * @return bool Returns true if the file was successfully uploaded; otherwise, false. 349 | */ 350 | public function uploadResource(string $resourceName, array $file): bool 351 | { 352 | if (!isset(self::IMAGE_RESOURCES[$resourceName])) return false; 353 | if (!isset($file["tmp_name"])) return false; 354 | if (isset($file["error"]) && $file["error"] !== UPLOAD_ERR_OK) { 355 | Session::addMessageAfterRedirect(sprintf("❌ Upload of file %s failed (file invalid)", $file["name"])); 356 | return false; 357 | } 358 | 359 | $extension = pathinfo($file["name"], PATHINFO_EXTENSION); 360 | if (!in_array($extension, self::IMAGE_RESOURCES[$resourceName]["accept"], true)) { 361 | Session::addMessageAfterRedirect(sprintf("❌ Uploaded file %s is invalid (only %s accepted)", $file["name"], implode(", ", self::IMAGE_RESOURCES[$resourceName]["accept"]))); 362 | return false; 363 | } 364 | if (!move_uploaded_file($file["tmp_name"], self::IMAGE_RESOURCES[$resourceName]["current"])) { 365 | Session::addMessageAfterRedirect(sprintf("❌ Upload of file %s failed", $file["name"])); 366 | return false; 367 | } 368 | return true; 369 | } 370 | 371 | /** 372 | * Updates the title by saving it to a designated resource file. 373 | * 374 | * This method writes the provided title to a file after applying the necessary escape functions 375 | * to ensure the content is safe for storage. 376 | * 377 | * @param string $title The new title to save. 378 | * 379 | * @return void This method does not return a value. 380 | */ 381 | public function changeTitle(string $title): void 382 | { 383 | if (!file_exists(self::FILES_DIR . "/modifiers.ini") && !self::initModifiers()) { 384 | return; 385 | } 386 | $ini = parse_ini_file(self::FILES_DIR . "/modifiers.ini"); 387 | if ($ini === false) { 388 | /** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */ 389 | $ini = ["title" => "GLPI", "login" => "false"]; 390 | } 391 | $ini["title"] = htmlescape($title); 392 | $iniString = []; 393 | foreach ($ini as $key => $value) { 394 | $iniString[] = "$key=$value"; 395 | } 396 | file_put_contents(self::FILES_DIR . "/modifiers.ini", implode("\n", $iniString)); 397 | } 398 | 399 | /** 400 | * Retrieves the current title. 401 | * 402 | * This method fetches the title from the designated resource file. If the file 403 | * is not accessible or its content is unavailable, a default value is returned. 404 | * 405 | * @return string Returns the current title of the resource, or a default value if unavailable. 406 | */ 407 | public static function getCurrentTitle(): string 408 | { 409 | if (!file_exists(self::FILES_DIR . "/modifiers.ini") && !self::initModifiers()) { 410 | return "GLPI"; 411 | } 412 | $ini = parse_ini_file(self::FILES_DIR . "/modifiers.ini"); 413 | if ($ini === false) return false; 414 | if (!isset($ini["title"])) { 415 | self::initModifiers(); 416 | return "GLPI"; 417 | } 418 | return $ini["title"]; 419 | } 420 | 421 | /** 422 | * Checks if the login page has been modified by verifying the relevant configuration in the modifiers.ini file. 423 | * 424 | * @return bool Returns true if the login page is flagged as modified, or false otherwise. 425 | */ 426 | public static function isLoginPageModified(): bool 427 | { 428 | if (!file_exists(self::FILES_DIR . "/modifiers.ini") && !self::initModifiers()) { 429 | return false; 430 | } 431 | $ini = parse_ini_file(self::FILES_DIR . "/modifiers.ini"); 432 | if ($ini === false) return false; 433 | if (!isset($ini["login"])) { 434 | self::initModifiers(); 435 | return false; 436 | } 437 | return $ini["login"] === "1"; 438 | } 439 | 440 | /** 441 | * Applies modifications to the login page by updating the modifiers.ini file. 442 | * If the file does not exist or cannot be parsed, it initializes the configuration 443 | * with default values and flags the login page as modified. 444 | * 445 | * @return void 446 | */ 447 | public function applyLoginPageModifier(): void 448 | { 449 | if (!file_exists(self::FILES_DIR . "/modifiers.ini") && !self::initModifiers()) { 450 | return; 451 | } 452 | $ini = parse_ini_file(self::FILES_DIR . "/modifiers.ini"); 453 | if ($ini === false) { 454 | /** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */ 455 | $ini = ["title" => "GLPI", "login" => "1"]; 456 | } 457 | $ini["login"] = "1"; 458 | $iniString = []; 459 | foreach ($ini as $key => $value) { 460 | $iniString[] = "$key=$value"; 461 | } 462 | file_put_contents(self::FILES_DIR . "/modifiers.ini", implode("\n", $iniString)); 463 | } 464 | 465 | /** 466 | * Disables the login page modification by updating the related configuration in the modifiers.ini file. 467 | * 468 | * @return void 469 | */ 470 | public function disableLoginPageModifier(): void 471 | { 472 | if (!file_exists(self::FILES_DIR . "/modifiers.ini") && !self::initModifiers()) { 473 | return; 474 | } 475 | $ini = parse_ini_file(self::FILES_DIR . "/modifiers.ini"); 476 | if ($ini === false) { 477 | /** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */ 478 | $ini = ["title" => "GLPI", "login" => "0"]; 479 | } 480 | $ini["login"] = "0"; 481 | $iniString = []; 482 | foreach ($ini as $key => $value) { 483 | $iniString[] = "$key=$value"; 484 | } 485 | file_put_contents(self::FILES_DIR . "/modifiers.ini", implode("\n", $iniString)); 486 | } 487 | 488 | } 489 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "0bb7734a8837cdd118f20d259d3613e7", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "glpi-project/tools", 12 | "version": "0.8.3", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/glpi-project/tools.git", 16 | "reference": "8ea2a7d4702a858f4b0360ba7d4f1841a5e77026" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/glpi-project/tools/zipball/8ea2a7d4702a858f4b0360ba7d4f1841a5e77026", 21 | "reference": "8ea2a7d4702a858f4b0360ba7d4f1841a5e77026", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "symfony/console": "^5.4 || ^6.0", 26 | "twig/twig": "^3.3" 27 | }, 28 | "require-dev": { 29 | "nikic/php-parser": "^4.13", 30 | "phpstan/phpstan-src": "^1.10" 31 | }, 32 | "bin": [ 33 | "bin/extract-locales", 34 | "bin/licence-headers-check", 35 | "tools/plugin-release" 36 | ], 37 | "type": "library", 38 | "autoload": { 39 | "psr-4": { 40 | "GlpiProject\\Tools\\": "src/" 41 | } 42 | }, 43 | "notification-url": "https://packagist.org/downloads/", 44 | "license": [ 45 | "GPL-3.0-or-later" 46 | ], 47 | "authors": [ 48 | { 49 | "name": "Teclib'", 50 | "email": "glpi@teclib.com", 51 | "homepage": "http://teclib-group.com" 52 | } 53 | ], 54 | "description": "Various tools for GLPI and its plugins", 55 | "keywords": [ 56 | "glpi", 57 | "plugins", 58 | "tools" 59 | ], 60 | "support": { 61 | "issues": "https://github.com/glpi-project/tools/issues", 62 | "source": "https://github.com/glpi-project/tools" 63 | }, 64 | "time": "2025-10-14T10:26:06+00:00" 65 | }, 66 | { 67 | "name": "psr/container", 68 | "version": "2.0.2", 69 | "source": { 70 | "type": "git", 71 | "url": "https://github.com/php-fig/container.git", 72 | "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" 73 | }, 74 | "dist": { 75 | "type": "zip", 76 | "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", 77 | "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", 78 | "shasum": "" 79 | }, 80 | "require": { 81 | "php": ">=7.4.0" 82 | }, 83 | "type": "library", 84 | "extra": { 85 | "branch-alias": { 86 | "dev-master": "2.0.x-dev" 87 | } 88 | }, 89 | "autoload": { 90 | "psr-4": { 91 | "Psr\\Container\\": "src/" 92 | } 93 | }, 94 | "notification-url": "https://packagist.org/downloads/", 95 | "license": [ 96 | "MIT" 97 | ], 98 | "authors": [ 99 | { 100 | "name": "PHP-FIG", 101 | "homepage": "https://www.php-fig.org/" 102 | } 103 | ], 104 | "description": "Common Container Interface (PHP FIG PSR-11)", 105 | "homepage": "https://github.com/php-fig/container", 106 | "keywords": [ 107 | "PSR-11", 108 | "container", 109 | "container-interface", 110 | "container-interop", 111 | "psr" 112 | ], 113 | "support": { 114 | "issues": "https://github.com/php-fig/container/issues", 115 | "source": "https://github.com/php-fig/container/tree/2.0.2" 116 | }, 117 | "time": "2021-11-05T16:47:00+00:00" 118 | }, 119 | { 120 | "name": "symfony/console", 121 | "version": "v6.4.26", 122 | "source": { 123 | "type": "git", 124 | "url": "https://github.com/symfony/console.git", 125 | "reference": "492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f" 126 | }, 127 | "dist": { 128 | "type": "zip", 129 | "url": "https://api.github.com/repos/symfony/console/zipball/492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f", 130 | "reference": "492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f", 131 | "shasum": "" 132 | }, 133 | "require": { 134 | "php": ">=8.1", 135 | "symfony/deprecation-contracts": "^2.5|^3", 136 | "symfony/polyfill-mbstring": "~1.0", 137 | "symfony/service-contracts": "^2.5|^3", 138 | "symfony/string": "^5.4|^6.0|^7.0" 139 | }, 140 | "conflict": { 141 | "symfony/dependency-injection": "<5.4", 142 | "symfony/dotenv": "<5.4", 143 | "symfony/event-dispatcher": "<5.4", 144 | "symfony/lock": "<5.4", 145 | "symfony/process": "<5.4" 146 | }, 147 | "provide": { 148 | "psr/log-implementation": "1.0|2.0|3.0" 149 | }, 150 | "require-dev": { 151 | "psr/log": "^1|^2|^3", 152 | "symfony/config": "^5.4|^6.0|^7.0", 153 | "symfony/dependency-injection": "^5.4|^6.0|^7.0", 154 | "symfony/event-dispatcher": "^5.4|^6.0|^7.0", 155 | "symfony/http-foundation": "^6.4|^7.0", 156 | "symfony/http-kernel": "^6.4|^7.0", 157 | "symfony/lock": "^5.4|^6.0|^7.0", 158 | "symfony/messenger": "^5.4|^6.0|^7.0", 159 | "symfony/process": "^5.4|^6.0|^7.0", 160 | "symfony/stopwatch": "^5.4|^6.0|^7.0", 161 | "symfony/var-dumper": "^5.4|^6.0|^7.0" 162 | }, 163 | "type": "library", 164 | "autoload": { 165 | "psr-4": { 166 | "Symfony\\Component\\Console\\": "" 167 | }, 168 | "exclude-from-classmap": [ 169 | "/Tests/" 170 | ] 171 | }, 172 | "notification-url": "https://packagist.org/downloads/", 173 | "license": [ 174 | "MIT" 175 | ], 176 | "authors": [ 177 | { 178 | "name": "Fabien Potencier", 179 | "email": "fabien@symfony.com" 180 | }, 181 | { 182 | "name": "Symfony Community", 183 | "homepage": "https://symfony.com/contributors" 184 | } 185 | ], 186 | "description": "Eases the creation of beautiful and testable command line interfaces", 187 | "homepage": "https://symfony.com", 188 | "keywords": [ 189 | "cli", 190 | "command-line", 191 | "console", 192 | "terminal" 193 | ], 194 | "support": { 195 | "source": "https://github.com/symfony/console/tree/v6.4.26" 196 | }, 197 | "funding": [ 198 | { 199 | "url": "https://symfony.com/sponsor", 200 | "type": "custom" 201 | }, 202 | { 203 | "url": "https://github.com/fabpot", 204 | "type": "github" 205 | }, 206 | { 207 | "url": "https://github.com/nicolas-grekas", 208 | "type": "github" 209 | }, 210 | { 211 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 212 | "type": "tidelift" 213 | } 214 | ], 215 | "time": "2025-09-26T12:13:46+00:00" 216 | }, 217 | { 218 | "name": "symfony/deprecation-contracts", 219 | "version": "v3.6.0", 220 | "source": { 221 | "type": "git", 222 | "url": "https://github.com/symfony/deprecation-contracts.git", 223 | "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" 224 | }, 225 | "dist": { 226 | "type": "zip", 227 | "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", 228 | "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", 229 | "shasum": "" 230 | }, 231 | "require": { 232 | "php": ">=8.1" 233 | }, 234 | "type": "library", 235 | "extra": { 236 | "thanks": { 237 | "url": "https://github.com/symfony/contracts", 238 | "name": "symfony/contracts" 239 | }, 240 | "branch-alias": { 241 | "dev-main": "3.6-dev" 242 | } 243 | }, 244 | "autoload": { 245 | "files": [ 246 | "function.php" 247 | ] 248 | }, 249 | "notification-url": "https://packagist.org/downloads/", 250 | "license": [ 251 | "MIT" 252 | ], 253 | "authors": [ 254 | { 255 | "name": "Nicolas Grekas", 256 | "email": "p@tchwork.com" 257 | }, 258 | { 259 | "name": "Symfony Community", 260 | "homepage": "https://symfony.com/contributors" 261 | } 262 | ], 263 | "description": "A generic function and convention to trigger deprecation notices", 264 | "homepage": "https://symfony.com", 265 | "support": { 266 | "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" 267 | }, 268 | "funding": [ 269 | { 270 | "url": "https://symfony.com/sponsor", 271 | "type": "custom" 272 | }, 273 | { 274 | "url": "https://github.com/fabpot", 275 | "type": "github" 276 | }, 277 | { 278 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 279 | "type": "tidelift" 280 | } 281 | ], 282 | "time": "2024-09-25T14:21:43+00:00" 283 | }, 284 | { 285 | "name": "symfony/polyfill-ctype", 286 | "version": "v1.33.0", 287 | "source": { 288 | "type": "git", 289 | "url": "https://github.com/symfony/polyfill-ctype.git", 290 | "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" 291 | }, 292 | "dist": { 293 | "type": "zip", 294 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", 295 | "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", 296 | "shasum": "" 297 | }, 298 | "require": { 299 | "php": ">=7.2" 300 | }, 301 | "provide": { 302 | "ext-ctype": "*" 303 | }, 304 | "suggest": { 305 | "ext-ctype": "For best performance" 306 | }, 307 | "type": "library", 308 | "extra": { 309 | "thanks": { 310 | "url": "https://github.com/symfony/polyfill", 311 | "name": "symfony/polyfill" 312 | } 313 | }, 314 | "autoload": { 315 | "files": [ 316 | "bootstrap.php" 317 | ], 318 | "psr-4": { 319 | "Symfony\\Polyfill\\Ctype\\": "" 320 | } 321 | }, 322 | "notification-url": "https://packagist.org/downloads/", 323 | "license": [ 324 | "MIT" 325 | ], 326 | "authors": [ 327 | { 328 | "name": "Gert de Pagter", 329 | "email": "BackEndTea@gmail.com" 330 | }, 331 | { 332 | "name": "Symfony Community", 333 | "homepage": "https://symfony.com/contributors" 334 | } 335 | ], 336 | "description": "Symfony polyfill for ctype functions", 337 | "homepage": "https://symfony.com", 338 | "keywords": [ 339 | "compatibility", 340 | "ctype", 341 | "polyfill", 342 | "portable" 343 | ], 344 | "support": { 345 | "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" 346 | }, 347 | "funding": [ 348 | { 349 | "url": "https://symfony.com/sponsor", 350 | "type": "custom" 351 | }, 352 | { 353 | "url": "https://github.com/fabpot", 354 | "type": "github" 355 | }, 356 | { 357 | "url": "https://github.com/nicolas-grekas", 358 | "type": "github" 359 | }, 360 | { 361 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 362 | "type": "tidelift" 363 | } 364 | ], 365 | "time": "2024-09-09T11:45:10+00:00" 366 | }, 367 | { 368 | "name": "symfony/polyfill-intl-grapheme", 369 | "version": "v1.33.0", 370 | "source": { 371 | "type": "git", 372 | "url": "https://github.com/symfony/polyfill-intl-grapheme.git", 373 | "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" 374 | }, 375 | "dist": { 376 | "type": "zip", 377 | "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", 378 | "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", 379 | "shasum": "" 380 | }, 381 | "require": { 382 | "php": ">=7.2" 383 | }, 384 | "suggest": { 385 | "ext-intl": "For best performance" 386 | }, 387 | "type": "library", 388 | "extra": { 389 | "thanks": { 390 | "url": "https://github.com/symfony/polyfill", 391 | "name": "symfony/polyfill" 392 | } 393 | }, 394 | "autoload": { 395 | "files": [ 396 | "bootstrap.php" 397 | ], 398 | "psr-4": { 399 | "Symfony\\Polyfill\\Intl\\Grapheme\\": "" 400 | } 401 | }, 402 | "notification-url": "https://packagist.org/downloads/", 403 | "license": [ 404 | "MIT" 405 | ], 406 | "authors": [ 407 | { 408 | "name": "Nicolas Grekas", 409 | "email": "p@tchwork.com" 410 | }, 411 | { 412 | "name": "Symfony Community", 413 | "homepage": "https://symfony.com/contributors" 414 | } 415 | ], 416 | "description": "Symfony polyfill for intl's grapheme_* functions", 417 | "homepage": "https://symfony.com", 418 | "keywords": [ 419 | "compatibility", 420 | "grapheme", 421 | "intl", 422 | "polyfill", 423 | "portable", 424 | "shim" 425 | ], 426 | "support": { 427 | "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" 428 | }, 429 | "funding": [ 430 | { 431 | "url": "https://symfony.com/sponsor", 432 | "type": "custom" 433 | }, 434 | { 435 | "url": "https://github.com/fabpot", 436 | "type": "github" 437 | }, 438 | { 439 | "url": "https://github.com/nicolas-grekas", 440 | "type": "github" 441 | }, 442 | { 443 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 444 | "type": "tidelift" 445 | } 446 | ], 447 | "time": "2025-06-27T09:58:17+00:00" 448 | }, 449 | { 450 | "name": "symfony/polyfill-intl-normalizer", 451 | "version": "v1.33.0", 452 | "source": { 453 | "type": "git", 454 | "url": "https://github.com/symfony/polyfill-intl-normalizer.git", 455 | "reference": "3833d7255cc303546435cb650316bff708a1c75c" 456 | }, 457 | "dist": { 458 | "type": "zip", 459 | "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", 460 | "reference": "3833d7255cc303546435cb650316bff708a1c75c", 461 | "shasum": "" 462 | }, 463 | "require": { 464 | "php": ">=7.2" 465 | }, 466 | "suggest": { 467 | "ext-intl": "For best performance" 468 | }, 469 | "type": "library", 470 | "extra": { 471 | "thanks": { 472 | "url": "https://github.com/symfony/polyfill", 473 | "name": "symfony/polyfill" 474 | } 475 | }, 476 | "autoload": { 477 | "files": [ 478 | "bootstrap.php" 479 | ], 480 | "psr-4": { 481 | "Symfony\\Polyfill\\Intl\\Normalizer\\": "" 482 | }, 483 | "classmap": [ 484 | "Resources/stubs" 485 | ] 486 | }, 487 | "notification-url": "https://packagist.org/downloads/", 488 | "license": [ 489 | "MIT" 490 | ], 491 | "authors": [ 492 | { 493 | "name": "Nicolas Grekas", 494 | "email": "p@tchwork.com" 495 | }, 496 | { 497 | "name": "Symfony Community", 498 | "homepage": "https://symfony.com/contributors" 499 | } 500 | ], 501 | "description": "Symfony polyfill for intl's Normalizer class and related functions", 502 | "homepage": "https://symfony.com", 503 | "keywords": [ 504 | "compatibility", 505 | "intl", 506 | "normalizer", 507 | "polyfill", 508 | "portable", 509 | "shim" 510 | ], 511 | "support": { 512 | "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" 513 | }, 514 | "funding": [ 515 | { 516 | "url": "https://symfony.com/sponsor", 517 | "type": "custom" 518 | }, 519 | { 520 | "url": "https://github.com/fabpot", 521 | "type": "github" 522 | }, 523 | { 524 | "url": "https://github.com/nicolas-grekas", 525 | "type": "github" 526 | }, 527 | { 528 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 529 | "type": "tidelift" 530 | } 531 | ], 532 | "time": "2024-09-09T11:45:10+00:00" 533 | }, 534 | { 535 | "name": "symfony/polyfill-mbstring", 536 | "version": "v1.33.0", 537 | "source": { 538 | "type": "git", 539 | "url": "https://github.com/symfony/polyfill-mbstring.git", 540 | "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" 541 | }, 542 | "dist": { 543 | "type": "zip", 544 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", 545 | "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", 546 | "shasum": "" 547 | }, 548 | "require": { 549 | "ext-iconv": "*", 550 | "php": ">=7.2" 551 | }, 552 | "provide": { 553 | "ext-mbstring": "*" 554 | }, 555 | "suggest": { 556 | "ext-mbstring": "For best performance" 557 | }, 558 | "type": "library", 559 | "extra": { 560 | "thanks": { 561 | "url": "https://github.com/symfony/polyfill", 562 | "name": "symfony/polyfill" 563 | } 564 | }, 565 | "autoload": { 566 | "files": [ 567 | "bootstrap.php" 568 | ], 569 | "psr-4": { 570 | "Symfony\\Polyfill\\Mbstring\\": "" 571 | } 572 | }, 573 | "notification-url": "https://packagist.org/downloads/", 574 | "license": [ 575 | "MIT" 576 | ], 577 | "authors": [ 578 | { 579 | "name": "Nicolas Grekas", 580 | "email": "p@tchwork.com" 581 | }, 582 | { 583 | "name": "Symfony Community", 584 | "homepage": "https://symfony.com/contributors" 585 | } 586 | ], 587 | "description": "Symfony polyfill for the Mbstring extension", 588 | "homepage": "https://symfony.com", 589 | "keywords": [ 590 | "compatibility", 591 | "mbstring", 592 | "polyfill", 593 | "portable", 594 | "shim" 595 | ], 596 | "support": { 597 | "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" 598 | }, 599 | "funding": [ 600 | { 601 | "url": "https://symfony.com/sponsor", 602 | "type": "custom" 603 | }, 604 | { 605 | "url": "https://github.com/fabpot", 606 | "type": "github" 607 | }, 608 | { 609 | "url": "https://github.com/nicolas-grekas", 610 | "type": "github" 611 | }, 612 | { 613 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 614 | "type": "tidelift" 615 | } 616 | ], 617 | "time": "2024-12-23T08:48:59+00:00" 618 | }, 619 | { 620 | "name": "symfony/service-contracts", 621 | "version": "v3.6.0", 622 | "source": { 623 | "type": "git", 624 | "url": "https://github.com/symfony/service-contracts.git", 625 | "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" 626 | }, 627 | "dist": { 628 | "type": "zip", 629 | "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", 630 | "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", 631 | "shasum": "" 632 | }, 633 | "require": { 634 | "php": ">=8.1", 635 | "psr/container": "^1.1|^2.0", 636 | "symfony/deprecation-contracts": "^2.5|^3" 637 | }, 638 | "conflict": { 639 | "ext-psr": "<1.1|>=2" 640 | }, 641 | "type": "library", 642 | "extra": { 643 | "thanks": { 644 | "url": "https://github.com/symfony/contracts", 645 | "name": "symfony/contracts" 646 | }, 647 | "branch-alias": { 648 | "dev-main": "3.6-dev" 649 | } 650 | }, 651 | "autoload": { 652 | "psr-4": { 653 | "Symfony\\Contracts\\Service\\": "" 654 | }, 655 | "exclude-from-classmap": [ 656 | "/Test/" 657 | ] 658 | }, 659 | "notification-url": "https://packagist.org/downloads/", 660 | "license": [ 661 | "MIT" 662 | ], 663 | "authors": [ 664 | { 665 | "name": "Nicolas Grekas", 666 | "email": "p@tchwork.com" 667 | }, 668 | { 669 | "name": "Symfony Community", 670 | "homepage": "https://symfony.com/contributors" 671 | } 672 | ], 673 | "description": "Generic abstractions related to writing services", 674 | "homepage": "https://symfony.com", 675 | "keywords": [ 676 | "abstractions", 677 | "contracts", 678 | "decoupling", 679 | "interfaces", 680 | "interoperability", 681 | "standards" 682 | ], 683 | "support": { 684 | "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" 685 | }, 686 | "funding": [ 687 | { 688 | "url": "https://symfony.com/sponsor", 689 | "type": "custom" 690 | }, 691 | { 692 | "url": "https://github.com/fabpot", 693 | "type": "github" 694 | }, 695 | { 696 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 697 | "type": "tidelift" 698 | } 699 | ], 700 | "time": "2025-04-25T09:37:31+00:00" 701 | }, 702 | { 703 | "name": "symfony/string", 704 | "version": "v7.3.4", 705 | "source": { 706 | "type": "git", 707 | "url": "https://github.com/symfony/string.git", 708 | "reference": "f96476035142921000338bad71e5247fbc138872" 709 | }, 710 | "dist": { 711 | "type": "zip", 712 | "url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872", 713 | "reference": "f96476035142921000338bad71e5247fbc138872", 714 | "shasum": "" 715 | }, 716 | "require": { 717 | "php": ">=8.2", 718 | "symfony/polyfill-ctype": "~1.8", 719 | "symfony/polyfill-intl-grapheme": "~1.0", 720 | "symfony/polyfill-intl-normalizer": "~1.0", 721 | "symfony/polyfill-mbstring": "~1.0" 722 | }, 723 | "conflict": { 724 | "symfony/translation-contracts": "<2.5" 725 | }, 726 | "require-dev": { 727 | "symfony/emoji": "^7.1", 728 | "symfony/http-client": "^6.4|^7.0", 729 | "symfony/intl": "^6.4|^7.0", 730 | "symfony/translation-contracts": "^2.5|^3.0", 731 | "symfony/var-exporter": "^6.4|^7.0" 732 | }, 733 | "type": "library", 734 | "autoload": { 735 | "files": [ 736 | "Resources/functions.php" 737 | ], 738 | "psr-4": { 739 | "Symfony\\Component\\String\\": "" 740 | }, 741 | "exclude-from-classmap": [ 742 | "/Tests/" 743 | ] 744 | }, 745 | "notification-url": "https://packagist.org/downloads/", 746 | "license": [ 747 | "MIT" 748 | ], 749 | "authors": [ 750 | { 751 | "name": "Nicolas Grekas", 752 | "email": "p@tchwork.com" 753 | }, 754 | { 755 | "name": "Symfony Community", 756 | "homepage": "https://symfony.com/contributors" 757 | } 758 | ], 759 | "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", 760 | "homepage": "https://symfony.com", 761 | "keywords": [ 762 | "grapheme", 763 | "i18n", 764 | "string", 765 | "unicode", 766 | "utf-8", 767 | "utf8" 768 | ], 769 | "support": { 770 | "source": "https://github.com/symfony/string/tree/v7.3.4" 771 | }, 772 | "funding": [ 773 | { 774 | "url": "https://symfony.com/sponsor", 775 | "type": "custom" 776 | }, 777 | { 778 | "url": "https://github.com/fabpot", 779 | "type": "github" 780 | }, 781 | { 782 | "url": "https://github.com/nicolas-grekas", 783 | "type": "github" 784 | }, 785 | { 786 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 787 | "type": "tidelift" 788 | } 789 | ], 790 | "time": "2025-09-11T14:36:48+00:00" 791 | }, 792 | { 793 | "name": "twig/twig", 794 | "version": "v3.21.1", 795 | "source": { 796 | "type": "git", 797 | "url": "https://github.com/twigphp/Twig.git", 798 | "reference": "285123877d4dd97dd7c11842ac5fb7e86e60d81d" 799 | }, 800 | "dist": { 801 | "type": "zip", 802 | "url": "https://api.github.com/repos/twigphp/Twig/zipball/285123877d4dd97dd7c11842ac5fb7e86e60d81d", 803 | "reference": "285123877d4dd97dd7c11842ac5fb7e86e60d81d", 804 | "shasum": "" 805 | }, 806 | "require": { 807 | "php": ">=8.1.0", 808 | "symfony/deprecation-contracts": "^2.5|^3", 809 | "symfony/polyfill-ctype": "^1.8", 810 | "symfony/polyfill-mbstring": "^1.3" 811 | }, 812 | "require-dev": { 813 | "phpstan/phpstan": "^2.0", 814 | "psr/container": "^1.0|^2.0", 815 | "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" 816 | }, 817 | "type": "library", 818 | "autoload": { 819 | "files": [ 820 | "src/Resources/core.php", 821 | "src/Resources/debug.php", 822 | "src/Resources/escaper.php", 823 | "src/Resources/string_loader.php" 824 | ], 825 | "psr-4": { 826 | "Twig\\": "src/" 827 | } 828 | }, 829 | "notification-url": "https://packagist.org/downloads/", 830 | "license": [ 831 | "BSD-3-Clause" 832 | ], 833 | "authors": [ 834 | { 835 | "name": "Fabien Potencier", 836 | "email": "fabien@symfony.com", 837 | "homepage": "http://fabien.potencier.org", 838 | "role": "Lead Developer" 839 | }, 840 | { 841 | "name": "Twig Team", 842 | "role": "Contributors" 843 | }, 844 | { 845 | "name": "Armin Ronacher", 846 | "email": "armin.ronacher@active-4.com", 847 | "role": "Project Founder" 848 | } 849 | ], 850 | "description": "Twig, the flexible, fast, and secure template language for PHP", 851 | "homepage": "https://twig.symfony.com", 852 | "keywords": [ 853 | "templating" 854 | ], 855 | "support": { 856 | "issues": "https://github.com/twigphp/Twig/issues", 857 | "source": "https://github.com/twigphp/Twig/tree/v3.21.1" 858 | }, 859 | "funding": [ 860 | { 861 | "url": "https://github.com/fabpot", 862 | "type": "github" 863 | }, 864 | { 865 | "url": "https://tidelift.com/funding/github/packagist/twig/twig", 866 | "type": "tidelift" 867 | } 868 | ], 869 | "time": "2025-05-03T07:21:55+00:00" 870 | } 871 | ], 872 | "aliases": [], 873 | "minimum-stability": "stable", 874 | "stability-flags": {}, 875 | "prefer-stable": false, 876 | "prefer-lowest": false, 877 | "platform": { 878 | "php": ">=8.2" 879 | }, 880 | "platform-dev": {}, 881 | "platform-overrides": { 882 | "php": "8.2.99" 883 | }, 884 | "plugin-api-version": "2.6.0" 885 | } 886 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------