nagiosql/index.php

70 lines
2.3 KiB
PHP
Raw Normal View History

2017-05-22 11:24:21 +02:00
<?php
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
2019-04-17 11:40:50 +02:00
// (c) 2005-2018 by Martin Willisegger
2017-05-22 11:24:21 +02:00
//
// Project : NagiosQL
// Component : Start script
2019-04-17 11:40:50 +02:00
// Website : https://sourceforge.net/projects/nagiosql/
// Version : 3.4.0
// GIT Repo : https://gitlab.com/wizonet/NagiosQL
2017-05-22 11:24:21 +02:00
//
///////////////////////////////////////////////////////////////////////////////
//
2019-04-17 11:40:50 +02:00
// Path settings
// ===================
$preRelPath = strstr(filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING), 'index.php', true);
$preBasePath = strstr(filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING), 'index.php', true);
//
2017-05-22 11:24:21 +02:00
// Destroy old session data
// ========================
session_start();
session_destroy();
//
// Define common variables
// =======================
2019-04-17 11:40:50 +02:00
$intPageID = 0;
$preContent = 'index.htm.tpl';
2017-05-22 11:24:21 +02:00
//
// Redirect to installation wizard
// ===============================
2019-04-17 11:40:50 +02:00
if (PHP_VERSION_ID < 50300) {
header('Location: install/index.php');
2017-05-22 11:24:21 +02:00
}
//
// Include preprocessing file
// ==========================
2019-04-17 11:40:50 +02:00
$preAccess = 0;
$preFieldvars = 0;
require $preBasePath.'functions/prepend_adm.php';
2017-05-22 11:24:21 +02:00
//
// Include Content
// ===============
2019-04-17 11:40:50 +02:00
$conttp->setVariable('TITLE', translate('Welcome to'));
$conttp->setVariable('TITLE_LOGIN', translate('Welcome'));
$conttp->setVariable('LOGIN_TEXT', translate('Please enter your username and password to access NagiosQL.<br>If '
. 'you forgot one of them, please contact your Administrator.'));
$conttp->setVariable('USERNAME', translate('Username'));
$conttp->setVariable('PASSWORD', translate('Password'));
$conttp->setVariable('LOGIN', translate('Login'));
if (isset($_SESSION['strLoginMessage']) && ($_SESSION['strLoginMessage'] != '')) {
$conttp->setVariable('MESSAGE', $_SESSION['strLoginMessage']);
2017-05-22 11:24:21 +02:00
} else {
2019-04-17 11:40:50 +02:00
$conttp->setVariable('MESSAGE', '&nbsp;');
2017-05-22 11:24:21 +02:00
}
2019-04-17 11:40:50 +02:00
$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING));
$conttp->setVariable('IMAGE_PATH', 'images/');
$conttp->parse('main');
$conttp->show('main');
2017-05-22 11:24:21 +02:00
//
// Include footer
// ==============
2019-04-17 11:40:50 +02:00
$maintp->setVariable('VERSION_INFO', "<a href='https://sourceforge.net/projects/nagiosql/' "
. "target='_blank'>NagiosQL</a> $setFileVersion");
$maintp->parse('footer');
$maintp->show('footer');