2006-07-11 16:14:09 +02:00
|
|
|
<?php
|
|
|
|
|
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
2009-06-08 20:26:14 +02:00
|
|
|
// ==================================================
|
2012-12-10 20:14:42 +01:00
|
|
|
// Copyright (c) 2005-2012 Artica Soluciones Tecnologicas
|
2009-06-08 20:26:14 +02:00
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2007-06-22 14:00:04 +02:00
|
|
|
|
2006-06-29 21:31:53 +02:00
|
|
|
// This program is free software; you can redistribute it and/or
|
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
|
|
|
// modify it under the terms of the GNU Lesser General Public License
|
2009-06-08 20:26:14 +02:00
|
|
|
// as published by the Free Software Foundation; version 2
|
|
|
|
|
2006-06-29 21:31:53 +02:00
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2006-06-29 21:31:53 +02:00
|
|
|
// GNU General Public License for more details.
|
2007-02-20 02:38:59 +01:00
|
|
|
|
2009-01-05 19:41:14 +01:00
|
|
|
//Set character encoding to UTF-8 - fixes a lot of multibyte character headaches
|
2009-01-16 13:37:47 +01:00
|
|
|
if (function_exists ('mb_internal_encoding')) {
|
2009-01-05 19:41:14 +01:00
|
|
|
mb_internal_encoding ("UTF-8");
|
|
|
|
}
|
|
|
|
|
2007-06-12 20:10:57 +02:00
|
|
|
// Set to 1 to do not check for installer or config file (for development!).
|
2010-03-02 Sancho Lerena <slerena@artica.es>
* include/functions_reporting.php: Solved issue with several undefined
vars.
* include/functions_servers.php: Solved issue with several undefined
vars.
* include/functions_config.php: Added metaconsola witch to readconfig.
* include/config_process.php: Update build.. is YYMMDD !
* include/functions_ui.php: Removed deprecated call to split and replaced
by preg_split.
* index.php: Activated developer mode.
* operation/agentes/estado_monitores.php: Solved small problem with modules
without history, filling missing column in table. Added headers
* godmode/alerts/configure_alert_compound.php,
operation/agentes/status_monitor.php
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php,
godmode/alerts/alert_commands.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php: Removed deprecated call to include
config.php and in some cases, added new header style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2444 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-03-02 15:13:00 +01:00
|
|
|
// Activate gives more error information, not useful for production sites
|
2013-10-01 14:53:38 +02:00
|
|
|
$develop_bypass = 0;
|
2007-04-11 05:12:48 +02:00
|
|
|
|
2008-11-17 16:49:29 +01:00
|
|
|
if ($develop_bypass != 1) {
|
2007-02-20 19:09:54 +01:00
|
|
|
// If no config file, automatically try to install
|
2008-11-17 16:49:29 +01:00
|
|
|
if (! file_exists ("include/config.php")) {
|
|
|
|
if (! file_exists ("install.php")) {
|
2013-04-22 12:31:20 +02:00
|
|
|
$login_screen = 'error_noconfig';
|
|
|
|
require('general/error_screen.php');
|
2007-04-11 05:12:48 +02:00
|
|
|
exit;
|
2011-03-01 17:42:12 +01:00
|
|
|
}
|
|
|
|
else {
|
2007-04-11 05:12:48 +02:00
|
|
|
include ("install.php");
|
2008-11-17 16:49:29 +01:00
|
|
|
exit;
|
|
|
|
}
|
2007-02-20 19:09:54 +01:00
|
|
|
}
|
2013-07-01 13:01:20 +02:00
|
|
|
|
2010-06-01 16:42:27 +02:00
|
|
|
if (filesize("include/config.php") == 0) {
|
|
|
|
include ("install.php");
|
|
|
|
exit;
|
|
|
|
}
|
2007-02-20 19:09:54 +01:00
|
|
|
// Check for installer presence
|
2008-11-17 16:49:29 +01:00
|
|
|
if (file_exists ("install.php")) {
|
2013-04-22 12:31:20 +02:00
|
|
|
$login_screen = 'error_install';
|
|
|
|
require('general/error_screen.php');
|
2007-02-20 19:09:54 +01:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
// Check perms for config.php
|
2008-11-17 16:49:29 +01:00
|
|
|
if ((substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0600") &&
|
2009-01-20 17:43:49 +01:00
|
|
|
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0660") &&
|
|
|
|
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0640")) {
|
2013-04-22 12:31:20 +02:00
|
|
|
$login_screen = 'error_perms';
|
|
|
|
require('general/error_screen.php');
|
2007-02-20 19:09:54 +01:00
|
|
|
exit;
|
|
|
|
}
|
2007-02-20 02:38:59 +01:00
|
|
|
}
|
2007-02-05 18:45:14 +01:00
|
|
|
|
2009-02-11 17:55:04 +01:00
|
|
|
if ((! file_exists ("include/config.php")) || (! is_readable ("include/config.php"))) {
|
2013-04-22 12:31:20 +02:00
|
|
|
$login_screen = 'error_noconfig';
|
|
|
|
require('general/error_screen.php');
|
2008-07-02 14:30:56 +02:00
|
|
|
exit;
|
2007-08-08 20:36:18 +02:00
|
|
|
}
|
|
|
|
|
2007-02-20 19:09:54 +01:00
|
|
|
// Real start
|
2009-02-11 17:55:04 +01:00
|
|
|
session_start ();
|
2008-07-21 14:23:28 +02:00
|
|
|
require_once ("include/config.php");
|
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
|
|
|
|
2013-01-22 10:22:56 +01:00
|
|
|
// If metaconsole activated, redirect to it
|
2013-10-02 12:08:45 +02:00
|
|
|
if ($config['metaconsole'] == 1 && $config['enterprise_installed'] == 1) {
|
2013-01-22 10:22:56 +01:00
|
|
|
header ("Location: " . $config['homeurl'] . "enterprise/meta");
|
|
|
|
}
|
|
|
|
|
2008-10-22 14:01:36 +02:00
|
|
|
/* Enterprise support */
|
2012-09-25 Miguel de Dios <miguel.dedios@artica.es>
* general/login_page.php, general/logoff.php, general/header.php,
general/login_help_dialog.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/agentes/planned_downtime.editor.php,
godmode/alerts/alert_list.list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_template.php,
include/styles/jquery-ui-1.8.23.custom.css,
include/javascript/jquery.jquery-ui-1.8.17.custom.min.js,
include/javascript/jquery.timeentry.js,
include/javascript/jquery.ui.droppable.js,
include/javascript/jquery.ui.draggable.js,
include/javascript/jquery.ui-timepicker-addon.js,
include/javascript/jquery.ui.resizable.js,
include/javascript/jquery.autocomplete.js,
include/javascript/jquery.ui.core.js,
include/javascript/jquery-1.8.2.js,
include/javascript/jquery.ui.dialog.js,
include/javascript/jquery.jquery-ui-1.8.23.custom.min.js,
include/functions_ui.php, index.php,
extensions/update_manager/update_pandora.php,
extensions/insert_data.php, operation/agentes/datos_agente.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php: updated the jquery and
jquery.ui, and removed old useless files. And added the jquery
library to timepicker and implemented the calls into the code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6999 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-25 17:34:36 +02:00
|
|
|
if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) {
|
|
|
|
include_once (ENTERPRISE_DIR . "/load_enterprise.php");
|
2008-10-22 14:01:36 +02:00
|
|
|
}
|
|
|
|
|
2012-09-25 Miguel de Dios <miguel.dedios@artica.es>
* general/login_page.php, general/logoff.php, general/header.php,
general/login_help_dialog.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/agentes/planned_downtime.editor.php,
godmode/alerts/alert_list.list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_template.php,
include/styles/jquery-ui-1.8.23.custom.css,
include/javascript/jquery.jquery-ui-1.8.17.custom.min.js,
include/javascript/jquery.timeentry.js,
include/javascript/jquery.ui.droppable.js,
include/javascript/jquery.ui.draggable.js,
include/javascript/jquery.ui-timepicker-addon.js,
include/javascript/jquery.ui.resizable.js,
include/javascript/jquery.autocomplete.js,
include/javascript/jquery.ui.core.js,
include/javascript/jquery-1.8.2.js,
include/javascript/jquery.ui.dialog.js,
include/javascript/jquery.jquery-ui-1.8.23.custom.min.js,
include/functions_ui.php, index.php,
extensions/update_manager/update_pandora.php,
extensions/insert_data.php, operation/agentes/datos_agente.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php: updated the jquery and
jquery.ui, and removed old useless files. And added the jquery
library to timepicker and implemented the calls into the code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6999 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-25 17:34:36 +02:00
|
|
|
if (file_exists (ENTERPRISE_DIR . "/include/functions_login.php")) {
|
|
|
|
include_once (ENTERPRISE_DIR . "/include/functions_login.php");
|
2012-05-17 13:08:11 +02:00
|
|
|
}
|
2008-11-05 14:12:45 +01:00
|
|
|
|
2009-01-30 16:09:16 +01:00
|
|
|
if (!empty ($config["https"]) && empty ($_SERVER['HTTPS'])) {
|
2012-02-24 Miguel de Dios <miguel.dedios@artica.es>
* pandora_console/include/functions_ui.php: changed the source code into the
function "ui_get_full_url" for accept false for to return url with the home
url or with any string (as query) return url with the php file.
* pandora_console/include/functions_graph.php,
pandora_console/include/functions_html.php,
pandora_console/include/functions_events.php,
pandora_console/include/functions_reporting.php,
pandora_console/include/functions_api.php,
pandora_console/include/functions.php, pandora_console/index.php,
pandora_console/extensions/system_info.php,
pandora_console/operation/agentes/stat_win.php,
pandora_console/operation/menu.php,
pandora_console/operation/events/events_rss.php,
pandora_console/operation/events/events_marquee.php,
pandora_console/operation/events/events.php: change in more part of source
code to use "ui_get_full_url" instead the hard write method of $_SERVER
vars, now Pandora Console run fine (in all actions I hope) with web servers
in other ports instead the typical 80.
Merged from branch pandora_4.0
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5646 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-02-24 14:48:46 +01:00
|
|
|
$query = '';
|
2009-01-30 16:09:16 +01:00
|
|
|
if (sizeof ($_REQUEST))
|
|
|
|
//Some (old) browsers don't like the ?&key=var
|
|
|
|
$query .= '?1=1';
|
|
|
|
|
|
|
|
//We don't clean these variables up as they're only being passed along
|
|
|
|
foreach ($_GET as $key => $value) {
|
|
|
|
if ($key == 1)
|
|
|
|
continue;
|
|
|
|
$query .= '&'.$key.'='.$value;
|
|
|
|
}
|
|
|
|
foreach ($_POST as $key => $value) {
|
|
|
|
$query .= '&'.$key.'='.$value;
|
|
|
|
}
|
2012-02-24 Miguel de Dios <miguel.dedios@artica.es>
* pandora_console/include/functions_ui.php: changed the source code into the
function "ui_get_full_url" for accept false for to return url with the home
url or with any string (as query) return url with the php file.
* pandora_console/include/functions_graph.php,
pandora_console/include/functions_html.php,
pandora_console/include/functions_events.php,
pandora_console/include/functions_reporting.php,
pandora_console/include/functions_api.php,
pandora_console/include/functions.php, pandora_console/index.php,
pandora_console/extensions/system_info.php,
pandora_console/operation/agentes/stat_win.php,
pandora_console/operation/menu.php,
pandora_console/operation/events/events_rss.php,
pandora_console/operation/events/events_marquee.php,
pandora_console/operation/events/events.php: change in more part of source
code to use "ui_get_full_url" instead the hard write method of $_SERVER
vars, now Pandora Console run fine (in all actions I hope) with web servers
in other ports instead the typical 80.
Merged from branch pandora_4.0
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5646 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-02-24 14:48:46 +01:00
|
|
|
$url = ui_get_full_url($query);
|
2010-08-18 13:35:42 +02:00
|
|
|
|
|
|
|
// Prevent HTTP response splitting attacks
|
|
|
|
// http://en.wikipedia.org/wiki/HTTP_response_splitting
|
2012-02-24 Miguel de Dios <miguel.dedios@artica.es>
* pandora_console/include/functions_ui.php: changed the source code into the
function "ui_get_full_url" for accept false for to return url with the home
url or with any string (as query) return url with the php file.
* pandora_console/include/functions_graph.php,
pandora_console/include/functions_html.php,
pandora_console/include/functions_events.php,
pandora_console/include/functions_reporting.php,
pandora_console/include/functions_api.php,
pandora_console/include/functions.php, pandora_console/index.php,
pandora_console/extensions/system_info.php,
pandora_console/operation/agentes/stat_win.php,
pandora_console/operation/menu.php,
pandora_console/operation/events/events_rss.php,
pandora_console/operation/events/events_marquee.php,
pandora_console/operation/events/events.php: change in more part of source
code to use "ui_get_full_url" instead the hard write method of $_SERVER
vars, now Pandora Console run fine (in all actions I hope) with web servers
in other ports instead the typical 80.
Merged from branch pandora_4.0
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5646 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-02-24 14:48:46 +01:00
|
|
|
$url = str_replace ("\n", "", $url);
|
|
|
|
|
2012-07-20 08:50:28 +02:00
|
|
|
header ('Location: '.$url);
|
2009-01-30 16:09:16 +01:00
|
|
|
exit; //Always exit after sending location headers
|
|
|
|
}
|
|
|
|
|
2008-07-02 14:30:56 +02:00
|
|
|
// Pure mode (without menu, header and footer).
|
2009-02-11 17:55:04 +01:00
|
|
|
$config["pure"] = (bool) get_parameter ("pure");
|
2008-06-13 Sancho Lerena <slerena@gmail.com>
* index.php: Added pure (Fullscreen). HTML code cleanup and user session.
* pandoradb.sql: talert_snmp: Added priority field.
* pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo
and some links.
* header.php: Fixed some user session management.
* logon_ok.php: New design for welcome screen, odometer is over.
* menu.php, godmode/menu.php: Some ACL improvements.
* agent_disk_conf_editor.php: Minor fix in view link.
* configurar_agente.php, agent_manager.php: Added parent combo and better
ACL checks. New remote configuration control for get timestamp info of
config file.
* modify_alert.php: Changes to use new internal Mail alert.
* config.php: Some items moved to config_process. (font, attachment and
default style).
* functions.php: Added form_agent_combo(), form_event_type_combo(),
form_priority() and return_priority() functions.
* functions_db.php: Added smal_event_table() to render a variable table
with latest events (filtered).
* pandora.css. Added pure and priority colors.
* estado_alertas.php: Fixed ACL problems.
* stado_generalagente.php: Graph of modules now represents modules that
has generated events. Old graph is not used anymore. Also display parent.
* estado_grupo.php: Border of boxes is now thicker.
* tactical.php: New screen, almost all code changed. Odometer is not used
anymore, added some new items, like module LAG meter, module sanity, and
other general metrics.
* ver_agente.php: Now renders also event for each agent view. Alert manual
validation generate a new event.
* events.php: New event system. 90% new code. A LOT of new features,
including full screen, coloured (by priority) and filters by six fields.
* snmp_alert.php: Added support for alert priority.
* operation/users/user.php: No longer a user with UM privileges could
see any other user.
* render_view.php: Added fullscreen support for visual maps.
* fgraph.php: Added support for session checking in graphs (at least!).
New graphics for events (some changed it's function like events by group),
and feature added to progress GD implementation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
|
|
|
|
2009-02-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/header.php, general/footer.php: Made it comply with standards
* general/main_menu.php: Fixed some typo's.
* include/javascript/jquery.pandora.js: This was loading an extension
that has a separate file already
* include/functions.php: Added process_page_head and process_page_body
these are callback functions for ob_start and add functionality like
conditional loading and external scripts in the correct places. Also adds
override functionality to certain items (like refresh) from anywhere
* include/javascript/time_en.js: Added as a placeholder
* extensions/update_manager.php: Fixed some typos
* operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/events/events.php, operation/extensions.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/groups/configure_group.php, godmode/reporting/graph_builder.php,
godmode/reporting/map_builder.php, godmode/reporting/reporting_builder.php
godmode/snmpconsole/snmp_alert.php: Changed javascript, css and jquery
loading to the new buffer callback handlers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1436 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-09 19:41:54 +01:00
|
|
|
// Auto Refresh page (can now be disabled anywhere in the script)
|
2012-06-18 12:48:07 +02:00
|
|
|
if (get_parameter ("refr"))
|
|
|
|
$config["refr"] = (int) get_parameter ("refr");
|
2012-02-24 Miguel de Dios <miguel.dedios@artica.es>
* pandora_console/include/functions_ui.php: changed the source code into the
function "ui_get_full_url" for accept false for to return url with the home
url or with any string (as query) return url with the php file.
* pandora_console/include/functions_graph.php,
pandora_console/include/functions_html.php,
pandora_console/include/functions_events.php,
pandora_console/include/functions_reporting.php,
pandora_console/include/functions_api.php,
pandora_console/include/functions.php, pandora_console/index.php,
pandora_console/extensions/system_info.php,
pandora_console/operation/agentes/stat_win.php,
pandora_console/operation/menu.php,
pandora_console/operation/events/events_rss.php,
pandora_console/operation/events/events_marquee.php,
pandora_console/operation/events/events.php: change in more part of source
code to use "ui_get_full_url" instead the hard write method of $_SERVER
vars, now Pandora Console run fine (in all actions I hope) with web servers
in other ports instead the typical 80.
Merged from branch pandora_4.0
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5646 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-02-24 14:48:46 +01:00
|
|
|
|
2009-08-14 18:29:53 +02:00
|
|
|
ob_start ();
|
2013-09-30 15:56:14 +02:00
|
|
|
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' .
|
|
|
|
"\n";
|
|
|
|
echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
|
|
|
|
echo '<head>' . "\n";
|
2009-03-03 16:21:13 +01:00
|
|
|
|
2009-08-14 18:29:53 +02:00
|
|
|
//This starts the page head. In the call back function, things from $page['head'] array will be processed into the head
|
2011-04-13 18:11:02 +02:00
|
|
|
ob_start ('ui_process_page_head');
|
2009-08-14 18:29:53 +02:00
|
|
|
|
2010-02-22 20:03:55 +01:00
|
|
|
// Enterprise main
|
2008-10-22 14:01:36 +02:00
|
|
|
enterprise_include ('index.php');
|
|
|
|
|
2011-04-13 18:11:02 +02:00
|
|
|
// This tag is included in the buffer passed to ui_process_page_head so
|
2010-02-22 20:03:55 +01:00
|
|
|
// technically it can be stripped
|
2013-09-30 15:56:14 +02:00
|
|
|
echo '</head>' . "\n";
|
|
|
|
|
2011-03-01 16:47:48 +01:00
|
|
|
require_once ("include/functions_themes.php");
|
2011-04-13 18:11:02 +02:00
|
|
|
ob_start ('ui_process_page_body');
|
2008-08-21 23:07:20 +02:00
|
|
|
|
2008-11-14 16:37:32 +01:00
|
|
|
$config["remote_addr"] = $_SERVER['REMOTE_ADDR'];
|
2006-12-15 16:25:19 +01:00
|
|
|
|
2008-12-23 22:41:05 +01:00
|
|
|
$sec2 = get_parameter_get ('sec2');
|
|
|
|
$sec2 = safe_url_extraclean ($sec2);
|
|
|
|
$page = $sec2; //Reference variable for old time sake
|
|
|
|
|
|
|
|
$sec = get_parameter_get ('sec');
|
|
|
|
$sec = safe_url_extraclean ($sec);
|
|
|
|
|
2012-04-13 12:39:28 +02:00
|
|
|
$process_login = false;
|
|
|
|
|
2012-05-17 13:08:11 +02:00
|
|
|
// Update user password
|
2012-07-02 13:11:21 +02:00
|
|
|
$change_pass = get_parameter_post('renew_password', 0);
|
2012-08-20 Miguel de Dios <miguel.dedios@artica.es>
* index.php, extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
general/login_page.php, general/logon_failed.php,
godmode/users/configure_user.php, include/api.php,
include/auth/mysql.php, pandoradb.sql, pandoradb.postgreSQL.sql,
pandoradb.oracle.sql: added the feature to set any user with
"not login" for only the user can work across the API.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6891 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-20 20:06:04 +02:00
|
|
|
|
2012-05-17 13:08:11 +02:00
|
|
|
if ($change_pass == 1) {
|
|
|
|
|
2012-07-02 13:11:21 +02:00
|
|
|
$password_new = (string) get_parameter_post ('new_password', '');
|
|
|
|
$password_confirm = (string) get_parameter_post ('confirm_new_password', '');
|
|
|
|
$id = (string) get_parameter_post ('login', '');
|
2012-08-20 Miguel de Dios <miguel.dedios@artica.es>
* index.php, extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
general/login_page.php, general/logon_failed.php,
godmode/users/configure_user.php, include/api.php,
include/auth/mysql.php, pandoradb.sql, pandoradb.postgreSQL.sql,
pandoradb.oracle.sql: added the feature to set any user with
"not login" for only the user can work across the API.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6891 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-20 20:06:04 +02:00
|
|
|
|
2012-05-17 13:08:11 +02:00
|
|
|
$changed_pass = login_update_password_check ($password_new, $password_confirm, $id);
|
|
|
|
}
|
|
|
|
|
2009-07-24 12:27:14 +02:00
|
|
|
$searchPage = false;
|
|
|
|
$search = get_parameter_get("head_search_keywords");
|
|
|
|
if (strlen($search) > 0) {
|
2014-03-05 16:29:57 +01:00
|
|
|
$config['search_keywords'] = io_safe_input(trim(io_safe_output(get_parameter('keywords'))));
|
2009-08-06 20:55:54 +02:00
|
|
|
// If not search category providad, we'll use an agent search
|
2013-04-10 09:57:54 +02:00
|
|
|
$config['search_category'] = get_parameter('search_category', 'all');
|
2009-07-24 12:27:14 +02:00
|
|
|
if (($config['search_keywords'] != 'Enter keywords to search') && (strlen($config['search_keywords']) > 0))
|
|
|
|
$searchPage = true;
|
|
|
|
}
|
|
|
|
|
2009-01-20 11:37:04 +01:00
|
|
|
// Hash login process
|
2009-03-05 13:52:59 +01:00
|
|
|
if (! isset ($config['id_user']) && isset ($_GET["loginhash"])) {
|
2009-01-20 17:43:49 +01:00
|
|
|
$loginhash_data = get_parameter("loginhash_data", "");
|
|
|
|
$loginhash_user = get_parameter("loginhash_user", "");
|
|
|
|
|
2010-08-18 13:35:42 +02:00
|
|
|
if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.$config["loginhash_pwd"])) {
|
2011-04-20 11:09:40 +02:00
|
|
|
db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
2009-01-20 11:37:04 +01:00
|
|
|
$_SESSION['id_usuario'] = $loginhash_user;
|
|
|
|
$config["id_user"] = $loginhash_user;
|
2010-09-22 18:52:29 +02:00
|
|
|
}
|
|
|
|
else {
|
2009-01-20 17:43:49 +01:00
|
|
|
require_once ('general/login_page.php');
|
2011-04-20 11:09:40 +02:00
|
|
|
db_pandora_audit("Logon Failed (loginhash", "", "system");
|
2009-02-17 19:20:04 +01:00
|
|
|
while (@ob_end_flush ());
|
|
|
|
exit ("</html>");
|
2009-01-20 17:43:49 +01:00
|
|
|
}
|
2010-09-22 18:52:29 +02:00
|
|
|
}
|
|
|
|
elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
|
2009-02-11 17:55:04 +01:00
|
|
|
// Login process
|
2013-09-30 15:56:14 +02:00
|
|
|
include_once('include/functions_db.php'); //Include it to use escape_string_sql function
|
|
|
|
|
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
|
|
|
$config["auth_error"] = ""; //Set this to the error message from the authorization mechanism
|
|
|
|
$nick = get_parameter_post ("nick"); //This is the variable with the login
|
|
|
|
$pass = get_parameter_post ("pass"); //This is the variable with the password
|
2011-04-20 11:09:40 +02:00
|
|
|
$nick = db_escape_string_sql($nick);
|
|
|
|
$pass = db_escape_string_sql($pass);
|
2012-04-13 12:39:28 +02:00
|
|
|
|
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
|
|
|
// process_user_login is a virtual function which should be defined in each auth file.
|
|
|
|
// It accepts username and password. The rest should be internal to the auth file.
|
|
|
|
// The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it
|
|
|
|
// process_user_login should return false in case of errors or invalid login, the nickname if correct
|
2010-10-27 13:33:17 +02:00
|
|
|
$nick_in_db = process_user_login ($nick, $pass);
|
2012-04-13 12:39:28 +02:00
|
|
|
|
2012-05-17 13:08:11 +02:00
|
|
|
$expired_pass = false;
|
|
|
|
|
2012-08-20 Miguel de Dios <miguel.dedios@artica.es>
* index.php, extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
general/login_page.php, general/logon_failed.php,
godmode/users/configure_user.php, include/api.php,
include/auth/mysql.php, pandoradb.sql, pandoradb.postgreSQL.sql,
pandoradb.oracle.sql: added the feature to set any user with
"not login" for only the user can work across the API.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6891 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-20 20:06:04 +02:00
|
|
|
if (($nick_in_db != false) && ((!is_user_admin($nick)
|
|
|
|
|| $config['enable_pass_policy_admin']))
|
|
|
|
&& (defined('PANDORA_ENTERPRISE'))
|
|
|
|
&& ($config['enable_pass_policy'])) {
|
2012-05-17 13:08:11 +02:00
|
|
|
include_once(ENTERPRISE_DIR."/include/auth/mysql.php");
|
2012-08-20 Miguel de Dios <miguel.dedios@artica.es>
* index.php, extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
general/login_page.php, general/logon_failed.php,
godmode/users/configure_user.php, include/api.php,
include/auth/mysql.php, pandoradb.sql, pandoradb.postgreSQL.sql,
pandoradb.oracle.sql: added the feature to set any user with
"not login" for only the user can work across the API.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6891 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-20 20:06:04 +02:00
|
|
|
|
2012-05-17 13:08:11 +02:00
|
|
|
$blocked = login_check_blocked($nick);
|
|
|
|
|
|
|
|
if ($blocked) {
|
|
|
|
require_once ('general/login_page.php');
|
|
|
|
db_pandora_audit("Password expired", "Password expired: ".$nick, $nick);
|
|
|
|
while (@ob_end_flush ());
|
|
|
|
exit ("</html>");
|
|
|
|
}
|
|
|
|
|
|
|
|
//Checks if password has expired
|
|
|
|
$check_status = check_pass_status($nick, $pass);
|
|
|
|
|
|
|
|
switch ($check_status) {
|
2013-02-26 17:31:40 +01:00
|
|
|
case PASSSWORD_POLICIES_FIRST_CHANGE: //first change
|
|
|
|
case PASSSWORD_POLICIES_EXPIRED: //pass expired
|
2012-05-17 13:08:11 +02:00
|
|
|
$expired_pass = true;
|
|
|
|
login_change_password($nick);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2012-07-03 Miguel de Dios <miguel.dedios@artica.es>
* ajax.php: added support for the enterprise, because some case
this file can't call enterprise functions.
* godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/visual_console_builder.constans.php (delete),
include/functions_visual_map_editor.php,
include/ajax/visual_console_builder.ajax.php,
include/functions_visual_map.php: some parts of code had been
refactored because it is necesary for to add enterprise feature to
Visual map.
* include/constants.php: cleaned source code style and added and
reordened the constants for visual maps.
* include/functions_html.php, include/styles/pandora.css,
include/functions_ui.php, include/functions.php, index.php: cleaned
source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6732 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-03 17:39:37 +02:00
|
|
|
|
2013-09-30 15:56:14 +02:00
|
|
|
if (($nick_in_db !== false) && $expired_pass) {
|
|
|
|
//login ok and password has expired
|
|
|
|
|
2012-05-17 13:08:11 +02:00
|
|
|
require_once ('general/login_page.php');
|
|
|
|
db_pandora_audit("Password expired", "Password expired: ".$nick, $nick);
|
|
|
|
while (@ob_end_flush ());
|
|
|
|
exit ("</html>");
|
2012-07-03 Miguel de Dios <miguel.dedios@artica.es>
* ajax.php: added support for the enterprise, because some case
this file can't call enterprise functions.
* godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/visual_console_builder.constans.php (delete),
include/functions_visual_map_editor.php,
include/ajax/visual_console_builder.ajax.php,
include/functions_visual_map.php: some parts of code had been
refactored because it is necesary for to add enterprise feature to
Visual map.
* include/constants.php: cleaned source code style and added and
reordened the constants for visual maps.
* include/functions_html.php, include/styles/pandora.css,
include/functions_ui.php, include/functions.php, index.php: cleaned
source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6732 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-03 17:39:37 +02:00
|
|
|
}
|
2012-08-20 Miguel de Dios <miguel.dedios@artica.es>
* index.php, extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
general/login_page.php, general/logon_failed.php,
godmode/users/configure_user.php, include/api.php,
include/auth/mysql.php, pandoradb.sql, pandoradb.postgreSQL.sql,
pandoradb.oracle.sql: added the feature to set any user with
"not login" for only the user can work across the API.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6891 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-20 20:06:04 +02:00
|
|
|
else if (($nick_in_db !== false) && (!$expired_pass)) {
|
|
|
|
//login ok and password has not expired
|
2012-04-13 12:39:28 +02:00
|
|
|
$process_login = true;
|
|
|
|
|
2013-10-02 12:08:45 +02:00
|
|
|
echo "<script type='text/javascript'>var process_login_ok = 1;</script>";
|
|
|
|
|
2009-01-07 11:42:38 +01:00
|
|
|
unset ($_GET["sec2"]);
|
|
|
|
$_GET["sec"] = "general/logon_ok";
|
2012-03-12 13:50:47 +01:00
|
|
|
$home_page ='';
|
|
|
|
if (isset($nick)) {
|
|
|
|
$user_info = users_get_user_by_id($nick);
|
|
|
|
$home_page = io_safe_output($user_info['section']);
|
|
|
|
$home_url = $user_info['data_section'];
|
|
|
|
if ($home_page != '') {
|
|
|
|
switch($home_page) {
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Event list':
|
2012-03-12 13:50:47 +01:00
|
|
|
$_GET["sec"] = "eventos";
|
|
|
|
$_GET["sec2"] = "operation/events/events";
|
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Group view':
|
2012-03-12 13:50:47 +01:00
|
|
|
$_GET["sec"] = "estado";
|
2012-03-12 15:53:20 +01:00
|
|
|
$_GET["sec2"] = "operation/agentes/group_view";
|
2012-03-12 13:50:47 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Alert detail':
|
2012-03-12 13:50:47 +01:00
|
|
|
$_GET["sec"] = "estado";
|
2012-03-12 15:53:20 +01:00
|
|
|
$_GET["sec2"] = "operation/agentes/alerts_status";
|
2012-03-12 13:50:47 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Tactical view':
|
2012-03-12 13:50:47 +01:00
|
|
|
$_GET["sec"] = "estado";
|
2012-03-12 15:53:20 +01:00
|
|
|
$_GET["sec2"] = "operation/agentes/tactical";
|
2012-03-12 13:50:47 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Default':
|
2012-03-12 13:50:47 +01:00
|
|
|
$_GET["sec"] = "general/logon_ok";
|
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Dashboard':
|
2012-03-12 13:50:47 +01:00
|
|
|
$_GET["sec"] = "dashboard";
|
2012-03-12 15:53:20 +01:00
|
|
|
$_GET["sec2"] = ENTERPRISE_DIR.'/dashboard/main_dashboard';
|
2012-03-12 13:50:47 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Visual console':
|
2012-03-12 13:50:47 +01:00
|
|
|
$_GET["sec"] = "visualc";
|
2012-03-12 15:53:20 +01:00
|
|
|
$_GET["sec2"] = "operation/visual_console/index";
|
2012-03-12 13:50:47 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Other':
|
2012-03-12 13:50:47 +01:00
|
|
|
$home_url = io_safe_output($home_url);
|
|
|
|
parse_str ($home_url, $res);
|
|
|
|
$_GET["sec"] = $res["sec"];
|
2012-03-12 15:53:20 +01:00
|
|
|
$_GET["sec2"] = $res["sec2"];
|
2012-03-12 13:50:47 +01:00
|
|
|
break;
|
|
|
|
}
|
2012-07-03 Miguel de Dios <miguel.dedios@artica.es>
* ajax.php: added support for the enterprise, because some case
this file can't call enterprise functions.
* godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/visual_console_builder.constans.php (delete),
include/functions_visual_map_editor.php,
include/ajax/visual_console_builder.ajax.php,
include/functions_visual_map.php: some parts of code had been
refactored because it is necesary for to add enterprise feature to
Visual map.
* include/constants.php: cleaned source code style and added and
reordened the constants for visual maps.
* include/functions_html.php, include/styles/pandora.css,
include/functions_ui.php, include/functions.php, index.php: cleaned
source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6732 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-03 17:39:37 +02:00
|
|
|
}
|
|
|
|
else {
|
2012-03-12 13:50:47 +01:00
|
|
|
$_GET["sec"] = "general/logon_ok";
|
|
|
|
}
|
|
|
|
}
|
2011-04-20 11:09:40 +02:00
|
|
|
db_logon ($nick_in_db, $_SERVER['REMOTE_ADDR']);
|
2010-10-27 13:33:17 +02:00
|
|
|
$_SESSION['id_usuario'] = $nick_in_db;
|
|
|
|
$config['id_user'] = $nick_in_db;
|
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
|
|
|
//Remove everything that might have to do with people's passwords or logins
|
|
|
|
unset ($_GET['pass'], $pass, $_POST['pass'], $_REQUEST['pass'], $login_good);
|
2012-04-13 12:39:28 +02:00
|
|
|
|
2011-07-26 12:32:13 +02:00
|
|
|
$user_language = get_user_language ($config['id_user']);
|
2012-04-13 12:39:28 +02:00
|
|
|
|
2009-11-27 Sancho lerena <slerena@artica.es>
* operation/menu.php: User section has no ACL check, always can be seen.
* index.php: Added suppor for user-defined custom language (this code was
on my disk for 3 months, pending to be commited!).
* include/functions_db.php,
* include/functions_agents.php,
* godmode/alerts/alert_list.php,
* godmode/agentes/modificar_agente.php,
* godmode/agentes/configurar_agente.php: Added audit calls to several
management operations who don't have or have insufficient audit info.
* godmode/users/configure_user.php: Fixed several annoyings bugs. Added
custom language support, and added more audit info on management operations.
* godmode/users/user_list.php: More audit info.
* include/config_process.php: Add new debug option to render error log to
/pandora_console.log. Also set timezone if not defined (this makes warnings
on several PHP 5.x setups). Added user custom language support.
* include/functions_events.php: More audit info. Fixed problems with HTML
encoding render.
* functions_io.php: Some cleaning.
* include/functions_messages.php: Fixed problems with HTML
encoding render.
* functions_ui.php: Fixed problems with HTML encoding render in
print_string_substr() function.
* auth/mysql.php: is_user_admin() functions seems to be broken ¿?¿!. Fixed.
* styles/pandora.css: removed green colored left border in default style.
* message.php, incident*: Fixed problems with HTML encoding render.
* user.php: Better ACL check before let user to view/edit another user.
* user_edit: Removed some un-used form fields, some arrangements in layout,
and FIXED forever problems with password change (new code written).
* users/user_statistics.php: Now user can see its own audit records.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2139 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-27 21:02:12 +01:00
|
|
|
$l10n = NULL;
|
2011-07-26 12:32:13 +02:00
|
|
|
if (file_exists ('./include/languages/'.$user_language.'.mo')) {
|
|
|
|
$l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$user_language.'.mo'));
|
2009-11-27 Sancho lerena <slerena@artica.es>
* operation/menu.php: User section has no ACL check, always can be seen.
* index.php: Added suppor for user-defined custom language (this code was
on my disk for 3 months, pending to be commited!).
* include/functions_db.php,
* include/functions_agents.php,
* godmode/alerts/alert_list.php,
* godmode/agentes/modificar_agente.php,
* godmode/agentes/configurar_agente.php: Added audit calls to several
management operations who don't have or have insufficient audit info.
* godmode/users/configure_user.php: Fixed several annoyings bugs. Added
custom language support, and added more audit info on management operations.
* godmode/users/user_list.php: More audit info.
* include/config_process.php: Add new debug option to render error log to
/pandora_console.log. Also set timezone if not defined (this makes warnings
on several PHP 5.x setups). Added user custom language support.
* include/functions_events.php: More audit info. Fixed problems with HTML
encoding render.
* functions_io.php: Some cleaning.
* include/functions_messages.php: Fixed problems with HTML
encoding render.
* functions_ui.php: Fixed problems with HTML encoding render in
print_string_substr() function.
* auth/mysql.php: is_user_admin() functions seems to be broken ¿?¿!. Fixed.
* styles/pandora.css: removed green colored left border in default style.
* message.php, incident*: Fixed problems with HTML encoding render.
* user.php: Better ACL check before let user to view/edit another user.
* user_edit: Removed some un-used form fields, some arrangements in layout,
and FIXED forever problems with password change (new code written).
* users/user_statistics.php: Now user can see its own audit records.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2139 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-27 21:02:12 +01:00
|
|
|
$l10n->load_tables();
|
|
|
|
}
|
2010-09-22 18:52:29 +02:00
|
|
|
}
|
2012-05-17 13:08:11 +02:00
|
|
|
else { //login wrong
|
|
|
|
$blocked = false;
|
|
|
|
|
2012-12-07 07:36:22 +01:00
|
|
|
if ((!is_user_admin($nick) || $config['enable_pass_policy_admin']) && defined('PANDORA_ENTERPRISE')) {
|
2012-05-17 13:08:11 +02:00
|
|
|
$blocked = login_check_blocked($nick);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$blocked) {
|
2012-12-07 07:36:22 +01:00
|
|
|
if (defined('PANDORA_ENTERPRISE')) {
|
|
|
|
login_check_failed($nick); //Checks failed attempts
|
|
|
|
}
|
2012-05-17 13:08:11 +02:00
|
|
|
$login_failed = true;
|
|
|
|
require_once ('general/login_page.php');
|
|
|
|
db_pandora_audit("Logon Failed", "Invalid login: ".$nick, $nick);
|
|
|
|
while (@ob_end_flush ());
|
|
|
|
exit ("</html>");
|
2012-07-30 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/alerts/alert_list.php, godmode/menu.php,
godmode/snmpconsole/snmp_filters.php, godmode/tag/edit_tag.php,
include/functions_alerts.php, include/functions_html.php,
pandoradb.sql, index.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6828 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-30 10:45:40 +02:00
|
|
|
}
|
|
|
|
else {
|
2012-05-17 13:08:11 +02:00
|
|
|
require_once ('general/login_page.php');
|
|
|
|
db_pandora_audit("Logon Failed", "Invalid login: ".$nick, $nick);
|
|
|
|
while (@ob_end_flush ());
|
|
|
|
exit ("</html>");
|
|
|
|
}
|
2007-02-27 20:03:56 +01:00
|
|
|
}
|
2010-09-22 18:52:29 +02:00
|
|
|
}
|
|
|
|
elseif (! isset ($config['id_user'])) {
|
2008-06-26 16:57:11 +02:00
|
|
|
// There is no user connected
|
2009-01-07 11:42:38 +01:00
|
|
|
require_once ('general/login_page.php');
|
2009-02-17 19:20:04 +01:00
|
|
|
while (@ob_end_flush ());
|
|
|
|
exit ("</html>");
|
2008-06-26 16:57:11 +02:00
|
|
|
}
|
2007-02-27 20:03:56 +01:00
|
|
|
|
2008-06-26 16:57:11 +02:00
|
|
|
// Log off
|
|
|
|
if (isset ($_GET["bye"])) {
|
2009-01-16 11:55:29 +01:00
|
|
|
include ("general/logoff.php");
|
2008-06-26 16:57:11 +02:00
|
|
|
$iduser = $_SESSION["id_usuario"];
|
2011-04-20 11:09:40 +02:00
|
|
|
db_logoff ($iduser, $_SERVER['REMOTE_ADDR']);
|
2010-02-10 18:10:10 +01:00
|
|
|
// Unregister Session (compatible with 5.2 and 6.x, old code was deprecated
|
|
|
|
unset($_SESSION['id_usuario']);
|
|
|
|
unset($iduser);
|
2009-02-17 19:20:04 +01:00
|
|
|
while (@ob_end_flush ());
|
|
|
|
exit ("</html>");
|
2008-06-26 16:57:11 +02:00
|
|
|
}
|
2008-07-02 14:30:56 +02:00
|
|
|
|
2011-09-26 21:59:49 +02:00
|
|
|
/**
|
|
|
|
* Load the basic configurations of extension and add extensions into menu.
|
|
|
|
* Load here, because if not, some extensions not load well, I don't why.
|
|
|
|
*/
|
2012-04-26 22:46:38 +02:00
|
|
|
|
2011-09-26 21:59:49 +02:00
|
|
|
extensions_load_extensions ($config['extensions']);
|
2012-04-13 12:39:28 +02:00
|
|
|
if ($process_login) {
|
|
|
|
/* Call all extensions login function */
|
|
|
|
extensions_call_login_function ();
|
2012-04-23 13:20:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Set the initial global counter for chat.
|
|
|
|
users_get_last_global_counter('session');
|
|
|
|
}
|
2012-07-03 Miguel de Dios <miguel.dedios@artica.es>
* ajax.php: added support for the enterprise, because some case
this file can't call enterprise functions.
* godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/visual_console_builder.constans.php (delete),
include/functions_visual_map_editor.php,
include/ajax/visual_console_builder.ajax.php,
include/functions_visual_map.php: some parts of code had been
refactored because it is necesary for to add enterprise feature to
Visual map.
* include/constants.php: cleaned source code style and added and
reordened the constants for visual maps.
* include/functions_html.php, include/styles/pandora.css,
include/functions_ui.php, include/functions.php, index.php: cleaned
source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6732 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-03 17:39:37 +02:00
|
|
|
|
2012-04-23 13:20:28 +02:00
|
|
|
//Get old parameters before navigation.
|
|
|
|
$old_sec = '';
|
|
|
|
$old_sec2 = '';
|
2012-04-23 16:29:34 +02:00
|
|
|
$old_page = '';
|
|
|
|
if (isset($_SERVER['HTTP_REFERER']))
|
|
|
|
$old_page = $_SERVER['HTTP_REFERER'];
|
2012-04-23 13:20:28 +02:00
|
|
|
$chunks = explode('?', $old_page);
|
|
|
|
if (count($chunks) == 2) {
|
|
|
|
$chunks = explode('&', $chunks[1]);
|
|
|
|
|
|
|
|
foreach ($chunks as $chunk) {
|
|
|
|
if (strstr($chunk, 'sec=') !== false) {
|
|
|
|
$old_sec = str_replace('sec=', '', $chunk);
|
|
|
|
}
|
|
|
|
if (strstr($chunk, 'sec2=') !== false) {
|
|
|
|
$old_sec = str_replace('sec2=', '', $chunk);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$_SESSION['new_chat'] = false;
|
|
|
|
if ($old_sec2 == 'operation/users/webchat') {
|
|
|
|
users_get_last_global_counter('session');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($page == 'operation/users/webchat') {
|
|
|
|
//Reload the global counter.
|
|
|
|
users_get_last_global_counter('session');
|
|
|
|
}
|
2012-04-23 18:38:09 +02:00
|
|
|
|
|
|
|
if (isset($_SESSION['global_counter_chat']))
|
|
|
|
$old_global_counter_chat = $_SESSION['global_counter_chat'];
|
|
|
|
else
|
|
|
|
$old_global_counter_chat = users_get_last_global_counter('return');
|
2012-04-23 13:20:28 +02:00
|
|
|
$now_global_counter_chat = users_get_last_global_counter('return');
|
|
|
|
|
|
|
|
if ($old_global_counter_chat != $now_global_counter_chat) {
|
|
|
|
if (!users_is_last_system_message())
|
|
|
|
$_SESSION['new_chat'] = true;
|
2012-04-13 12:39:28 +02:00
|
|
|
}
|
2011-09-26 21:59:49 +02:00
|
|
|
|
2013-09-30 15:56:14 +02:00
|
|
|
if (get_parameter ('login', 0) !== 0) {
|
2014-05-30 11:27:20 +02:00
|
|
|
// Display news dialog
|
|
|
|
include_once("general/news_dialog.php");
|
2012-04-25 21:20:23 +02:00
|
|
|
|
2014-05-30 11:27:20 +02:00
|
|
|
// Display login help info dialog
|
2012-04-25 21:20:23 +02:00
|
|
|
// If it's configured to not skip this
|
2013-02-19 Miguel de Dios <miguel.dedios@artica.es>
* godmode/alerts/configure_alert_command.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/reporting/reporting_builder.list_items.php,
godmode/agentes/agent_template.php,
godmode/snmpconsole/snmp_alert.php, index.php,
operation/search_users.php,
operation/integria_incidents/incident.php,
operation/reporting/reporting_xml.php,
operation/agentes/exportdata.csv.php: cleaned source code style.
* general/login_help_dialog.php, general/login_page.php: fixed the
set to hidden window of info.
Fixes: #3604645
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7680 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-19 12:27:57 +01:00
|
|
|
if (!isset($config['skip_login_help_dialog']) ||
|
|
|
|
$config['skip_login_help_dialog'] == 0) {
|
2012-04-25 21:20:23 +02:00
|
|
|
|
|
|
|
include_once("general/login_help_dialog.php");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-06-26 16:57:11 +02:00
|
|
|
// Header
|
2008-08-04 10:15:16 +02:00
|
|
|
if ($config["pure"] == 0) {
|
2008-08-21 23:07:20 +02:00
|
|
|
echo '<div id="container"><div id="head">';
|
2012-04-13 12:39:28 +02:00
|
|
|
require ("general/header.php");
|
2008-08-21 23:07:20 +02:00
|
|
|
echo '</div><div id="page"><div id="menu">';
|
2008-06-26 16:57:11 +02:00
|
|
|
require ("general/main_menu.php");
|
2008-07-02 14:30:56 +02:00
|
|
|
echo '</div>';
|
2011-02-24 10:40:14 +01:00
|
|
|
}
|
|
|
|
else {
|
2008-06-26 16:57:11 +02:00
|
|
|
echo '<div id="main_pure">';
|
2012-09-27 15:02:16 +02:00
|
|
|
// Require menu only to build structure to use it in ACLs
|
|
|
|
require ("operation/menu.php");
|
|
|
|
require ("godmode/menu.php");
|
2008-06-26 16:57:11 +02:00
|
|
|
}
|
|
|
|
|
2011-06-16 21:26:45 +02:00
|
|
|
// http://es2.php.net/manual/en/ref.session.php#64525
|
|
|
|
// Session locking concurrency speedup!
|
|
|
|
session_write_close ();
|
|
|
|
|
2012-04-13 12:39:28 +02:00
|
|
|
|
2008-06-26 16:57:11 +02:00
|
|
|
// Main block of content
|
2008-10-22 14:01:36 +02:00
|
|
|
if ($config["pure"] == 0) {
|
2008-06-26 16:57:11 +02:00
|
|
|
echo '<div id="main">';
|
|
|
|
}
|
2008-06-13 Sancho Lerena <slerena@gmail.com>
* index.php: Added pure (Fullscreen). HTML code cleanup and user session.
* pandoradb.sql: talert_snmp: Added priority field.
* pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo
and some links.
* header.php: Fixed some user session management.
* logon_ok.php: New design for welcome screen, odometer is over.
* menu.php, godmode/menu.php: Some ACL improvements.
* agent_disk_conf_editor.php: Minor fix in view link.
* configurar_agente.php, agent_manager.php: Added parent combo and better
ACL checks. New remote configuration control for get timestamp info of
config file.
* modify_alert.php: Changes to use new internal Mail alert.
* config.php: Some items moved to config_process. (font, attachment and
default style).
* functions.php: Added form_agent_combo(), form_event_type_combo(),
form_priority() and return_priority() functions.
* functions_db.php: Added smal_event_table() to render a variable table
with latest events (filtered).
* pandora.css. Added pure and priority colors.
* estado_alertas.php: Fixed ACL problems.
* stado_generalagente.php: Graph of modules now represents modules that
has generated events. Old graph is not used anymore. Also display parent.
* estado_grupo.php: Border of boxes is now thicker.
* tactical.php: New screen, almost all code changed. Odometer is not used
anymore, added some new items, like module LAG meter, module sanity, and
other general metrics.
* ver_agente.php: Now renders also event for each agent view. Alert manual
validation generate a new event.
* events.php: New event system. 90% new code. A LOT of new features,
including full screen, coloured (by priority) and filters by six fields.
* snmp_alert.php: Added support for alert priority.
* operation/users/user.php: No longer a user with UM privileges could
see any other user.
* render_view.php: Added fullscreen support for visual maps.
* fgraph.php: Added support for session checking in graphs (at least!).
New graphics for events (some changed it's function like events by group),
and feature added to progress GD implementation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
|
|
|
|
2012-04-13 12:39:28 +02:00
|
|
|
|
|
|
|
|
2008-06-26 16:57:11 +02:00
|
|
|
// Page loader / selector
|
2009-07-24 12:27:14 +02:00
|
|
|
if ($searchPage) {
|
|
|
|
require ('operation/search_results.php');
|
|
|
|
}
|
2010-02-22 20:03:55 +01:00
|
|
|
else {
|
2009-07-24 12:27:14 +02:00
|
|
|
if ($page != "") {
|
|
|
|
$page .= '.php';
|
2010-02-22 20:03:55 +01:00
|
|
|
// Enterprise ACL check
|
2012-06-18 17:16:17 +02:00
|
|
|
if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $sec, $sec2, true)) == false) {
|
2010-02-22 20:03:55 +01:00
|
|
|
require ("general/noaccess.php");
|
2012-11-07 16:15:18 +01:00
|
|
|
}
|
2010-02-22 20:03:55 +01:00
|
|
|
elseif (file_exists ($page)) {
|
2012-02-22 12:23:27 +01:00
|
|
|
if (! extensions_is_extension ($page)) {
|
2011-04-20 16:22:40 +02:00
|
|
|
require_once($page);
|
2010-02-22 20:03:55 +01:00
|
|
|
}
|
2009-07-24 12:27:14 +02:00
|
|
|
else {
|
|
|
|
if ($sec[0] == 'g')
|
2011-05-11 14:15:14 +02:00
|
|
|
extensions_call_godmode_function (basename ($page));
|
2009-07-24 12:27:14 +02:00
|
|
|
else
|
2011-05-11 14:15:14 +02:00
|
|
|
extensions_call_main_function (basename ($page));
|
2008-08-04 10:15:16 +02:00
|
|
|
}
|
2009-07-24 12:27:14 +02:00
|
|
|
}
|
2013-05-23 17:42:32 +02:00
|
|
|
else {
|
|
|
|
ui_print_error_message(__('Sorry! I can\'t find the page!'));
|
|
|
|
}
|
2012-03-08 17:42:31 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
//home screen chosen by the user
|
|
|
|
$home_page ='';
|
|
|
|
if (isset($config['id_user'])) {
|
|
|
|
$user_info = users_get_user_by_id($config['id_user']);
|
|
|
|
$home_page = io_safe_output($user_info['section']);
|
|
|
|
$home_url = $user_info['data_section'];
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($home_page != '') {
|
|
|
|
switch($home_page) {
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Event list':
|
2012-03-12 12:15:23 +01:00
|
|
|
require ('operation/events/events.php');
|
2012-03-08 17:42:31 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Group view':
|
2012-03-12 12:15:23 +01:00
|
|
|
require ('operation/agentes/group_view.php');
|
2012-03-08 17:42:31 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Alert detail':
|
2012-03-12 12:15:23 +01:00
|
|
|
require ('operation/agentes/alerts_status.php');
|
2012-03-08 17:42:31 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Tactical view':
|
2012-03-12 12:15:23 +01:00
|
|
|
require ('operation/agentes/tactical.php');
|
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Default':
|
2012-03-12 12:15:23 +01:00
|
|
|
require ('general/logon_ok.php');
|
2012-03-08 17:42:31 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Dashboard':
|
2012-03-08 17:42:31 +01:00
|
|
|
$id_dashboard = db_get_value('id', 'tdashboard', 'name', $home_url);
|
2012-03-12 12:15:23 +01:00
|
|
|
$str = 'sec=visualc&sec2='.ENTERPRISE_DIR.'/dashboard/main_dashboard&id='.$id_dashboard;
|
|
|
|
parse_str($str, $res);
|
|
|
|
foreach ($res as $key => $param) {
|
|
|
|
$_GET[$key] = $param;
|
|
|
|
}
|
|
|
|
require(ENTERPRISE_DIR.'/dashboard/main_dashboard.php');
|
2012-03-08 17:42:31 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Visual console':
|
2012-03-08 17:42:31 +01:00
|
|
|
$id_visualc = db_get_value('id', 'tlayout', 'name', $home_url);
|
2012-03-12 15:53:20 +01:00
|
|
|
if (($home_url == '') || ($id_visualc == false)) {
|
|
|
|
$str = 'sec=visualc&sec2=operation/visual_console/index&refr=60';
|
|
|
|
} else
|
2012-03-12 12:15:23 +01:00
|
|
|
$str = 'sec=visualc&sec2=operation/visual_console/render_view&id='.$id_visualc .'&refr=60';
|
|
|
|
parse_str($str, $res);
|
|
|
|
foreach ($res as $key => $param) {
|
|
|
|
$_GET[$key] = $param;
|
|
|
|
}
|
2012-03-12 15:53:20 +01:00
|
|
|
require($_GET["sec2"].'.php');
|
2012-03-08 17:42:31 +01:00
|
|
|
break;
|
2012-04-21 11:06:22 +02:00
|
|
|
case 'Other':
|
2012-03-12 12:15:23 +01:00
|
|
|
$home_url = io_safe_output($home_url);
|
|
|
|
parse_str ($home_url, $res);
|
|
|
|
foreach ($res as $key => $param) {
|
|
|
|
$_GET[$key] = $param;
|
|
|
|
}
|
|
|
|
if (isset($_GET['sec2'])) {
|
|
|
|
$file = $_GET['sec2'].'.php';
|
|
|
|
|
|
|
|
if (!file_exists ($file)) {
|
|
|
|
unset($_GET['sec2']);
|
|
|
|
require('general/logon_ok.php');
|
2012-07-30 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/alerts/alert_list.php, godmode/menu.php,
godmode/snmpconsole/snmp_filters.php, godmode/tag/edit_tag.php,
include/functions_alerts.php, include/functions_html.php,
pandoradb.sql, index.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6828 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-30 10:45:40 +02:00
|
|
|
}
|
|
|
|
else {
|
2012-03-12 12:15:23 +01:00
|
|
|
require($file);
|
|
|
|
}
|
|
|
|
}
|
2012-03-08 17:42:31 +01:00
|
|
|
break;
|
|
|
|
}
|
2012-07-03 Miguel de Dios <miguel.dedios@artica.es>
* ajax.php: added support for the enterprise, because some case
this file can't call enterprise functions.
* godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/visual_console_builder.constans.php (delete),
include/functions_visual_map_editor.php,
include/ajax/visual_console_builder.ajax.php,
include/functions_visual_map.php: some parts of code had been
refactored because it is necesary for to add enterprise feature to
Visual map.
* include/constants.php: cleaned source code style and added and
reordened the constants for visual maps.
* include/functions_html.php, include/styles/pandora.css,
include/functions_ui.php, include/functions.php, index.php: cleaned
source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6732 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-03 17:39:37 +02:00
|
|
|
}
|
|
|
|
else {
|
2012-03-08 17:42:31 +01:00
|
|
|
require("general/logon_ok.php");
|
|
|
|
}
|
2008-08-04 10:15:16 +02:00
|
|
|
}
|
2012-02-01 11:57:43 +01:00
|
|
|
require("general/shortcut_bar.php");
|
2008-08-21 23:07:20 +02:00
|
|
|
}
|
2008-06-26 16:57:11 +02:00
|
|
|
|
2009-01-16 11:55:29 +01:00
|
|
|
if ($config["pure"] == 0) {
|
2013-04-10 09:57:54 +02:00
|
|
|
echo '<div style="clear:both"></div>';
|
2008-06-26 16:57:11 +02:00
|
|
|
echo '</div>'; // main
|
2008-12-19 22:45:20 +01:00
|
|
|
echo '<div style="clear:both"> </div>';
|
2008-08-21 23:07:20 +02:00
|
|
|
echo '</div>'; // page (id = page)
|
2011-03-01 17:42:12 +01:00
|
|
|
}
|
|
|
|
else {
|
2008-08-21 23:07:20 +02:00
|
|
|
echo "</div>"; // main_pure
|
2008-06-26 16:57:11 +02:00
|
|
|
}
|
|
|
|
|
2012-04-21 11:06:22 +02:00
|
|
|
|
2008-06-26 16:57:11 +02:00
|
|
|
if ($config["pure"] == 0) {
|
2013-06-03 13:10:20 +02:00
|
|
|
echo '</div>'; //container div
|
2013-08-01 16:56:50 +02:00
|
|
|
echo '<div style="clear:both"></div>';
|
2008-06-26 16:57:11 +02:00
|
|
|
echo '<div id="foot">';
|
2008-07-02 14:30:56 +02:00
|
|
|
require ("general/footer.php");
|
2008-06-26 16:57:11 +02:00
|
|
|
echo '</div>';
|
|
|
|
}
|
2009-02-25 14:48:40 +01:00
|
|
|
while (@ob_end_flush ());
|
2009-02-25 13:24:06 +01:00
|
|
|
|
2011-04-20 11:09:40 +02:00
|
|
|
db_print_database_debug ();
|
2009-02-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/header.php, general/footer.php: Made it comply with standards
* general/main_menu.php: Fixed some typo's.
* include/javascript/jquery.pandora.js: This was loading an extension
that has a separate file already
* include/functions.php: Added process_page_head and process_page_body
these are callback functions for ob_start and add functionality like
conditional loading and external scripts in the correct places. Also adds
override functionality to certain items (like refresh) from anywhere
* include/javascript/time_en.js: Added as a placeholder
* extensions/update_manager.php: Fixed some typos
* operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/events/events.php, operation/extensions.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/groups/configure_group.php, godmode/reporting/graph_builder.php,
godmode/reporting/map_builder.php, godmode/reporting/reporting_builder.php
godmode/snmpconsole/snmp_alert.php: Changed javascript, css and jquery
loading to the new buffer callback handlers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1436 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-09 19:41:54 +01:00
|
|
|
echo '</html>';
|
2009-02-26 13:09:21 +01:00
|
|
|
|
|
|
|
$run_time = format_numeric (microtime (true) - $config['start_time'], 3);
|
|
|
|
echo "\n<!-- Page generated in $run_time seconds -->\n";
|
2013-02-26 17:10:02 +01:00
|
|
|
|
2013-04-29 10:59:03 +02:00
|
|
|
// Values from PHP to be recovered from JAVASCRIPT
|
|
|
|
require('include/php_to_js_values.php');
|
2013-06-03 13:10:20 +02:00
|
|
|
|
|
|
|
|
2013-08-07 10:26:26 +02:00
|
|
|
?>
|
2013-06-03 13:10:20 +02:00
|
|
|
|
2013-08-07 10:26:26 +02:00
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
//Initial load of page
|
2013-08-08 16:05:57 +02:00
|
|
|
$(document).ready(adjustFooter);
|
2013-08-21 14:37:37 +02:00
|
|
|
|
2013-08-07 10:26:26 +02:00
|
|
|
//Every resize of window
|
2013-08-08 16:05:57 +02:00
|
|
|
$(window).resize(adjustFooter);
|
2013-08-07 10:26:26 +02:00
|
|
|
|
2013-08-14 08:46:20 +02:00
|
|
|
//Every show/hide call may need footer re-layout
|
|
|
|
(function() {
|
|
|
|
var oShow = jQuery.fn.show;
|
|
|
|
var oHide = jQuery.fn.hide;
|
2013-10-02 12:08:45 +02:00
|
|
|
|
2013-08-14 08:46:20 +02:00
|
|
|
jQuery.fn.show = function () {
|
|
|
|
var rv = oShow.apply(this, arguments);
|
|
|
|
adjustFooter();
|
|
|
|
return rv;
|
|
|
|
};
|
|
|
|
jQuery.fn.hide = function () {
|
|
|
|
var rv = oHide.apply(this, arguments);
|
2013-08-08 16:05:57 +02:00
|
|
|
adjustFooter();
|
2013-08-14 08:46:20 +02:00
|
|
|
return rv;
|
|
|
|
};
|
|
|
|
})();
|
2013-08-27 11:29:36 +02:00
|
|
|
|
2013-08-14 08:46:20 +02:00
|
|
|
//Dynamically assign footer position and width.
|
2013-08-08 16:05:57 +02:00
|
|
|
function adjustFooter() {
|
2013-10-11 11:19:59 +02:00
|
|
|
if (document.readyState !== 'complete' || $('#container').position() == undefined) {
|
2013-08-14 08:46:20 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// minimum top value (upper limit) for div#foot
|
2013-08-08 16:05:57 +02:00
|
|
|
var ulim = $('#container').position().top + $('#container').outerHeight(true);
|
2013-08-14 08:46:20 +02:00
|
|
|
// window height. $(window).height() returns wrong value on Opera and Google Chrome.
|
|
|
|
var wh = document.documentElement.clientHeight;
|
|
|
|
// save div#foot's height for latter use
|
2013-08-08 16:05:57 +02:00
|
|
|
var h = $('#foot').height();
|
2013-08-14 08:46:20 +02:00
|
|
|
// new top value for div#foot
|
2013-08-08 16:05:57 +02:00
|
|
|
var t = (ulim + $('#foot').outerHeight() > wh) ? ulim : wh - $('#foot').outerHeight();
|
2013-10-02 12:08:45 +02:00
|
|
|
|
2013-08-14 08:46:20 +02:00
|
|
|
if ($('#foot').position().top != t) {
|
|
|
|
$('#foot').css({ position: "absolute", top: t, left: $('#foot').offset().left});
|
|
|
|
$('#foot').height(h);
|
|
|
|
}
|
|
|
|
if ($('#foot').width() != $(window).width()) {
|
|
|
|
$('#foot').width($(window).width());
|
|
|
|
}
|
2013-06-03 13:10:20 +02:00
|
|
|
}
|
|
|
|
</script>
|