Estado original vindo do servidor de origem via tar.gz, antes da rodada de conformidade com a knowledge-base e fixes de GLPI 11. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
90 lines
2.6 KiB
PHP
90 lines
2.6 KiB
PHP
<?php
|
|
|
|
$_GET["donotcheckversion"] = true;
|
|
$dont_check_maintenance_mode = true;
|
|
|
|
define('GLPI_AJAX', true);
|
|
include('../../../inc/includes.php');
|
|
|
|
// FIX: Prevent this script from being stored as the "Return URL" after login
|
|
if (isset($_SESSION['glpi_currentpage']) && strpos($_SESSION['glpi_currentpage'], basename(__FILE__)) !== false) {
|
|
unset($_SESSION['glpi_currentpage']);
|
|
}
|
|
|
|
// Redirect if is a not cached URL
|
|
if (!isset($_GET['_'])) {
|
|
$timestamp = PluginButterflyToolbox::getTimestamp();
|
|
|
|
// Disable cache and redirect to cached URL
|
|
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
|
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
|
header("Pragma: no-cache");
|
|
|
|
$file = basename(__FILE__);
|
|
$url = "$file?_=$timestamp";
|
|
if (isset($_GET['v'])) {
|
|
$url .= '&v=' . $_GET['v'];
|
|
}
|
|
header("Location: " . $url);
|
|
die;
|
|
}
|
|
|
|
header('Content-Type: application/javascript');
|
|
|
|
$is_cacheable = !isset($_GET['debug']) && !isset($_GET['nocache']);
|
|
if ($is_cacheable) {
|
|
// Makes CSS cacheable by browsers and proxies
|
|
$max_age = WEEK_TIMESTAMP;
|
|
header_remove('Pragma');
|
|
header('Cache-Control: public');
|
|
header('Cache-Control: max-age=' . $max_age);
|
|
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + $max_age));
|
|
}
|
|
|
|
if (false) {
|
|
?>
|
|
<script>
|
|
<?php
|
|
}
|
|
?>
|
|
<?php echo "$(function () {"; ?>
|
|
$('link[href*="butterfly/front/internal.css.php"]').appendTo($('head'))
|
|
<?php
|
|
$favicon = PluginButterflyConfig::getConfig('favicon_picture');
|
|
if ($favicon):
|
|
$faviconUrl = PluginButterflyToolbox::getPictureUrl($favicon);
|
|
?>
|
|
var $icon = $('link[rel*=icon]');
|
|
$icon.attr('type', null);
|
|
$icon.attr('href', <?php echo json_encode($faviconUrl) ?>);
|
|
<?php
|
|
endif;
|
|
$pageTitle = PluginButterflyConfig::getConfig('page_title');
|
|
if ($pageTitle):
|
|
?>
|
|
var $title = $('title');
|
|
var newTitle = $title.text().replace('GLPI', <?php echo json_encode($pageTitle) ?>);
|
|
$title.text(newTitle);
|
|
<?php
|
|
endif;
|
|
|
|
$footerDisplay = PluginButterflyConfig::getConfig('page_footer_display', 'original');
|
|
$footerText = PluginButterflyConfig::getConfig('page_footer_text', '');
|
|
if ($footerDisplay === 'hide'):
|
|
?>
|
|
$('a[id^=show_about_modal_]').hide();
|
|
<?php
|
|
endif;
|
|
if ($footerDisplay === 'custom'):
|
|
$footerText = \Glpi\RichText\RichText::getEnhancedHtml($footerText);
|
|
?>
|
|
$('div[id^=about_modal_] .copyright').parent().parent().html(<?php echo json_encode($footerText) ?>);
|
|
<?php
|
|
endif;
|
|
|
|
echo "});";
|
|
if (false) {
|
|
?>
|
|
</script>
|
|
<?php
|
|
}
|