Merge branch 'develop' into 3373-Añadir-opcion-a-mas-parametros-en-api_get_groups

Former-commit-id: b8436e3dcbc1b23de21653fcbaff88c544c79562
This commit is contained in:
alejandro-campos 2019-02-15 13:54:28 +01:00
commit 196de9ae3d
872 changed files with 240435 additions and 211178 deletions

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, AIX version # Version 7.0NG.731, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, FreeBSD Version # Version 7.0NG.731, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, HP-UX Version # Version 7.0NG.731, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, GNU/Linux # Version 7.0NG.731, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, GNU/Linux # Version 7.0NG.731, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, Solaris Version # Version 7.0NG.731, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas # (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.730 # Version 7.0NG.731
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.730, AIX version # Version 7.0NG.731, AIX version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.730 # Version 7.0NG.731
# FreeBSD/IPSO version # FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena # Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.730, HPUX Version # Version 7.0NG.731, HPUX Version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730 # Version 7.0NG.731
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas # (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730 # Version 7.0NG.731
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas # (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730 # Version 7.0NG.731
# Licensed under GPL license v2, # Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.730, Solaris version # Version 7.0NG.731, Solaris version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, AIX version # Version 7.0NG.731, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.730-190114 Version: 7.0NG.731-190215
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.730-190114" pandora_version="7.0NG.731-190215"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, GNU/Linux # Version 7.0NG.731, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, FreeBSD Version # Version 7.0NG.731, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, HP-UX Version # Version 7.0NG.731, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, GNU/Linux # Version 7.0NG.731, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, GNU/Linux # Version 7.0NG.731, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, NetBSD Version # Version 7.0NG.731, NetBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.730, Solaris Version # Version 7.0NG.731, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -41,8 +41,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads # Semaphore used to control the number of threads
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.730'; use constant AGENT_VERSION => '7.0NG.731';
use constant AGENT_BUILD => '190114'; use constant AGENT_BUILD => '190215';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.730 %define version 7.0NG.731
%define release 190114 %define release 190215
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.730 %define version 7.0NG.731
%define release 190114 %define release 190215
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.730" PI_VERSION="7.0NG.731"
PI_BUILD="190114" PI_BUILD="190215"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas # (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.730 # Version 7.0NG.731
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes} {Yes}
AppName AppName
{Pandora FMS Windows Agent v7.0NG.730} {Pandora FMS Windows Agent v7.0NG.731}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{190114} {190215}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.730(Build 190114)") #define PANDORA_VERSION ("7.0NG.731(Build 190215)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.730(Build 190114))" VALUE "ProductVersion", "(7.0NG.731(Build 190215))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.730-190114 Version: 7.0NG.731-190215
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.730-190114" pandora_version="7.0NG.731-190215"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -4,18 +4,17 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License // modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// Enable profiler for testing // Enable profiler for testing
if (!defined("__PAN_XHPROF__")) define ("__PAN_XHPROF__", 0); if (!defined('__PAN_XHPROF__')) {
define('__PAN_XHPROF__', 0);
}
if (__PAN_XHPROF__ === 1) { if (__PAN_XHPROF__ === 1) {
if (function_exists('tideways_xhprof_enable')) { if (function_exists('tideways_xhprof_enable')) {
@ -23,34 +22,35 @@ if (__PAN_XHPROF__ === 1) {
} }
} }
if ((! file_exists("include/config.php")) || (! is_readable("include/config.php"))) { if ((! file_exists('include/config.php')) || (! is_readable('include/config.php'))) {
exit; exit;
} }
// Don't start a session before this import. // Don't start a session before this import.
// The session is configured and started inside the config process. // The session is configured and started inside the config process.
require_once ('include/config.php'); require_once 'include/config.php';
require_once ('include/functions.php'); require_once 'include/functions.php';
require_once ('include/functions_db.php'); require_once 'include/functions_db.php';
require_once ('include/auth/mysql.php'); require_once 'include/auth/mysql.php';
// Hash login process // Hash login process
if (isset ($_GET["loginhash"])) { if (isset($_GET['loginhash'])) {
$loginhash_data = get_parameter('loginhash_data', '');
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
$loginhash_data = get_parameter("loginhash_data", ""); if ($config['loginhash_pwd'] != ''
$loginhash_user = str_rot13(get_parameter("loginhash_user", "")); && $loginhash_data == md5($loginhash_user.io_output_password($config['loginhash_pwd']))
) {
if ($config["loginhash_pwd"] != ""
&& $loginhash_data == md5($loginhash_user.io_output_password($config["loginhash_pwd"]))) {
db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']); db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']);
$_SESSION['id_usuario'] = $loginhash_user; $_SESSION['id_usuario'] = $loginhash_user;
$config["id_user"] = $loginhash_user; $config['id_user'] = $loginhash_user;
} else {
include_once 'general/login_page.php';
db_pandora_audit('Logon Failed (loginhash', '', 'system');
while (@ob_end_flush()) {
} }
else {
require_once ('general/login_page.php'); exit('</html>');
db_pandora_audit("Logon Failed (loginhash", "", "system");
while (@ob_end_flush ());
exit ("</html>");
} }
} }
@ -62,43 +62,43 @@ if ($public_hash == false) {
} else { } else {
enterprise_include_once('include/functions_dashboard.php'); enterprise_include_once('include/functions_dashboard.php');
if (dashboard_check_public_hash($public_hash) === false) { if (dashboard_check_public_hash($public_hash) === false) {
db_pandora_audit("Invalid public hash", "Trying to access public dashboard"); db_pandora_audit('Invalid public hash', 'Trying to access public dashboard');
require ("general/noaccess.php"); include 'general/noaccess.php';
exit; exit;
} }
} }
define('AJAX', true); define('AJAX', true);
/* Enterprise support */ // Enterprise support
if (file_exists (ENTERPRISE_DIR."/load_enterprise.php")) { if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
include_once (ENTERPRISE_DIR."/load_enterprise.php"); include_once ENTERPRISE_DIR.'/load_enterprise.php';
} }
$config["remote_addr"] = $_SERVER['REMOTE_ADDR']; $config['remote_addr'] = $_SERVER['REMOTE_ADDR'];
$page = (string) get_parameter('page'); $page = (string) get_parameter('page');
$page = safe_url_extraclean($page); $page = safe_url_extraclean($page);
$page .= '.php'; $page .= '.php';
$config["id_user"] = $_SESSION["id_usuario"]; $config['id_user'] = $_SESSION['id_usuario'];
$isFunctionSkins = enterprise_include_once('include/functions_skins.php'); $isFunctionSkins = enterprise_include_once('include/functions_skins.php');
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$config["relative_path"] = enterprise_hook('skins_set_image_skin_path',array($config['id_user'])); $config['relative_path'] = enterprise_hook('skins_set_image_skin_path', [$config['id_user']]);
}
if (isset($config['metaconsole'])) { if (isset($config['metaconsole'])) {
// Not cool way of know if we are executing from metaconsole or normal console // Not cool way of know if we are executing from metaconsole or normal console
if ($config['metaconsole']) if ($config['metaconsole']) {
define('METACONSOLE', true); define('METACONSOLE', true);
} }
}
if (file_exists($page)) { if (file_exists($page)) {
require_once ($page); include_once $page;
} } else {
else {
echo '<br /><b class="error">Sorry! I can\'t find the page '.$page.'!</b>'; echo '<br /><b class="error">Sorry! I can\'t find the page '.$page.'!</b>';
} }
if (__PAN_XHPROF__ === 1) { if (__PAN_XHPROF__ === 1) {
pandora_xhprof_display_result("ajax", "console"); pandora_xhprof_display_result('ajax', 'console');
} }
?>

View File

@ -4,87 +4,86 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
require_once $config['homedir'].'/include/functions_agents.php';
require_once $config['homedir'].'/include/functions_modules.php';
require_once $config['homedir'].'/include/functions_users.php';
include_once($config['homedir'] . "/include/functions_agents.php");
include_once($config['homedir'] . "/include/functions_modules.php");
include_once($config['homedir'] . '/include/functions_users.php');
function mainAgentsAlerts() { function mainAgentsAlerts()
{
global $config; global $config;
// Load global vars // Load global vars
require_once ("include/config.php"); include_once 'include/config.php';
require_once ("include/functions_reporting.php"); include_once 'include/functions_reporting.php';
check_login(); check_login();
// ACL Check // ACL Check
if (! check_acl ($config['id_user'], 0, "AR")) { if (! check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit("ACL Violation", db_pandora_audit(
"Trying to access Agent view (Grouped)"); 'ACL Violation',
require ("general/noaccess.php"); 'Trying to access Agent view (Grouped)'
);
include 'general/noaccess.php';
exit; exit;
} }
// Update network modules for this group // Update network modules for this group
// Check for Network FLAG change request // Check for Network FLAG change request
// Made it a subquery, much faster on both the database and server side // Made it a subquery, much faster on both the database and server side
if (isset ($_GET["update_netgroup"])) { if (isset($_GET['update_netgroup'])) {
$group = get_parameter_get ("update_netgroup", 0); $group = get_parameter_get('update_netgroup', 0);
if (check_acl ($config['id_user'], $group, "AW")) { if (check_acl($config['id_user'], $group, 'AW')) {
$where = array("id_agente" => "ANY(SELECT id_agente FROM tagente WHERE id_grupo = " . $group); $where = ['id_agente' => 'ANY(SELECT id_agente FROM tagente WHERE id_grupo = '.$group];
db_process_sql_update('tagente_modulo', array("flag" => 1), $where); db_process_sql_update('tagente_modulo', ['flag' => 1], $where);
} } else {
else { db_pandora_audit('ACL Violation', 'Trying to set flag for groups');
db_pandora_audit("ACL Violation", "Trying to set flag for groups"); include 'general/noaccess.php';
require ("general/noaccess.php");
exit; exit;
} }
} }
if ($config["realtimestats"] == 0) { if ($config['realtimestats'] == 0) {
$updated_info = __('Last update'). " : ". ui_print_timestamp (db_get_sql ("SELECT min(utimestamp) FROM tgroup_stat"), true); $updated_info = __('Last update').' : '.ui_print_timestamp(db_get_sql('SELECT min(utimestamp) FROM tgroup_stat'), true);
} } else {
else {
// $updated_info = __("Updated at realtime"); // $updated_info = __("Updated at realtime");
$updated_info = ""; $updated_info = '';
} }
$updated_time = $updated_info; $updated_time = $updated_info;
$create_alert = (int)get_parameter ("create_alert",0); $create_alert = (int) get_parameter('create_alert', 0);
if ($create_alert) { if ($create_alert) {
$template2 = get_parameter("template"); $template2 = get_parameter('template');
$module_action_threshold = get_parameter("module_action_threshold"); $module_action_threshold = get_parameter('module_action_threshold');
$id_alert = alerts_create_alert_agent_module($create_alert, $template2); $id_alert = alerts_create_alert_agent_module($create_alert, $template2);
if ($id_alert !== false) { if ($id_alert !== false) {
$action_select = get_parameter("action_select",0); $action_select = get_parameter('action_select', 0);
if ($action_select != 0) { if ($action_select != 0) {
$values = array(); $values = [];
$values['fires_min'] = 0; $values['fires_min'] = 0;
$values['fires_max'] = 0; $values['fires_max'] = 0;
$values['module_action_threshold'] = $values['module_action_threshold'] = (int) get_parameter('module_action_threshold');
(int)get_parameter ('module_action_threshold');
alerts_add_alert_agent_module_action($id_alert, $action_select, $values); alerts_add_alert_agent_module_action($id_alert, $action_select, $values);
} }
} }
} }
$refr = (int) get_parameter('refr', 30); // By default 30 seconds
$show_modules = (bool) get_parameter ("show_modules",0); $refr = (int) get_parameter('refr', 30);
// By default 30 seconds
$show_modules = (bool) get_parameter('show_modules', 0);
$group_id = get_parameter('group_id', 0); $group_id = get_parameter('group_id', 0);
$offset = get_parameter('offset', 0); $offset = get_parameter('offset', 0);
$hor_offset = get_parameter('hor_offset', 0); $hor_offset = get_parameter('hor_offset', 0);
@ -93,67 +92,77 @@ function mainAgentsAlerts() {
$groups = users_get_groups(); $groups = users_get_groups();
$filter_groups .= '<b>'.__('Group').'</b>'; $filter_groups .= '<b>'.__('Group').'</b>';
$filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, false, '', '', true, false, true, '', false , 'margin-right: 10px; margin-top: 5px;'); $filter_groups .= html_print_select_groups(false, 'AR', true, 'group_id', $group_id, false, '', '', true, false, true, '', false, 'margin-right: 10px; margin-top: 5px;');
$check = '<b>'.__('Show modules without alerts').'</b>'; $check = '<b>'.__('Show modules without alerts').'</b>';
$check .= html_print_checkbox('slides_ids[]', $d['id'], $show_modules, true, false, '', true); $check .= html_print_checkbox('slides_ids[]', $d['id'], $show_modules, true, false, '', true);
$comborefr = '<form method="post" action="'.ui_get_url_refresh(['offset' => 0, 'hor_offset' => 0]).'">';
$comborefr = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => 0, 'hor_offset' => 0)).'">';
$comborefr .= '<b>'.__('Refresh').'</b>'; $comborefr .= '<b>'.__('Refresh').'</b>';
$comborefr .= html_print_select( $comborefr .= html_print_select(
array('30' => '30 '.__('seconds'), [
'30' => '30 '.__('seconds'),
(string) SECONDS_1MINUTE => __('1 minute'), (string) SECONDS_1MINUTE => __('1 minute'),
(string) SECONDS_2MINUTES => __('2 minutes'), (string) SECONDS_2MINUTES => __('2 minutes'),
(string) SECONDS_5MINUTES => __('5 minutes'), (string) SECONDS_5MINUTES => __('5 minutes'),
(string)SECONDS_10MINUTES => __('10 minutes')) (string) SECONDS_10MINUTES => __('10 minutes'),
, 'refr', (int)get_parameter('refr', 0), $script = 'this.form.submit()', '', 0, true, false, false, '', false, 'width: 100px; margin-right: 10px; margin-top: 5px;'); ],
$comborefr .= "</form>"; 'refr',
(int) get_parameter('refr', 0),
$script = 'this.form.submit()',
'',
0,
true,
false,
false,
'',
false,
'width: 100px; margin-right: 10px; margin-top: 5px;'
);
$comborefr .= '</form>';
if ($config["pure"] == 0) { if ($config['pure'] == 0) {
$fullscreen['text'] = '<a href="'.ui_get_url_refresh(array ('pure' => 1)).'">' $fullscreen['text'] = '<a href="'.ui_get_url_refresh(['pure' => 1]).'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode'))) } else {
. "</a>"; $fullscreen['text'] = '<a href="'.ui_get_url_refresh(['pure' => 0]).'">'.html_print_image('images/normal_screen.png', true, ['title' => __('Back to normal mode')]).'</a>';
}
else {
$fullscreen['text'] = '<a href="'.ui_get_url_refresh(array ('pure' => 0)).'">'
. html_print_image ("images/normal_screen.png", true, array ("title" => __('Back to normal mode')))
. "</a>";
$config['refr'] = $refr; $config['refr'] = $refr;
} }
$onheader = array('updated_time' => $updated_time, 'fullscreen' => $fullscreen, $onheader = [
'combo_groups' => $filter_groups); 'updated_time' => $updated_time,
'fullscreen' => $fullscreen,
'combo_groups' => $filter_groups,
];
if ($config['pure'] == 1) { if ($config['pure'] == 1) {
$onheader['combo_refr'] = $comborefr; $onheader['combo_refr'] = $comborefr;
} }
// Header // Header
ui_print_page_header (__("Agents/Alerts"), "images/op_alerts.png", false, "", false, $updated_time); ui_print_page_header(__('Agents/Alerts'), 'images/op_alerts.png', false, '', false, $updated_time);
// Old style table, we need a lot of special formatting,don't use table function // Old style table, we need a lot of special formatting,don't use table function
// Prepare old-style table // Prepare old-style table
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">'; echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
echo "<tr>"; echo '<tr>';
echo "<td>" . $filter_groups . "</td>"; echo '<td>'.$filter_groups.'</td>';
echo "<td>" . $check . "</td>"; echo '<td>'.$check.'</td>';
if ($config['pure'] == 1) if ($config['pure'] == 1) {
echo "<td>" . $comborefr . "</td>"; echo '<td>'.$comborefr.'</td>';
echo "<td> <strong>" . __("Full screen") . "</strong>" . $fullscreen['text'] . "</td>"; }
echo "</tr>";
echo "</table>"; echo '<td> <strong>'.__('Full screen').'</strong>'.$fullscreen['text'].'</td>';
echo '</tr>';
echo '</table>';
if ($show_modules) { if ($show_modules) {
if ($group_id > 0) { if ($group_id > 0) {
$grupo = " AND tagente.id_grupo = $group_id"; $grupo = " AND tagente.id_grupo = $group_id";
} else { } else {
$grupo = ''; $grupo = '';
} }
$offset_modules = get_parameter ("offset",0); $offset_modules = get_parameter('offset', 0);
$sql_count = "SELECT COUNT(tagente_modulo.nombre) FROM tagente_modulo $sql_count = "SELECT COUNT(tagente_modulo.nombre) FROM tagente_modulo
INNER JOIN tagente ON tagente.id_agente = tagente_modulo.id_agente INNER JOIN tagente ON tagente.id_agente = tagente_modulo.id_agente
WHERE id_agente_modulo NOT IN (SELECT id_agent_module FROM talert_template_modules) WHERE id_agente_modulo NOT IN (SELECT id_agent_module FROM talert_template_modules)
@ -167,14 +176,24 @@ function mainAgentsAlerts() {
$grupo LIMIT 20 OFFSET $offset_modules"; $grupo LIMIT 20 OFFSET $offset_modules";
$agent_modules = db_get_all_rows_sql($sql); $agent_modules = db_get_all_rows_sql($sql);
ui_pagination ($count_agent_module[0]['COUNT(tagente_modulo.nombre)'], ui_pagination(
ui_get_url_refresh(),0,0,false,'offset',true,'', $count_agent_module[0]['COUNT(tagente_modulo.nombre)'],
'',false,'alerts_modules'); ui_get_url_refresh(),
0,
0,
false,
'offset',
true,
'',
'',
false,
'alerts_modules'
);
$table->width = '100%'; $table->width = '100%';
$table->class = "databox data"; $table->class = 'databox data';
$table->id = "table_agent_module"; $table->id = 'table_agent_module';
$table->data = array (); $table->data = [];
$table->head[0] = __('Agents'); $table->head[0] = __('Agents');
$table->head[1] = __('Modules'); $table->head[1] = __('Modules');
@ -188,17 +207,17 @@ function mainAgentsAlerts() {
$data[0] = io_safe_output($agent_module['alias']); $data[0] = io_safe_output($agent_module['alias']);
$data[1] = io_safe_output($agent_module['nombre']); $data[1] = io_safe_output($agent_module['nombre']);
$uniqid = $agent_module['id_agente_modulo']; $uniqid = $agent_module['id_agente_modulo'];
$data[2] = "<a title='".__('Create alert')."' href='javascript:show_add_alerts(\"$uniqid\")'>".html_print_image('images/add_mc.png', true)."</a>"; $data[2] = "<a title='".__('Create alert')."' href='javascript:show_add_alerts(\"$uniqid\")'>".html_print_image('images/add_mc.png', true).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
$table2->width = '100%'; $table2->width = '100%';
$table2->id = "table_add_alert"; $table2->id = 'table_add_alert';
$table2->class = 'databox filters'; $table2->class = 'databox filters';
$table2->data = array (); $table2->data = [];
// $data[0] = // $data[0] =
$table2->data[0][0] = __('Actions'); $table2->data[0][0] = __('Actions');
$groups_user = users_get_groups($config["id_user"]); $groups_user = users_get_groups($config['id_user']);
if (!empty($groups_user)) { if (!empty($groups_user)) {
$groups = implode(',', array_keys($groups_user)); $groups = implode(',', array_keys($groups_user));
$sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)"; $sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)";
@ -206,19 +225,31 @@ function mainAgentsAlerts() {
} }
$table2->data[0][1] = html_print_select( $table2->data[0][1] = html_print_select(
index_array($actions, 'id', 'name'), 'action_select', '', '', index_array($actions, 'id', 'name'),
__('Default action'), '0', true, '', true, '', false, 'action_select',
'width: 250px;'); '',
'',
__('Default action'),
'0',
true,
'',
true,
'',
false,
'width: 250px;'
);
$table2->data[0][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>'; $table2->data[0][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>';
$table2->data[0][1] .= __('Number of alerts match from').' '; $table2->data[0][1] .= __('Number of alerts match from').' ';
$table2->data[0][1] .= html_print_input_text('fires_min', '', '', 4, 10, true); $table2->data[0][1] .= html_print_input_text('fires_min', '', '', 4, 10, true);
$table2->data[0][1] .= ' '.__('to').' '; $table2->data[0][1] .= ' '.__('to').' ';
$table2->data[0][1] .= html_print_input_text('fires_max', '', '', 4, 10, true); $table2->data[0][1] .= html_print_input_text('fires_max', '', '', 4, 10, true);
$table2->data[0][1] .= ui_print_help_icon ("alert-matches", true, $table2->data[0][1] .= ui_print_help_icon(
ui_get_full_url(false, false, false, false)); 'alert-matches',
true,
ui_get_full_url(false, false, false, false)
);
$table2->data[0][1] .= '</span>'; $table2->data[0][1] .= '</span>';
if (check_acl ($config['id_user'], 0, "LM")) { if (check_acl($config['id_user'], 0, 'LM')) {
$table2->data[0][1] .= '<a style="margin-left:5px;" href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">'; $table2->data[0][1] .= '<a style="margin-left:5px;" href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
$table2->data[0][1] .= html_print_image('images/add.png', true); $table2->data[0][1] .= html_print_image('images/add.png', true);
$table2->data[0][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Action').'</span>'; $table2->data[0][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Action').'</span>';
@ -227,25 +258,37 @@ function mainAgentsAlerts() {
$table2->data[1][0] = __('Template'); $table2->data[1][0] = __('Template');
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
$templates = alerts_get_alert_templates (false, array ('id', 'name')); $templates = alerts_get_alert_templates(false, ['id', 'name']);
else { } else {
$usr_groups = users_get_groups($config['id_user'], 'LW', true); $usr_groups = users_get_groups($config['id_user'], 'LW', true);
$filter_groups = ''; $filter_groups = '';
$filter_groups = implode(',', array_keys($usr_groups)); $filter_groups = implode(',', array_keys($usr_groups));
$templates = alerts_get_alert_templates (array ('id_group IN (' . $filter_groups . ')'), array ('id', 'name')); $templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
} }
$table2->data[1][1] = html_print_select (index_array ($templates, 'id', 'name'), $table2->data[1][1] = html_print_select(
'template', '', '', __('Select'), 0, true, false, true, '', false, 'width: 250px;'); index_array($templates, 'id', 'name'),
$table2->data[1][1] .= ' <a class="template_details invisible" href="#">' . 'template',
html_print_image("images/zoom.png", true, array("class" => 'img_help')) . '</a>'; '',
if (check_acl ($config['id_user'], 0, "LM")) { '',
__('Select'),
0,
true,
false,
true,
'',
false,
'width: 250px;'
);
$table2->data[1][1] .= ' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a>';
if (check_acl($config['id_user'], 0, 'LM')) {
$table2->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">'; $table2->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
$table2->data[1][1] .= html_print_image('images/add.png', true); $table2->data[1][1] .= html_print_image('images/add.png', true);
$table2->data[1][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Template').'</span>'; $table2->data[1][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Template').'</span>';
$table2->data[1][1] .= '</a>'; $table2->data[1][1] .= '</a>';
} }
$table2->data[2][0] = __('Threshold'); $table2->data[2][0] = __('Threshold');
$table2->data[2][1] = html_print_input_text('module_action_threshold', '0', '', 5, 7, true); $table2->data[2][1] = html_print_input_text('module_action_threshold', '0', '', 5, 7, true);
$table2->data[2][1] .= ' '.__('seconds').ui_print_help_icon('action_threshold', true); $table2->data[2][1] .= ' '.__('seconds').ui_print_help_icon('action_threshold', true);
@ -263,12 +306,12 @@ function mainAgentsAlerts() {
} }
html_print_table($table); html_print_table($table);
} else { } else {
$filter = [
$filter = array ('offset' => (int) $offset, 'offset' => (int) $offset,
'limit' => (int) $config['block_size']); 'limit' => (int) $config['block_size'],
$filter_count = array(); ];
$filter_count = [];
if ($group_id > 0) { if ($group_id > 0) {
$filter['id_grupo'] = $group_id; $filter['id_grupo'] = $group_id;
@ -284,10 +327,10 @@ function mainAgentsAlerts() {
$agents_with_alerts_raw = db_get_all_rows_sql($sql); $agents_with_alerts_raw = db_get_all_rows_sql($sql);
if ($agents_with_alerts_raw === false) { if ($agents_with_alerts_raw === false) {
$agents_with_alerts_raw = array(); $agents_with_alerts_raw = [];
} }
$agents_with_alerts = array(); $agents_with_alerts = [];
foreach ($agents_with_alerts_raw as $awar) { foreach ($agents_with_alerts_raw as $awar) {
$agents_with_alerts[] = $awar['id_agente']; $agents_with_alerts[] = $awar['id_agente'];
} }
@ -300,51 +343,67 @@ function mainAgentsAlerts() {
$nagents = count(agents_get_agents($filter_count)); $nagents = count(agents_get_agents($filter_count));
if ($agents == false) { if ($agents == false) {
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no agents with alerts') ) ); ui_print_info_message(['no_close' => true, 'message' => __('There are no agents with alerts') ]);
return; return;
} }
$all_alerts = agents_get_alerts_simple(); $all_alerts = agents_get_alerts_simple();
if($config["pure"] == 1) { if ($config['pure'] == 1) {
$block = count($all_alerts); $block = count($all_alerts);
} }
$templates = array(); $templates = [];
$agent_alerts = array(); $agent_alerts = [];
foreach ($all_alerts as $alert) { foreach ($all_alerts as $alert) {
$templates[$alert['id_alert_template']] = ''; $templates[$alert['id_alert_template']] = '';
$agent_alerts[$alert['agent_name']][$alert['id_alert_template']][] = $alert; $agent_alerts[$alert['agent_name']][$alert['id_alert_template']][] = $alert;
} }
// Prepare pagination // Prepare pagination
ui_pagination ($nagents,false,0,0,false,'offset',true,'', ui_pagination(
'',array('count' => '', 'offset' => 'offset_param'),'alerts_agents'); $nagents,
false,
0,
0,
false,
'offset',
true,
'',
'',
[
'count' => '',
'offset' => 'offset_param',
],
'alerts_agents'
);
echo '<table class="databox data" cellpadding="0" cellspacing="0" border="0" width=100%>'; echo '<table class="databox data" cellpadding="0" cellspacing="0" border="0" width=100%>';
echo "<th width='140px' >".__("Agents")." / ".__("Alert templates")."</th>"; echo "<th width='140px' >".__('Agents').' / '.__('Alert templates').'</th>';
if ($hor_offset > 0) { if ($hor_offset > 0) {
$new_hor_offset = $hor_offset-$block; $new_hor_offset = ($hor_offset - $block);
echo "<th width='20px' style='' rowspan='".($nagents + 1)."'> echo "<th width='20px' style='' rowspan='".($nagents + 1)."'>
<a href='index.php?sec=extensions&sec2=extensions/agents_alerts&refr=0&hor_offset=". <a href='index.php?sec=extensions&sec2=extensions/agents_alerts&refr=0&hor_offset=".$new_hor_offset.'&offset='.$offset.'&group_id='.$group_id."'>".html_print_image('images/darrowleft.png', true, ['title' => __('Previous templates')]).'</a> </th>';
$new_hor_offset."&offset=".$offset."&group_id=".$group_id."'>".
html_print_image("images/darrowleft.png",true, array('title' => __('Previous templates')))."</a> </th>";
} }
$templates_raw = array(); $templates_raw = [];
if (!empty($templates)) { if (!empty($templates)) {
$sql = sprintf('SELECT id, name $sql = sprintf(
'SELECT id, name
FROM talert_templates FROM talert_templates
WHERE id IN (%s)',implode(',',array_keys($templates))); WHERE id IN (%s)',
implode(',', array_keys($templates))
);
$templates_raw = db_get_all_rows_sql($sql); $templates_raw = db_get_all_rows_sql($sql);
} }
if (empty($templates_raw)) if (empty($templates_raw)) {
$templates_raw = array(); $templates_raw = [];
}
$alerts = array(); $alerts = [];
$ntemplates = 0; $ntemplates = 0;
foreach ($templates_raw as $temp) { foreach ($templates_raw as $temp) {
if (isset($templates[$temp['id']]) && $templates[$temp['id']] == '') { if (isset($templates[$temp['id']]) && $templates[$temp['id']] == '') {
@ -352,6 +411,7 @@ function mainAgentsAlerts() {
if ($ntemplates <= $hor_offset || $ntemplates > ($hor_offset + $block)) { if ($ntemplates <= $hor_offset || $ntemplates > ($hor_offset + $block)) {
continue; continue;
} }
$templates[$temp['id']] = $temp['name']; $templates[$temp['id']] = $temp['name'];
} }
} }
@ -360,14 +420,14 @@ function mainAgentsAlerts() {
if ($tname == '') { if ($tname == '') {
continue; continue;
} }
echo '<th width="20px" >'. io_safe_output($tname) . html_print_image('images/information_alerts.png', true, array('title' => io_safe_output($tname),'style' => 'margin-left:5px' )) ."</th>";
echo '<th width="20px" >'.io_safe_output($tname).html_print_image('images/information_alerts.png', true, ['title' => io_safe_output($tname), 'style' => 'margin-left:5px' ]).'</th>';
} }
if (($hor_offset + $block) < $ntemplates) { if (($hor_offset + $block) < $ntemplates) {
$new_hor_offset = $hor_offset+$block; $new_hor_offset = ($hor_offset + $block);
echo "<th width='20px' style='' rowspan='".($nagents + 1)."'> echo "<th width='20px' style='' rowspan='".($nagents + 1)."'>
<a href='index.php?sec=extensions&sec2=extensions/agents_alerts&hor_offset=".$new_hor_offset."&offset=". <a href='index.php?sec=extensions&sec2=extensions/agents_alerts&hor_offset=".$new_hor_offset.'&offset='.$offset.'&group_id='.$group_id."'>".html_print_image('images/darrowright.png', true, ['title' => __('More templates')]).'</a> </th>';
$offset."&group_id=".$group_id."'>".html_print_image("images/darrowright.png",true, array('title' => __('More templates')))."</a> </th>";
} }
foreach ($agents as $agent) { foreach ($agents as $agent) {
@ -382,9 +442,10 @@ function mainAgentsAlerts() {
if ($tname == '') { if ($tname == '') {
continue; continue;
} }
if (isset($agent_alerts[$agent['nombre']][$tid])) { if (isset($agent_alerts[$agent['nombre']][$tid])) {
foreach ($agent_alerts[$agent['nombre']][$tid] as $alert) { foreach ($agent_alerts[$agent['nombre']][$tid] as $alert) {
if($alert["times_fired"] > 0) { if ($alert['times_fired'] > 0) {
$anyfired = true; $anyfired = true;
} }
} }
@ -397,36 +458,37 @@ function mainAgentsAlerts() {
echo '<td style=";'.$cellstyle.'"> '; echo '<td style=";'.$cellstyle.'"> ';
$uniqid = uniqid(); $uniqid = uniqid();
echo "<div>"; echo '<div>';
echo count($agent_alerts[$agent['nombre']][$tid])." ".__('Alerts')." "; echo count($agent_alerts[$agent['nombre']][$tid]).' '.__('Alerts').' ';
echo "<a href='javascript:show_alerts_details(\"$uniqid\")'>".html_print_image('images/zoom.png', true)."</a>"; echo "<a href='javascript:show_alerts_details(\"$uniqid\")'>".html_print_image('images/zoom.png', true).'</a>';
echo "</div>"; echo '</div>';
print_alerts_summary_modal_window($uniqid, $agent_alerts[$agent['nombre']][$tid]); print_alerts_summary_modal_window($uniqid, $agent_alerts[$agent['nombre']][$tid]);
} } else {
else {
echo '<td style="text-align:center"> '; echo '<td style="text-align:center"> ';
} }
echo '</td>'; echo '</td>';
} }
echo '</tr>'; echo '</tr>';
} }
echo '</table>'; echo '</table>';
} }
} }
// Print the modal window for the summary of each alerts group
function print_alerts_summary_modal_window($id, $alerts) {
// Print the modal window for the summary of each alerts group
function print_alerts_summary_modal_window($id, $alerts)
{
$table->width = '98%'; $table->width = '98%';
$table->class = "databox"; $table->class = 'databox';
$table->data = array (); $table->data = [];
$table->head[0] = __('Module'); $table->head[0] = __('Module');
$table->head[1] = __('Action'); $table->head[1] = __('Action');
@ -438,10 +500,12 @@ function print_alerts_summary_modal_window($id, $alerts) {
$actions = alerts_get_alert_agent_module_actions($alert['id']); $actions = alerts_get_alert_agent_module_actions($alert['id']);
$actionDefault = db_get_value_sql(" $actionDefault = db_get_value_sql(
'
SELECT id_alert_action SELECT id_alert_action
FROM talert_templates FROM talert_templates
WHERE id = " . $alert['id_alert_template']); WHERE id = '.$alert['id_alert_template']
);
$actionText = ''; $actionText = '';
@ -449,36 +513,36 @@ function print_alerts_summary_modal_window($id, $alerts) {
$actionText = '<div style="margin-left: 10px;"><ul class="action_list">'; $actionText = '<div style="margin-left: 10px;"><ul class="action_list">';
foreach ($actions as $action) { foreach ($actions as $action) {
$actionText .= '<div><span class="action_name"><li>'.$action['name']; $actionText .= '<div><span class="action_name"><li>'.$action['name'];
if ($action["fires_min"] != $action["fires_max"]) { if ($action['fires_min'] != $action['fires_max']) {
$actionText .= " (".$action["fires_min"] . " / ". $action["fires_max"] . ")"; $actionText .= ' ('.$action['fires_min'].' / '.$action['fires_max'].')';
} }
$actionText .= '</li></span><br /></div>'; $actionText .= '</li></span><br /></div>';
} }
$actionText .= '</ul></div>'; $actionText .= '</ul></div>';
} } else {
else {
if (!empty($actionDefault)) { if (!empty($actionDefault)) {
$actionText = db_get_sql ("SELECT name $actionText = db_get_sql(
"SELECT name
FROM talert_actions FROM talert_actions
WHERE id = $actionDefault") . WHERE id = $actionDefault"
" <i>(" . __("Default") . ")</i>"; ).' <i>('.__('Default').')</i>';
} }
} }
$data[1] = $actionText; $data[1] = $actionText;
$data[2] = ui_print_timestamp ($alert["last_fired"], true); $data[2] = ui_print_timestamp($alert['last_fired'], true);
$status = STATUS_ALERT_NOT_FIRED; $status = STATUS_ALERT_NOT_FIRED;
if ($alert["times_fired"] > 0) { if ($alert['times_fired'] > 0) {
$status = STATUS_ALERT_FIRED; $status = STATUS_ALERT_FIRED;
$title = __('Alert fired').' '.$alert["internal_counter"].' '.__('time(s)'); $title = __('Alert fired').' '.$alert['internal_counter'].' '.__('time(s)');
} } else if ($alert['disabled'] > 0) {
elseif ($alert["disabled"] > 0) {
$status = STATUS_ALERT_DISABLED; $status = STATUS_ALERT_DISABLED;
$title = __('Alert disabled'); $title = __('Alert disabled');
} } else {
else {
$status = STATUS_ALERT_NOT_FIRED; $status = STATUS_ALERT_NOT_FIRED;
$title = __('Alert not fired'); $title = __('Alert not fired');
} }
@ -496,7 +560,8 @@ function print_alerts_summary_modal_window($id, $alerts) {
echo '<div id="alerts_details_'.$id.'" title="'.__('Agent').': '.$agent.' / '.__('Template').': '.$template.'" style="display:none">'.$content.'</div>'; echo '<div id="alerts_details_'.$id.'" title="'.__('Agent').': '.$agent.' / '.__('Template').': '.$template.'" style="display:none">'.$content.'</div>';
} }
extensions_add_operation_menu_option(__("Agents/Alerts view"), 'estado', null, "v1r1","view");
extensions_add_operation_menu_option(__('Agents/Alerts view'), 'estado', null, 'v1r1', 'view');
extensions_add_main_function('mainAgentsAlerts'); extensions_add_main_function('mainAgentsAlerts');
ui_require_jquery_file('pandora'); ui_require_jquery_file('pandora');

View File

@ -4,66 +4,65 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
$refr = (int) get_parameter('refresh', 0);
$refr = (int) get_parameter('refresh', 0); // By default 30 seconds // By default 30 seconds
function mainAgentsModules() { function mainAgentsModules()
{
global $config; global $config;
// Load global vars // Load global vars
require_once ("include/config.php"); include_once 'include/config.php';
require_once ("include/functions_reporting.php"); include_once 'include/functions_reporting.php';
include_once($config['homedir'] . "/include/functions_agents.php"); include_once $config['homedir'].'/include/functions_agents.php';
include_once($config['homedir'] . "/include/functions_modules.php"); include_once $config['homedir'].'/include/functions_modules.php';
include_once($config['homedir'] . '/include/functions_users.php'); include_once $config['homedir'].'/include/functions_users.php';
check_login(); check_login();
// ACL Check // ACL Check
if (! check_acl ($config['id_user'], 0, "AR")) { if (! check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit("ACL Violation", db_pandora_audit(
"Trying to access Agent view (Grouped)"); 'ACL Violation',
require ("general/noaccess.php"); 'Trying to access Agent view (Grouped)'
);
include 'general/noaccess.php';
exit; exit;
} }
// Update network modules for this group // Update network modules for this group
// Check for Network FLAG change request // Check for Network FLAG change request
// Made it a subquery, much faster on both the database and server side // Made it a subquery, much faster on both the database and server side
if (isset ($_GET["update_netgroup"])) { if (isset($_GET['update_netgroup'])) {
$group = get_parameter_get ("update_netgroup", 0); $group = get_parameter_get('update_netgroup', 0);
if (check_acl ($config['id_user'], $group, "AW")) { if (check_acl($config['id_user'], $group, 'AW')) {
$where = array("id_agente" => "ANY(SELECT id_agente FROM tagente WHERE id_grupo = " . $group); $where = ['id_agente' => 'ANY(SELECT id_agente FROM tagente WHERE id_grupo = '.$group];
db_process_sql_update('tagente_modulo', array("flag" => 1), $where); db_process_sql_update('tagente_modulo', ['flag' => 1], $where);
} } else {
else { db_pandora_audit('ACL Violation', 'Trying to set flag for groups');
db_pandora_audit("ACL Violation", "Trying to set flag for groups"); include 'general/noaccess.php';
require ("general/noaccess.php");
exit; exit;
} }
} }
if ($config["realtimestats"] == 0) { if ($config['realtimestats'] == 0) {
$updated_info = __('Last update'). " : ". ui_print_timestamp (db_get_sql ("SELECT min(utimestamp) FROM tgroup_stat"), true); $updated_info = __('Last update').' : '.ui_print_timestamp(db_get_sql('SELECT min(utimestamp) FROM tgroup_stat'), true);
} } else {
else {
// $updated_info = __("Updated at realtime"); // $updated_info = __("Updated at realtime");
$updated_info = ""; $updated_info = '';
} }
$updated_time = $updated_info; $updated_time = $updated_info;
$modulegroup = get_parameter('modulegroup', 0); $modulegroup = get_parameter('modulegroup', 0);
$refr = (int) get_parameter('refresh', 0); // By default 30 seconds $refr = (int) get_parameter('refresh', 0);
// By default 30 seconds
$recursion = get_parameter('recursion', 0); $recursion = get_parameter('recursion', 0);
$group_id = (int) get_parameter('group_id', 0); $group_id = (int) get_parameter('group_id', 0);
$offset = (int) get_parameter('offset', 0); $offset = (int) get_parameter('offset', 0);
@ -72,124 +71,131 @@ function mainAgentsModules() {
if (get_parameter('modulegroup') != null) { if (get_parameter('modulegroup') != null) {
$agents_id = (array) get_parameter('id_agents2', null); $agents_id = (array) get_parameter('id_agents2', null);
} }
$selection_a_m = (int) get_parameter('selection_agent_module'); $selection_a_m = (int) get_parameter('selection_agent_module');
$modules_selected = (array) get_parameter('module', 0); $modules_selected = (array) get_parameter('module', 0);
$update_item = (string) get_parameter('edit_item', ''); $update_item = (string) get_parameter('edit_item', '');
$save_serialize = (int) get_parameter('save_serialize', 0); $save_serialize = (int) get_parameter('save_serialize', 0);
$full_modules_selected = explode(";",get_parameter('full_modules_selected', 0)); $full_modules_selected = explode(';', get_parameter('full_modules_selected', 0));
$full_agents_id = explode(";",get_parameter('full_agents_id', 0)); $full_agents_id = explode(';', get_parameter('full_agents_id', 0));
if ($save_serialize && $update_item == '') { if ($save_serialize && $update_item == '') {
$unserialize_modules_selected = unserialize_in_temp($config['id_user']."_agent_module", true, 1); $unserialize_modules_selected = unserialize_in_temp($config['id_user'].'_agent_module', true, 1);
$unserialize_agents_id = unserialize_in_temp($config['id_user']."_agents", true, 1); $unserialize_agents_id = unserialize_in_temp($config['id_user'].'_agents', true, 1);
if ($unserialize_modules_selected) { if ($unserialize_modules_selected) {
$modules_selected = $unserialize_modules_selected; $modules_selected = $unserialize_modules_selected;
} }
if ($unserialize_agents_id) { if ($unserialize_agents_id) {
$agents_id = $unserialize_agents_id; $agents_id = $unserialize_agents_id;
} }
} } else {
else{ unserialize_in_temp($config['id_user'].'_agent_module', true, 1);
unserialize_in_temp($config['id_user']."_agent_module", true, 1); unserialize_in_temp($config['id_user'].'_agents', true, 1);
unserialize_in_temp($config['id_user']."_agents", true, 1);
} }
if ($modules_selected[0]) { if ($modules_selected[0]) {
serialize_in_temp($modules_selected, $config['id_user']."_agent_module", 1); serialize_in_temp($modules_selected, $config['id_user'].'_agent_module', 1);
}
if($agents_id[0] != -1 ){
serialize_in_temp($agents_id, $config['id_user']."_agents", 1);
} }
if ($agents_id[0] != -1) {
serialize_in_temp($agents_id, $config['id_user'].'_agents', 1);
}
// if($agents_id != -1) $agents_id = null; // if($agents_id != -1) $agents_id = null;
if ($config['pure'] == 0) {
if ($config["pure"] == 0) {
if ($modules_selected[0] && $agents_id[0]) { if ($modules_selected[0] && $agents_id[0]) {
$full_modules = urlencode(implode(';', $modules_selected));
$full_modules = urlencode(implode(";",$modules_selected)); $full_agents = urlencode(implode(';', $agents_id));
$full_agents = urlencode(implode(";",$agents_id));
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp; $fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.' offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">' &full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode')))
. "</a>";
} else if ($full_modules_selected[0] && $full_agents_id[0]) { } else if ($full_modules_selected[0] && $full_agents_id[0]) {
$full_modules = urlencode(implode(';', $full_modules_selected));
$full_modules = urlencode(implode(";",$full_modules_selected)); $full_agents = urlencode(implode(';', $full_agents_id));
$full_agents = urlencode(implode(";",$full_agents_id));
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp; $fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.' offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">' &full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode')))
. "</a>";
} else { } else {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp; $fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">' offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode')))
. "</a>";
} }
} }
// groups // groups
$filter_groups_label = '<b>'.__('Group').'</b>'; $filter_groups_label = '<b>'.__('Group').'</b>';
$filter_groups = html_print_select_groups(false, "AR", true, 'group_id', $group_id, '', '', '', true, false, true, '', false , 'width: auto;'); $filter_groups = html_print_select_groups(false, 'AR', true, 'group_id', $group_id, '', '', '', true, false, true, '', false, 'width: auto;');
$filter_recursion_label = '<b>'.__('Recursion').'</b>'; $filter_recursion_label = '<b>'.__('Recursion').'</b>';
$filter_recursion = html_print_checkbox('recursion', 1, 0, true); $filter_recursion = html_print_checkbox('recursion', 1, 0, true);
// groups module // groups module
$filter_module_groups_label = '<b>'.__('Module group').'</b>'; $filter_module_groups_label = '<b>'.__('Module group').'</b>';
$filter_module_groups = html_print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name", $filter_module_groups = html_print_select_from_sql(
'modulegroup', $modulegroup, '',__('All'), 0, true, false, true, false, 'width: auto;'); 'SELECT * FROM tmodule_group ORDER BY name',
'modulegroup',
$modulegroup,
'',
__('All'),
0,
true,
false,
true,
false,
'width: auto;'
);
// agent // agent
$agents = agents_get_group_agents($group_id); $agents = agents_get_group_agents($group_id);
if ((empty($agents)) || $agents == -1) $agents = array(); if ((empty($agents)) || $agents == -1) {
$agents = [];
}
$filter_agents_label = '<b>'.__('Agents').'</b>'; $filter_agents_label = '<b>'.__('Agents').'</b>';
$filter_agents = html_print_select($agents, 'id_agents2[]', $agents_id, '', '', 0, true, true, true, '', false, "min-width: 180px; max-width: 200px;"); $filter_agents = html_print_select($agents, 'id_agents2[]', $agents_id, '', '', 0, true, true, true, '', false, 'min-width: 180px; max-width: 200px;');
// type show // type show
$selection = array(0 => __('Show common modules'), $selection = [
1=> __('Show all modules')); 0 => __('Show common modules'),
1 => __('Show all modules'),
];
$filter_type_show_label = '<b>'.__('Show common modules').'</b>'; $filter_type_show_label = '<b>'.__('Show common modules').'</b>';
$filter_type_show = html_print_select($selection, 'selection_agent_module', $selection_a_m, '', "", 0, true, false, true, '', false, "min-width: 180px;"); $filter_type_show = html_print_select($selection, 'selection_agent_module', $selection_a_m, '', '', 0, true, false, true, '', false, 'min-width: 180px;');
// modules // modules
$all_modules = select_modules_for_agent_group($group_id, $agents_id, $selection_a_m, false); $all_modules = select_modules_for_agent_group($group_id, $agents_id, $selection_a_m, false);
$filter_modules_label = '<b>'.__('Module').'</b>'; $filter_modules_label = '<b>'.__('Module').'</b>';
$filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', '', 0, true, true, false, '', false, "min-width: 180px; max-width: 200px;"); $filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', '', 0, true, true, false, '', false, 'min-width: 180px; max-width: 200px;');
// update // update
$filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true); $filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true);
$onheader = array('updated_time' => $updated_time, 'fullscreen' => $fullscreen, $onheader = [
'updated_time' => $updated_time,
'fullscreen' => $fullscreen,
'combo_module_groups' => $filter_module_groups, 'combo_module_groups' => $filter_module_groups,
'combo_groups' => $filter_groups); 'combo_groups' => $filter_groups,
];
// Old style table, we need a lot of special formatting,don't use table function // Old style table, we need a lot of special formatting,don't use table function
// Prepare old-style table // Prepare old-style table
if ($config['pure'] == 0) { if ($config['pure'] == 0) {
// Header // Header
ui_print_page_header (__("Agents/Modules"), "images/module_mc.png", false, "", false, $updated_time); ui_print_page_header(__('Agents/Modules'), 'images/module_mc.png', false, '', false, $updated_time);
echo '<table style="width:100%;">'; echo '<table style="width:100%;">';
echo "<tr>"; echo '<tr>';
echo "<td> <span style='float: right;'>" . $fullscreen['text'] . "</span> </td>"; echo "<td> <span style='float: right;'>".$fullscreen['text'].'</span> </td>';
echo "</tr>"; echo '</tr>';
echo "</table>"; echo '</table>';
} else { } else {
if ($full_agents_id[0]) { if ($full_agents_id[0]) {
$full_modules = urlencode(implode(';', $full_modules_selected));
$full_modules = urlencode(implode(";",$full_modules_selected)) ; $full_agents = urlencode(implode(';', $full_agents_id));
$full_agents = urlencode(implode(";",$full_agents_id));
$url = " index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset $url = " index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset
&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr&full_modules_selected=$full_modules &group_id=$group_id&modulegroup=$modulegroup&refresh=$refr&full_modules_selected=$full_modules
&full_agents_id=$full_agents&selection_agent_module=$selection_a_m"; &full_agents_id=$full_agents&selection_agent_module=$selection_a_m";
} else { } else {
$url = " index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr"; $url = " index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr";
} }
@ -203,7 +209,7 @@ function mainAgentsModules() {
// Quit fullscreen // Quit fullscreen
echo '<li class="nomn">'; echo '<li class="nomn">';
echo '<a target="_top" href="'.$url.'">'; echo '<a target="_top" href="'.$url.'">';
echo html_print_image('images/normal_screen.png', true, array('title' => __('Back to normal mode'))); echo html_print_image('images/normal_screen.png', true, ['title' => __('Back to normal mode')]);
echo '</a>'; echo '</a>';
echo '</li>'; echo '</li>';
@ -228,54 +234,49 @@ function mainAgentsModules() {
echo '</div>'; echo '</div>';
// Floating menu - End // Floating menu - End
ui_require_jquery_file('countdown'); ui_require_jquery_file('countdown');
ui_require_css_file('countdown');
} }
if ($config['pure'] != 1) { if ($config['pure'] != 1) {
echo '<form method="post" action="' echo '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'">';
. ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">'; echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
echo "<tr>"; echo '<tr>';
echo "<td>" . $filter_groups_label . "</td>"; echo '<td>'.$filter_groups_label.'</td>';
echo "<td>" . $filter_groups ."&nbsp;&nbsp;&nbsp;". $filter_recursion_label . $filter_recursion. "</td>"; echo '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>';
echo "<td></td>"; echo '<td></td>';
echo "<td></td>"; echo '<td></td>';
echo "<td>" . $filter_module_groups_label . "</td>"; echo '<td>'.$filter_module_groups_label.'</td>';
echo "<td>" . $filter_module_groups . "</td>"; echo '<td>'.$filter_module_groups.'</td>';
echo "</tr>"; echo '</tr>';
echo "<tr>"; echo '<tr>';
echo "<td>" . $filter_agents_label . "</td>"; echo '<td>'.$filter_agents_label.'</td>';
echo "<td>" . $filter_agents . "</td>"; echo '<td>'.$filter_agents.'</td>';
echo "<td>" . $filter_type_show_label . "</td>"; echo '<td>'.$filter_type_show_label.'</td>';
echo "<td>" . $filter_type_show . "</td>"; echo '<td>'.$filter_type_show.'</td>';
echo "<td>" . $filter_modules_label . "</td>"; echo '<td>'.$filter_modules_label.'</td>';
echo "<td>" . $filter_modules . "</td>"; echo '<td>'.$filter_modules.'</td>';
echo "</tr>"; echo '</tr>';
echo "<tr>"; echo '<tr>';
echo "<td colspan=6 ><span style='float: right; padding-right: 20px;'>" . $filter_update . "</sapn></td>"; echo "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</sapn></td>';
echo "</tr>"; echo '</tr>';
echo "</table>"; echo '</table>';
echo '</form>'; echo '</form>';
} }
if ($agents_id[0] != -1) { if ($agents_id[0] != -1) {
$agents = $agents_id; $agents = $agents_id;
} } else {
else {
if ($full_agents_id[0]) { if ($full_agents_id[0]) {
$agents = $full_agents_id; $agents = $full_agents_id;
} else { } else {
$agents = ''; $agents = '';
$agents = agents_get_group_agents($group_id,array('disabled' => 0)); $agents = agents_get_group_agents($group_id, ['disabled' => 0]);
$agents = array_keys($agents); $agents = array_keys($agents);
} }
} }
$filter_module_group = array('disabled' => 0); $filter_module_group = ['disabled' => 0];
if ($modulegroup > 0) { if ($modulegroup > 0) {
$filter_module_group['id_module_group'] = $modulegroup; $filter_module_group['id_module_group'] = $modulegroup;
@ -284,16 +285,23 @@ function mainAgentsModules() {
$count = 0; $count = 0;
foreach ($agents as $agent) { foreach ($agents as $agent) {
// TODO TAGS agents_get_modules // TODO TAGS agents_get_modules
$module = agents_get_modules($agent, false, $module = agents_get_modules(
$filter_module_group, true, true); $agent,
false,
$filter_module_group,
true,
true
);
if ($module == false) { if ($module == false) {
unset($agents[$count]); unset($agents[$count]);
} }
$count++; $count++;
} }
$total_pagination = count($agents); $total_pagination = count($agents);
if ($agents_id[0] != -1) { if ($agents_id[0] != -1) {
$all_modules = array(); $all_modules = [];
foreach ($modules_selected as $key => $value) { foreach ($modules_selected as $key => $value) {
$name = modules_get_agentmodule_name($value); $name = modules_get_agentmodule_name($value);
$sql = "SELECT id_agente_modulo $sql = "SELECT id_agente_modulo
@ -308,8 +316,7 @@ function mainAgentsModules() {
} }
} }
} }
} } else {
else{
if ($full_modules_selected[0]) { if ($full_modules_selected[0]) {
foreach ($full_modules_selected as $key => $value) { foreach ($full_modules_selected as $key => $value) {
$name = modules_get_agentmodule_name($value); $name = modules_get_agentmodule_name($value);
@ -324,48 +331,59 @@ function mainAgentsModules() {
} }
} }
} }
} else { } else {
// TODO TAGS agents_get_modules // TODO TAGS agents_get_modules
$all_modules = agents_get_modules($agents, false, $all_modules = agents_get_modules(
$filter_module_group, true, true); $agents,
false,
$filter_module_group,
true,
true
);
}
} }
} $modules_by_name = [];
$modules_by_name = array();
$name = ''; $name = '';
$cont = 0; $cont = 0;
foreach ($all_modules as $key => $module) { foreach ($all_modules as $key => $module) {
if ($module == $name) { if ($module == $name) {
$modules_by_name[$cont-1]['id'][] = $key; $modules_by_name[($cont - 1)]['id'][] = $key;
} } else {
else {
$name = $module; $name = $module;
$modules_by_name[$cont]['name'] = $name; $modules_by_name[$cont]['name'] = $name;
$modules_by_name[$cont]['id'][] = $key; $modules_by_name[$cont]['id'][] = $key;
$cont ++; $cont ++;
} }
} }
if ($config["pure"] == 1) {
if ($config['pure'] == 1) {
$block = count($modules_by_name); $block = count($modules_by_name);
} }
if ($update_item == '') { if ($update_item == '') {
$filter_groups = array ('offset' => (int) $offset, $filter_groups = [
'limit' => (int) $config['block_size'], 'disabled' => 0,'id_agente'=>$agents); 'offset' => (int) $offset,
} 'limit' => (int) $config['block_size'],
else{ 'disabled' => 0,
$filter_groups = array ('offset' => 0, 'id_agente' => $agents,
'limit' => (int) $config['block_size'], 'disabled' => 0,'id_agente'=>$agents); ];
} else {
$filter_groups = [
'offset' => 0,
'limit' => (int) $config['block_size'],
'disabled' => 0,
'id_agente' => $agents,
];
} }
if ($group_id > 0) { if ($group_id > 0) {
if ($recursion) { if ($recursion) {
$filter_groups['id_grupo'] = array_merge($group_id, $filter_groups['id_grupo'] = array_merge(
groups_get_id_recursive($group_id, true)); $group_id,
} groups_get_id_recursive($group_id, true)
else{ );
} else {
$filter_groups['id_grupo'] = $group_id; $filter_groups['id_grupo'] = $group_id;
} }
} }
@ -373,39 +391,29 @@ function mainAgentsModules() {
if (!empty($filter_groups['id_agente'])) { if (!empty($filter_groups['id_agente'])) {
$agents = agents_get_agents($filter_groups); $agents = agents_get_agents($filter_groups);
} }
$nagents = count($agents); $nagents = count($agents);
if ($all_modules == false || $agents == false) { if ($all_modules == false || $agents == false) {
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no agents with modules') ) ); ui_print_info_message(['no_close' => true, 'message' => __('There are no agents with modules') ]);
return; return;
} }
echo '<table cellpadding="4" cellspacing="4" border="0" style="width:100%;" class="agents_modules_table">'; echo '<table cellpadding="4" cellspacing="4" border="0" style="width:100%;" class="agents_modules_table">';
echo "<tr>"; echo '<tr>';
echo "<th width='140px' style='text-align: right !important; padding-right:13px;'>" . __("Agents") . " / " . __("Modules") . "</th>"; echo "<th width='140px' style='text-align: right !important; padding-right:13px;'>".__('Agents').' / '.__('Modules').'</th>';
if ($hor_offset > 0) { if ($hor_offset > 0) {
$new_hor_offset = $hor_offset-$block; $new_hor_offset = ($hor_offset - $block);
echo "<th width='20px' " . echo "<th width='20px' "."style='vertical-align:top; padding-top: 35px;' "."rowspan='".($nagents + 1)."'>"."<a href='index.php?".'extension_in_menu=estado&'.'sec=extensions&'.'sec2=extensions/agents_modules&'.'refr=0&'.'save_serialize=1&'.'selection_a_m='.$selection_a_m.'&'.'hor_offset='.$new_hor_offset.'&'.'offset='.$offset."'>".html_print_image(
"style='vertical-align:top; padding-top: 35px;' " . 'images/arrow_left.png',
"rowspan='" . ($nagents + 1) . "'>" . true,
"<a href='index.php?" . ['title' => __('Previous modules')]
"extension_in_menu=estado&" . ).'</a>'.'</th>';
"sec=extensions&" .
"sec2=extensions/agents_modules&" .
"refr=0&" .
"save_serialize=1&" .
"selection_a_m=" . $selection_a_m . "&" .
"hor_offset=" . $new_hor_offset . "&" .
"offset=" . $offset .
"'>" .
html_print_image("images/arrow_left.png", true,
array('title' => __('Previous modules'))) .
"</a>" .
"</th>";
} }
$nmodules = 0; $nmodules = 0;
foreach ($modules_by_name as $module) { foreach ($modules_by_name as $module) {
$nmodules++; $nmodules++;
@ -418,68 +426,67 @@ function mainAgentsModules() {
echo '<th align="center" width="20px" id="th_module_r_'.$nmodules.'" class="th_class_module_r"> echo '<th align="center" width="20px" id="th_module_r_'.$nmodules.'" class="th_class_module_r">
<div style="width: 30px;"> <div style="width: 30px;">
<div id="div_module_r_' . $nmodules . '" style="display: none;padding-left:10px" class="rotate_text_module">' . <div id="div_module_r_'.$nmodules.'" style="display: none;padding-left:10px" class="rotate_text_module">'.$text.'</div>
$text .
'</div>
</div> </div>
</th>'; </th>';
} }
if (($hor_offset + $block) < $nmodules) { if (($hor_offset + $block) < $nmodules) {
$new_hor_offset = $hor_offset+$block; $new_hor_offset = ($hor_offset + $block);
echo "<th width='20px' " . echo "<th width='20px' "."style='vertical-align:top; padding-top: 35px;' "."rowspan='".($nagents + 1)."'>"."<a href='index.php?".'extension_in_menu=estado&'.'sec=extensions&'.'sec2=extensions/agents_modules&'.'save_serialize=1&'.'selection_a_m='.$selection_a_m.'&'.'hor_offset='.$new_hor_offset.'&'.'offset='.$offset."'>".html_print_image(
"style='vertical-align:top; padding-top: 35px;' " . 'images/arrow.png',
"rowspan='".($nagents+1)."'>" . true,
"<a href='index.php?" . ['title' => __('More modules')]
"extension_in_menu=estado&" . ).'</a>'.'</th>';
"sec=extensions&".
"sec2=extensions/agents_modules&".
"save_serialize=1&" .
"selection_a_m=" . $selection_a_m . "&" .
"hor_offset=" . $new_hor_offset . "&".
"offset=" . $offset .
"'>" .
html_print_image(
"images/arrow.png", true,
array('title' => __('More modules'))) .
"</a>" .
"</th>";
} }
echo "</tr>"; echo '</tr>';
$filter_agents = array('offset' => (int) $offset, 'disabled' => 0); $filter_agents = [
'offset' => (int) $offset,
'disabled' => 0,
];
if ($group_id > 0) { if ($group_id > 0) {
$filter_agents['id_grupo'] = $group_id; $filter_agents['id_grupo'] = $group_id;
} }
// Prepare pagination // Prepare pagination
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&' . "hor_offset=" . $hor_offset ."&selection_a_m=" . $selection_a_m; $url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&'.'hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m;
ui_pagination($total_pagination, $url); ui_pagination($total_pagination, $url);
foreach ($agents as $agent) { foreach ($agents as $agent) {
// Get stats for this group // Get stats for this group
$agent_status = agents_get_status($agent['id_agente']); $agent_status = agents_get_status($agent['id_agente']);
$alias = db_get_row ("tagente", "id_agente", $agent['id_agente']); $alias = db_get_row('tagente', 'id_agente', $agent['id_agente']);
if (empty($alias['alias'])) { if (empty($alias['alias'])) {
$alias['alias'] = $agent['nombre']; $alias['alias'] = $agent['nombre'];
} }
switch ($agent_status) { switch ($agent_status) {
case 4: // Alert fired status case 4:
// Alert fired status
$rowcolor = 'group_view_alrm'; $rowcolor = 'group_view_alrm';
break; break;
case 1: // Critical status
case 1:
// Critical status
$rowcolor = 'group_view_crit'; $rowcolor = 'group_view_crit';
break; break;
case 2: // Warning status
case 2:
// Warning status
$rowcolor = 'group_view_warn'; $rowcolor = 'group_view_warn';
break; break;
case 0: // Normal status
$rowcolor = "group_view_ok"; case 0:
// Normal status
$rowcolor = 'group_view_ok';
break; break;
case 3: case 3:
case -1: case -1:
default: // Unknown status default:
// Unknown status
$rowcolor = 'group_view_unk'; $rowcolor = 'group_view_unk';
break; break;
} }
@ -487,9 +494,7 @@ function mainAgentsModules() {
echo "<tr style='height: 25px;'>"; echo "<tr style='height: 25px;'>";
echo "<td class='$rowcolor'> echo "<td class='$rowcolor'>
<a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>" . <a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>".$alias['alias'].'</a></td>';
$alias['alias'] .
"</a></td>";
// TODO TAGS agents_get_modules // TODO TAGS agents_get_modules
$agent_modules = agents_get_modules($agent['id_agente'], false, $filter_module_group, true, true); $agent_modules = agents_get_modules($agent['id_agente'], false, $filter_module_group, true, true);
@ -507,78 +512,81 @@ function mainAgentsModules() {
if (!$match && array_key_exists($module_id, $agent_modules)) { if (!$match && array_key_exists($module_id, $agent_modules)) {
$status = modules_get_agentmodule_status($module_id); $status = modules_get_agentmodule_status($module_id);
echo "<td style='text-align: center;'>"; echo "<td style='text-align: center;'>";
$win_handle = dechex(crc32($module_id.$module["name"])); $win_handle = dechex(crc32($module_id.$module['name']));
$graph_type = return_graphtype(modules_get_agentmodule_type($module_id)); $graph_type = return_graphtype(modules_get_agentmodule_type($module_id));
$link ="winopeng('" . $link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'label='.rawurlencode(
"operation/agentes/stat_win.php?" .
"type=$graph_type&" .
"period=" . SECONDS_1DAY . "&" .
"id=" . $module_id . "&" .
"label=" . rawurlencode(
urlencode( urlencode(
base64_encode($module["name"]))) . "&" . base64_encode($module['name'])
"refresh=" . SECONDS_10MINUTES . "', 'day_".$win_handle."')"; )
).'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."')";
echo '<a href="javascript:'.$link.'">'; echo '<a href="javascript:'.$link.'">';
switch ($status) { switch ($status) {
case AGENT_MODULE_STATUS_NORMAL: case AGENT_MODULE_STATUS_NORMAL:
ui_print_status_image('module_ok.png', modules_get_last_value($module_id), false); ui_print_status_image('module_ok.png', modules_get_last_value($module_id), false);
break; break;
case AGENT_MODULE_STATUS_CRITICAL_BAD: case AGENT_MODULE_STATUS_CRITICAL_BAD:
ui_print_status_image('module_critical.png', modules_get_last_value($module_id), false); ui_print_status_image('module_critical.png', modules_get_last_value($module_id), false);
break; break;
case AGENT_MODULE_STATUS_WARNING: case AGENT_MODULE_STATUS_WARNING:
ui_print_status_image('module_warning.png', modules_get_last_value($module_id), false); ui_print_status_image('module_warning.png', modules_get_last_value($module_id), false);
break; break;
case AGENT_MODULE_STATUS_UNKNOWN: case AGENT_MODULE_STATUS_UNKNOWN:
ui_print_status_image('module_unknown.png', modules_get_last_value($module_id), false); ui_print_status_image('module_unknown.png', modules_get_last_value($module_id), false);
break; break;
case AGENT_MODULE_STATUS_NORMAL_ALERT: case AGENT_MODULE_STATUS_NORMAL_ALERT:
case AGENT_MODULE_STATUS_WARNING_ALERT: case AGENT_MODULE_STATUS_WARNING_ALERT:
case AGENT_MODULE_STATUS_CRITICAL_ALERT: case AGENT_MODULE_STATUS_CRITICAL_ALERT:
ui_print_status_image('module_alertsfired.png', modules_get_last_value($module_id), false); ui_print_status_image('module_alertsfired.png', modules_get_last_value($module_id), false);
break; break;
case 4: case 4:
ui_print_status_image('module_no_data.png', modules_get_last_value($module_id), false); ui_print_status_image('module_no_data.png', modules_get_last_value($module_id), false);
break; break;
} }
echo '</a>'; echo '</a>';
echo "</td>"; echo '</td>';
$match = true; $match = true;
} }
} }
if (!$match) { if (!$match) {
echo "<td></td>"; echo '<td></td>';
} }
} }
echo "</tr>";
}
echo "</table>"; echo '</tr>';
}
echo '</table>';
echo "<div class='legend_basic' style='width: 96%'>"; echo "<div class='legend_basic' style='width: 96%'>";
echo "<table>"; echo '<table>';
echo "<tr><td colspan='2' style='padding-bottom: 10px;'><b>" . __('Legend') . "</b></td></tr>"; echo "<tr><td colspan='2' style='padding-bottom: 10px;'><b>".__('Legend').'</b></td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_ALERTFIRED . ";'></div></td><td>" . __("Orange cell when the module has fired alerts") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></td><td>".__('Orange cell when the module has fired alerts').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_CRITICAL . ";'></div></td><td>" . __("Red cell when the module has a critical status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></td><td>".__('Red cell when the module has a critical status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_WARNING . ";'></div></td><td>" . __("Yellow cell when the module has a warning status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Yellow cell when the module has a warning status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NORMAL . ";'></div></td><td>" . __("Green cell when the module has a normal status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></td><td>".__('Green cell when the module has a normal status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_UNKNOWN . ";'></div></td><td>" . __("Grey cell when the module has an unknown status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></td><td>".__('Grey cell when the module has an unknown status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NOTINIT . ";'></div></td><td>" . __("Cell turns blue when the module is in 'not initialize' status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></td><td>".__("Cell turns blue when the module is in 'not initialize' status").'</td></tr>';
echo "</table>"; echo '</table>';
echo "</div>"; echo '</div>';
$pure_var = $config['pure']; $pure_var = $config['pure'];
if ($pure_var) { if ($pure_var) {
$pure_var = 1; $pure_var = 1;
} } else {
else{
$pure_var = 0; $pure_var = 0;
} }
} }
extensions_add_operation_menu_option(__("Agents/Modules view"), 'estado', 'agents_modules/icon_menu.png', "v1r1","view");
extensions_add_operation_menu_option(__('Agents/Modules view'), 'estado', 'agents_modules/icon_menu.png', 'v1r1', 'view');
extensions_add_main_function('mainAgentsModules'); extensions_add_main_function('mainAgentsModules');
$ignored_params['refresh'] = ''; $ignored_params['refresh'] = '';

View File

@ -4,39 +4,39 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function api_execute($url, $ip, $pandora_url, $apipass, $user, $password, $op, $op2, $id, $id2, $return_type, $other, $other_mode)
function api_execute($url, $ip, $pandora_url, $apipass, $user, $password, $op, $op2, $id, $id2, $return_type, $other, $other_mode) { {
if (empty($url)) { if (empty($url)) {
$url = "http://" . $ip . $pandora_url . "/include/api.php"; $url = 'http://'.$ip.$pandora_url.'/include/api.php';
$url .= "?"; $url .= '?';
$url .= "apipass=" . $apipass; $url .= 'apipass='.$apipass;
$url .= "&user=" . $user; $url .= '&user='.$user;
$url .= "&pass=" . $password; $url .= '&pass='.$password;
$url .= "&op=" . $op; $url .= '&op='.$op;
$url .= "&op2=" . $op2; $url .= '&op2='.$op2;
if ($id !== '') { if ($id !== '') {
$url .= "&id=" . $id; $url .= '&id='.$id;
} }
if ($id2 !== '') { if ($id2 !== '') {
$url .= "&id2=" . $id2; $url .= '&id2='.$id2;
} }
if ($return_type !== '') { if ($return_type !== '') {
$url .= "&return_type=" . $return_type; $url .= '&return_type='.$return_type;
} }
if ($other !== '') { if ($other !== '') {
$url .= "&other_mode=" . $other_mode; $url .= '&other_mode='.$other_mode;
$url .= "&other=" . $other; $url .= '&other='.$other;
} }
} }
@ -46,20 +46,27 @@ function api_execute($url, $ip, $pandora_url, $apipass, $user, $password, $op, $
$result = curl_exec($curlObj); $result = curl_exec($curlObj);
curl_close($curlObj); curl_close($curlObj);
$return = array('url' => $url, 'result' => $result); $return = [
'url' => $url,
'result' => $result,
];
return $return; return $return;
} }
function extension_api_checker() {
function extension_api_checker()
{
global $config; global $config;
check_login(); check_login();
if (! check_acl ($config['id_user'], 0, "PM")) { if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit("ACL Violation", db_pandora_audit(
"Trying to access Profile Management"); 'ACL Violation',
require ("general/noaccess.php"); 'Trying to access Profile Management'
);
include 'general/noaccess.php';
return; return;
} }
@ -83,130 +90,146 @@ function extension_api_checker() {
$return_call_api = ''; $return_call_api = '';
if ($api_execute) { if ($api_execute) {
$return_call_api = $return_call_api = api_execute(
api_execute($url, $ip, $pandora_url, $apipass, $user, $password, $url,
$op, $op2, urlencode($id), urlencode($id2), $ip,
$return_type, urlencode($other), $other_mode); $pandora_url,
$apipass,
$user,
$password,
$op,
$op2,
urlencode($id),
urlencode($id2),
$return_type,
urlencode($other),
$other_mode
);
} }
ui_print_page_header (__("API checker"), ui_print_page_header(
"images/extensions.png", false, "", true, ""); __('API checker'),
'images/extensions.png',
false,
'',
true,
''
);
$table = null; $table = null;
$table->data = array(); $table->data = [];
$row = array(); $row = [];
$row[] = __("IP"); $row[] = __('IP');
$row[] = html_print_input_text('ip', $ip, '', 50, 255, true); $row[] = html_print_input_text('ip', $ip, '', 50, 255, true);
$table->data[] = $row; $table->data[] = $row;
$row = array(); $row = [];
$row[] = __("%s Console URL", get_product_name()); $row[] = __('%s Console URL', get_product_name());
$row[] = html_print_input_text('pandora_url', $pandora_url, '', 50, 255, true); $row[] = html_print_input_text('pandora_url', $pandora_url, '', 50, 255, true);
$table->data[] = $row; $table->data[] = $row;
$row = array(); $row = [];
$row[] = __("API Pass"); $row[] = __('API Pass');
$row[] = html_print_input_password('apipass', $apipass, '', 50, 255, true); $row[] = html_print_input_password('apipass', $apipass, '', 50, 255, true);
$table->data[] = $row; $table->data[] = $row;
$row = array(); $row = [];
$row[] = __("User"); $row[] = __('User');
$row[] = html_print_input_text('user', $user, '', 50, 255, true); $row[] = html_print_input_text('user', $user, '', 50, 255, true);
$table->data[] = $row; $table->data[] = $row;
$row = array(); $row = [];
$row[] = __("Password"); $row[] = __('Password');
$row[] = html_print_input_password('password', $password, '', 50, 255, true); $row[] = html_print_input_password('password', $password, '', 50, 255, true);
$table->data[] = $row; $table->data[] = $row;
$table2 = null; $table2 = null;
$table2->data = array(); $table2->data = [];
$row = array(); $row = [];
$row[] = __("Action (get or set)"); $row[] = __('Action (get or set)');
$row[] = html_print_input_text('op', $op, '', 50, 255, true); $row[] = html_print_input_text('op', $op, '', 50, 255, true);
$table2->data[] = $row; $table2->data[] = $row;
$row = array(); $row = [];
$row[] = __("Operation"); $row[] = __('Operation');
$row[] = html_print_input_text('op2', $op2, '', 50, 255, true); $row[] = html_print_input_text('op2', $op2, '', 50, 255, true);
$table2->data[] = $row; $table2->data[] = $row;
$row = array(); $row = [];
$row[] = __("ID"); $row[] = __('ID');
$row[] = html_print_input_text('id', $id, '', 50, 255, true); $row[] = html_print_input_text('id', $id, '', 50, 255, true);
$table2->data[] = $row; $table2->data[] = $row;
$row = array(); $row = [];
$row[] = __("ID 2"); $row[] = __('ID 2');
$row[] = html_print_input_text('id2', $id2, '', 50, 255, true); $row[] = html_print_input_text('id2', $id2, '', 50, 255, true);
$table2->data[] = $row; $table2->data[] = $row;
$row = array(); $row = [];
$row[] = __("Return Type"); $row[] = __('Return Type');
$row[] = html_print_input_text('return_type', $return_type, '', 50, 255, true); $row[] = html_print_input_text('return_type', $return_type, '', 50, 255, true);
$table2->data[] = $row; $table2->data[] = $row;
$row = array(); $row = [];
$row[] = __("Other"); $row[] = __('Other');
$row[] = html_print_input_text('other', $other, '', 50, 255, true); $row[] = html_print_input_text('other', $other, '', 50, 255, true);
$table2->data[] = $row; $table2->data[] = $row;
$row = array(); $row = [];
$row[] = __("Other Mode"); $row[] = __('Other Mode');
$row[] = html_print_input_text('other_mode', $other_mode, '', 50, 255, true); $row[] = html_print_input_text('other_mode', $other_mode, '', 50, 255, true);
$table2->data[] = $row; $table2->data[] = $row;
$table3 = null; $table3 = null;
$table3->data = array(); $table3->data = [];
$row = array(); $row = [];
$row[] = __("Raw URL"); $row[] = __('Raw URL');
$row[] = html_print_input_text('url', $url, '', 150, 2048, true); $row[] = html_print_input_text('url', $url, '', 150, 2048, true);
$table3->data[] = $row; $table3->data[] = $row;
echo "<form method='post'>"; echo "<form method='post'>";
echo "<fieldset>"; echo '<fieldset>';
echo "<legend>" . __('Credentials') . "</legend>"; echo '<legend>'.__('Credentials').'</legend>';
html_print_table($table); html_print_table($table);
echo "</fieldset>"; echo '</fieldset>';
echo "<fieldset>"; echo '<fieldset>';
echo "<legend>" . __('Call parameters') . "</legend>"; echo '<legend>'.__('Call parameters').'</legend>';
html_print_table($table2); html_print_table($table2);
echo "</fieldset>"; echo '</fieldset>';
echo "<div style='text-align: right;'>"; echo "<div style='text-align: right;'>";
html_print_input_hidden('api_execute', 1); html_print_input_hidden('api_execute', 1);
html_print_submit_button(__('Call'), 'submit', false, 'class="sub next"'); html_print_submit_button(__('Call'), 'submit', false, 'class="sub next"');
echo "</div>"; echo '</div>';
echo "</form>"; echo '</form>';
echo "<form method='post'>"; echo "<form method='post'>";
echo "<fieldset>"; echo '<fieldset>';
echo "<legend>" . __('Custom URL') . "</legend>"; echo '<legend>'.__('Custom URL').'</legend>';
html_print_table($table3); html_print_table($table3);
echo "</fieldset>"; echo '</fieldset>';
echo "<div style='text-align: right;'>"; echo "<div style='text-align: right;'>";
html_print_input_hidden('api_execute', 1); html_print_input_hidden('api_execute', 1);
html_print_submit_button(__('Call'), 'submit', false, 'class="sub next"'); html_print_submit_button(__('Call'), 'submit', false, 'class="sub next"');
echo "</div>"; echo '</div>';
echo "</form>"; echo '</form>';
if ($api_execute) { if ($api_execute) {
echo "<fieldset>"; echo '<fieldset>';
echo "<legend>" . __('Result') . "</legend>"; echo '<legend>'.__('Result').'</legend>';
echo __('URL') . "<br />"; echo __('URL').'<br />';
html_print_input_password('url', $return_call_api['url'], '', 150, 255, false, true); html_print_input_password('url', $return_call_api['url'], '', 150, 255, false, true);
echo "&nbsp;<a id='show_icon' title='".__('Show URL')."' href='javascript: show_url();'>"; echo "&nbsp;<a id='show_icon' title='".__('Show URL')."' href='javascript: show_url();'>";
html_print_image("images/input_zoom.png"); html_print_image('images/input_zoom.png');
echo "</a>"; echo '</a>';
echo "<br />"; echo '<br />';
echo __('Result') . "<br />"; echo __('Result').'<br />';
html_print_textarea('result', 30, 20, $return_call_api['result'], 'readonly="readonly"'); html_print_textarea('result', 30, 20, $return_call_api['result'], 'readonly="readonly"');
echo "</fieldset>"; echo '</fieldset>';
} }
?> ?>
<script> <script>
@ -224,6 +247,7 @@ function extension_api_checker() {
<?php <?php
} }
extensions_add_godmode_function('extension_api_checker'); extensions_add_godmode_function('extension_api_checker');
extensions_add_godmode_menu_option(__('API checker'), 'PM', 'gextensions', null, "v1r1"); extensions_add_godmode_menu_option(__('API checker'), 'PM', 'gextensions', null, 'v1r1');
?>

View File

@ -4,17 +4,15 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function extension_db_status()
function extension_db_status() { {
global $config; global $config;
$db_user = get_parameter('db_user', ''); $db_user = get_parameter('db_user', '');
@ -23,56 +21,72 @@ function extension_db_status() {
$db_name = get_parameter('db_name', ''); $db_name = get_parameter('db_name', '');
$db_status_execute = (bool) get_parameter('db_status_execute', false); $db_status_execute = (bool) get_parameter('db_status_execute', false);
ui_print_page_header (__("DB Schema check"), ui_print_page_header(
"images/extensions.png", false, "", true, ""); __('DB Schema check'),
'images/extensions.png',
false,
'',
true,
''
);
if (!is_user_admin($config['id_user'])) { if (!is_user_admin($config['id_user'])) {
db_pandora_audit("ACL Violation", db_pandora_audit(
"Trying to access db status"); 'ACL Violation',
require ("general/noaccess.php"); 'Trying to access db status'
);
include 'general/noaccess.php';
return; return;
} }
ui_print_info_message( ui_print_info_message(
__('This extension checks the DB is correct. Because sometimes the old DB from a migration has not some fields in the tables or the data is changed.')); __('This extension checks the DB is correct. Because sometimes the old DB from a migration has not some fields in the tables or the data is changed.')
);
ui_print_info_message( ui_print_info_message(
__('At the moment the checks is for MySQL/MariaDB.')); __('At the moment the checks is for MySQL/MariaDB.')
);
echo "<form method='post'>"; echo "<form method='post'>";
echo "<fieldset>"; echo '<fieldset>';
echo "<legend>" . __('DB settings') . "</legend>"; echo '<legend>'.__('DB settings').'</legend>';
$table = new stdClass(); $table = new stdClass();
$table->data = array(); $table->data = [];
$row = array(); $row = [];
$row[] = __("DB User with privileges"); $row[] = __('DB User with privileges');
$row[] = html_print_input_text('db_user', $db_user, '', 50, 255, true); $row[] = html_print_input_text('db_user', $db_user, '', 50, 255, true);
$row[] = __("DB Password for this user"); $row[] = __('DB Password for this user');
$row[] = html_print_input_password('db_password', $db_password, '', 50, 255, true); $row[] = html_print_input_password('db_password', $db_password, '', 50, 255, true);
$table->data[] = $row; $table->data[] = $row;
$row = array(); $row = [];
$row[] = __("DB Hostname"); $row[] = __('DB Hostname');
$row[] = html_print_input_text('db_host', $db_host, '', 50, 255, true); $row[] = html_print_input_text('db_host', $db_host, '', 50, 255, true);
$row[] = __("DB Name (temporal for testing)"); $row[] = __('DB Name (temporal for testing)');
$row[] = html_print_input_text('db_name', $db_name, '', 50, 255, true); $row[] = html_print_input_text('db_name', $db_name, '', 50, 255, true);
$table->data[] = $row; $table->data[] = $row;
html_print_table($table); html_print_table($table);
echo "</fieldset>"; echo '</fieldset>';
echo "<div style='text-align: right;'>"; echo "<div style='text-align: right;'>";
html_print_input_hidden('db_status_execute', 1); html_print_input_hidden('db_status_execute', 1);
html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub"'); html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub"');
echo "</div>"; echo '</div>';
echo "</form>"; echo '</form>';
if ($db_status_execute) { if ($db_status_execute) {
extension_db_status_execute_checks($db_user, $db_password, extension_db_status_execute_checks(
$db_host, $db_name); $db_user,
$db_password,
$db_host,
$db_name
);
} }
} }
function extension_db_status_execute_checks($db_user, $db_password, $db_host, $db_name) {
function extension_db_status_execute_checks($db_user, $db_password, $db_host, $db_name)
{
global $config; global $config;
$connection_system = $config['dbconnection']; $connection_system = $config['dbconnection'];
@ -80,22 +94,21 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
// Avoid SQL injection // Avoid SQL injection
$db_name = io_safe_output($db_name); $db_name = io_safe_output($db_name);
$db_name = str_replace(';', ' ', $db_name); $db_name = str_replace(';', ' ', $db_name);
$db_name = explode(" ", $db_name); $db_name = explode(' ', $db_name);
$db_name = $db_name[0]; $db_name = $db_name[0];
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
$connection_test = mysqli_connect($db_host, $db_user, $db_password); $connection_test = mysqli_connect($db_host, $db_user, $db_password);
} } else {
else{
$connection_test = mysql_connect($db_host, $db_user, $db_password); $connection_test = mysql_connect($db_host, $db_user, $db_password);
} }
if (!$connection_test) { if (!$connection_test) {
ui_print_error_message( ui_print_error_message(
__('Unsuccessful connected to the DB')); __('Unsuccessful connected to the DB')
} );
else { } else {
if($config["mysqli"] === true){ if ($config['mysqli'] === true) {
$create_db = mysqli_query($connection_test, "CREATE DATABASE `$db_name`"); $create_db = mysqli_query($connection_test, "CREATE DATABASE `$db_name`");
} else { } else {
$create_db = mysql_query("CREATE DATABASE `$db_name`"); $create_db = mysql_query("CREATE DATABASE `$db_name`");
@ -103,37 +116,37 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
if (!$create_db) { if (!$create_db) {
ui_print_error_message( ui_print_error_message(
__('Unsuccessful created the testing DB')); __('Unsuccessful created the testing DB')
} );
else { } else {
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
mysqli_select_db($connection_test, $db_name); mysqli_select_db($connection_test, $db_name);
} } else {
else{
mysql_select_db($db_name, $connection_test); mysql_select_db($db_name, $connection_test);
} }
$install_tables = extension_db_status_execute_sql_file( $install_tables = extension_db_status_execute_sql_file(
$config['homedir'] . "/pandoradb.sql", $config['homedir'].'/pandoradb.sql',
$connection_test); $connection_test
);
if (!$install_tables) { if (!$install_tables) {
ui_print_error_message( ui_print_error_message(
__('Unsuccessful installed tables into the testing DB')); __('Unsuccessful installed tables into the testing DB')
} );
else { } else {
extension_db_check_tables_differences( extension_db_check_tables_differences(
$connection_test, $connection_test,
$connection_system, $connection_system,
$db_name, $db_name,
$config['dbname']); $config['dbname']
);
} }
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
mysqli_select_db($connection_test, $db_name); mysqli_select_db($connection_test, $db_name);
mysqli_query($connection_test, "DROP DATABASE IF EXISTS `$db_name`"); mysqli_query($connection_test, "DROP DATABASE IF EXISTS `$db_name`");
} } else {
else{
mysql_select_db($db_name, $connection_test); mysql_select_db($db_name, $connection_test);
mysql_query("DROP DATABASE IF EXISTS `$db_name`", $connection_test); mysql_query("DROP DATABASE IF EXISTS `$db_name`", $connection_test);
} }
@ -141,55 +154,61 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
} }
} }
function extension_db_check_tables_differences($connection_test,
$connection_system, $db_name_test, $db_name_system) {
function extension_db_check_tables_differences(
$connection_test,
$connection_system,
$db_name_test,
$db_name_system
) {
global $config; global $config;
// --------- Check the tables -------------------------------------- // --------- Check the tables --------------------------------------
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
mysqli_select_db($connection_test, $db_name_test); mysqli_select_db($connection_test, $db_name_test);
$result = mysqli_query($connection_test, "SHOW TABLES"); $result = mysqli_query($connection_test, 'SHOW TABLES');
} else { } else {
mysql_select_db($db_name_test, $connection_test); mysql_select_db($db_name_test, $connection_test);
$result = mysql_query("SHOW TABLES", $connection_test); $result = mysql_query('SHOW TABLES', $connection_test);
} }
$tables_test = array(); $tables_test = [];
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
while ($row = mysqli_fetch_array($result)) { while ($row = mysqli_fetch_array($result)) {
$tables_test[] = $row[0]; $tables_test[] = $row[0];
} }
mysqli_free_result($result); mysqli_free_result($result);
mysqli_select_db($connection_test, $db_name_system); mysqli_select_db($connection_test, $db_name_system);
$result = mysqli_query( $connection_test, "SHOW TABLES"); $result = mysqli_query($connection_test, 'SHOW TABLES');
} } else {
else{
while ($row = mysql_fetch_array($result)) { while ($row = mysql_fetch_array($result)) {
$tables_test[] = $row[0]; $tables_test[] = $row[0];
} }
mysql_free_result($result); mysql_free_result($result);
mysql_select_db($db_name_system, $connection_test); mysql_select_db($db_name_system, $connection_test);
$result = mysql_query("SHOW TABLES", $connection_test); $result = mysql_query('SHOW TABLES', $connection_test);
} }
$tables_system = array(); $tables_system = [];
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
while ($row = mysqli_fetch_array($result)) { while ($row = mysqli_fetch_array($result)) {
$tables_system[] = $row[0]; $tables_system[] = $row[0];
} }
mysqli_free_result($result); mysqli_free_result($result);
} } else {
else{
while ($row = mysql_fetch_array($result)) { while ($row = mysql_fetch_array($result)) {
$tables_system[] = $row[0]; $tables_system[] = $row[0];
} }
mysql_free_result($result); mysql_free_result($result);
} }
@ -198,37 +217,36 @@ function extension_db_check_tables_differences($connection_test,
ui_print_result_message( ui_print_result_message(
!empty($diff_tables), !empty($diff_tables),
__('Success! %s DB contains all tables', get_product_name()), __('Success! %s DB contains all tables', get_product_name()),
__('%s DB could not retrieve all tables. The missing tables are (%s)', __(
get_product_name(), implode(", ", $diff_tables))); '%s DB could not retrieve all tables. The missing tables are (%s)',
get_product_name(),
implode(', ', $diff_tables)
)
);
if (!empty($diff_tables)) { if (!empty($diff_tables)) {
foreach ($diff_tables as $table) { foreach ($diff_tables as $table) {
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
mysqli_select_db($connection_test, $db_name_test); mysqli_select_db($connection_test, $db_name_test);
$result = mysqli_query($connection_test, "SHOW CREATE TABLE " . $table); $result = mysqli_query($connection_test, 'SHOW CREATE TABLE '.$table);
$tables_test = array(); $tables_test = [];
while ($row = mysql_fetch_array($result)) { while ($row = mysql_fetch_array($result)) {
ui_print_info_message( ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" . __('You can execute this SQL query for to fix.').'<br />'.'<pre>'.$row[1].'</pre>'
'<pre>' .
$row[1] .
'</pre>'
); );
} }
mysqli_free_result($result); mysqli_free_result($result);
} } else {
else{
mysql_select_db($db_name_test, $connection_test); mysql_select_db($db_name_test, $connection_test);
$result = mysql_query("SHOW CREATE TABLE " . $table, $connection_test); $result = mysql_query('SHOW CREATE TABLE '.$table, $connection_test);
$tables_test = array(); $tables_test = [];
while ($row = mysql_fetch_array($result)) { while ($row = mysql_fetch_array($result)) {
ui_print_info_message( ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" . __('You can execute this SQL query for to fix.').'<br />'.'<pre>'.$row[1].'</pre>'
'<pre>' .
$row[1] .
'</pre>'
); );
} }
mysql_free_result($result); mysql_free_result($result);
} }
} }
@ -238,140 +256,143 @@ function extension_db_check_tables_differences($connection_test,
$correct_fields = true; $correct_fields = true;
foreach ($tables_system as $table) { foreach ($tables_system as $table) {
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
mysqli_select_db($connection_test, $db_name_test); mysqli_select_db($connection_test, $db_name_test);
$result = mysqli_query($connection_test, "EXPLAIN " . $table); $result = mysqli_query($connection_test, 'EXPLAIN '.$table);
} } else {
else{
mysql_select_db($db_name_test, $connection_test); mysql_select_db($db_name_test, $connection_test);
$result = mysql_query("EXPLAIN " . $table, $connection_test); $result = mysql_query('EXPLAIN '.$table, $connection_test);
} }
$fields_test = array(); $fields_test = [];
if (!empty($result)) { if (!empty($result)) {
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
while ($row = mysqli_fetch_array($result)) { while ($row = mysqli_fetch_array($result)) {
$fields_test[$row[0]] = array( $fields_test[$row[0]] = [
'field ' => $row[0], 'field ' => $row[0],
'type' => $row[1], 'type' => $row[1],
'null' => $row[2], 'null' => $row[2],
'key' => $row[3], 'key' => $row[3],
'default' => $row[4], 'default' => $row[4],
'extra' => $row[5]); 'extra' => $row[5],
];
} }
mysqli_free_result($result); mysqli_free_result($result);
mysqli_select_db($connection_test, $db_name_system); mysqli_select_db($connection_test, $db_name_system);
} } else {
else{
while ($row = mysql_fetch_array($result)) { while ($row = mysql_fetch_array($result)) {
$fields_test[$row[0]] = array( $fields_test[$row[0]] = [
'field ' => $row[0], 'field ' => $row[0],
'type' => $row[1], 'type' => $row[1],
'null' => $row[2], 'null' => $row[2],
'key' => $row[3], 'key' => $row[3],
'default' => $row[4], 'default' => $row[4],
'extra' => $row[5]); 'extra' => $row[5],
];
} }
mysql_free_result($result); mysql_free_result($result);
mysql_select_db($db_name_system, $connection_test); mysql_select_db($db_name_system, $connection_test);
} }
} }
if($config["mysqli"] === true){ if ($config['mysqli'] === true) {
$result = mysqli_query($connection_test, "EXPLAIN " . $table); $result = mysqli_query($connection_test, 'EXPLAIN '.$table);
} } else {
else{ $result = mysql_query('EXPLAIN '.$table, $connection_test);
$result = mysql_query("EXPLAIN " . $table, $connection_test);
} }
$fields_system = array(); $fields_system = [];
if (!empty($result)) { if (!empty($result)) {
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
while ($row = mysqli_fetch_array($result)) { while ($row = mysqli_fetch_array($result)) {
$fields_system[$row[0]] = array( $fields_system[$row[0]] = [
'field ' => $row[0], 'field ' => $row[0],
'type' => $row[1], 'type' => $row[1],
'null' => $row[2], 'null' => $row[2],
'key' => $row[3], 'key' => $row[3],
'default' => $row[4], 'default' => $row[4],
'extra' => $row[5]); 'extra' => $row[5],
];
} }
mysqli_free_result($result); mysqli_free_result($result);
} } else {
else{
while ($row = mysql_fetch_array($result)) { while ($row = mysql_fetch_array($result)) {
$fields_system[$row[0]] = array( $fields_system[$row[0]] = [
'field ' => $row[0], 'field ' => $row[0],
'type' => $row[1], 'type' => $row[1],
'null' => $row[2], 'null' => $row[2],
'key' => $row[3], 'key' => $row[3],
'default' => $row[4], 'default' => $row[4],
'extra' => $row[5]); 'extra' => $row[5],
];
} }
mysql_free_result($result); mysql_free_result($result);
} }
} }
foreach ($fields_test as $name_field => $field_test) { foreach ($fields_test as $name_field => $field_test) {
if (!isset($fields_system[$name_field])) { if (!isset($fields_system[$name_field])) {
$correct_fields = false; $correct_fields = false;
ui_print_error_message( ui_print_error_message(
__('Unsuccessful the table %s has not the field %s', __(
$table, $name_field)); 'Unsuccessful the table %s has not the field %s',
ui_print_info_message( $table,
__('You can execute this SQL query for to fix.') . "<br />" . $name_field
'<pre>' . )
"ALTER TABLE " . $table . " ADD COLUMN " . $name_field . " text;" .
'</pre>'
); );
} ui_print_info_message(
else { __('You can execute this SQL query for to fix.').'<br />'.'<pre>'.'ALTER TABLE '.$table.' ADD COLUMN '.$name_field.' text;'.'</pre>'
);
} else {
$correct_fields = false; $correct_fields = false;
$field_system = $fields_system[$name_field]; $field_system = $fields_system[$name_field];
$diff = array_diff($field_test, $field_system); $diff = array_diff($field_test, $field_system);
if (!empty($diff)) { if (!empty($diff)) {
$info_message = ""; $info_message = '';
$error_message = ""; $error_message = '';
if ($diff['type']) { if ($diff['type']) {
$error_message .= "Unsuccessful the field ".$name_field." in the table ".$table." must be set the type with ".$diff['type']."<br>"; $error_message .= 'Unsuccessful the field '.$name_field.' in the table '.$table.' must be set the type with '.$diff['type'].'<br>';
} }
if ($diff['null']) { if ($diff['null']) {
$error_message .= "Unsuccessful the field $name_field in the table $table must be null: (".$diff['null'].").<br>"; $error_message .= "Unsuccessful the field $name_field in the table $table must be null: (".$diff['null'].').<br>';
} }
if ($diff['default']) { if ($diff['default']) {
$error_message .= "Unsuccessful the field $name_field in the table $table must be set ".$diff['default']." as default value.<br>"; $error_message .= "Unsuccessful the field $name_field in the table $table must be set ".$diff['default'].' as default value.<br>';
} }
if($field_test['null'] == "YES" || !isset($field_test['null']) || $field_test['null'] == ""){ if ($field_test['null'] == 'YES' || !isset($field_test['null']) || $field_test['null'] == '') {
$null_defect = " NULL"; $null_defect = ' NULL';
} } else {
else{ $null_defect = ' NOT NULL';
$null_defect = " NOT NULL";
} }
if(!isset($field_test['default']) || $field_test['default'] == ""){ if (!isset($field_test['default']) || $field_test['default'] == '') {
$default_value = ""; $default_value = '';
} } else {
else{ $default_value = ' DEFAULT '.$field_test['default'];
$default_value = " DEFAULT ".$field_test['default'];
} }
if ($diff['type'] || $diff['null'] || $diff['default']) { if ($diff['type'] || $diff['null'] || $diff['default']) {
$info_message .= "ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . $null_defect . $default_value.";"; $info_message .= 'ALTER TABLE '.$table.' MODIFY COLUMN '.$name_field.' '.$field_test['type'].$null_defect.$default_value.';';
} }
if ($diff['key']) { if ($diff['key']) {
$error_message .= "Unsuccessful the field $name_field in the table $table must be set the key as defined in the SQL file.<br>"; $error_message .= "Unsuccessful the field $name_field in the table $table must be set the key as defined in the SQL file.<br>";
$info_message .= "<br><br>Please check the SQL file for to know the kind of key needed."; $info_message .= '<br><br>Please check the SQL file for to know the kind of key needed.';
} }
if ($diff['extra']) { if ($diff['extra']) {
$error_message .= "Unsuccessful the field $name_field in the table $table must be set as defined in the SQL file.<br>"; $error_message .= "Unsuccessful the field $name_field in the table $table must be set as defined in the SQL file.<br>";
$info_message .= "<br><br>Please check the SQL file for to know the kind of extra config needed."; $info_message .= '<br><br>Please check the SQL file for to know the kind of extra config needed.';
} }
ui_print_error_message(__($error_message)); ui_print_error_message(__($error_message));
@ -381,6 +402,7 @@ function extension_db_check_tables_differences($connection_test,
} }
} }
} }
if ($correct_fields) { if ($correct_fields) {
ui_print_success_message( ui_print_success_message(
__('Successful all the tables have the correct fields') __('Successful all the tables have the correct fields')
@ -388,39 +410,44 @@ function extension_db_check_tables_differences($connection_test,
} }
} }
function extension_db_status_execute_sql_file($url, $connection) {
function extension_db_status_execute_sql_file($url, $connection)
{
global $config; global $config;
if (file_exists($url)) { if (file_exists($url)) {
$file_content = file($url); $file_content = file($url);
$query = ""; $query = '';
foreach ($file_content as $sql_line) { foreach ($file_content as $sql_line) {
if (trim($sql_line) != "" && strpos($sql_line, "--") === false) { if (trim($sql_line) != '' && strpos($sql_line, '--') === false) {
$query .= $sql_line; $query .= $sql_line;
if (preg_match("/;[\040]*\$/", $sql_line)) { if (preg_match("/;[\040]*\$/", $sql_line)) {
if ($config["mysqli"] === true) { if ($config['mysqli'] === true) {
if (!$result = mysqli_query($connection, $query)) { if (!$result = mysqli_query($connection, $query)) {
echo mysqli_error(); //Uncomment for debug echo mysqli_error();
// Uncomment for debug
echo "<i><br>$query<br></i>"; echo "<i><br>$query<br></i>";
return 0; return 0;
} }
} } else {
else{
if (!$result = mysql_query($query, $connection)) { if (!$result = mysql_query($query, $connection)) {
echo mysql_error(); //Uncomment for debug echo mysql_error();
// Uncomment for debug
echo "<i><br>$query<br></i>"; echo "<i><br>$query<br></i>";
return 0; return 0;
} }
} }
$query = "";
} $query = '';
} }
} }
return 1; }
}
else return 1;
return 0; } else {
} return 0;
}
}
extensions_add_godmode_function('extension_db_status'); extensions_add_godmode_function('extension_db_status');
extensions_add_godmode_menu_option(__('DB Schema check'), 'DM', 'gextensions', null, "v1r1", 'gdbman'); extensions_add_godmode_menu_option(__('DB Schema check'), 'DM', 'gextensions', null, 'v1r1', 'gdbman');
?>

View File

@ -4,34 +4,32 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function dbmanager_query($sql, &$error, $dbconnection)
function dbmanager_query ($sql, &$error, $dbconnection) { {
global $config; global $config;
$retval = array(); $retval = [];
if ($sql == '') if ($sql == '') {
return false; return false;
}
$sql = html_entity_decode($sql, ENT_QUOTES); $sql = html_entity_decode($sql, ENT_QUOTES);
if ($config["mysqli"]) { if ($config['mysqli']) {
$result = mysqli_query($dbconnection, $sql); $result = mysqli_query($dbconnection, $sql);
if ($result === false) { if ($result === false) {
$backtrace = debug_backtrace(); $backtrace = debug_backtrace();
$error = mysqli_error($dbconnection); $error = mysqli_error($dbconnection);
return false; return false;
} }
} } else {
else{
$result = mysql_query($sql, $dbconnection); $result = mysql_query($sql, $dbconnection);
if ($result === false) { if ($result === false) {
$backtrace = debug_backtrace(); $backtrace = debug_backtrace();
@ -41,69 +39,72 @@ function dbmanager_query ($sql, &$error, $dbconnection) {
} }
if ($result === true) { if ($result === true) {
if($config["mysqli"]){ if ($config['mysqli']) {
return mysqli_affected_rows($dbconnection); return mysqli_affected_rows($dbconnection);
} } else {
else{
return mysql_affected_rows(); return mysql_affected_rows();
} }
} }
if($config["mysqli"]){ if ($config['mysqli']) {
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
array_push($retval, $row); array_push($retval, $row);
} }
} } else {
else{
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
array_push($retval, $row); array_push($retval, $row);
} }
} }
if($config["mysqli"]){ if ($config['mysqli']) {
mysqli_free_result($result); mysqli_free_result($result);
} } else {
else{
mysql_free_result($result); mysql_free_result($result);
} }
if (! empty ($retval)) if (! empty($retval)) {
return $retval; return $retval;
}
// Return false, check with === or !== // Return false, check with === or !==
return "Empty"; return 'Empty';
} }
function dbmgr_extension_main () { function dbmgr_extension_main()
{
ui_require_css_file('dbmanager', 'extensions/dbmanager/'); ui_require_css_file('dbmanager', 'extensions/dbmanager/');
global $config; global $config;
if (!is_user_admin($config['id_user'])) { if (!is_user_admin($config['id_user'])) {
db_pandora_audit("ACL Violation", "Trying to access Setup Management"); db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
require ("general/noaccess.php"); include 'general/noaccess.php';
return; return;
} }
$sql = (string) get_parameter('sql'); $sql = (string) get_parameter('sql');
ui_print_page_header (__('Database interface'), "images/gm_db.png", false, false, true); ui_print_page_header(__('Database interface'), 'images/gm_db.png', false, false, true);
echo '<div class="notify">'; echo '<div class="notify">';
echo __("This is an advanced extension to interface with %s database directly from WEB console echo __(
"This is an advanced extension to interface with %s database directly from WEB console
using native SQL sentences. Please note that <b>you can damage</b> your %s installation using native SQL sentences. Please note that <b>you can damage</b> your %s installation
if you don't know </b>exactly</b> what are you are doing, if you don't know </b>exactly</b> what are you are doing,
this means that you can severily damage your setup using this extension. this means that you can severily damage your setup using this extension.
This extension is intended to be used <b>only by experienced users</b> This extension is intended to be used <b>only by experienced users</b>
with a depth knowledge of %s internals.", with a depth knowledge of %s internals.",
get_product_name(), get_product_name(), get_product_name()); get_product_name(),
get_product_name(),
get_product_name()
);
echo '</div>'; echo '</div>';
echo "<br />"; echo '<br />';
echo "Some samples of usage: <blockquote><em>SHOW STATUS;<br />DESCRIBE tagente<br />SELECT * FROM tserver<br />UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'</em></blockquote>"; echo "Some samples of usage: <blockquote><em>SHOW STATUS;<br />DESCRIBE tagente<br />SELECT * FROM tserver<br />UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'</em></blockquote>";
echo "<br /><br />"; echo '<br /><br />';
echo "<form method='post' action=''>"; echo "<form method='post' action=''>";
html_print_textarea('sql', 5, 50, html_entity_decode($sql, ENT_QUOTES)); html_print_textarea('sql', 5, 50, html_entity_decode($sql, ENT_QUOTES));
echo '<br />'; echo '<br />';
@ -111,15 +112,16 @@ function dbmgr_extension_main () {
echo '<br />'; echo '<br />';
html_print_submit_button(__('Execute SQL'), '', false, 'class="sub next"'); html_print_submit_button(__('Execute SQL'), '', false, 'class="sub next"');
echo '</div>'; echo '</div>';
echo "</form>"; echo '</form>';
// Processing SQL Code // Processing SQL Code
if ($sql == '') if ($sql == '') {
return; return;
}
echo "<br />"; echo '<br />';
echo "<hr />"; echo '<hr />';
echo "<br />"; echo '<br />';
$dbconnection = $config['dbconnection']; $dbconnection = $config['dbconnection'];
$error = ''; $error = '';
@ -130,15 +132,15 @@ function dbmgr_extension_main () {
echo '<strong>An error has occured when querying the database.</strong><br />'; echo '<strong>An error has occured when querying the database.</strong><br />';
echo $error; echo $error;
db_pandora_audit("DB Interface Extension", "Error in SQL", false, false, $sql); db_pandora_audit('DB Interface Extension', 'Error in SQL', false, false, $sql);
return; return;
} }
if (! is_array($result)) { if (! is_array($result)) {
echo "<strong>Output: <strong>".$result; echo '<strong>Output: <strong>'.$result;
db_pandora_audit("DB Interface Extension", "SQL", false, false, $sql); db_pandora_audit('DB Interface Extension', 'SQL', false, false, $sql);
return; return;
} }
@ -152,12 +154,12 @@ function dbmgr_extension_main () {
$table->data = $result; $table->data = $result;
html_print_table($table); html_print_table($table);
echo "</div>"; echo '</div>';
} }
/* This adds a option in the operation menu */
extensions_add_godmode_menu_option (__('DB interface'), 'PM','gextensions',"dbmanager/icon.png","v1r1", 'gdbman');
/* This sets the function to be called when the extension is selected in the operation menu */ // This adds a option in the operation menu
extensions_add_godmode_menu_option(__('DB interface'), 'PM', 'gextensions', 'dbmanager/icon.png', 'v1r1', 'gdbman');
// This sets the function to be called when the extension is selected in the operation menu
extensions_add_godmode_function('dbmgr_extension_main'); extensions_add_godmode_function('dbmgr_extension_main');
?>

View File

@ -1,13 +1,15 @@
table.dbmanager,
table.dbmanager, table.dbmanager td, table.dbmanager th { table.dbmanager td,
table.dbmanager th {
border: 1px solid #888; border: 1px solid #888;
border-collapse: collapse; border-collapse: collapse;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
table.dbmanager td, table.dbmanager th { table.dbmanager td,
padding:.2em .5em; table.dbmanager th {
padding: 0.2em 0.5em;
vertical-align: top; vertical-align: top;
font-weight: normal; font-weight: normal;
background: #fafafa; background: #fafafa;
@ -26,4 +28,3 @@ textarea {
height: 50px; height: 50px;
width: 95%; width: 95%;
} }

View File

@ -4,37 +4,33 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function load_matrix_console()
function load_matrix_console() { {
global $config; global $config;
if (! check_acl ($config["id_user"], 0, "ER")) { if (! check_acl($config['id_user'], 0, 'ER')) {
db_pandora_audit("ACL Violation", "Trying to access event viewer"); db_pandora_audit('ACL Violation', 'Trying to access event viewer');
require ("general/noaccess.php"); include 'general/noaccess.php';
return; return;
} }
$pure = (bool) get_parameter('pure'); $pure = (bool) get_parameter('pure');
if (! $pure) { if (! $pure) {
$title_menu = __("Matrix events"); $title_menu = __('Matrix events');
$fullscreen['text'] = '<a href="index.php?extension_in_menu=eventos&sec=extensions&sec2=extensions/matrix_events&pure=1">' $fullscreen['text'] = '<a href="index.php?extension_in_menu=eventos&sec=extensions&sec2=extensions/matrix_events&pure=1">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode'))) $onheader = ['fullscreen' => $fullscreen];
. "</a>"; ui_print_page_header($title_menu, 'images/op_monitoring.png', false, '', false, $onheader);
$onheader = array('fullscreen' => $fullscreen);
ui_print_page_header ($title_menu, "images/op_monitoring.png", false, "", false, $onheader);
} }
echo "<canvas id=\"matrix-terminal\" style=\"display:block;\"></canvas>"; echo '<canvas id="matrix-terminal" style="display:block;"></canvas>';
?> ?>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
@ -260,6 +256,7 @@ function load_matrix_console() {
<?php <?php
} }
extensions_add_operation_menu_option("Matrix", 'eventos', '', "v1r1");
extensions_add_operation_menu_option('Matrix', 'eventos', '', 'v1r1');
extensions_add_main_function('load_matrix_console'); extensions_add_main_function('load_matrix_console');
?>

View File

@ -4,29 +4,35 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function extension_uploader_extensions()
function extension_uploader_extensions() { {
global $config; global $config;
if (!check_acl($config['id_user'], 0, "PM")) { if (!check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit("ACL Violation", db_pandora_audit(
"Trying to access Group Management"); 'ACL Violation',
require ("general/noaccess.php"); 'Trying to access Group Management'
);
include 'general/noaccess.php';
return; return;
} }
ui_print_page_header (__("Uploader extension"), ui_print_page_header(
"images/extensions.png", false, "", true, ""); __('Uploader extension'),
'images/extensions.png',
false,
'',
true,
''
);
$upload = (bool) get_parameter('upload', 0); $upload = (bool) get_parameter('upload', 0);
$upload_enteprise = (bool) get_parameter('upload_enterprise', 0); $upload_enteprise = (bool) get_parameter('upload_enterprise', 0);
@ -41,41 +47,39 @@ function extension_uploader_extensions() {
if ($upload_enteprise) { if ($upload_enteprise) {
$pathname = $config['homedir'].'/'.ENTERPRISE_DIR.'/'.EXTENSIONS_DIR.'/'; $pathname = $config['homedir'].'/'.ENTERPRISE_DIR.'/'.EXTENSIONS_DIR.'/';
} } else {
else {
$pathname = $config['homedir'].'/'.EXTENSIONS_DIR.'/'; $pathname = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
} }
if ($zip->open($tmpName) === true) { if ($zip->open($tmpName) === true) {
$result = $zip->extractTo($pathname); $result = $zip->extractTo($pathname);
} } else {
else {
$result = false; $result = false;
} }
} } else {
else {
$result = false; $result = false;
} }
if ($result) { if ($result) {
db_pandora_audit ("Extension manager", "Upload extension " . $_FILES['extension']['name']); db_pandora_audit('Extension manager', 'Upload extension '.$_FILES['extension']['name']);
} }
ui_print_result_message ($result, __('Success to upload extension'), ui_print_result_message(
__('Fail to upload extension')); $result,
__('Success to upload extension'),
__('Fail to upload extension')
);
} }
$table = null; $table = null;
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->data = array(); $table->data = [];
$table->data[0][0] = __('Upload extension'); $table->data[0][0] = __('Upload extension');
$table->data[0][1] = html_print_input_file('extension', true) . $table->data[0][1] = html_print_input_file('extension', true).ui_print_help_tip(__('Upload the extension as a zip file.'), true);
ui_print_help_tip (__("Upload the extension as a zip file."), true);
if (enterprise_installed()) { if (enterprise_installed()) {
$table->data[0][2] = __('Upload enterprise extension') . "&nbsp;" . $table->data[0][2] = __('Upload enterprise extension').'&nbsp;'.html_print_checkbox('upload_enterprise', 1, false, true);
html_print_checkbox('upload_enterprise', 1, false, true);
} }
echo "<form method='post' enctype='multipart/form-data'>"; echo "<form method='post' enctype='multipart/form-data'>";
@ -83,10 +87,10 @@ function extension_uploader_extensions() {
echo "<div style='text-align: right; width: ".$table->width."'>"; echo "<div style='text-align: right; width: ".$table->width."'>";
html_print_input_hidden('upload', 1); html_print_input_hidden('upload', 1);
html_print_submit_button(__('Upload'), 'submit', false, 'class="sub add"'); html_print_submit_button(__('Upload'), 'submit', false, 'class="sub add"');
echo "</div>"; echo '</div>';
echo "</form>"; echo '</form>';
} }
extensions_add_godmode_menu_option(__('Extension uploader'), 'PM', null, null, "v1r1");
extensions_add_godmode_menu_option(__('Extension uploader'), 'PM', null, null, 'v1r1');
extensions_add_godmode_function('extension_uploader_extensions'); extensions_add_godmode_function('extension_uploader_extensions');
?>

View File

@ -4,36 +4,35 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function pandora_files_repo_install()
{
function pandora_files_repo_install () {
global $config; global $config;
if (isset($config['files_repo_installed']) && $config['files_repo_installed'] == 1) {
if (isset($config['files_repo_installed']) && $config['files_repo_installed'] == 1)
return; return;
}
$full_extensions_dir = $config['homedir']."/".EXTENSIONS_DIR."/"; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
$full_sql_dir = $full_extensions_dir."files_repo/sql/"; $full_sql_dir = $full_extensions_dir.'files_repo/sql/';
$file_path = ''; $file_path = '';
switch ($config['dbtype']) { switch ($config['dbtype']) {
case "mysql": case 'mysql':
$file_path = $full_sql_dir.'files_repo.sql'; $file_path = $full_sql_dir.'files_repo.sql';
break; break;
case "postgresql":
case 'postgresql':
$file_path = $full_sql_dir.'files_repo.postgreSQL.sql'; $file_path = $full_sql_dir.'files_repo.postgreSQL.sql';
break; break;
case "oracle":
case 'oracle':
$file_path = $full_sql_dir.'files_repo.oracle.sql'; $file_path = $full_sql_dir.'files_repo.oracle.sql';
break; break;
} }
@ -42,49 +41,62 @@ function pandora_files_repo_install () {
$result = db_process_file($file_path); $result = db_process_file($file_path);
if ($result) { if ($result) {
/* Configuration values */ // Configuration values
$values = array( $values = [
"token" => "files_repo_installed", 'token' => 'files_repo_installed',
"value" => 1 'value' => 1,
); ];
db_process_sql_insert('tconfig', $values); db_process_sql_insert('tconfig', $values);
} }
} }
} }
function pandora_files_repo_uninstall () {
function pandora_files_repo_uninstall()
{
global $config; global $config;
switch ($config["dbtype"]) { switch ($config['dbtype']) {
case "mysql": case 'mysql':
db_process_sql('DROP TABLE `tfiles_repo_group`'); db_process_sql('DROP TABLE `tfiles_repo_group`');
db_process_sql('DROP TABLE `tfiles_repo`'); db_process_sql('DROP TABLE `tfiles_repo`');
db_process_sql('DELETE FROM `tconfig` db_process_sql(
WHERE `token` LIKE "files_repo_%"'); 'DELETE FROM `tconfig`
WHERE `token` LIKE "files_repo_%"'
);
break; break;
case "postgresql":
case 'postgresql':
db_process_sql('DROP TABLE "tfiles_repo_group"'); db_process_sql('DROP TABLE "tfiles_repo_group"');
db_process_sql('DROP TABLE "tfiles_repo"'); db_process_sql('DROP TABLE "tfiles_repo"');
db_process_sql('DELETE FROM "tconfig" db_process_sql(
WHERE "token" LIKE \'files_repo_%\''); 'DELETE FROM "tconfig"
WHERE "token" LIKE \'files_repo_%\''
);
break; break;
case "oracle":
case 'oracle':
db_process_sql('DROP TRIGGER "tfiles_repo_group_inc"'); db_process_sql('DROP TRIGGER "tfiles_repo_group_inc"');
db_process_sql('DROP SEQUENCE "tfiles_repo_group_s"'); db_process_sql('DROP SEQUENCE "tfiles_repo_group_s"');
db_process_sql('DROP TABLE "tfiles_repo_group"'); db_process_sql('DROP TABLE "tfiles_repo_group"');
db_process_sql('DROP TRIGGER "tfiles_repo_inc"'); db_process_sql('DROP TRIGGER "tfiles_repo_inc"');
db_process_sql('DROP SEQUENCE "tfiles_repo_s"'); db_process_sql('DROP SEQUENCE "tfiles_repo_s"');
db_process_sql('DROP TABLE "tfiles_repo"'); db_process_sql('DROP TABLE "tfiles_repo"');
db_process_sql('DELETE FROM tconfig db_process_sql(
WHERE token LIKE \'files_repo_%\''); 'DELETE FROM tconfig
WHERE token LIKE \'files_repo_%\''
);
break; break;
} }
if (!empty($config['attachment_store'])) if (!empty($config['attachment_store'])) {
delete_dir($config['attachment_store']."/files_repo"); delete_dir($config['attachment_store'].'/files_repo');
}
} }
function pandora_files_repo_godmode () {
function pandora_files_repo_godmode()
{
global $config; global $config;
if (!isset($config['files_repo_installed']) || !$config['files_repo_installed']) { if (!isset($config['files_repo_installed']) || !$config['files_repo_installed']) {
@ -93,30 +105,29 @@ function pandora_files_repo_godmode () {
// ACL Check // ACL Check
check_login(); check_login();
if (! check_acl ($config['id_user'], 0, "PM")) { if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit("ACL Violation", "Trying to access to Files repository"); db_pandora_audit('ACL Violation', 'Trying to access to Files repository');
require ("general/noaccess.php"); include 'general/noaccess.php';
return; return;
} }
// Header tabs // Header tabs
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">' $godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view')]).'</a>';
. html_print_image ("images/setup.png", true, array ("title" => __('Administration view')))
. "</a>";
$godmode['godmode'] = 1; $godmode['godmode'] = 1;
$godmode['active'] = 1; $godmode['active'] = 1;
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">' $operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/operation.png', true, ['title' => __('Operation view')]).'</a>';
. html_print_image ("images/operation.png", true, array ("title" => __('Operation view')))
. "</a>";
$operation['operation'] = 1; $operation['operation'] = 1;
$onheader = array('godmode' => $godmode, 'operation' => $operation); $onheader = [
'godmode' => $godmode,
'operation' => $operation,
];
// Header // Header
ui_print_page_header (__("Files repository manager"), "images/extensions.png", false, "", true, $onheader); ui_print_page_header(__('Files repository manager'), 'images/extensions.png', false, '', true, $onheader);
$full_extensions_dir = $config['homedir']."/".EXTENSIONS_DIR."/"; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
require_once ($full_extensions_dir . "files_repo/functions_files_repo.php"); include_once $full_extensions_dir.'files_repo/functions_files_repo.php';
// Directory files_repo check // Directory files_repo check
if (!files_repo_check_directory(true)) { if (!files_repo_check_directory(true)) {
@ -124,8 +135,9 @@ function pandora_files_repo_godmode () {
} }
$server_content_length = 0; $server_content_length = 0;
if (isset($_SERVER['CONTENT_LENGTH'])) if (isset($_SERVER['CONTENT_LENGTH'])) {
$server_content_length = $_SERVER['CONTENT_LENGTH']; $server_content_length = $_SERVER['CONTENT_LENGTH'];
}
// Check for an anoying error that causes the $_POST and $_FILES arrays // Check for an anoying error that causes the $_POST and $_FILES arrays
// were empty if the file is larger than the post_max_size // were empty if the file is larger than the post_max_size
@ -134,73 +146,79 @@ function pandora_files_repo_godmode () {
} }
// GET and POST parameters // GET and POST parameters
$file_id = (int) get_parameter ("file_id"); $file_id = (int) get_parameter('file_id');
$add_file = (bool) get_parameter ("add_file"); $add_file = (bool) get_parameter('add_file');
$update_file = (bool) get_parameter ("update_file"); $update_file = (bool) get_parameter('update_file');
$delete_file = (bool) get_parameter ("delete"); $delete_file = (bool) get_parameter('delete');
// File add or update // File add or update
if ($add_file || ($update_file && $file_id > 0)) { if ($add_file || ($update_file && $file_id > 0)) {
$groups = get_parameter ("groups", array()); $groups = get_parameter('groups', []);
$public = (bool) get_parameter ("public"); $public = (bool) get_parameter('public');
$description = io_safe_output((string) get_parameter ("description")); $description = io_safe_output((string) get_parameter('description'));
if (mb_strlen($description, "UTF-8") > 200) { if (mb_strlen($description, 'UTF-8') > 200) {
$description = mb_substr($description, 0, 200, "UTF-8"); $description = mb_substr($description, 0, 200, 'UTF-8');
} }
$description = io_safe_input($description); $description = io_safe_input($description);
if ($add_file) { if ($add_file) {
$result = files_repo_add_file("upfile", $description, $groups, $public); $result = files_repo_add_file('upfile', $description, $groups, $public);
} else if ($update_file) { } else if ($update_file) {
$result = files_repo_update_file($file_id, $description, $groups, $public); $result = files_repo_update_file($file_id, $description, $groups, $public);
$file_id = 0; $file_id = 0;
} }
if ($result['status'] == false) { if ($result['status'] == false) {
ui_print_error_message($result['message']); ui_print_error_message($result['message']);
} }
} }
// File delete // File delete
if ($delete_file && $file_id > 0) { if ($delete_file && $file_id > 0) {
$result = files_repo_delete_file($file_id); $result = files_repo_delete_file($file_id);
if ($result !== -1) { if ($result !== -1) {
ui_print_result_message($result, __('Successfully deleted'), __('Could not be deleted')); ui_print_result_message($result, __('Successfully deleted'), __('Could not be deleted'));
} }
$file_id = 0; $file_id = 0;
} }
// FORM // FORM
require ($full_extensions_dir."files_repo/files_repo_form.php"); include $full_extensions_dir.'files_repo/files_repo_form.php';
if (!$file_id) { if (!$file_id) {
// LIST // LIST
$manage = true; $manage = true;
require ($full_extensions_dir."files_repo/files_repo_list.php"); include $full_extensions_dir.'files_repo/files_repo_list.php';
} }
} }
function pandora_files_repo_operation () {
function pandora_files_repo_operation()
{
global $config; global $config;
// Header tabs // Header tabs
$onheader = array(); $onheader = [];
if (check_acl($config['id_user'], 0, "PM")) { if (check_acl($config['id_user'], 0, 'PM')) {
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">' $godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view')]).'</a>';
. html_print_image ("images/setup.png", true, array ("title" => __('Administration view')))
. "</a>";
$godmode['godmode'] = 1; $godmode['godmode'] = 1;
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">' $operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/operation.png', true, ['title' => __('Operation view')]).'</a>';
. html_print_image ("images/operation.png", true, array ("title" => __('Operation view')))
. "</a>";
$operation['operation'] = 1; $operation['operation'] = 1;
$operation['active'] = 1; $operation['active'] = 1;
$onheader = array('godmode' => $godmode, 'operation' => $operation); $onheader = [
'godmode' => $godmode,
'operation' => $operation,
];
} }
// Header
ui_print_page_header (__("Files repository"), "images/extensions.png", false, "", false, $onheader);
$full_extensions_dir = $config['homedir']."/".EXTENSIONS_DIR."/"; // Header
require_once ($full_extensions_dir."files_repo/functions_files_repo.php"); ui_print_page_header(__('Files repository'), 'images/extensions.png', false, '', false, $onheader);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php';
// Directory files_repo check // Directory files_repo check
if (!files_repo_check_directory(true)) { if (!files_repo_check_directory(true)) {
@ -208,17 +226,16 @@ function pandora_files_repo_operation () {
} }
// LIST // LIST
$full_extensions_dir = $config['homedir']."/".EXTENSIONS_DIR."/"; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
require ($full_extensions_dir . "files_repo/files_repo_list.php"); include $full_extensions_dir.'files_repo/files_repo_list.php';
} }
extensions_add_operation_menu_option(__('Files repository'), null, null, "v1r1");
extensions_add_operation_menu_option(__('Files repository'), null, null, 'v1r1');
extensions_add_main_function('pandora_files_repo_operation'); extensions_add_main_function('pandora_files_repo_operation');
extensions_add_godmode_menu_option(__('Files repository manager'), 'PM', null, null, "v1r1"); extensions_add_godmode_menu_option(__('Files repository manager'), 'PM', null, null, 'v1r1');
extensions_add_godmode_function('pandora_files_repo_godmode'); extensions_add_godmode_function('pandora_files_repo_godmode');
// pandora_files_repo_uninstall(); // pandora_files_repo_uninstall();
pandora_files_repo_install(); pandora_files_repo_install();
?>

View File

@ -4,29 +4,25 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
$full_extensions_dir = $config['homedir']."/".EXTENSIONS_DIR."/"; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
require_once ($full_extensions_dir."files_repo/functions_files_repo.php"); require_once $full_extensions_dir.'files_repo/functions_files_repo.php';
$file = array(); $file = [];
$file['name'] = ''; $file['name'] = '';
$file['description'] = ''; $file['description'] = '';
$file['hash'] = ''; $file['hash'] = '';
$file['groups'] = array(); $file['groups'] = [];
if (isset($file_id) && $file_id > 0) { if (isset($file_id) && $file_id > 0) {
$file = files_repo_get_files(array('id' => $file_id)); $file = files_repo_get_files(['id' => $file_id]);
if (empty($file)) { if (empty($file)) {
$file_id = 0; $file_id = 0;
} else { } else {
@ -37,19 +33,19 @@ if (isset($file_id) && $file_id > 0) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->style = array(); $table->style = [];
$table->style[0] = "font-weight: bold;"; $table->style[0] = 'font-weight: bold;';
$table->style[2] = "text-align: center;"; $table->style[2] = 'text-align: center;';
$table->colspan = array(); $table->colspan = [];
$table->data = array(); $table->data = [];
// GROUPS // GROUPS
$groups = groups_get_all(); $groups = groups_get_all();
// Add the All group to the beginning to be always the first // Add the All group to the beginning to be always the first
// Use this instead array_unshift to keep the array keys // Use this instead array_unshift to keep the array keys
$groups = array(0 => __('All')) + $groups; $groups = ([0 => __('All')] + $groups);
$html = ""; $html = '';
$style = "style=\"padding: 2px 10px; display: inline-block;\""; $style = 'style="padding: 2px 10px; display: inline-block;"';
foreach ($groups as $id => $name) { foreach ($groups as $id => $name) {
$checked = in_array($id, $file['groups']); $checked = in_array($id, $file['groups']);
$all_checked = false; $all_checked = false;
@ -59,16 +55,18 @@ foreach ($groups as $id => $name) {
} else { } else {
$checkbox = html_print_checkbox_extended('groups[]', $id, $checked, $all_checked, '', 'class="chkb_group"', true); $checkbox = html_print_checkbox_extended('groups[]', $id, $checked, $all_checked, '', 'class="chkb_group"', true);
} }
$html .= "<div $style>$name&nbsp;$checkbox</div>"; $html .= "<div $style>$name&nbsp;$checkbox</div>";
} }
$row = array();
$row = [];
$row[0] = __('Groups'); $row[0] = __('Groups');
$row[1] = $html; $row[1] = $html;
$table->data[] = $row; $table->data[] = $row;
$table->colspan[][1] = 3; $table->colspan[][1] = 3;
// DESCRIPTION // DESCRIPTION
$row = array(); $row = [];
$row[0] = __('Description'); $row[0] = __('Description');
$row[0] .= ui_print_help_tip(__('Only 200 characters are permitted'), true); $row[0] .= ui_print_help_tip(__('Only 200 characters are permitted'), true);
$row[1] = html_print_textarea('description', 3, 20, $file['description'], 'style="min-height: 40px; max-height: 40px; width: 98%;"', true); $row[1] = html_print_textarea('description', 3, 20, $file['description'], 'style="min-height: 40px; max-height: 40px; width: 98%;"', true);
@ -76,10 +74,10 @@ $table->data[] = $row;
$table->colspan[][1] = 3; $table->colspan[][1] = 3;
// FILE and SUBMIT BUTTON // FILE and SUBMIT BUTTON
$row = array(); $row = [];
// Public checkbox // Public checkbox
$checkbox = html_print_checkbox('public', 1, (bool) !empty($file['hash']), true); $checkbox = html_print_checkbox('public', 1, (bool) !empty($file['hash']), true);
$style = "style=\"padding: 2px 10px; display: inline-block;\""; $style = 'style="padding: 2px 10px; display: inline-block;"';
$row[0] = __('File'); $row[0] = __('File');
if ($file_id > 0) { if ($file_id > 0) {
@ -94,13 +92,14 @@ if ($file_id > 0) {
$row[3] = html_print_submit_button(__('Add'), 'submit', false, 'class="sub add"', true); $row[3] = html_print_submit_button(__('Add'), 'submit', false, 'class="sub add"', true);
$row[3] .= html_print_input_hidden('add_file', 1, true); $row[3] .= html_print_input_hidden('add_file', 1, true);
} }
$table->data[] = $row; $table->data[] = $row;
$table->colspan[][1] = 1; $table->colspan[][1] = 1;
$url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo"); $url = ui_get_full_url('index.php?sec=godmode/extensions&sec2=extensions/files_repo');
echo "<form method='post' action='$url' enctype='multipart/form-data'>"; echo "<form method='post' action='$url' enctype='multipart/form-data'>";
html_print_table($table); html_print_table($table);
echo "</form>"; echo '</form>';
?> ?>

View File

@ -4,18 +4,14 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas // Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License // modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
require_once '../../include/config.php';
require_once ("../../include/config.php");
$file_hash = (string) get_parameter('file'); $file_hash = (string) get_parameter('file');
@ -25,46 +21,48 @@ $check_get = (count($_GET) === 1) ? true : false;
$check_post = (count($_POST) === 0) ? true : false; $check_post = (count($_POST) === 0) ? true : false;
// Only allow the parameter 'file' // Only allow the parameter 'file'
$check_parameter = (!empty($file_hash)) ? true : false; $check_parameter = (!empty($file_hash)) ? true : false;
$check_string = (preg_match("/^[0-9a-zA-Z]{8}$/", $file_hash) === 1) ? true : false; $check_string = (preg_match('/^[0-9a-zA-Z]{8}$/', $file_hash) === 1) ? true : false;
$checks = ($check_request && $check_get && $check_post && $check_parameter && $check_string); $checks = ($check_request && $check_get && $check_post && $check_parameter && $check_string);
if (!$checks) { if (!$checks) {
throw_error(15); // ERROR throw_error(15);
// ERROR
} }
// Get the db file row // Get the db file row
$file = db_get_row_filter("tfiles_repo", array('hash' => $file_hash)); $file = db_get_row_filter('tfiles_repo', ['hash' => $file_hash]);
if (!$file) { if (!$file) {
throw_error(10); // ERROR throw_error(10);
// ERROR
} }
// Case sensitive check // Case sensitive check
$check_hash = ($file['hash'] == $file_hash) ? true : false; $check_hash = ($file['hash'] == $file_hash) ? true : false;
if (!$check_hash) { if (!$check_hash) {
throw_error(10); // ERROR throw_error(10);
// ERROR
} }
// Get the location // Get the location
$files_repo_path = io_safe_output($config['attachment_store'])."/files_repo"; $files_repo_path = io_safe_output($config['attachment_store']).'/files_repo';
$location = $files_repo_path."/".$file['id']."_".$file['name']; $location = $files_repo_path.'/'.$file['id'].'_'.$file['name'];
if (!file_exists($location) || !is_readable($location) || !is_file($location)) { if (!file_exists($location) || !is_readable($location) || !is_file($location)) {
throw_error(5); // ERROR throw_error(5);
// ERROR
} }
// All checks are fine. Download the file! // All checks are fine. Download the file!
header('Content-type: aplication/octet-stream;'); header('Content-type: aplication/octet-stream;');
header("Content-Length: " . filesize($location)); header('Content-Length: '.filesize($location));
header('Content-Disposition: attachment; filename="'.$file['name'].'"'); header('Content-Disposition: attachment; filename="'.$file['name'].'"');
readfile($location); readfile($location);
///
function throw_error ($time = 15) {
function throw_error($time=15)
{
sleep($time); sleep($time);
$styleError = "background:url(\"../images/err.png\") no-repeat scroll 0 0 transparent; padding:4px 1px 6px 30px; color:#CC0000;"; $styleError = 'background:url("../images/err.png") no-repeat scroll 0 0 transparent; padding:4px 1px 6px 30px; color:#CC0000;';
echo "<h3 style='" . $styleError . "'>" . echo "<h3 style='".$styleError."'>".__('Unreliable petition').'. '.__('Please contact the administrator').'</h3>';
__('Unreliable petition') . ". " . __('Please contact the administrator') .
"</h3>";
exit; exit;
} }
?>

View File

@ -4,115 +4,116 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
$full_extensions_dir = $config['homedir'] . "/" . EXTENSIONS_DIR . "/"; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
require_once ($full_extensions_dir . require_once $full_extensions_dir.'files_repo/functions_files_repo.php';
"files_repo/functions_files_repo.php");
$offset = (int) get_parameter('offset'); $offset = (int) get_parameter('offset');
$filter = array(); $filter = [];
$filter['limit'] = $config['block_size']; $filter['limit'] = $config['block_size'];
$filter['offset'] = $offset; $filter['offset'] = $offset;
$filter['order'] = array('field' => 'id', 'order' => 'DESC'); $filter['order'] = [
'field' => 'id',
'order' => 'DESC',
];
$files = files_repo_get_files($filter); $files = files_repo_get_files($filter);
if (!empty($files)) { if (!empty($files)) {
if (!isset($manage)) { if (!isset($manage)) {
$manage = false; $manage = false;
} }
// Pagination // Pagination
if ($manage) { if ($manage) {
$url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo"); $url = ui_get_full_url('index.php?sec=godmode/extensions&sec2=extensions/files_repo');
} } else {
else { $url = ui_get_full_url('index.php?sec=extensions&sec2=extensions/files_repo');
$url = ui_get_full_url("index.php?sec=extensions&sec2=extensions/files_repo");
} }
$total_files = files_repo_get_files(false, true); $total_files = files_repo_get_files(false, true);
ui_pagination($total_files, $url, $offset); ui_pagination($total_files, $url, $offset);
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'databox data';
$table->style = array(); $table->style = [];
$table->style[1] = "max-width: 200px;"; $table->style[1] = 'max-width: 200px;';
$table->style[2] = "text-align: center;"; $table->style[2] = 'text-align: center;';
$table->style[3] = "text-align: center;"; $table->style[3] = 'text-align: center;';
$table->style[4] = "text-align: center;"; $table->style[4] = 'text-align: center;';
$table->head = array(); $table->head = [];
$table->head[0] = __("Name"); $table->head[0] = __('Name');
$table->head[1] = __("Description"); $table->head[1] = __('Description');
$table->head[2] = __("Size"); $table->head[2] = __('Size');
$table->head[3] = __("Last modification"); $table->head[3] = __('Last modification');
$table->head[4] = ""; $table->head[4] = '';
$table->data = array(); $table->data = [];
foreach ($files as $file_id => $file) { foreach ($files as $file_id => $file) {
$data = array(); $data = [];
// Prepare the filename for the get_file.php script // Prepare the filename for the get_file.php script
$document_root = str_replace("\\", "/", io_safe_output($_SERVER['DOCUMENT_ROOT'])); $document_root = str_replace('\\', '/', io_safe_output($_SERVER['DOCUMENT_ROOT']));
$file['location'] = str_replace("\\", "/", io_safe_output($file['location'])); $file['location'] = str_replace('\\', '/', io_safe_output($file['location']));
$relative_path = str_replace($document_root, '', $file['location']); $relative_path = str_replace($document_root, '', $file['location']);
$file_path = base64_encode($relative_path); $file_path = base64_encode($relative_path);
$hash = md5($relative_path.$config['dbpass']); $hash = md5($relative_path.$config['dbpass']);
$url = ui_get_full_url("include/get_file.php?file=$file_path&hash=$hash"); $url = ui_get_full_url("include/get_file.php?file=$file_path&hash=$hash");
$date_format = ($config['date_format']) ? io_safe_output($config['date_format']) : 'F j, Y - H:m'; $date_format = ($config['date_format']) ? io_safe_output($config['date_format']) : 'F j, Y - H:m';
$data[0] = "<a href=\"$url\" target=\"_blank\">" . $file['name'] . "</a>"; // Name $data[0] = "<a href=\"$url\" target=\"_blank\">".$file['name'].'</a>';
$data[1] = ui_print_truncate_text($file['description'], 'description', true, true); // Description // Name
$data[2] = ui_format_filesize($file['size']); // Size $data[1] = ui_print_truncate_text($file['description'], 'description', true, true);
$data[3] = date($date_format, $file['mtime']); // Last modification // Description
$data[2] = ui_format_filesize($file['size']);
// Size
$data[3] = date($date_format, $file['mtime']);
// Last modification
// Public URL // Public URL
$data[4] = ""; $data[4] = '';
if (!empty($file['hash'])) { if (!empty($file['hash'])) {
$public_url = ui_get_full_url(EXTENSIONS_DIR . "/files_repo/files_repo_get_file.php?file=" . $file['hash']); $public_url = ui_get_full_url(EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']);
$message = __('Copy to clipboard') . ": Ctrl+C -> Enter"; $message = __('Copy to clipboard').': Ctrl+C -> Enter';
$action = "window.prompt('$message', '$public_url');"; $action = "window.prompt('$message', '$public_url');";
$data[4] .= "<a href=\"javascript:;\" onclick=\"$action\">"; $data[4] .= "<a href=\"javascript:;\" onclick=\"$action\">";
$data[4] .= html_print_image('images/world.png', true, array('title' => __('Public link'))); // Public link image $data[4] .= html_print_image('images/world.png', true, ['title' => __('Public link')]);
$data[4] .= "</a> "; // Public link image
$data[4] .= '</a> ';
} }
$data[4] .= "<a href=\"$url\" target=\"_blank\">"; $data[4] .= "<a href=\"$url\" target=\"_blank\">";
$data[4] .= html_print_image('images/download.png', true, array('title' => __('Download'))); // Download image $data[4] .= html_print_image('images/download.png', true, ['title' => __('Download')]);
$data[4] .= "</a>"; // Download image
$data[4] .= '</a>';
if ($manage) { if ($manage) {
$config_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&file_id=$file_id"); $config_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&file_id=$file_id");
$data[4] .= " <a href=\"$config_url\">"; $data[4] .= " <a href=\"$config_url\">";
$data[4] .= html_print_image('images/config.png', true, array('title' => __('Edit'))); // Edit image $data[4] .= html_print_image('images/config.png', true, ['title' => __('Edit')]);
$data[4] .= "</a>"; // Edit image
$data[4] .= '</a>';
$delete_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&delete=1&file_id=$file_id"); $delete_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&delete=1&file_id=$file_id");
$data[4] .= " <a href=\"$delete_url\" onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\">"; $data[4] .= " <a href=\"$delete_url\" onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\">";
$data[4] .= html_print_image('images/cross.png', true, array('title' => __('Delete'))); // Delete image $data[4] .= html_print_image('images/cross.png', true, ['title' => __('Delete')]);
$data[4] .= "</a>"; // Delete image
$data[4] .= '</a>';
} }
$table->data[] = $data; $table->data[] = $data;
} }
html_print_table($table);
} html_print_table($table);
else { } else {
ui_print_info_message(__('No items')); ui_print_info_message(__('No items'));
} }
?>

View File

@ -4,31 +4,34 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function files_repo_check_directory($print_messages=false)
{
function files_repo_check_directory ($print_messages = false) {
global $config; global $config;
$attachment_path = io_safe_output($config['attachment_store']); $attachment_path = io_safe_output($config['attachment_store']);
$files_repo_path = $attachment_path."/files_repo"; $files_repo_path = $attachment_path.'/files_repo';
$result = false; $result = false;
$messages = ""; $messages = '';
// attachment/ check // attachment/ check
if (!is_writable($attachment_path)) { if (!is_writable($attachment_path)) {
$messages .= ui_print_error_message(array('message' => __('Attachment directory is not writable by HTTP Server') $messages .= ui_print_error_message(
.'</h3>'.'<p>'.sprinf(__('Please check that the web server has write rights on the %s directory'), $attachment_path), [
'no_close' => true, 'force_style' => 'color: #000000 !important'), '', true); 'message' => __('Attachment directory is not writable by HTTP Server').'</h3>'.'<p>'.sprinf(__('Please check that the web server has write rights on the %s directory'), $attachment_path),
'no_close' => true,
'force_style' => 'color: #000000 !important',
],
'',
true
);
} else { } else {
// attachment/agent_packages/ check // attachment/agent_packages/ check
if (!file_exists($files_repo_path) || !is_writable($files_repo_path)) { if (!file_exists($files_repo_path) || !is_writable($files_repo_path)) {
@ -36,10 +39,17 @@ function files_repo_check_directory ($print_messages = false) {
if (!file_exists($files_repo_path)) { if (!file_exists($files_repo_path)) {
mkdir($files_repo_path); mkdir($files_repo_path);
} }
if (!is_writable($files_repo_path)) { if (!is_writable($files_repo_path)) {
$messages .= ui_print_error_message(array('message' => __('Attachment directory is not writable by HTTP Server') $messages .= ui_print_error_message(
.'</h3>'.'<p>'.sprintf(__('Please check that the web server has write rights on the %s directory'), $attachment_path), [
'no_close' => true, 'force_style' => 'color: #000000 !important'), '', true); 'message' => __('Attachment directory is not writable by HTTP Server').'</h3>'.'<p>'.sprintf(__('Please check that the web server has write rights on the %s directory'), $attachment_path),
'no_close' => true,
'force_style' => 'color: #000000 !important',
],
'',
true
);
} else { } else {
$result = true; $result = true;
} }
@ -51,23 +61,28 @@ function files_repo_check_directory ($print_messages = false) {
if ($print_messages) { if ($print_messages) {
echo $messages; echo $messages;
} }
return $result; return $result;
} }
function files_repo_check_file_acl ($file_id, $user_id = false, $file_groups = false, $user_groups = false) {
function files_repo_check_file_acl($file_id, $user_id=false, $file_groups=false, $user_groups=false)
{
global $config; global $config;
$result = false; $result = false;
if (!$user_id) { if (!$user_id) {
$user_id = $config['id_user']; $user_id = $config['id_user'];
} }
if (is_user_admin($user_id)) { if (is_user_admin($user_id)) {
return true; return true;
} }
if (!$file_groups) { if (!$file_groups) {
$file_groups = files_repo_get_file_groups($file_id); $file_groups = files_repo_get_file_groups($file_id);
if (empty($file_groups)) { if (empty($file_groups)) {
$file_groups = array(); $file_groups = [];
} }
} }
@ -78,7 +93,7 @@ function files_repo_check_file_acl ($file_id, $user_id = false, $file_groups = f
if (!$user_groups) { if (!$user_groups) {
$user_groups = users_get_groups($user_id, false, true); $user_groups = users_get_groups($user_id, false, true);
if (empty($user_groups)) { if (empty($user_groups)) {
$user_groups = array(); $user_groups = [];
} }
} }
@ -93,11 +108,12 @@ function files_repo_check_file_acl ($file_id, $user_id = false, $file_groups = f
return $result; return $result;
} }
function files_repo_get_file_groups ($file_id) {
$groups = array(); function files_repo_get_file_groups($file_id)
$filter = array('id_file' => $file_id); {
$result = db_get_all_rows_filter("tfiles_repo_group", $filter, "id_group"); $groups = [];
$filter = ['id_file' => $file_id];
$result = db_get_all_rows_filter('tfiles_repo_group', $filter, 'id_group');
if (!empty($result)) { if (!empty($result)) {
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
@ -108,11 +124,12 @@ function files_repo_get_file_groups ($file_id) {
return $groups; return $groups;
} }
function files_repo_get_user_groups ($user_id) {
$groups = array(); function files_repo_get_user_groups($user_id)
$filter = array('id_usuario' => $user_id); {
$result = db_get_all_rows_filter("tusuario_perfil", $filter, "id_grupo"); $groups = [];
$filter = ['id_usuario' => $user_id];
$result = db_get_all_rows_filter('tusuario_perfil', $filter, 'id_grupo');
if (!empty($result)) { if (!empty($result)) {
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
@ -123,35 +140,37 @@ function files_repo_get_user_groups ($user_id) {
return $groups; return $groups;
} }
function files_repo_get_files ($filter = false, $count = false) {
function files_repo_get_files($filter=false, $count=false)
{
global $config; global $config;
// Don't use the realpath for the download links! // Don't use the realpath for the download links!
$files_repo_path = io_safe_output($config['attachment_store'])."/files_repo"; $files_repo_path = io_safe_output($config['attachment_store']).'/files_repo';
$sql = "SELECT * $sql = 'SELECT *
FROM tfiles_repo FROM tfiles_repo
" . db_format_array_where_clause_sql($filter, "AND", "WHERE"); '.db_format_array_where_clause_sql($filter, 'AND', 'WHERE');
$files = db_get_all_rows_sql($sql); $files = db_get_all_rows_sql($sql);
if ($files === false) if ($files === false) {
$files = array(); $files = [];
}
$user_groups = files_repo_get_user_groups($config['id_user']); $user_groups = files_repo_get_user_groups($config['id_user']);
$files_data = array(); $files_data = [];
foreach ($files as $file) { foreach ($files as $file) {
$file_groups = files_repo_get_file_groups($file['id']); $file_groups = files_repo_get_file_groups($file['id']);
$permission = files_repo_check_file_acl($file['id'], $config['id_user'], $file_groups, $user_groups); $permission = files_repo_check_file_acl($file['id'], $config['id_user'], $file_groups, $user_groups);
if (!$permission) { if (!$permission) {
continue; continue;
} }
$data = array(); $data = [];
$data['name'] = $file['name']; $data['name'] = $file['name'];
$data['description'] = $file['description']; $data['description'] = $file['description'];
$data['location'] = $files_repo_path . "/" . $file['id']."_".$data['name']; $data['location'] = $files_repo_path.'/'.$file['id'].'_'.$data['name'];
// Size in bytes // Size in bytes
$data['size'] = filesize($data['location']); $data['size'] = filesize($data['location']);
// Last modification time in unix timestamp // Last modification time in unix timestamp
@ -168,15 +187,17 @@ function files_repo_get_files ($filter = false, $count = false) {
return $files_data; return $files_data;
} }
function files_repo_add_file ($file_input_name = "upfile", $description = "", $groups = array(), $public = false) {
function files_repo_add_file($file_input_name='upfile', $description='', $groups=[], $public=false)
{
global $config; global $config;
$attachment_path = io_safe_output($config['attachment_store']); $attachment_path = io_safe_output($config['attachment_store']);
$files_repo_path = $attachment_path."/"."files_repo"; $files_repo_path = $attachment_path.'/'.'files_repo';
$result = array(); $result = [];
$result["status"] = false; $result['status'] = false;
$result["message"] = ""; $result['message'] = '';
$upload_status = get_file_upload_status($file_input_name); $upload_status = get_file_upload_status($file_input_name);
$upload_result = translate_file_upload_status($upload_status); $upload_result = translate_file_upload_status($upload_status);
@ -184,120 +205,120 @@ function files_repo_add_file ($file_input_name = "upfile", $description = "", $g
if ($upload_result === true) { if ($upload_result === true) {
$filename = $_FILES[$file_input_name]['name']; $filename = $_FILES[$file_input_name]['name'];
// Replace conflictive characters // Replace conflictive characters
$filename = str_replace (array(" ", "=", "?", "&"), "_", $filename); $filename = str_replace([' ', '=', '?', '&'], '_', $filename);
$filename = filter_var($filename, FILTER_SANITIZE_URL); $filename = filter_var($filename, FILTER_SANITIZE_URL);
// The filename should not be larger than 200 characters // The filename should not be larger than 200 characters
if (mb_strlen($filename, "UTF-8") > 200) { if (mb_strlen($filename, 'UTF-8') > 200) {
$filename = mb_substr($filename, 0, 200, "UTF-8"); $filename = mb_substr($filename, 0, 200, 'UTF-8');
} }
$hash = ""; $hash = '';
if ($public) { if ($public) {
$hash = md5(time().$config['dbpass']); $hash = md5(time().$config['dbpass']);
$hash = mb_substr($hash, 0, 8, "UTF-8"); $hash = mb_substr($hash, 0, 8, 'UTF-8');
} }
$values = array( $values = [
'name' => $filename, 'name' => $filename,
'description' => $description, 'description' => $description,
'hash' => $hash 'hash' => $hash,
); ];
$file_id = db_process_sql_insert('tfiles_repo', $values); $file_id = db_process_sql_insert('tfiles_repo', $values);
if ($file_id) { if ($file_id) {
$file_tmp = $_FILES[$file_input_name]['tmp_name']; $file_tmp = $_FILES[$file_input_name]['tmp_name'];
$destination = $files_repo_path."/".$file_id."_".$filename; $destination = $files_repo_path.'/'.$file_id.'_'.$filename;
if (move_uploaded_file($file_tmp, $destination)) { if (move_uploaded_file($file_tmp, $destination)) {
if (is_array($groups) && !empty($groups)) { if (is_array($groups) && !empty($groups)) {
db_process_sql_delete('tfiles_repo_group', array('id_file' => $file_id)); db_process_sql_delete('tfiles_repo_group', ['id_file' => $file_id]);
foreach ($groups as $group) { foreach ($groups as $group) {
$values = array( $values = [
'id_file' => $file_id, 'id_file' => $file_id,
'id_group' => $group 'id_group' => $group,
); ];
db_process_sql_insert('tfiles_repo_group', $values); db_process_sql_insert('tfiles_repo_group', $values);
} }
} }
$result["status"] = true; $result['status'] = true;
} else { } else {
db_process_sql_delete('tfiles_repo', array('id' => $file_id)); db_process_sql_delete('tfiles_repo', ['id' => $file_id]);
unlink($file_tmp); unlink($file_tmp);
$result["message"] = __('The file could not be copied'); $result['message'] = __('The file could not be copied');
}
} else {
$result["message"] = __('There was an error creating the file');
} }
} else { } else {
$result["message"] = $upload_result; $result['message'] = __('There was an error creating the file');
}
} else {
$result['message'] = $upload_result;
} }
return $result; return $result;
} }
function files_repo_update_file ($file_id, $description = "", $groups = array(), $public = false) {
function files_repo_update_file($file_id, $description='', $groups=[], $public=false)
{
global $config; global $config;
$result = array(); $result = [];
$result["status"] = false; $result['status'] = false;
$result["message"] = ""; $result['message'] = '';
$hash = ""; $hash = '';
if ($public) { if ($public) {
$hash = md5(time().$config['dbpass']); $hash = md5(time().$config['dbpass']);
$hash = mb_substr($hash, 0, 8, "UTF-8"); $hash = mb_substr($hash, 0, 8, 'UTF-8');
} }
$values = array( $values = [
'description' => $description, 'description' => $description,
'hash' => $hash 'hash' => $hash,
); ];
$filter = array('id' => $file_id); $filter = ['id' => $file_id];
$res = db_process_sql_update('tfiles_repo', $values, $filter); $res = db_process_sql_update('tfiles_repo', $values, $filter);
if ($res !== false) { if ($res !== false) {
if (is_array($groups) && !empty($groups)) { if (is_array($groups) && !empty($groups)) {
db_process_sql_delete('tfiles_repo_group', array('id_file' => $file_id)); db_process_sql_delete('tfiles_repo_group', ['id_file' => $file_id]);
foreach ($groups as $group) { foreach ($groups as $group) {
$values = array( $values = [
'id_file' => $file_id, 'id_file' => $file_id,
'id_group' => $group 'id_group' => $group,
); ];
db_process_sql_insert('tfiles_repo_group', $values); db_process_sql_insert('tfiles_repo_group', $values);
} }
} }
$result["status"] = true;
$result['status'] = true;
} else { } else {
$result["message"] = __('There was an error updating the file'); $result['message'] = __('There was an error updating the file');
} }
return $result; return $result;
} }
function files_repo_delete_file ($file_id) {
function files_repo_delete_file($file_id)
{
global $config; global $config;
$result = -1; $result = -1;
$filename = db_get_value("name", "tfiles_repo", "id", $file_id); $filename = db_get_value('name', 'tfiles_repo', 'id', $file_id);
if ($filename) { if ($filename) {
$attachment_path = io_safe_output($config['attachment_store']); $attachment_path = io_safe_output($config['attachment_store']);
$files_repo_path = $attachment_path."/files_repo"; $files_repo_path = $attachment_path.'/files_repo';
$location = $files_repo_path."/".$file_id."_".$filename; $location = $files_repo_path.'/'.$file_id.'_'.$filename;
if (file_exists($location)) { if (file_exists($location)) {
$result = false; $result = false;
if (unlink($location)) { if (unlink($location)) {
$result = (bool) db_process_sql_delete('tfiles_repo', array('id' => $file_id)); $result = (bool) db_process_sql_delete('tfiles_repo', ['id' => $file_id]);
} }
} }
} }
return $result; return $result;
} }
?>

View File

@ -4,28 +4,26 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
include_once($config['homedir'] . "/include/functions_agents.php"); require_once $config['homedir'].'/include/functions_agents.php';
include_once($config['homedir'] . "/include/functions_modules.php"); require_once $config['homedir'].'/include/functions_modules.php';
include_once($config['homedir'] . "/include/functions.php"); require_once $config['homedir'].'/include/functions.php';
function createXMLData($agent, $agentModule, $time, $data) {
function createXMLData($agent, $agentModule, $time, $data)
{
global $config; global $config;
$xmlTemplate = "<?xml version='1.0' encoding='UTF-8'?> $xmlTemplate = "<?xml version='1.0' encoding='UTF-8'?>
<agent_data description='' group='' os_name='%s' " . <agent_data description='' group='' os_name='%s' "." os_version='%s' interval='%d' version='%s' timestamp='%s' agent_name='%s' timezone_offset='0'>
" os_version='%s' interval='%d' version='%s' timestamp='%s' agent_name='%s' timezone_offset='0'>
<module> <module>
<name><![CDATA[%s]]></name> <name><![CDATA[%s]]></name>
<description><![CDATA[%s]]></description> <description><![CDATA[%s]]></description>
@ -48,49 +46,47 @@ function createXMLData($agent, $agentModule, $time, $data) {
$data $data
); );
$file_name = $config["remote_config"] . "/" . io_safe_output($agent["alias"]) . "." . strtotime($time) . ".data"; $file_name = $config['remote_config'].'/'.io_safe_output($agent['alias']).'.'.strtotime($time).'.data';
return (bool) @file_put_contents($file_name, $xml); return (bool) @file_put_contents($file_name, $xml);
} }
function mainInsertData() {
function mainInsertData()
{
global $config; global $config;
ui_print_page_header (__("Insert data"), "images/extensions.png", false, "", true, ""); ui_print_page_header(__('Insert data'), 'images/extensions.png', false, '', true, '');
if (! check_acl ($config['id_user'], 0, "AW") && ! is_user_admin ($config['id_user'])) { if (! check_acl($config['id_user'], 0, 'AW') && ! is_user_admin($config['id_user'])) {
db_pandora_audit("ACL Violation", "Trying to access Setup Management"); db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
require ("general/noaccess.php"); include 'general/noaccess.php';
return; return;
} }
$save = (bool) get_parameter("save"); $save = (bool) get_parameter('save');
$agent_id = (int) get_parameter("agent_id"); $agent_id = (int) get_parameter('agent_id');
$agent_name = (string) get_parameter("agent_name"); $agent_name = (string) get_parameter('agent_name');
$id_agent_module = (int) get_parameter("id_agent_module"); $id_agent_module = (int) get_parameter('id_agent_module');
$data = (string) get_parameter('data'); $data = (string) get_parameter('data');
$date = (string) get_parameter('date', date(DATE_FORMAT)); $date = (string) get_parameter('date', date(DATE_FORMAT));
$time = (string) get_parameter('time', date(TIME_FORMAT)); $time = (string) get_parameter('time', date(TIME_FORMAT));
if (isset($_FILES['csv'])) { if (isset($_FILES['csv'])) {
if ($_FILES['csv']['error'] != 4) { if ($_FILES['csv']['error'] != 4) {
$csv = $_FILES['csv']; $csv = $_FILES['csv'];
} } else {
else {
$csv = false; $csv = false;
} }
} } else {
else {
$csv = false; $csv = false;
} }
if ($save) { if ($save) {
if (!check_acl($config['id_user'], agents_get_agent_group($agent_id), "AW")) { if (!check_acl($config['id_user'], agents_get_agent_group($agent_id), 'AW')) {
ui_print_error_message(__('You haven\'t privileges for insert data in the agent.')); ui_print_error_message(__('You haven\'t privileges for insert data in the agent.'));
} } else {
else { $agent = db_get_row_filter('tagente', ['id_agente' => $agent_id]);
$agent = db_get_row_filter('tagente', array('id_agente' => $agent_id)); $agentModule = db_get_row_filter('tagente_modulo', ['id_agente_modulo' => $id_agent_module]);
$agentModule = db_get_row_filter('tagente_modulo', array('id_agente_modulo' => $id_agent_module));
$done = 0; $done = 0;
$errors = 0; $errors = 0;
@ -99,27 +95,24 @@ function mainInsertData() {
foreach ($file as $line) { foreach ($file as $line) {
$tokens = explode(';', $line); $tokens = explode(';', $line);
$utimestamp = strtotime(trim($tokens[0])) - get_fixed_offset(); $utimestamp = (strtotime(trim($tokens[0])) - get_fixed_offset());
$timestamp = date(DATE_FORMAT . " " . TIME_FORMAT, $utimestamp); $timestamp = date(DATE_FORMAT.' '.TIME_FORMAT, $utimestamp);
$result = createXMLData($agent, $agentModule, $timestamp, trim($tokens[1])); $result = createXMLData($agent, $agentModule, $timestamp, trim($tokens[1]));
if ($result) { if ($result) {
$done++; $done++;
} } else {
else {
$errors++; $errors++;
} }
} }
} } else {
else { $utimestamp = (strtotime($date.' '.$time) - get_fixed_offset());
$utimestamp = strtotime($date . " " . $time) - get_fixed_offset(); $timestamp = date(DATE_FORMAT.' '.TIME_FORMAT, $utimestamp);
$timestamp = date(DATE_FORMAT . " " . TIME_FORMAT, $utimestamp);
$result = createXMLData($agent, $agentModule, $timestamp, $data); $result = createXMLData($agent, $agentModule, $timestamp, $data);
if ($result) { if ($result) {
$done++; $done++;
} } else {
else {
$errors++; $errors++;
} }
} }
@ -130,32 +123,37 @@ function mainInsertData() {
if ($errors > 1) { if ($errors > 1) {
$msg .= " ($errors)"; $msg .= " ($errors)";
} }
ui_print_error_message($msg); ui_print_error_message($msg);
} }
if ($done > 0) { if ($done > 0) {
$msg = sprintf(__('Save agent (%s), module (%s) data xml.'), $agent['alias'], $agentModule['nombre']); $msg = sprintf(__('Save agent (%s), module (%s) data xml.'), $agent['alias'], $agentModule['nombre']);
if ($done > 1) { if ($done > 1) {
$msg .= " ($done)"; $msg .= " ($done)";
} }
ui_print_success_message($msg); ui_print_success_message($msg);
} }
} }
echo '<div class="notify" style="margin-bottom:15px;">'; echo '<div class="notify" style="margin-bottom:15px;">';
echo sprintf(__("Please check that the directory \"%s\" is writeable by the apache user. <br /><br />The CSV file format is date;value&lt;newline&gt;date;value&lt;newline&gt;... The date in CSV is in format Y/m/d H:i:s."), echo sprintf(
$config['remote_config']); __('Please check that the directory "%s" is writeable by the apache user. <br /><br />The CSV file format is date;value&lt;newline&gt;date;value&lt;newline&gt;... The date in CSV is in format Y/m/d H:i:s.'),
$config['remote_config']
);
echo '</div>'; echo '</div>';
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->style = array(); $table->style = [];
$table->style[0] = 'font-weight: bolder;'; $table->style[0] = 'font-weight: bolder;';
$table->data = array(); $table->data = [];
$table->data[0][0] = __('Agent'); $table->data[0][0] = __('Agent');
$params = array(); $params = [];
$params['return'] = true; $params['return'] = true;
$params['show_helptip'] = true; $params['show_helptip'] = true;
$params['input_name'] = 'agent_name'; $params['input_name'] = 'agent_name';
@ -172,12 +170,24 @@ function mainInsertData() {
$table->data[0][1] = ui_print_agent_autocomplete_input($params); $table->data[0][1] = ui_print_agent_autocomplete_input($params);
$table->data[1][0] = __('Module'); $table->data[1][0] = __('Module');
$modules = array (); $modules = [];
if ($agent_id) { if ($agent_id) {
$modules = agents_get_modules ($agent_id, false, array("delete_pending" => 0)); $modules = agents_get_modules($agent_id, false, ['delete_pending' => 0]);
} }
$table->data[1][1] = html_print_select ($modules, 'id_agent_module', $id_agent_module, true,
__('Select'), 0, true, false, true, '', empty($agent_id)); $table->data[1][1] = html_print_select(
$modules,
'id_agent_module',
$id_agent_module,
true,
__('Select'),
0,
true,
false,
true,
'',
empty($agent_id)
);
$table->data[2][0] = __('Data'); $table->data[2][0] = __('Data');
$table->data[2][1] = html_print_input_text('data', $data, __('Data'), 40, 60, true); $table->data[2][1] = html_print_input_text('data', $data, __('Data'), 40, 60, true);
$table->data[3][0] = __('Date'); $table->data[3][0] = __('Date');
@ -193,13 +203,13 @@ function mainInsertData() {
echo "<div style='text-align: right; width: ".$table->width."'>"; echo "<div style='text-align: right; width: ".$table->width."'>";
html_print_input_hidden('save', 1); html_print_input_hidden('save', 1);
html_print_submit_button(__('Save'), 'submit', ($id_agent === ''), 'class="sub next"'); html_print_submit_button(__('Save'), 'submit', ($id_agent === ''), 'class="sub next"');
echo "</div>"; echo '</div>';
echo "</form>"; echo '</form>';
ui_require_css_file('datepicker'); ui_require_css_file('datepicker');
ui_include_time_picker(); ui_include_time_picker();
ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/"); ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
@ -255,6 +265,7 @@ function mainInsertData() {
<?php <?php
} }
extensions_add_godmode_function('mainInsertData'); extensions_add_godmode_function('mainInsertData');
extensions_add_godmode_menu_option(__('Insert Data'), 'AW', 'gagente', null, "v1r1"); extensions_add_godmode_menu_option(__('Insert Data'), 'AW', 'gagente', null, 'v1r1');
?>

View File

@ -4,52 +4,50 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
if (is_ajax()) { if (is_ajax()) {
if (! check_acl($config['id_user'], 0, 'ER')) {
if (! check_acl ($config["id_user"], 0, "ER")) { db_pandora_audit('ACL Violation', 'Trying to access event viewer');
db_pandora_audit("ACL Violation", "Trying to access event viewer");
return; return;
} }
$get_last_events = (bool) get_parameter("get_last_events"); $get_last_events = (bool) get_parameter('get_last_events');
if ($get_last_events) { if ($get_last_events) {
include_once 'include/functions_io.php';
include_once 'include/functions_tags.php';
require_once ('include/functions_io.php'); $limit = (int) get_parameter('limit', 5);
require_once ('include/functions_tags.php');
$limit = (int) get_parameter("limit", 5);
$tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND'); $tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND');
$filter = "estado <> 1 $tags_condition"; $filter = "estado <> 1 $tags_condition";
$sql = sprintf ("SELECT id_agente, evento, utimestamp $sql = sprintf(
'SELECT id_agente, evento, utimestamp
FROM tevento FROM tevento
LEFT JOIN tagent_secondary_group LEFT JOIN tagent_secondary_group
ON tevento.id_agente = tagent_secondary_group.id_agent ON tevento.id_agente = tagent_secondary_group.id_agent
WHERE %s WHERE %s
ORDER BY utimestamp DESC LIMIT %d", ORDER BY utimestamp DESC LIMIT %d',
$filter, $limit); $filter,
$limit
);
$result = db_get_all_rows_sql($sql); $result = db_get_all_rows_sql($sql);
$events = array(); $events = [];
if (! empty($result)) { if (! empty($result)) {
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$event = array(); $event = [];
$event['agent'] = (empty($value['id_agente'])) ? "System" : agents_get_name($value['id_agente']); $event['agent'] = (empty($value['id_agente'])) ? 'System' : agents_get_name($value['id_agente']);
$event['text'] = io_safe_output($value['evento']); $event['text'] = io_safe_output($value['evento']);
$event['date'] = date(io_safe_output($config['date_format']), $value['utimestamp']); $event['date'] = date(io_safe_output($config['date_format']), $value['utimestamp']);
$events[] = $event; $events[] = $event;
@ -64,5 +62,3 @@ if (is_ajax()) {
return; return;
} }
?>

View File

@ -4,17 +4,14 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
global $config; global $config;
check_login(); check_login();
@ -24,30 +21,33 @@ if (is_ajax ()) {
if ($get_info_alert_module_group) { if ($get_info_alert_module_group) {
$send_tooltip = json_decode(io_safe_output(get_parameter('send_tooltip')), true); $send_tooltip = json_decode(io_safe_output(get_parameter('send_tooltip')), true);
echo "<ul class='tooltip_counters'><h3>" . __('Counters Module') . "</h3>"; echo "<ul class='tooltip_counters'><h3>".__('Counters Module').'</h3>';
echo "<li><div style='background-color: " . COL_ALERTFIRED . ";'></div>" . __('Alerts_Fired') . ": " . $send_tooltip['alerts_module_count'] . "</li>"; echo "<li><div style='background-color: ".COL_ALERTFIRED.";'></div>".__('Alerts_Fired').': '.$send_tooltip['alerts_module_count'].'</li>';
echo "<li><div style='background-color: " . COL_CRITICAL . ";'></div>" . __('Critical') . ": " . $send_tooltip['critical_module_count'] . "</li>"; echo "<li><div style='background-color: ".COL_CRITICAL.";'></div>".__('Critical').': '.$send_tooltip['critical_module_count'].'</li>';
echo "<li><div style='background-color: " . COL_WARNING . ";'></div>" . __('warning') . ": " . $send_tooltip['warning_module_count'] . "</li>"; echo "<li><div style='background-color: ".COL_WARNING.";'></div>".__('warning').': '.$send_tooltip['warning_module_count'].'</li>';
echo "<li><div style='background-color: " . COL_UNKNOWN . ";'></div>" . __('Unknown') . ": " . $send_tooltip['unknown_module_count'] . "</li>"; echo "<li><div style='background-color: ".COL_UNKNOWN.";'></div>".__('Unknown').': '.$send_tooltip['unknown_module_count'].'</li>';
echo "<li><div style='background-color: " . COL_NORMAL . ";'></div>" . __('OK') . ": " . $send_tooltip['normal_module_count'] . "</li>"; echo "<li><div style='background-color: ".COL_NORMAL.";'></div>".__('OK').': '.$send_tooltip['normal_module_count'].'</li>';
echo "<li><div style='background-color: " . COL_MAINTENANCE . ";'></div>" . __('Not_init') . ": " . $send_tooltip['notInit_module_count'] . "</li></ul>"; echo "<li><div style='background-color: ".COL_MAINTENANCE.";'></div>".__('Not_init').': '.$send_tooltip['notInit_module_count'].'</li></ul>';
} }
} }
/** /**
* The main function of module groups and the enter point to * The main function of module groups and the enter point to
* execute the code. * execute the code.
*/ */
function mainModuleGroups() { function mainModuleGroups()
{
global $config; global $config;
require_once($config['homedir'] . "/include/class/TreeGroup.class.php"); include_once $config['homedir'].'/include/class/TreeGroup.class.php';
require_once($config['homedir'] . "/include/functions_groupview.php"); include_once $config['homedir'].'/include/functions_groupview.php';
$tree_group = new TreeGroup("group", "group"); $tree_group = new TreeGroup('group', 'group');
$tree_group->setPropagateCounters(false); $tree_group->setPropagateCounters(false);
$tree_group->setDisplayAllGroups(true); $tree_group->setDisplayAllGroups(true);
$tree_group->setFilter( array( $tree_group->setFilter(
[
'searchAgent' => '', 'searchAgent' => '',
'statusAgent' => AGENT_STATUS_ALL, 'statusAgent' => AGENT_STATUS_ALL,
'searchModule' => '', 'searchModule' => '',
@ -55,8 +55,9 @@ function mainModuleGroups() {
'groupID' => 0, 'groupID' => 0,
'tagID' => 0, 'tagID' => 0,
'show_not_init_agents' => 1, 'show_not_init_agents' => 1,
'show_not_init_modules' => 1 'show_not_init_modules' => 1,
)); ]
);
$info = $tree_group->getArray(); $info = $tree_group->getArray();
$info = groupview_plain_groups($info); $info = groupview_plain_groups($info);
$counter = count($info); $counter = count($info);
@ -64,24 +65,31 @@ function mainModuleGroups() {
$agent_group_search = get_parameter('agent_group_search', ''); $agent_group_search = get_parameter('agent_group_search', '');
$module_group_search = get_parameter('module_group_search', ''); $module_group_search = get_parameter('module_group_search', '');
$info = array_filter($info, function($v, $k) use ($agent_group_search) { $info = array_filter(
$info,
function ($v, $k) use ($agent_group_search) {
return preg_match("/$agent_group_search/i", $v['name']); return preg_match("/$agent_group_search/i", $v['name']);
}, ARRAY_FILTER_USE_BOTH); },
ARRAY_FILTER_USE_BOTH
);
if (!empty($info)) { if (!empty($info)) {
$groups_view = $is_not_paginated $groups_view = $is_not_paginated ? $info : array_slice($info, $offset, $config['block_size']);
? $info $agents_counters = array_reduce(
: array_slice($info, $offset, $config['block_size']); $groups_view,
$agents_counters = array_reduce($groups_view, function($carry, $item){ function ($carry, $item) {
$carry[$item['id']] = $item; $carry[$item['id']] = $item;
return $carry; return $carry;
}, array()); },
[]
);
$ids_array = array_keys($agents_counters); $ids_array = array_keys($agents_counters);
$ids_group = implode(',', $ids_array); $ids_group = implode(',', $ids_array);
} else } else {
$ids_group = -1; $ids_group = -1;
}
$condition_critical = modules_get_state_condition(AGENT_MODULE_STATUS_CRITICAL_ALERT); $condition_critical = modules_get_state_condition(AGENT_MODULE_STATUS_CRITICAL_ALERT);
$condition_warning = modules_get_state_condition(AGENT_MODULE_STATUS_WARNING_ALERT); $condition_warning = modules_get_state_condition(AGENT_MODULE_STATUS_WARNING_ALERT);
@ -89,22 +97,26 @@ function mainModuleGroups() {
$condition_not_init = modules_get_state_condition(AGENT_MODULE_STATUS_NO_DATA); $condition_not_init = modules_get_state_condition(AGENT_MODULE_STATUS_NO_DATA);
$condition_normal = modules_get_state_condition(AGENT_MODULE_STATUS_NORMAL); $condition_normal = modules_get_state_condition(AGENT_MODULE_STATUS_NORMAL);
$array_for_defect = array(); $array_for_defect = [];
$array_module_group = array(); $array_module_group = [];
$array_data = array(); $array_data = [];
$sql = "SELECT id_mg, `name` FROM tmodule_group"; $sql = 'SELECT id_mg, `name` FROM tmodule_group';
$array_mod = db_get_all_rows_sql($sql); $array_mod = db_get_all_rows_sql($sql);
foreach ($array_mod as $key => $value) { foreach ($array_mod as $key => $value) {
$array_module_group[$value['id_mg']] = $value['name']; $array_module_group[$value['id_mg']] = $value['name'];
} }
$array_module_group[0] = 'Nothing'; $array_module_group[0] = 'Nothing';
$array_module_group = array_filter(
$array_module_group = array_filter($array_module_group, function($v, $k) use ($module_group_search) { $array_module_group,
function ($v, $k) use ($module_group_search) {
return preg_match("/$module_group_search/i", $v); return preg_match("/$module_group_search/i", $v);
}, ARRAY_FILTER_USE_BOTH); },
ARRAY_FILTER_USE_BOTH
);
foreach ($agents_counters as $key => $value) { foreach ($agents_counters as $key => $value) {
$array_for_defect[$key]['gm'] = $array_module_group; $array_for_defect[$key]['gm'] = $array_module_group;
@ -113,8 +125,7 @@ function mainModuleGroups() {
$array_for_defect[$key]['data']['icon'] = $value['icon']; $array_for_defect[$key]['data']['icon'] = $value['icon'];
} }
$sql = $sql = "SELECT SUM(IF(tae.alert_fired <> 0, 1, 0)) AS alerts_module_count,
"SELECT SUM(IF(tae.alert_fired <> 0, 1, 0)) AS alerts_module_count,
SUM(IF($condition_warning, 1, 0)) AS warning_module_count, SUM(IF($condition_warning, 1, 0)) AS warning_module_count,
SUM(IF($condition_unknown, 1, 0)) AS unknown_module_count, SUM(IF($condition_unknown, 1, 0)) AS unknown_module_count,
SUM(IF($condition_not_init, 1, 0)) AS notInit_module_count, SUM(IF($condition_not_init, 1, 0)) AS notInit_module_count,
@ -181,26 +192,26 @@ $sql =
$array_data[$value['id_grupo']][$value['id_mg']] = $value; $array_data[$value['id_grupo']][$value['id_mg']] = $value;
} }
ui_print_page_header (__("Combined table of agent group and module group"), "images/module_group.png", false, "", false, ''); ui_print_page_header(__('Combined table of agent group and module group'), 'images/module_group.png', false, '', false, '');
echo "<table cellpadding='4' cellspacing='4' class='databox filters' width='100%' style='font-weight: bold; margin-bottom: 10px;'> echo "<table cellpadding='4' cellspacing='4' class='databox filters' width='100%' style='font-weight: bold; margin-bottom: 10px;'>
<tr>"; <tr>";
echo "<form method='post' echo "<form method='post'
action='index.php?sec=view&sec2=extensions/module_groups'>"; action='index.php?sec=view&sec2=extensions/module_groups'>";
echo "<td>"; echo '<td>';
echo __('Search by agent group').'&nbsp;'; echo __('Search by agent group').'&nbsp;';
html_print_input_text ("agent_group_search", $agent_group_search); html_print_input_text('agent_group_search', $agent_group_search);
echo "</td><td>"; echo '</td><td>';
echo __('Search by module group').'&nbsp;'; echo __('Search by module group').'&nbsp;';
html_print_input_text ("module_group_search", $module_group_search); html_print_input_text('module_group_search', $module_group_search);
echo "</td><td>"; echo '</td><td>';
echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>"; echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>";
echo "</form>"; echo '</form>';
echo "<td>"; echo '<td>';
echo "</tr></table>"; echo '</tr></table>';
if (true) { if (true) {
$table = new StdClass(); $table = new StdClass();
@ -208,9 +219,9 @@ $sql =
$table->width = '100%'; $table->width = '100%';
$head[0] = __('Groups'); $head[0] = __('Groups');
$headstyle[0] = "width: 20%; font-weight: bolder;"; $headstyle[0] = 'width: 20%; font-weight: bolder;';
foreach ($array_module_group as $key => $value) { foreach ($array_module_group as $key => $value) {
$headstyle[] = "min-width: 60px;max-width: 5%;text-align:center; color: #ffffff; background-color: #373737; font-weight: bolder;"; $headstyle[] = 'min-width: 60px;max-width: 5%;text-align:center; color: #ffffff; background-color: #373737; font-weight: bolder;';
$head[] = ui_print_truncate_text($value, GENERIC_SIZE_TEXT, true, true, true, '&hellip;', 'color:#FFF'); $head[] = ui_print_truncate_text($value, GENERIC_SIZE_TEXT, true, true, true, '&hellip;', 'color:#FFF');
} }
@ -223,49 +234,50 @@ $sql =
foreach ($value['gm'] as $k => $v) { foreach ($value['gm'] as $k => $v) {
if (isset($array_data[$key][$k])) { if (isset($array_data[$key][$k])) {
$send_tooltip = json_encode($array_data[$key][$k]); $send_tooltip = json_encode($array_data[$key][$k]);
$rel = "ajax.php?page=extensions/module_groups&get_info_alert_module_group=1&send_tooltip=" . $send_tooltip; $rel = 'ajax.php?page=extensions/module_groups&get_info_alert_module_group=1&send_tooltip='.$send_tooltip;
$url = "index.php?sec=estado&sec2=operation/agentes/status_monitor&status=-1&ag_group=" . $key . "&modulegroup=" . $k; $url = 'index.php?sec=estado&sec2=operation/agentes/status_monitor&status=-1&ag_group='.$key.'&modulegroup='.$k;
if ($array_data[$key][$k]['alerts_module_count'] != 0) { if ($array_data[$key][$k]['alerts_module_count'] != 0) {
$color = '#FFA631'; //Orange when the cell for this model group and agent has at least one alert fired. $color = '#FFA631';
} // Orange when the cell for this model group and agent has at least one alert fired.
else if ($array_data[$key][$k]['critical_module_count'] != 0) { } else if ($array_data[$key][$k]['critical_module_count'] != 0) {
$color = '#FC4444'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state. $color = '#FC4444';
} // Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
elseif ($array_data[$key][$k]['warning_module_count'] != 0) { } else if ($array_data[$key][$k]['warning_module_count'] != 0) {
$color = '#FAD403'; //Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state. $color = '#FAD403';
} // Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
elseif ($array_data[$key][$k]['unknown_module_count'] != 0) { } else if ($array_data[$key][$k]['unknown_module_count'] != 0) {
$color = '#B2B2B2 '; //Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state. $color = '#B2B2B2 ';
} // Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state.
elseif ($array_data[$key][$k]['normal_module_count'] != 0) { } else if ($array_data[$key][$k]['normal_module_count'] != 0) {
$color = '#80BA27'; //Green when the cell for this model group and agent has OK state all modules. $color = '#80BA27';
} // Green when the cell for this model group and agent has OK state all modules.
elseif ($array_data[$key][$k]['notInit_module_count'] != 0) { } else if ($array_data[$key][$k]['notInit_module_count'] != 0) {
$color = '#5BB6E5'; // Blue when the cell for this module group and all modules have not init value. $color = '#5BB6E5';
// Blue when the cell for this module group and all modules have not init value.
} }
$data[$i][$j] = "<div style='background:$color; height: 20px;min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>"; $data[$i][$j] = "<div style='background:$color; height: 20px;min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] .= "<a class='info_cell' rel='$rel' href='$url' style='color:white;font-size: 18px;'>"; $data[$i][$j] .= "<a class='info_cell' rel='$rel' href='$url' style='color:white;font-size: 18px;'>";
$data[$i][$j] .= $array_data[$key][$k]['total_count']; $data[$i][$j] .= $array_data[$key][$k]['total_count'];
$data[$i][$j] .= "</a></div>"; $data[$i][$j] .= '</a></div>';
} } else {
else{
$data[$i][$j] = "<div style='background:white; height: 20px;min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>"; $data[$i][$j] = "<div style='background:white; height: 20px;min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] .= 0; $data[$i][$j] .= 0;
$data[$i][$j] .= "</div>"; $data[$i][$j] .= '</div>';
} }
$j++; $j++;
} }
} } else {
else{
foreach ($value['gm'] as $k => $v) { foreach ($value['gm'] as $k => $v) {
$data[$i][$j] = "<div style='background:white; height: 20px;min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>"; $data[$i][$j] = "<div style='background:white; height: 20px;min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] .= 0; $data[$i][$j] .= 0;
$data[$i][$j] .= "</div>"; $data[$i][$j] .= '</div>';
$j++; $j++;
} }
} }
$i++; $i++;
} }
@ -277,29 +289,27 @@ $sql =
echo "<div style='width:100%; overflow-x:auto;'>"; echo "<div style='width:100%; overflow-x:auto;'>";
html_print_table($table); html_print_table($table);
echo "</div>"; echo '</div>';
ui_pagination($counter); ui_pagination($counter);
echo "<div class='legend_basic' style='width: 98.6%'>"; echo "<div class='legend_basic' style='width: 98.6%'>";
echo "<table >"; echo '<table >';
echo "<tr><td colspan='2' style='padding-bottom: 10px;'><b>" . __('Legend') . "</b></td></tr>"; echo "<tr><td colspan='2' style='padding-bottom: 10px;'><b>".__('Legend').'</b></td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_ALERTFIRED . ";'></div></td><td>" . __("Orange cell when the module group and agent have at least one alarm fired.") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></td><td>".__('Orange cell when the module group and agent have at least one alarm fired.').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_CRITICAL . ";'></div></td><td>" . __("Red cell when the module group and agent have at least one module in critical status and the others in any status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></td><td>".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_WARNING . ";'></div></td><td>" . __("Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_UNKNOWN . ";'></div></td><td>" . __("Grey cell when the module group and agent have at least one in unknown status and the others in green status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></td><td>".__('Grey cell when the module group and agent have at least one in unknown status and the others in green status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NORMAL . ";'></div></td><td>" . __("Green cell when the module group and agent have all modules in OK status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></td><td>".__('Green cell when the module group and agent have all modules in OK status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_MAINTENANCE . ";'></div></td><td>" .__("Blue cell when the module group and agent have all modules in not init status.") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_MAINTENANCE.";'></div></td><td>".__('Blue cell when the module group and agent have all modules in not init status.').'</td></tr>';
echo "</table>"; echo '</table>';
echo "</div>"; echo '</div>';
} else {
} ui_print_info_message(['no_close' => true, 'message' => __('This table shows in columns the modules group and in rows agents group. The cell shows all modules') ]);
else { ui_print_info_message(['no_close' => true, 'message' => __('There are no defined groups or module groups') ]);
ui_print_info_message ( array('no_close'=>true, 'message'=> __("This table shows in columns the modules group and in rows agents group. The cell shows all modules") ));
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined groups or module groups') ));
} }
ui_require_css_file('cluetip'); ui_require_css_file('cluetip', 'include/styles/js/');
ui_require_jquery_file('cluetip'); ui_require_jquery_file('cluetip');
?> ?>
<script> <script>
@ -315,6 +325,6 @@ $sql =
<?php <?php
} }
extensions_add_operation_menu_option(__("Module groups"), 'estado', 'module_groups/brick.png', "v1r1","view");
extensions_add_operation_menu_option(__('Module groups'), 'estado', 'module_groups/brick.png', 'v1r1', 'view');
extensions_add_main_function('mainModuleGroups'); extensions_add_main_function('mainModuleGroups');
?>

View File

@ -4,26 +4,25 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
$id_agente = get_parameter('id_agente');
$id_agente = get_parameter ("id_agente");
// This extension is usefull only if the agent has associated IP // This extension is usefull only if the agent has associated IP
$address = agents_get_address($id_agente); $address = agents_get_address($id_agente);
if (!empty($address) || empty($id_agente)) { if (!empty($address) || empty($id_agente)) {
extensions_add_opemode_tab_agent ('network_tools','Network Tools','extensions/net_tools/nettool.png',"main_net_tools", "v1r1", 'AW'); extensions_add_opemode_tab_agent('network_tools', 'Network Tools', 'extensions/net_tools/nettool.png', 'main_net_tools', 'v1r1', 'AW');
} }
function whereis_the_command ($command) {
function whereis_the_command($command)
{
global $config; global $config;
if (isset($config['network_tools_config'])) { if (isset($config['network_tools_config'])) {
@ -36,30 +35,37 @@ function whereis_the_command ($command) {
switch ($command) { switch ($command) {
case 'traceroute': case 'traceroute':
if (!empty($traceroute_path)) if (!empty($traceroute_path)) {
return $traceroute_path; return $traceroute_path;
}
break; break;
case 'ping': case 'ping':
if (!empty($ping_path)) if (!empty($ping_path)) {
return $ping_path; return $ping_path;
}
break; break;
case 'nmap': case 'nmap':
if (!empty($nmap_path)) if (!empty($nmap_path)) {
return $nmap_path; return $nmap_path;
}
break; break;
case 'dig': case 'dig':
if (!empty($dig_path)) if (!empty($dig_path)) {
return $dig_path; return $dig_path;
}
break; break;
case 'snmpget': case 'snmpget':
if (!empty($snmpget_path)) if (!empty($snmpget_path)) {
return $snmpget_path; return $snmpget_path;
}
break; break;
} }
} }
ob_start(); ob_start();
system('whereis '.$command); system('whereis '.$command);
$output = ob_get_clean(); $output = ob_get_clean();
@ -67,35 +73,38 @@ function whereis_the_command ($command) {
$result = trim($result[1]); $result = trim($result[1]);
if (empty($result)) { if (empty($result)) {
return NULL; return null;
} }
$result = explode(' ', $result); $result = explode(' ', $result);
$fullpath = trim($result[0]); $fullpath = trim($result[0]);
if (! file_exists($fullpath)) { if (! file_exists($fullpath)) {
return NULL; return null;
} }
return $fullpath; return $fullpath;
} }
function main_net_tools () {
$id_agente = get_parameter ("id_agente"); function main_net_tools()
{
$id_agente = get_parameter('id_agente');
$principal_ip = db_get_sql("SELECT direccion FROM tagente WHERE id_agente = $id_agente"); $principal_ip = db_get_sql("SELECT direccion FROM tagente WHERE id_agente = $id_agente");
$list_address = db_get_all_rows_sql ("select id_a from taddress_agent where id_agent = " . $id_agente); $list_address = db_get_all_rows_sql('select id_a from taddress_agent where id_agent = '.$id_agente);
foreach ($list_address as $address) { foreach ($list_address as $address) {
$ids []= join(",",$address); $ids[] = join(',', $address);
} }
$ids_address = implode(",",$ids);
$ips = db_get_all_rows_sql ("select ip from taddress where id_a in (" . $ids_address . ")");
if ($ips == "") { $ids_address = implode(',', $ids);
echo "<div class='error' style='margin-top:5px'>" . __('The agent hasn\'t got IP') . "</div>"; $ips = db_get_all_rows_sql('select ip from taddress where id_a in ('.$ids_address.')');
if ($ips == '') {
echo "<div class='error' style='margin-top:5px'>".__('The agent hasn\'t got IP').'</div>';
return; return;
} }
echo " echo "
<script type='text/javascript'> <script type='text/javascript'>
function mostrarColumns(ValueSelect) { function mostrarColumns(ValueSelect) {
@ -111,136 +120,133 @@ function main_net_tools () {
} }
</script>"; </script>";
echo "<div>"; echo '<div>';
echo "<form name='actionbox' method='post'>"; echo "<form name='actionbox' method='post'>";
echo "<table class='databox filters' width=100% id=netToolTable>"; echo "<table class='databox filters' width=100% id=netToolTable>";
echo "<tr><td>"; echo '<tr><td>';
echo __("Operation"); echo __('Operation');
ui_print_help_tip( ui_print_help_tip(
__('You can set the command path in the menu Administration -&gt; Extensions -&gt; Config Network Tools')); __('You can set the command path in the menu Administration -&gt; Extensions -&gt; Config Network Tools')
echo "</td><td>"; );
echo '</td><td>';
echo "<select name='operation' onChange='mostrarColumns(this);'>"; echo "<select name='operation' onChange='mostrarColumns(this);'>";
echo "<option value='1'>" . __("Traceroute"); echo "<option value='1'>".__('Traceroute');
echo "<option value='2'>" . __("Ping host & Latency"); echo "<option value='2'>".__('Ping host & Latency');
echo "<option value='3'>" . __("SNMP Interface status"); echo "<option value='3'>".__('SNMP Interface status');
echo "<option value='4'>" . __("Basic TCP Port Scan"); echo "<option value='4'>".__('Basic TCP Port Scan');
echo "<option value='5'>" . __("DiG/Whois Lookup"); echo "<option value='5'>".__('DiG/Whois Lookup');
echo "</select>"; echo '</select>';
echo "</td>"; echo '</td>';
echo "<td>"; echo '<td>';
echo __("IP address"); echo __('IP address');
echo "</td><td>"; echo '</td><td>';
echo "<select name='select_ips'>"; echo "<select name='select_ips'>";
foreach ($ips as $ip) { foreach ($ips as $ip) {
if ($ip['ip'] == $principal_ip) { if ($ip['ip'] == $principal_ip) {
echo "<option value='".$ip['ip']."' selected = 'selected'>".$ip['ip']; echo "<option value='".$ip['ip']."' selected = 'selected'>".$ip['ip'];
} } else {
else {
echo "<option value='".$ip['ip']."'>".$ip['ip']; echo "<option value='".$ip['ip']."'>".$ip['ip'];
} }
} }
echo "</select>";
echo "</td>"; echo '</select>';
echo '</td>';
echo "<td id='snmpcolumn' style=\"display:none;\">"; echo "<td id='snmpcolumn' style=\"display:none;\">";
echo __("SNMP Community") . "&nbsp;"; echo __('SNMP Community').'&nbsp;';
echo "<input name=community type=text value='public'>"; echo "<input name=community type=text value='public'>";
echo "</td><td>"; echo '</td><td>';
echo "<input style='margin:0px;' name=submit type=submit class='sub next' value='".__('Execute')."'>"; echo "<input style='margin:0px;' name=submit type=submit class='sub next' value='".__('Execute')."'>";
echo "</td>"; echo '</td>';
echo "</tr></table>"; echo '</tr></table>';
echo "</form>"; echo '</form>';
$operation = get_parameter('operation', 0);
$operation = get_parameter ("operation", 0); $community = get_parameter('community', 'public');
$community = get_parameter ("community", "public"); $ip = get_parameter('select_ips');
$ip = get_parameter("select_ips");
if (!validate_address($ip)) { if (!validate_address($ip)) {
ui_print_error_message(__('The ip or dns name entered cannot be resolved')); ui_print_error_message(__('The ip or dns name entered cannot be resolved'));
} } else {
else{
switch ($operation) { switch ($operation) {
case 1: case 1:
$traceroute = whereis_the_command('traceroute'); $traceroute = whereis_the_command('traceroute');
if (empty($traceroute)) { if (empty($traceroute)) {
ui_print_error_message(__('Traceroute executable does not exist.')); ui_print_error_message(__('Traceroute executable does not exist.'));
} } else {
else { echo '<h3>'.__('Traceroute to ').$ip.'</h3>';
echo "<h3>".__("Traceroute to "). $ip. "</h3>"; echo '<pre>';
echo "<pre>";
echo system("$traceroute $ip"); echo system("$traceroute $ip");
echo "</pre>"; echo '</pre>';
} }
break; break;
case 2: case 2:
$ping = whereis_the_command('ping'); $ping = whereis_the_command('ping');
if (empty($ping)) { if (empty($ping)) {
ui_print_error_message(__('Ping executable does not exist.')); ui_print_error_message(__('Ping executable does not exist.'));
} } else {
else { echo '<h3>'.__('Ping to %s', $ip).'</h3>';
echo "<h3>" . __("Ping to %s", $ip) . "</h3>"; echo '<pre>';
echo "<pre>";
echo system("$ping -c 5 $ip"); echo system("$ping -c 5 $ip");
echo "</pre>"; echo '</pre>';
} }
break; break;
case 4: case 4:
$nmap = whereis_the_command('nmap'); $nmap = whereis_the_command('nmap');
if (empty($nmap)) { if (empty($nmap)) {
ui_print_error_message(__('Nmap executable does not exist.')); ui_print_error_message(__('Nmap executable does not exist.'));
} } else {
else { echo '<h3>'.__('Basic TCP Scan on ').$ip.'</h3>';
echo "<h3>".__("Basic TCP Scan on "). $ip. "</h3>"; echo '<pre>';
echo "<pre>";
echo system("$nmap -F $ip"); echo system("$nmap -F $ip");
echo "</pre>"; echo '</pre>';
} }
break; break;
case 5: case 5:
echo "<h3>".__("Domain and IP information for "). $ip. "</h3>"; echo '<h3>'.__('Domain and IP information for ').$ip.'</h3>';
$dig = whereis_the_command('dig'); $dig = whereis_the_command('dig');
if (empty($dig)) { if (empty($dig)) {
ui_print_error_message(__('Dig executable does not exist.')); ui_print_error_message(__('Dig executable does not exist.'));
} } else {
else { echo '<pre>';
echo "<pre>";
echo system("dig $ip"); echo system("dig $ip");
echo "</pre>"; echo '</pre>';
} }
$whois = whereis_the_command('whois'); $whois = whereis_the_command('whois');
if (empty($whois)) { if (empty($whois)) {
ui_print_error_message(__('Whois executable does not exist.')); ui_print_error_message(__('Whois executable does not exist.'));
} } else {
else { echo '<pre>';
echo "<pre>";
echo system("whois $ip"); echo system("whois $ip");
echo "</pre>"; echo '</pre>';
} }
break; break;
case 3: case 3:
echo "<h3>".__("SNMP information for "). $ip. "</h3>"; echo '<h3>'.__('SNMP information for ').$ip.'</h3>';
$snmpget = whereis_the_command('snmpget'); $snmpget = whereis_the_command('snmpget');
if (empty($snmpget)) { if (empty($snmpget)) {
ui_print_error_message(__('SNMPget executable does not exist.')); ui_print_error_message(__('SNMPget executable does not exist.'));
} } else {
else { echo '<h4>'.__('Uptime').'</h4>';
echo "<h4>" . __("Uptime") . "</h4>"; echo '<pre>';
echo "<pre>";
echo exec("$snmpget -Ounv -v1 -c $community $ip .1.3.6.1.2.1.1.3.0 "); echo exec("$snmpget -Ounv -v1 -c $community $ip .1.3.6.1.2.1.1.3.0 ");
echo "</pre>"; echo '</pre>';
echo "<h4>" . __("Device info") . "</h4>"; echo '<h4>'.__('Device info').'</h4>';
echo "<pre>"; echo '<pre>';
echo system("$snmpget -Ounv -v1 -c $community $ip .1.3.6.1.2.1.1.1.0 "); echo system("$snmpget -Ounv -v1 -c $community $ip .1.3.6.1.2.1.1.1.0 ");
echo "</pre>"; echo '</pre>';
echo "<h4>Interface Information</h4>"; echo '<h4>Interface Information</h4>';
echo "<table class=databox>"; echo '<table class=databox>';
echo "<tr><th>".__("Interface"); echo '<tr><th>'.__('Interface');
echo "<th>".__("Status"); echo '<th>'.__('Status');
$int_max = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.1.0 "); $int_max = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.1.0 ");
@ -249,24 +255,29 @@ function main_net_tools () {
$estado = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.2.1.8.$ax "); $estado = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.2.1.8.$ax ");
echo "<tr><td>$interface<td>$estado"; echo "<tr><td>$interface<td>$estado";
} }
echo "</table>";
echo '</table>';
} }
break; break;
} }
} }
echo "</div>"; echo '</div>';
} }
function godmode_net_tools() {
function godmode_net_tools()
{
global $config; global $config;
check_login(); check_login();
if (! check_acl ($config['id_user'], 0, "PM")) { if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit("ACL Violation", db_pandora_audit(
"Trying to access Profile Management"); 'ACL Violation',
require ("general/noaccess.php"); 'Trying to access Profile Management'
);
include 'general/noaccess.php';
return; return;
} }
@ -280,9 +291,8 @@ function godmode_net_tools() {
$dig_path = (string) get_parameter('dig_path', ''); $dig_path = (string) get_parameter('dig_path', '');
$snmpget_path = (string) get_parameter('snmpget_path', ''); $snmpget_path = (string) get_parameter('snmpget_path', '');
if ($update_traceroute) { if ($update_traceroute) {
$network_tools_config = array(); $network_tools_config = [];
$network_tools_config['traceroute_path'] = $traceroute_path; $network_tools_config['traceroute_path'] = $traceroute_path;
$network_tools_config['ping_path'] = $ping_path; $network_tools_config['ping_path'] = $ping_path;
$network_tools_config['nmap_path'] = $nmap_path; $network_tools_config['nmap_path'] = $nmap_path;
@ -291,11 +301,12 @@ function godmode_net_tools() {
$result = config_update_value('network_tools_config', json_encode($network_tools_config)); $result = config_update_value('network_tools_config', json_encode($network_tools_config));
ui_print_result_message($result, __('Set the paths.'), ui_print_result_message(
__('Set the paths.')); $result,
} __('Set the paths.'),
else { __('Set the paths.')
);
} else {
if (isset($config['network_tools_config'])) { if (isset($config['network_tools_config'])) {
$network_tools_config_output = io_safe_output($config['network_tools_config']); $network_tools_config_output = io_safe_output($config['network_tools_config']);
$network_tools_config = json_decode($network_tools_config_output, true); $network_tools_config = json_decode($network_tools_config_output, true);
@ -308,36 +319,36 @@ function godmode_net_tools() {
} }
$table = null; $table = null;
$table->width = "100%"; $table->width = '100%';
$table->data = array(); $table->data = [];
$table->data[0][0] = __("Traceroute path"); $table->data[0][0] = __('Traceroute path');
$table->data[0][0] .= ui_print_help_tip(__('If empty, %s will search the traceroute system.', get_product_name()), true); $table->data[0][0] .= ui_print_help_tip(__('If empty, %s will search the traceroute system.', get_product_name()), true);
$table->data[0][1] = html_print_input_text('traceroute_path', $traceroute_path, '', 40, 255, true); $table->data[0][1] = html_print_input_text('traceroute_path', $traceroute_path, '', 40, 255, true);
$table->data[1][0] = __("Ping path"); $table->data[1][0] = __('Ping path');
$table->data[1][0] .= ui_print_help_tip(__('If empty, %s will search the ping system.', get_product_name()), true); $table->data[1][0] .= ui_print_help_tip(__('If empty, %s will search the ping system.', get_product_name()), true);
$table->data[1][1] = html_print_input_text('ping_path', $ping_path, '', 40, 255, true); $table->data[1][1] = html_print_input_text('ping_path', $ping_path, '', 40, 255, true);
$table->data[2][0] = __("Nmap path"); $table->data[2][0] = __('Nmap path');
$table->data[2][0] .= ui_print_help_tip(__('If empty, %s will search the nmap system.', get_product_name()), true); $table->data[2][0] .= ui_print_help_tip(__('If empty, %s will search the nmap system.', get_product_name()), true);
$table->data[2][1] = html_print_input_text('nmap_path', $nmap_path, '', 40, 255, true); $table->data[2][1] = html_print_input_text('nmap_path', $nmap_path, '', 40, 255, true);
$table->data[3][0] = __("Dig path"); $table->data[3][0] = __('Dig path');
$table->data[3][0] .= ui_print_help_tip(__('If empty, %s will search the dig system', get_product_name()), true); $table->data[3][0] .= ui_print_help_tip(__('If empty, %s will search the dig system', get_product_name()), true);
$table->data[3][1] = html_print_input_text('dig_path', $dig_path, '', 40, 255, true); $table->data[3][1] = html_print_input_text('dig_path', $dig_path, '', 40, 255, true);
$table->data[4][0] = __("Snmpget path"); $table->data[4][0] = __('Snmpget path');
$table->data[4][0] .= ui_print_help_tip(__('If empty, %s will search the snmpget system.', get_product_name()), true); $table->data[4][0] .= ui_print_help_tip(__('If empty, %s will search the snmpget system.', get_product_name()), true);
$table->data[4][1] = html_print_input_text('snmpget_path', $snmpget_path, '', 40, 255, true); $table->data[4][1] = html_print_input_text('snmpget_path', $snmpget_path, '', 40, 255, true);
echo '<form id="form_setup" method="post" >'; echo '<form id="form_setup" method="post" >';
echo "<fieldset>"; echo '<fieldset>';
echo "<legend>" . __('Options') . "</legend>"; echo '<legend>'.__('Options').'</legend>';
html_print_input_hidden('update_traceroute', 1); html_print_input_hidden('update_traceroute', 1);
html_print_table($table); html_print_table($table);
echo "</fieldset>"; echo '</fieldset>';
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"'); html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"');
@ -345,6 +356,6 @@ function godmode_net_tools() {
echo '</form>'; echo '</form>';
} }
extensions_add_godmode_menu_option(__('Config Network Tools'), 'PM'); extensions_add_godmode_menu_option(__('Config Network Tools'), 'PM');
extensions_add_godmode_function('godmode_net_tools'); extensions_add_godmode_function('godmode_net_tools');
?>

View File

@ -4,83 +4,76 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function view_logfile($file_name)
function view_logfile ($file_name) { {
global $config; global $config;
$memory_limit = ini_get("memory_limit"); $memory_limit = ini_get('memory_limit');
if (strstr($memory_limit, "M") !== false) { if (strstr($memory_limit, 'M') !== false) {
$memory_limit = str_replace("M", "", $memory_limit); $memory_limit = str_replace('M', '', $memory_limit);
$memory_limit = $memory_limit * 1024 * 1024; $memory_limit = ($memory_limit * 1024 * 1024);
// Arbitrary size for the PHP program // Arbitrary size for the PHP program
$memory_limit = $memory_limit - (8 * 1024 * 1024); $memory_limit = ($memory_limit - (8 * 1024 * 1024));
} }
if (!file_exists($file_name)) { if (!file_exists($file_name)) {
ui_print_error_message(__("Cannot find file") . "(" . $file_name . ")"); ui_print_error_message(__('Cannot find file').'('.$file_name.')');
} } else {
else {
$file_size = filesize($file_name); $file_size = filesize($file_name);
if ($memory_limit < $file_size) { if ($memory_limit < $file_size) {
echo "<h2>$file_name (" . __("File is too large than PHP memory allocated in the system.") . ")</h2>"; echo "<h2>$file_name (".__('File is too large than PHP memory allocated in the system.').')</h2>';
echo "<h2>" . __("The preview file is imposible.") . "</h2>"; echo '<h2>'.__('The preview file is imposible.').'</h2>';
} } else if ($file_size > ($config['max_log_size'] * 1000)) {
else if ($file_size > ($config['max_log_size'] * 1000)) { $data = file_get_contents($file_name, false, null, ($file_size - ($config['max_log_size'] * 1000)));
$data = file_get_contents ($file_name, false, NULL, $file_size - ($config['max_log_size'] * 1000)); echo "<h2>$file_name (".format_numeric(filesize($file_name) / 1024).' KB) </h2>';
echo "<h2>$file_name (".format_numeric(filesize ($file_name)/1024)." KB) </h2>";
echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>"; echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>";
echo "... "; echo '... ';
echo $data; echo $data;
echo "</textarea><br><br>"; echo '</textarea><br><br>';
} } else {
else {
$data = file_get_contents($file_name); $data = file_get_contents($file_name);
echo "<h2>$file_name (".format_numeric(filesize ($file_name)/1024)." KB) </h2>"; echo "<h2>$file_name (".format_numeric(filesize($file_name) / 1024).' KB) </h2>';
echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>"; echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>";
echo $data; echo $data;
echo "</textarea><br><br>"; echo '</textarea><br><br>';
} }
} }
} }
function pandoralogs_extension_main () { function pandoralogs_extension_main()
{
global $config; global $config;
if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_user'])) { if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit("ACL Violation", "Trying to access Setup Management"); db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
require ("general/noaccess.php"); include 'general/noaccess.php';
return; return;
} }
ui_print_page_header (__("System logfile viewer"), "images/extensions.png", false, "", true, "" ); ui_print_page_header(__('System logfile viewer'), 'images/extensions.png', false, '', true, '');
echo "<p>" . __('Use this tool to view your %s logfiles directly on the console', get_product_name()) . "</p>"; echo '<p>'.__('Use this tool to view your %s logfiles directly on the console', get_product_name()).'</p>';
echo "<p>" . __('You can choose the amount of information shown in general setup (Log size limit in system logs viewer extension), ' . $config['max_log_size'] * 1000 . 'B at the moment') . "</p>"; echo '<p>'.__('You can choose the amount of information shown in general setup (Log size limit in system logs viewer extension), '.($config['max_log_size'] * 1000).'B at the moment').'</p>';
$logs_directory = (!empty($config["server_log_dir"])) ? io_safe_output($config["server_log_dir"]) : "/var/log/pandora"; $logs_directory = (!empty($config['server_log_dir'])) ? io_safe_output($config['server_log_dir']) : '/var/log/pandora';
view_logfile ($config["homedir"]."/pandora_console.log"); view_logfile($config['homedir'].'/pandora_console.log');
view_logfile ($logs_directory."/pandora_server.log"); view_logfile($logs_directory.'/pandora_server.log');
view_logfile ($logs_directory."/pandora_server.error"); view_logfile($logs_directory.'/pandora_server.error');
} }
extensions_add_godmode_menu_option (__('System logfiles'), 'PM','', null, "v1r1");
extensions_add_godmode_function('pandoralogs_extension_main');
?> extensions_add_godmode_menu_option(__('System logfiles'), 'PM', '', null, 'v1r1');
extensions_add_godmode_function('pandoralogs_extension_main');

View File

@ -4,54 +4,53 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function pluginreg_extension_main()
function pluginreg_extension_main () { {
global $config; global $config;
check_login(); check_login();
if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_user'])) { if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit("ACL Violation", "Trying to access Setup Management"); db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
require ("general/noaccess.php"); include 'general/noaccess.php';
return; return;
} }
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
ui_print_page_header (__('Plugin registration'), "images/extensions.png", false, "", true, "" ); ui_print_page_header(__('Plugin registration'), 'images/extensions.png', false, '', true, '');
echo '<div class="new_task"> echo '<div class="new_task">
<div class="image_task">'; <div class="image_task">';
echo html_print_image("images/firts_task/icono_grande_import.png", true, array("title" => __("Plugin Registration") )); echo html_print_image('images/firts_task/icono_grande_import.png', true, ['title' => __('Plugin Registration') ]);
echo '</div>'; echo '</div>';
echo '<div class="text_task">'; echo '<div class="text_task">';
echo '<h3>' . __("Plugin registration") . '</h3>'; echo '<h3>'.__('Plugin registration').'</h3>';
echo '<p id="description_task">' . echo '<p id="description_task">'.__(
__("This extension makes registering server plugins an easier task. "This extension makes registering server plugins an easier task.
Here you can upload a server plugin in .pspz zipped format. Here you can upload a server plugin in .pspz zipped format.
Please refer to the official documentation on how to obtain and use Server Plugins. Please refer to the official documentation on how to obtain and use Server Plugins.
<br><br>You can get more plugins in our <a href='http://pandorafms.com/Library/Library/'>Public Resource Library</a> ") . '</p>'; <br><br>You can get more plugins in our <a href='http://pandorafms.com/Library/Library/'>Public Resource Library</a> "
).'</p>';
// Upload form // Upload form
echo "<form name='submit_plugin' method='post' enctype='multipart/form-data'>"; echo "<form name='submit_plugin' method='post' enctype='multipart/form-data'>";
echo '<table class="" id="table1" width="100%" border="0" cellpadding="4" cellspacing="4">'; echo '<table class="" id="table1" width="100%" border="0" cellpadding="4" cellspacing="4">';
echo "<tr><td class='datos'><input type='file' name='plugin_upload' />"; echo "<tr><td class='datos'><input type='file' name='plugin_upload' />";
echo "<td class='datos'><input type='submit' class='sub next' value='".__('Upload')."' />"; echo "<td class='datos'><input type='submit' class='sub next' value='".__('Upload')."' />";
echo "</form></table>"; echo '</form></table>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
$zip = null; $zip = null;
$upload = false; $upload = false;
if (isset($_FILES['plugin_upload'])) { if (isset($_FILES['plugin_upload'])) {
$config["plugin_store"] = $config["attachment_store"] . "/plugin"; $config['plugin_store'] = $config['attachment_store'].'/plugin';
$name_file = $_FILES['plugin_upload']['name']; $name_file = $_FILES['plugin_upload']['name'];
@ -61,14 +60,14 @@ function pluginreg_extension_main () {
if ($zip) { if ($zip) {
while ($zip_entry = zip_read($zip)) { while ($zip_entry = zip_read($zip)) {
if (zip_entry_open($zip, $zip_entry, "r")) { if (zip_entry_open($zip, $zip_entry, 'r')) {
if (zip_entry_name($zip_entry) == "plugin_definition.ini") { if (zip_entry_name($zip_entry) == 'plugin_definition.ini') {
$basepath = $config["attachment_store"]; $basepath = $config['attachment_store'];
} else {
$basepath = $config['plugin_store'];
} }
else {
$basepath = $config["plugin_store"]; $filename = $basepath.'/'.zip_entry_name($zip_entry);
}
$filename = $basepath . "/". zip_entry_name($zip_entry);
$fp = fopen($filename, 'w'); $fp = fopen($filename, 'w');
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
fwrite($fp, $buf); fwrite($fp, $buf);
@ -77,164 +76,152 @@ function pluginreg_extension_main () {
zip_entry_close($zip_entry); zip_entry_close($zip_entry);
} }
} }
zip_close($zip); zip_close($zip);
} }
if ($upload) { if ($upload) {
// Parse with sections // Parse with sections
if (! $ini_array = parse_ini_file($config["attachment_store"] . "/plugin_definition.ini", true)) { if (! $ini_array = parse_ini_file($config['attachment_store'].'/plugin_definition.ini', true)) {
echo "<h2 class=error>".__("Cannot load INI file")."</h2>"; echo '<h2 class=error>'.__('Cannot load INI file').'</h2>';
} } else {
else { $version = preg_replace('/.*[.]/', '', $name_file);
$version = preg_replace("/.*[.]/", "", $name_file); $exec_path = $config['plugin_store'].'/'.$ini_array['plugin_definition']['filename'];
$exec_path = $config["plugin_store"] . "/" . $ini_array["plugin_definition"]["filename"];
$file_exec_path = $exec_path; $file_exec_path = $exec_path;
if (isset($ini_array["plugin_definition"]["execution_command"]) if (isset($ini_array['plugin_definition']['execution_command'])
&& ($ini_array["plugin_definition"]["execution_command"] != "")) { && ($ini_array['plugin_definition']['execution_command'] != '')
) {
$exec_path = $ini_array["plugin_definition"]["execution_command"] . " " . $config["plugin_store"] . "/" . $ini_array["plugin_definition"]["filename"]; $exec_path = $ini_array['plugin_definition']['execution_command'].' '.$config['plugin_store'].'/'.$ini_array['plugin_definition']['filename'];
} }
if (isset($ini_array["plugin_definition"]["execution_postcommand"]) if (isset($ini_array['plugin_definition']['execution_postcommand'])
&& ($ini_array["plugin_definition"]["execution_postcommand"] != "")) { && ($ini_array['plugin_definition']['execution_postcommand'] != '')
) {
$exec_path = $exec_path . " " .$ini_array["plugin_definition"]["execution_postcommand"]; $exec_path = $exec_path.' '.$ini_array['plugin_definition']['execution_postcommand'];
} }
if (!file_exists($file_exec_path)) { if (!file_exists($file_exec_path)) {
echo "<h2 class=error>".__("Plugin exec not found. Aborting!")."</h2>"; echo '<h2 class=error>'.__('Plugin exec not found. Aborting!').'</h2>';
unlink ($config["attachment_store"] . "/plugin_definition.ini"); unlink($config['attachment_store'].'/plugin_definition.ini');
} } else {
else {
// Verify if a plugin with the same name is already registered // Verify if a plugin with the same name is already registered
$sql0 = "SELECT COUNT(*) $sql0 = "SELECT COUNT(*)
FROM tplugin FROM tplugin
WHERE name = '" . io_safe_input ($ini_array["plugin_definition"]["name"]) . "'"; WHERE name = '".io_safe_input($ini_array['plugin_definition']['name'])."'";
$result = db_get_sql($sql0); $result = db_get_sql($sql0);
if ($result > 0) { if ($result > 0) {
echo "<h2 class=error>".__("Plugin already registered. Aborting!")."</h2>"; echo '<h2 class=error>'.__('Plugin already registered. Aborting!').'</h2>';
unlink ($config["attachment_store"] . "/plugin_definition.ini"); unlink($config['attachment_store'].'/plugin_definition.ini');
} } else {
else { $values = [
'name' => io_safe_input($ini_array['plugin_definition']['name']),
$values = array( 'description' => io_safe_input($ini_array['plugin_definition']['description']),
'name' => io_safe_input ($ini_array["plugin_definition"]["name"]), 'max_timeout' => $ini_array['plugin_definition']['timeout'],
'description' => io_safe_input ($ini_array["plugin_definition"]["description"]),
'max_timeout' => $ini_array["plugin_definition"]["timeout"],
'execute' => io_safe_input($exec_path), 'execute' => io_safe_input($exec_path),
'net_dst_opt' => $ini_array["plugin_definition"]["ip_opt"], 'net_dst_opt' => $ini_array['plugin_definition']['ip_opt'],
'net_port_opt' => $ini_array["plugin_definition"]["port_opt"], 'net_port_opt' => $ini_array['plugin_definition']['port_opt'],
'user_opt' => $ini_array["plugin_definition"]["user_opt"], 'user_opt' => $ini_array['plugin_definition']['user_opt'],
'pass_opt' => $ini_array["plugin_definition"]["pass_opt"], 'pass_opt' => $ini_array['plugin_definition']['pass_opt'],
'parameters' => $ini_array["plugin_definition"]["parameters"], 'parameters' => $ini_array['plugin_definition']['parameters'],
'plugin_type' => $ini_array["plugin_definition"]["plugin_type"]); 'plugin_type' => $ini_array['plugin_definition']['plugin_type'],
];
switch ($version) { switch ($version) {
case 'pspz': case 'pspz':
// Fixed the static parameters // Fixed the static parameters
// for // for
// the dinamic parameters of pandoras 5 // the dinamic parameters of pandoras 5
$total_macros = 0; $total_macros = 0;
$macros = array(); $macros = [];
if (!isset($values['parameters'])) if (!isset($values['parameters'])) {
$values['parameters'] = ""; $values['parameters'] = '';
}
if ($values['net_dst_opt'] != "") { if ($values['net_dst_opt'] != '') {
$total_macros++; $total_macros++;
$macro = array(); $macro = [];
$macro['macro'] = '_field'.$total_macros.'_'; $macro['macro'] = '_field'.$total_macros.'_';
$macro['desc'] = 'Target IP from net'; $macro['desc'] = 'Target IP from net';
$macro['help'] = ''; $macro['help'] = '';
$macro['value'] = ''; $macro['value'] = '';
$values['parameters'] .= $values['parameters'] .= $values['net_dst_opt'].' _field'.$total_macros.'_ ';
$values['net_dst_opt'] . ' _field' . $total_macros . '_ ';
$macros[(string) $total_macros] = $macro; $macros[(string) $total_macros] = $macro;
} }
if ($values['ip_opt'] != "") { if ($values['ip_opt'] != '') {
$total_macros++; $total_macros++;
$macro = array(); $macro = [];
$macro['macro'] = '_field'.$total_macros.'_'; $macro['macro'] = '_field'.$total_macros.'_';
$macro['desc'] = 'Target IP'; $macro['desc'] = 'Target IP';
$macro['help'] = ''; $macro['help'] = '';
$macro['value'] = ''; $macro['value'] = '';
$values['parameters'] .= $values['parameters'] .= $values['ip_opt'].' _field'.$total_macros.'_ ';
$values['ip_opt'] . ' _field' . $total_macros . '_ ';
$macros[(string) $total_macros] = $macro; $macros[(string) $total_macros] = $macro;
} }
if ($values['net_port_opt'] != "") { if ($values['net_port_opt'] != '') {
$total_macros++; $total_macros++;
$macro = array(); $macro = [];
$macro['macro'] = '_field'.$total_macros.'_'; $macro['macro'] = '_field'.$total_macros.'_';
$macro['desc'] = 'Port from net'; $macro['desc'] = 'Port from net';
$macro['help'] = ''; $macro['help'] = '';
$macro['value'] = ''; $macro['value'] = '';
$values['parameters'] .= $values['parameters'] .= $values['net_port_opt'].' _field'.$total_macros.'_ ';
$values['net_port_opt'] . ' _field' . $total_macros . '_ ';
$macros[(string) $total_macros] = $macro; $macros[(string) $total_macros] = $macro;
} }
if ($values['port_opt'] != "") { if ($values['port_opt'] != '') {
$total_macros++; $total_macros++;
$macro = array(); $macro = [];
$macro['macro'] = '_field'.$total_macros.'_'; $macro['macro'] = '_field'.$total_macros.'_';
$macro['desc'] = 'Port'; $macro['desc'] = 'Port';
$macro['help'] = ''; $macro['help'] = '';
$macro['value'] = ''; $macro['value'] = '';
$values['parameters'] .= $values['parameters'] .= $values['port_opt'].' _field'.$total_macros.'_ ';
$values['port_opt'] . ' _field' . $total_macros . '_ ';
$macros[(string) $total_macros] = $macro; $macros[(string) $total_macros] = $macro;
} }
if ($values['user_opt'] != "") { if ($values['user_opt'] != '') {
$total_macros++; $total_macros++;
$macro = array(); $macro = [];
$macro['macro'] = '_field'.$total_macros.'_'; $macro['macro'] = '_field'.$total_macros.'_';
$macro['desc'] = 'Username'; $macro['desc'] = 'Username';
$macro['help'] = ''; $macro['help'] = '';
$macro['value'] = ''; $macro['value'] = '';
$values['parameters'] .= $values['parameters'] .= $values['user_opt'].' _field'.$total_macros.'_ ';
$values['user_opt'] . ' _field' . $total_macros . '_ ';
$macros[(string) $total_macros] = $macro; $macros[(string) $total_macros] = $macro;
} }
if ($values['pass_opt'] != "") { if ($values['pass_opt'] != '') {
$total_macros++; $total_macros++;
$macro = array(); $macro = [];
$macro['macro'] = '_field'.$total_macros.'_'; $macro['macro'] = '_field'.$total_macros.'_';
$macro['desc'] = 'Password'; $macro['desc'] = 'Password';
$macro['help'] = ''; $macro['help'] = '';
$macro['value'] = ''; $macro['value'] = '';
$values['parameters'] .= $values['parameters'] .= $values['pass_opt'].' _field'.$total_macros.'_ ';
$values['pass_opt'] . ' _field' . $total_macros . '_ ';
$macros[(string) $total_macros] = $macro; $macros[(string) $total_macros] = $macro;
} }
@ -244,38 +231,39 @@ function pluginreg_extension_main () {
// side of the module // side of the module
$total_macros++; $total_macros++;
$macro = array(); $macro = [];
$macro['macro'] = '_field'.$total_macros.'_'; $macro['macro'] = '_field'.$total_macros.'_';
$macro['desc'] = 'Plug-in Parameters'; $macro['desc'] = 'Plug-in Parameters';
$macro['help'] = ''; $macro['help'] = '';
$macro['value'] = ''; $macro['value'] = '';
$values['parameters'] .= $values['parameters'] .= ' _field'.$total_macros.'_';
' _field' . $total_macros . '_';
$macros[(string) $total_macros] = $macro; $macros[(string) $total_macros] = $macro;
break; break;
case 'pspz2': case 'pspz2':
// Fill the macros field. // Fill the macros field.
$total_macros = $total_macros = $ini_array['plugin_definition']['total_macros_provided'];
$ini_array["plugin_definition"]["total_macros_provided"];
$macros = array(); $macros = [];
for ($it_macros = 1; $it_macros <= $total_macros; $it_macros++) { for ($it_macros = 1; $it_macros <= $total_macros; $it_macros++) {
$label = "macro_" . $it_macros; $label = 'macro_'.$it_macros;
$macro = array(); $macro = [];
$macro['macro'] = '_field'.$it_macros.'_'; $macro['macro'] = '_field'.$it_macros.'_';
$macro['hide'] = $macro['hide'] = $ini_array[$label]['hide'];
$ini_array[$label]['hide'];
$macro['desc'] = io_safe_input( $macro['desc'] = io_safe_input(
$ini_array[$label]['description']); $ini_array[$label]['description']
);
$macro['help'] = io_safe_input( $macro['help'] = io_safe_input(
$ini_array[$label]['help']); $ini_array[$label]['help']
);
$macro['value'] = io_safe_input( $macro['value'] = io_safe_input(
$ini_array[$label]['value']); $ini_array[$label]['value']
);
$macros[(string) $it_macros] = $macro; $macros[(string) $it_macros] = $macro;
} }
@ -290,56 +278,65 @@ function pluginreg_extension_main () {
if (empty($create_id)) { if (empty($create_id)) {
ui_print_error_message( ui_print_error_message(
__('Plug-in Remote Registered unsuccessfull')); __('Plug-in Remote Registered unsuccessfull')
);
ui_print_info_message( ui_print_info_message(
__('Please check the syntax of file "plugin_definition.ini"')); __('Please check the syntax of file "plugin_definition.ini"')
);
} else {
for ($ax = 1; $ax <= $ini_array['plugin_definition']['total_modules_provided']; $ax++) {
$label = 'module'.$ax;
$plugin_user = '';
if (isset($ini_array[$label]['plugin_user'])) {
$plugin_user = $ini_array[$label]['plugin_user'];
} }
else {
for ($ax = 1; $ax <= $ini_array["plugin_definition"]["total_modules_provided"]; $ax++) {
$label = "module" . $ax;
$plugin_user = ""; $plugin_pass = '';
if (isset($ini_array[$label]["plugin_user"])) if (isset($ini_array[$label]['plugin_pass'])) {
$plugin_user = $ini_array[$label]["plugin_user"]; $plugin_pass = $ini_array[$label]['plugin_pass'];
$plugin_pass = ""; }
if (isset($ini_array[$label]["plugin_pass"]))
$plugin_pass = $ini_array[$label]["plugin_pass"];
$plugin_parameter = "";
if (isset($ini_array[$label]["plugin_parameter"]))
$plugin_parameter = $ini_array[$label]["plugin_parameter"];
$unit = "";
if (isset($ini_array[$label]["unit"]))
$unit = $ini_array[$label]["unit"];
$values = array( $plugin_parameter = '';
'name' => io_safe_input ($ini_array[$label]["name"]), if (isset($ini_array[$label]['plugin_parameter'])) {
'description' => io_safe_input ($ini_array[$label]["description"]), $plugin_parameter = $ini_array[$label]['plugin_parameter'];
'id_group' => $ini_array[$label]["id_group"], }
'type' => $ini_array[$label]["type"],
'max' => isset($ini_array[$label]["max"]) ? $ini_array[$label]["max"] : '', $unit = '';
'min' => isset($ini_array[$label]["min"]) ? $ini_array[$label]["min"] : '', if (isset($ini_array[$label]['unit'])) {
'module_interval' => isset($ini_array[$label]["module_interval"]) ? $ini_array[$label]["module_interval"] : '', $unit = $ini_array[$label]['unit'];
'id_module_group' => $ini_array[$label]["id_module_group"], }
'id_modulo' => $ini_array[$label]["id_modulo"],
$values = [
'name' => io_safe_input($ini_array[$label]['name']),
'description' => io_safe_input($ini_array[$label]['description']),
'id_group' => $ini_array[$label]['id_group'],
'type' => $ini_array[$label]['type'],
'max' => isset($ini_array[$label]['max']) ? $ini_array[$label]['max'] : '',
'min' => isset($ini_array[$label]['min']) ? $ini_array[$label]['min'] : '',
'module_interval' => isset($ini_array[$label]['module_interval']) ? $ini_array[$label]['module_interval'] : '',
'id_module_group' => $ini_array[$label]['id_module_group'],
'id_modulo' => $ini_array[$label]['id_modulo'],
'plugin_user' => io_safe_input($plugin_user), 'plugin_user' => io_safe_input($plugin_user),
'plugin_pass' => io_safe_input($plugin_pass), 'plugin_pass' => io_safe_input($plugin_pass),
'plugin_parameter' => io_safe_input($plugin_parameter), 'plugin_parameter' => io_safe_input($plugin_parameter),
'unit' => io_safe_input($unit), 'unit' => io_safe_input($unit),
'max_timeout' => isset($ini_array[$label]["max_timeout"]) ? $ini_array[$label]["max_timeout"] : '', 'max_timeout' => isset($ini_array[$label]['max_timeout']) ? $ini_array[$label]['max_timeout'] : '',
'history_data' => isset($ini_array[$label]["history_data"]) ? $ini_array[$label]["history_data"] : '', 'history_data' => isset($ini_array[$label]['history_data']) ? $ini_array[$label]['history_data'] : '',
'dynamic_interval' => isset($ini_array[$label]["dynamic_interval"]) ? $ini_array[$label]["dynamic_interval"] : '', 'dynamic_interval' => isset($ini_array[$label]['dynamic_interval']) ? $ini_array[$label]['dynamic_interval'] : '',
'dynamic_min' => isset($ini_array[$label]["dynamic_min"]) ? $ini_array[$label]["dynamic_min"] : '', 'dynamic_min' => isset($ini_array[$label]['dynamic_min']) ? $ini_array[$label]['dynamic_min'] : '',
'dynamic_max' => isset($ini_array[$label]["dynamic_max"]) ? $ini_array[$label]["dynamic_max"] : '', 'dynamic_max' => isset($ini_array[$label]['dynamic_max']) ? $ini_array[$label]['dynamic_max'] : '',
'dynamic_two_tailed' => isset($ini_array[$label]["dynamic_two_tailed"]) ? $ini_array[$label]["dynamic_two_tailed"] : '', 'dynamic_two_tailed' => isset($ini_array[$label]['dynamic_two_tailed']) ? $ini_array[$label]['dynamic_two_tailed'] : '',
'min_warning' => isset($ini_array[$label]["min_warning"]) ? $ini_array[$label]["min_warning"] : '', 'min_warning' => isset($ini_array[$label]['min_warning']) ? $ini_array[$label]['min_warning'] : '',
'max_warning' => isset($ini_array[$label]["max_warning"]) ? $ini_array[$label]["max_warning"] : '', 'max_warning' => isset($ini_array[$label]['max_warning']) ? $ini_array[$label]['max_warning'] : '',
'str_warning' => isset($ini_array[$label]["str_warning"]) ? $ini_array[$label]["str_warning"] : '', 'str_warning' => isset($ini_array[$label]['str_warning']) ? $ini_array[$label]['str_warning'] : '',
'min_critical' => isset($ini_array[$label]["min_critical"]) ? $ini_array[$label]["min_critical"] : '', 'min_critical' => isset($ini_array[$label]['min_critical']) ? $ini_array[$label]['min_critical'] : '',
'max_critical' => isset($ini_array[$label]["max_critical"]) ? $ini_array[$label]["max_critical"] : '', 'max_critical' => isset($ini_array[$label]['max_critical']) ? $ini_array[$label]['max_critical'] : '',
'str_critical' => isset($ini_array[$label]["str_critical"]) ? $ini_array[$label]["str_critical"] : '', 'str_critical' => isset($ini_array[$label]['str_critical']) ? $ini_array[$label]['str_critical'] : '',
'min_ff_event' => isset($ini_array[$label]["min_ff_event"]) ? $ini_array[$label]["min_ff_event"] : '', 'min_ff_event' => isset($ini_array[$label]['min_ff_event']) ? $ini_array[$label]['min_ff_event'] : '',
'tcp_port' => isset($ini_array[$label]["tcp_port"]) ? $ini_array[$label]["tcp_port"] : '', 'tcp_port' => isset($ini_array[$label]['tcp_port']) ? $ini_array[$label]['tcp_port'] : '',
'id_plugin' => $create_id); 'id_plugin' => $create_id,
];
$macros_component = $macros; $macros_component = $macros;
@ -348,61 +345,49 @@ function pluginreg_extension_main () {
// Fixed the static parameters // Fixed the static parameters
// for // for
// the dinamic parameters of pandoras 5 // the dinamic parameters of pandoras 5
foreach ($macros_component as $key => $macro) { foreach ($macros_component as $key => $macro) {
if ($macro['desc'] == 'Target IP from net') { if ($macro['desc'] == 'Target IP from net') {
if (!empty($values['ip_target'])) { if (!empty($values['ip_target'])) {
$macros_component[$key]['value'] = $macros_component[$key]['value'] = io_safe_input($values['ip_target']);
io_safe_input($values['ip_target']);
} }
} }
if ($macro['desc'] == 'Target IP') { if ($macro['desc'] == 'Target IP') {
if (!empty($values['ip_target'])) { if (!empty($values['ip_target'])) {
$macros_component[$key]['value'] = $macros_component[$key]['value'] = io_safe_input($values['ip_target']);
io_safe_input($values['ip_target']);
} }
} } else if ($macro['desc'] == 'Port from net') {
else if ($macro['desc'] == 'Port from net') {
if (!empty($values['tcp_port'])) { if (!empty($values['tcp_port'])) {
$macros_component[$key]['value'] = $macros_component[$key]['value'] = io_safe_input($values['tcp_port']);
io_safe_input($values['tcp_port']);
} }
} } else if ($macro['desc'] == 'Port') {
else if ($macro['desc'] == 'Port') {
if (!empty($values['tcp_port'])) { if (!empty($values['tcp_port'])) {
$macros_component[$key]['value'] = $macros_component[$key]['value'] = io_safe_input($values['tcp_port']);
io_safe_input($values['tcp_port']);
} }
} } else if ($macro['desc'] == 'Username') {
else if ($macro['desc'] == 'Username') {
if (!empty($values['plugin_user'])) { if (!empty($values['plugin_user'])) {
$macros_component[$key]['value'] = $macros_component[$key]['value'] = io_safe_input($values['plugin_user']);
io_safe_input($values['plugin_user']);
} }
} } else if ($macro['desc'] == 'Password') {
else if ($macro['desc'] == 'Password') {
if (!empty($values['plugin_pass'])) { if (!empty($values['plugin_pass'])) {
$macros_component[$key]['value'] = $macros_component[$key]['value'] = io_safe_input($values['plugin_pass']);
io_safe_input($values['plugin_pass']);
} }
} } else if ($macro['desc'] == 'Plug-in Parameters') {
else if ($macro['desc'] == 'Plug-in Parameters') {
if (!empty($values['plugin_parameter'])) { if (!empty($values['plugin_parameter'])) {
$macros_component[$key]['value'] = $macros_component[$key]['value'] = io_safe_input($values['plugin_parameter']);
io_safe_input($values['plugin_parameter']);
} }
} }
} }
break; break;
case 'pspz2': case 'pspz2':
if ($total_macros > 0) { if ($total_macros > 0) {
for ($it_macros = 1; $it_macros <= $total_macros; $it_macros++) { for ($it_macros = 1; $it_macros <= $total_macros; $it_macros++) {
$macro = "macro_" . $it_macros . "_value"; $macro = 'macro_'.$it_macros.'_value';
// Set the value or use the default // Set the value or use the default
if (isset($ini_array[$label][$macro])) { if (isset($ini_array[$label][$macro])) {
$macros_component[(string)$it_macros]['value'] = $macros_component[(string) $it_macros]['value'] = io_safe_input($ini_array[$label][$macro]);
io_safe_input($ini_array[$label][$macro]);
} }
} }
} }
@ -415,23 +400,19 @@ function pluginreg_extension_main () {
db_process_sql_insert('tnetwork_component', $values); db_process_sql_insert('tnetwork_component', $values);
echo "<h3 class=suc>" . echo '<h3 class=suc>'.__('Module plugin registered').' : '.$ini_array[$label]['name'].'</h3>';
__("Module plugin registered") . " : " . $ini_array[$label]["name"] .
"</h3>";
} }
echo "<h2 class=suc>" . echo '<h2 class=suc>'.__('Plugin').' '.$ini_array['plugin_definition']['name'].' '.__('Registered successfully').'</h2>';
__("Plugin") . " " . $ini_array["plugin_definition"]["name"] . " " . __("Registered successfully") .
"</h2>";
} }
unlink ($config["attachment_store"] . "/plugin_definition.ini");
unlink($config['attachment_store'].'/plugin_definition.ini');
} }
} }
} }
} }
} }
extensions_add_godmode_menu_option (__('Register plugin'), 'PM','gservers', null, "v1r1");
extensions_add_godmode_menu_option(__('Register plugin'), 'PM', 'gservers', null, 'v1r1');
extensions_add_godmode_function('pluginreg_extension_main'); extensions_add_godmode_function('pluginreg_extension_main');
?>

View File

@ -4,40 +4,39 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2014 Artica Soluciones Tecnologicas // Copyright (c) 2005-2014 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
include_once($config['homedir'] . '/include/graphs/fgraph.php'); require_once $config['homedir'].'/include/graphs/fgraph.php';
include_once($config['homedir'] . '/include/functions_snmp_browser.php'); require_once $config['homedir'].'/include/functions_snmp_browser.php';
function pandora_realtime_graphs () {
function pandora_realtime_graphs()
{
global $config; global $config;
check_login(); check_login();
$id_network = get_parameter('id_network', 0); $id_network = get_parameter('id_network', 0);
$action = get_parameter('action', 'list'); $action = get_parameter('action', 'list');
$onheader = array(); $onheader = [];
$hide_header = get_parameter('hide_header', 0); $hide_header = get_parameter('hide_header', 0);
if (!$hide_header) { if (!$hide_header) {
ui_print_page_header (__("Realtime graphs"), "images/extensions.png", false, "", false, $onheader); ui_print_page_header(__('Realtime graphs'), 'images/extensions.png', false, '', false, $onheader);
} }
$chart[time()]['graph'] = '0'; $chart[time()]['graph'] = '0';
$interactive_graph = true; $interactive_graph = true;
$color = array(); $color = [];
$legend = ''; $legend = '';
$long_index = array(); $long_index = [];
$no_data_image = ''; $no_data_image = '';
$canvas = '<div id="graph_container">'; $canvas = '<div id="graph_container">';
@ -46,13 +45,13 @@ function pandora_realtime_graphs () {
$width = 800; $width = 800;
$height = 300; $height = 300;
$data_array['realtime']['data'][0][0] = time() - 10; $data_array['realtime']['data'][0][0] = (time() - 10);
$data_array['realtime']['data'][0][1] = 0; $data_array['realtime']['data'][0][1] = 0;
$data_array['realtime']['data'][1][0] = time(); $data_array['realtime']['data'][1][0] = time();
$data_array['realtime']['data'][1][1] = 0; $data_array['realtime']['data'][1][1] = 0;
$data_array['realtime']['color'] = 'green'; $data_array['realtime']['color'] = 'green';
$params =array( $params = [
'agent_module_id' => false, 'agent_module_id' => false,
'period' => 300, 'period' => 300,
'width' => $width, 'width' => $width,
@ -65,8 +64,8 @@ function pandora_realtime_graphs () {
'font-size' => $config['font_size'], 'font-size' => $config['font_size'],
'array_data_create' => $data_array, 'array_data_create' => $data_array,
'show_legend' => false, 'show_legend' => false,
'show_menu' => false 'show_menu' => false,
); ];
$canvas .= grafico_modulo_sparse($params); $canvas .= grafico_modulo_sparse($params);
@ -76,7 +75,7 @@ function pandora_realtime_graphs () {
$table->width = '100%'; $table->width = '100%';
$table->id = 'table-form'; $table->id = 'table-form';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->style = array (); $table->style = [];
$table->cellpadding = '0'; $table->cellpadding = '0';
$table->cellspacing = '0'; $table->cellspacing = '0';
$table->style['graph'] = 'font-weight: bold;'; $table->style['graph'] = 'font-weight: bold;';
@ -87,7 +86,7 @@ function pandora_realtime_graphs () {
$table->style['snmp_community'] = 'font-weight: bold;'; $table->style['snmp_community'] = 'font-weight: bold;';
$table->style['snmp_oid'] = 'font-weight: bold;'; $table->style['snmp_oid'] = 'font-weight: bold;';
$table->style['snmp_oid'] = 'font-weight: bold;'; $table->style['snmp_oid'] = 'font-weight: bold;';
$table->data = array (); $table->data = [];
$graph_fields['cpu_load'] = __('%s Server CPU', get_product_name()); $graph_fields['cpu_load'] = __('%s Server CPU', get_product_name());
$graph_fields['pending_packets'] = __('Pending packages from %s Server', get_product_name()); $graph_fields['pending_packets'] = __('Pending packages from %s Server', get_product_name());
@ -118,13 +117,26 @@ function pandora_realtime_graphs () {
// Append all the hidden in this cell // Append all the hidden in this cell
$data['module_info'] .= html_print_input_hidden('incremental', $module_incremental, true); $data['module_info'] .= html_print_input_hidden('incremental', $module_incremental, true);
$data['module_info'] .= html_print_select( $data['module_info'] .= html_print_select(
array('snmp_module' => '-'), 'graph', 'snmp_module', '', '', 0, true, false, true, '', false, 'display: none;' ['snmp_module' => '-'],
'graph',
'snmp_module',
'',
'',
0,
true,
false,
true,
'',
false,
'display: none;'
); );
} }
$data['refresh'] = __('Refresh interval').'&nbsp;&nbsp;'.html_print_select($refresh_fields, 'refresh', $refresh, '', '', 0, true); $data['refresh'] = __('Refresh interval').'&nbsp;&nbsp;'.html_print_select($refresh_fields, 'refresh', $refresh, '', '', 0, true);
if ($graph != 'snmp_module') { if ($graph != 'snmp_module') {
$data['incremental'] = __('Incremental').'&nbsp;&nbsp;'.html_print_checkbox('incremental', 1, 0, true); $data['incremental'] = __('Incremental').'&nbsp;&nbsp;'.html_print_checkbox('incremental', 1, 0, true);
} }
$data['reset'] = html_print_button(__('Clear graph'), 'reset', false, 'javascript:realtimeGraphs.clearGraph();', 'class="sub delete" style="margin-top:0px;"', true); $data['reset'] = html_print_button(__('Clear graph'), 'reset', false, 'javascript:realtimeGraphs.clearGraph();', 'class="sub delete" style="margin-top:0px;"', true);
$table->data[] = $data; $table->data[] = $data;
@ -134,7 +146,7 @@ function pandora_realtime_graphs () {
$snmp_oid = get_parameter('snmp_oid', ''); $snmp_oid = get_parameter('snmp_oid', '');
$snmp_ver = get_parameter('snmp_ver', ''); $snmp_ver = get_parameter('snmp_ver', '');
$data = array(); $data = [];
$data['snmp_address'] = __('Target IP').'&nbsp;&nbsp;'.html_print_input_text('ip_target', $snmp_address, '', 50, 255, true); $data['snmp_address'] = __('Target IP').'&nbsp;&nbsp;'.html_print_input_text('ip_target', $snmp_address, '', 50, 255, true);
$table->colspan[1]['snmp_address'] = 2; $table->colspan[1]['snmp_address'] = 2;
@ -144,12 +156,12 @@ function pandora_realtime_graphs () {
$table->data[] = $data; $table->data[] = $data;
$snmp_versions = array(); $snmp_versions = [];
$snmp_versions['1'] = '1'; $snmp_versions['1'] = '1';
$snmp_versions['2'] = '2'; $snmp_versions['2'] = '2';
$snmp_versions['2c'] = '2c'; $snmp_versions['2c'] = '2c';
$data = array(); $data = [];
$data['snmp_oid'] = __('OID').'&nbsp;&nbsp;'.html_print_input_text('snmp_oid', $snmp_oid, '', 100, 255, true); $data['snmp_oid'] = __('OID').'&nbsp;&nbsp;'.html_print_input_text('snmp_oid', $snmp_oid, '', 100, 255, true);
$table->colspan[2]['snmp_oid'] = 2; $table->colspan[2]['snmp_oid'] = 2;
@ -161,9 +173,10 @@ function pandora_realtime_graphs () {
// Hide some options in snmp_module graphs // Hide some options in snmp_module graphs
if ($graph == 'snmp_module') { if ($graph == 'snmp_module') {
$table->rowstyle[1] = "display: none;"; $table->rowstyle[1] = 'display: none;';
$table->rowstyle[2] = "display: none;"; $table->rowstyle[2] = 'display: none;';
} }
snmp_browser_print_container(false, '100%', '60%', 'none'); snmp_browser_print_container(false, '100%', '60%', 'none');
} }
@ -176,19 +189,19 @@ function pandora_realtime_graphs () {
echo '</form>'; echo '</form>';
// Define a custom action to save the OID selected in the SNMP browser to the form // Define a custom action to save the OID selected in the SNMP browser to the form
html_print_input_hidden ('custom_action', urlencode (base64_encode('&nbsp;<a href="javascript:realtimeGraphs.setOID();"><img src="' . ui_get_full_url("images") . '/input_filter.disabled.png" title="' . __("Use this OID") . '" style="vertical-align: middle;"></img></a>')), false); html_print_input_hidden('custom_action', urlencode(base64_encode('&nbsp;<a href="javascript:realtimeGraphs.setOID();"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" style="vertical-align: middle;"></img></a>')), false);
html_print_input_hidden('incremental_base', '0'); html_print_input_hidden('incremental_base', '0');
echo '<script type="text/javascript" src="'.ui_get_full_url("extensions/realtime_graphs/realtime_graphs.js").'"></script>'; echo '<script type="text/javascript" src="'.ui_get_full_url('extensions/realtime_graphs/realtime_graphs.js').'"></script>';
echo '<script type="text/javascript" src="'.ui_get_full_url("include/javascript/pandora_snmp_browser.js").'"></script>'; echo '<script type="text/javascript" src="'.ui_get_full_url('include/javascript/pandora_snmp_browser.js').'"></script>';
echo '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url("extensions/realtime_graphs/realtime_graphs.css").'"></style>'; echo '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url('extensions/realtime_graphs/realtime_graphs.css').'"></style>';
// Store servers timezone offset to be retrieved from js // Store servers timezone offset to be retrieved from js
set_js_value('timezone_offset', date('Z', time())); set_js_value('timezone_offset', date('Z', time()));
} }
extensions_add_operation_menu_option (__('Realtime graphs'), "estado", null, "v1r1","view");
extensions_add_operation_menu_option(__('Realtime graphs'), 'estado', null, 'v1r1', 'view');
extensions_add_main_function('pandora_realtime_graphs'); extensions_add_main_function('pandora_realtime_graphs');
$db = NULL; $db = null;
?>

View File

@ -4,17 +4,14 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2014 Artica Soluciones Tecnologicas // Copyright (c) 2005-2014 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
require_once '../../include/functions_html.php';
require_once ('../../include/functions_html.php');
$graph = $_POST['graph']; $graph = $_POST['graph'];
$graph_title = $_POST['graph_title']; $graph_title = $_POST['graph_title'];
@ -24,40 +21,52 @@ $os = strtolower(PHP_OS);
if (substr($os, 0, 3) === 'win') { if (substr($os, 0, 3) === 'win') {
$os = 'windows'; $os = 'windows';
} }
switch ($graph) { switch ($graph) {
case 'cpu_load': case 'cpu_load':
if ( $os == 'windows') if ($os == 'windows') {
$data = exec('wmic cpu get loadpercentage|find /I /V "Loadpercentage" | findstr /r "[0-9]" '); $data = exec('wmic cpu get loadpercentage|find /I /V "Loadpercentage" | findstr /r "[0-9]" ');
else } else {
$data = exec("top -bn 2 -d 0.01 | grep '^Cpu' | tail -n 1 | awk '{ print $2+$4+$6 }'"); $data = exec("top -bn 2 -d 0.01 | grep '^Cpu' | tail -n 1 | awk '{ print $2+$4+$6 }'");
}
break; break;
case 'pending_packets': case 'pending_packets':
$data = exec("ls /var/spool/pandora/data_in/*.data | wc -l"); $data = exec('ls /var/spool/pandora/data_in/*.data | wc -l');
break; break;
case 'disk_io_wait': case 'disk_io_wait':
if ( $os == 'windows') if ($os == 'windows') {
$data = exec("vmstat 1 3 | tail -1 | awk '{ print $16 }'"); $data = exec("vmstat 1 3 | tail -1 | awk '{ print $16 }'");
else } else {
$data = exec("vmstat 1 3 | tail -1 | awk '{ print $16 }'"); $data = exec("vmstat 1 3 | tail -1 | awk '{ print $16 }'");
}
break; break;
case 'mysql_load': case 'mysql_load':
if ( $os == 'windows') if ($os == 'windows') {
$data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(mysqld)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."'); $data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(mysqld)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."');
else } else {
$data = exec("ps aux | grep mysqld | grep -v safe | grep -v grep | awk '{ print $3 }'"); $data = exec("ps aux | grep mysqld | grep -v safe | grep -v grep | awk '{ print $3 }'");
}
break; break;
case 'apache_load': case 'apache_load':
if ( $os == 'windows') if ($os == 'windows') {
$data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(httpd)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."'); $data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(httpd)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."');
else } else {
$data = exec("ps aux | grep apache2 | grep -v safe | grep -v grep | awk '{ sum+=$3 } END { print sum }'"); $data = exec("ps aux | grep apache2 | grep -v safe | grep -v grep | awk '{ sum+=$3 } END { print sum }'");
}
break; break;
case 'server_load': case 'server_load':
if ( $os == 'windows') if ($os == 'windows') {
$data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(pandora_server)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."'); $data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(pandora_server)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."');
else } else {
$data = exec("ps aux | grep pandora_server | grep -v grep | awk '{ print $3 }'"); $data = exec("ps aux | grep pandora_server | grep -v grep | awk '{ print $3 }'");
}
break; break;
case 'snmp_interface': case 'snmp_interface':
case 'snmp_module': case 'snmp_module':
$snmp_address = $_POST['snmp_address']; $snmp_address = $_POST['snmp_address'];
@ -67,8 +76,7 @@ switch($graph) {
if (empty($snmp_address) || empty($snmp_oid)) { if (empty($snmp_address) || empty($snmp_oid)) {
$data = 0; $data = 0;
} } else {
else {
$data = get_snmpwalk($snmp_address, $snmp_ver, $snmp_community, '', '', '', '', '', '', 0, $snmp_oid); $data = get_snmpwalk($snmp_address, $snmp_ver, $snmp_community, '', '', '', '', '', '', 0, $snmp_oid);
$data_index = array_keys($data); $data_index = array_keys($data);
$graph_title = $data_index[0]; $graph_title = $data_index[0];
@ -77,18 +85,21 @@ switch($graph) {
if (count($data_array) > 1) { if (count($data_array) > 1) {
$data = $data_array[1]; $data = $data_array[1];
} }
// Redefine boolean data // Redefine boolean data
switch ($data) { switch ($data) {
case "up(1)": case 'up(1)':
$data = 1; $data = 1;
break; break;
case "down(0)":
case 'down(0)':
$data = 0; $data = 0;
break; break;
} }
} }
} }
break; break;
default: default:
$data = 0; $data = 0;
} }
@ -101,4 +112,3 @@ echo '{
"label": "'.$graph_title.'", "label": "'.$graph_title.'",
"data": [["'.time().'", '.$data.']] "data": [["'.time().'", '.$data.']]
}'; }';
?>

View File

@ -1,7 +1,9 @@
(function() { (function() {
var numberOfPoints = 100; var numberOfPoints = 100;
var refresh = parseInt($('#refresh').val()); var refresh = parseInt($("#refresh").val());
var incremental = $('#checkbox-incremental').is(':checked') || $('#hidden-incremental').val() == 1; var incremental =
$("#checkbox-incremental").is(":checked") ||
$("#hidden-incremental").val() == 1;
var lastIncVal = null; var lastIncVal = null;
var intervalRef = null; var intervalRef = null;
var currentXHR = null; var currentXHR = null;
@ -13,18 +15,24 @@
tickFormatter: function(timestamp, axis) { tickFormatter: function(timestamp, axis) {
var date = new Date(timestamp * 1000); var date = new Date(timestamp * 1000);
var server_timezone_offset = get_php_value('timezone_offset'); var server_timezone_offset = get_php_value("timezone_offset");
var local_timezone_offset = date.getTimezoneOffset() * 60 * -1; var local_timezone_offset = date.getTimezoneOffset() * 60 * -1;
if (server_timezone_offset != local_timezone_offset) { if (server_timezone_offset != local_timezone_offset) {
// If timezone of server and client is different, adjust the time to the server // If timezone of server and client is different, adjust the time to the server
date = new Date((timestamp + (server_timezone_offset - local_timezone_offset)) * 1000); date = new Date(
(timestamp + (server_timezone_offset - local_timezone_offset)) *
1000
);
} }
var hours = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()); var hours =
var minutes = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()); date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var seconds = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()); var minutes =
var formattedTime = hours + ':' + minutes + ':' + seconds; date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds =
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
var formattedTime = hours + ":" + minutes + ":" + seconds;
return formattedTime; return formattedTime;
} }
}, },
@ -39,11 +47,11 @@
fill: true fill: true
} }
}, },
colors: ['#6db431'] colors: ["#6db431"]
}; };
function updatePlot(data) { function updatePlot(data) {
plot = $.plot($('.graph'), data, plotOptions); plot = $.plot($(".graph"), data, plotOptions);
} }
function requestData() { function requestData() {
@ -54,12 +62,12 @@
type: "POST", type: "POST",
dataType: "json", dataType: "json",
data: { data: {
graph: $('#graph :selected').val(), graph: $("#graph :selected").val(),
graph_title: $('#graph :selected').html(), graph_title: $("#graph :selected").html(),
snmp_community: $('#text-snmp_community').val(), snmp_community: $("#text-snmp_community").val(),
snmp_oid: $('#text-snmp_oid').val(), snmp_oid: $("#text-snmp_oid").val(),
snmp_ver: $('#snmp_version :selected').val(), snmp_ver: $("#snmp_version :selected").val(),
snmp_address: $('#text-ip_target').val(), snmp_address: $("#text-ip_target").val(),
refresh: refresh refresh: refresh
}, },
success: function(serie) { success: function(serie) {
@ -125,32 +133,33 @@
// Set the form OID to the value selected in the SNMP browser // Set the form OID to the value selected in the SNMP browser
function setOID() { function setOID() {
if ($('#snmp_browser_version').val() == '3') { if ($("#snmp_browser_version").val() == "3") {
$('#text-snmp_oid').val($('#table1-0-1').text()); $("#text-snmp_oid").val($("#table1-0-1").text());
} else { } else {
$('#text-snmp_oid').val($('#snmp_selected_oid').text()); $("#text-snmp_oid").val($("#snmp_selected_oid").text());
} }
// Close the SNMP browser // Close the SNMP browser
$('.ui-dialog-titlebar-close').trigger('click'); $(".ui-dialog-titlebar-close").trigger("click");
} }
// Show the SNMP browser window // Show the SNMP browser window
function snmpBrowserWindow() { function snmpBrowserWindow() {
// Keep elements in the form and the SNMP browser synced // Keep elements in the form and the SNMP browser synced
$('#text-target_ip').val($('#text-ip_target').val()); $("#text-target_ip").val($("#text-ip_target").val());
$('#text-community').val($('#text-snmp_community').val()); $("#text-community").val($("#text-snmp_community").val());
$('#snmp_browser_version').val($('#snmp_version').val()); $("#snmp_browser_version").val($("#snmp_version").val());
$('#snmp3_browser_auth_user').val($('#snmp3_auth_user').val()); $("#snmp3_browser_auth_user").val($("#snmp3_auth_user").val());
$('#snmp3_browser_security_level').val($('#snmp3_security_level').val()); $("#snmp3_browser_security_level").val($("#snmp3_security_level").val());
$('#snmp3_browser_auth_method').val($('#snmp3_auth_method').val()); $("#snmp3_browser_auth_method").val($("#snmp3_auth_method").val());
$('#snmp3_browser_auth_pass').val($('#snmp3_auth_pass').val()); $("#snmp3_browser_auth_pass").val($("#snmp3_auth_pass").val());
$('#snmp3_browser_privacy_method').val($('#snmp3_privacy_method').val()); $("#snmp3_browser_privacy_method").val($("#snmp3_privacy_method").val());
$('#snmp3_browser_privacy_pass').val($('#snmp3_privacy_pass').val()); $("#snmp3_browser_privacy_pass").val($("#snmp3_privacy_pass").val());
$("#snmp_browser_container").show().dialog ({ $("#snmp_browser_container")
title: '', .show()
.dialog({
title: "",
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: true, modal: true,
@ -182,17 +191,17 @@
return +(Math.round(num + "e+2") + "e-2"); return +(Math.round(num + "e+2") + "e-2");
} }
$('#graph').change(function() { $("#graph").change(function() {
$('form#realgraph').submit(); $("form#realgraph").submit();
}); });
$('#refresh').change(function () { $("#refresh").change(function() {
refresh = parseInt($('#refresh').val()); refresh = parseInt($("#refresh").val());
resetDataPooling(); resetDataPooling();
}); });
$('#checkbox-incremental').change(function() { $("#checkbox-incremental").change(function() {
incremental = $('#checkbox-incremental').is(':checked'); incremental = $("#checkbox-incremental").is(":checked");
clearGraph(); clearGraph();
}); });
@ -205,6 +214,5 @@
clearGraph: clearGraph, clearGraph: clearGraph,
setOID: setOID, setOID: setOID,
snmpBrowserWindow: snmpBrowserWindow snmpBrowserWindow: snmpBrowserWindow
} };
})(); })();

View File

@ -4,57 +4,53 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
if (isset($_GET['get_ptr'])) { if (isset($_GET['get_ptr'])) {
if ($_GET['get_ptr'] == 1) { if ($_GET['get_ptr'] == 1) {
$ownDir = dirname(__FILE__).'/'; $ownDir = dirname(__FILE__).'/';
$ownDir = str_replace("\\", "/", $ownDir); $ownDir = str_replace('\\', '/', $ownDir);
// Don't start a session before this import. // Don't start a session before this import.
// The session is configured and started inside the config process. // The session is configured and started inside the config process.
require_once ($ownDir.'../include/config.php'); include_once $ownDir.'../include/config.php';
// Login check // Login check
if (!isset($_SESSION["id_usuario"])) { if (!isset($_SESSION['id_usuario'])) {
$config['id_user'] = null; $config['id_user'] = null;
} } else {
else { $config['id_user'] = $_SESSION['id_usuario'];
$config['id_user'] = $_SESSION["id_usuario"];
} }
if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_user'])) { if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit("ACL Violation", "Trying to access Setup Management"); db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
require ("general/noaccess.php"); include 'general/noaccess.php';
return; return;
} }
$hook_enterprise = enterprise_include('extensions/resource_exportation/functions.php'); $hook_enterprise = enterprise_include('extensions/resource_exportation/functions.php');
header("Content-type: binary"); header('Content-type: binary');
header("Content-Disposition: attachment; filename=\"".get_name_xml_resource($hook_enterprise)) . "\""; header('Content-Disposition: attachment; filename="'.get_name_xml_resource($hook_enterprise)).'"';
header("Pragma: no-cache"); header('Pragma: no-cache');
header("Expires: 0"); header('Expires: 0');
output_xml_resource($hook_enterprise); output_xml_resource($hook_enterprise);
} }
} } else {
else { extensions_add_godmode_menu_option(__('Resource exportation'), 'PM', 'gagente', '', 'v1r1');
extensions_add_godmode_menu_option (__('Resource exportation'), 'PM','gagente','', "v1r1");
extensions_add_godmode_function('resource_exportation_extension_main'); extensions_add_godmode_function('resource_exportation_extension_main');
} }
function output_xml_resource($hook_enterprise) {
function output_xml_resource($hook_enterprise)
{
global $config; global $config;
$type = get_parameter('type'); $type = get_parameter('type');
@ -64,9 +60,11 @@ function output_xml_resource($hook_enterprise) {
case 'report': case 'report':
output_xml_report($id); output_xml_report($id);
break; break;
case 'visual_console': case 'visual_console':
output_xml_visual_console($id); output_xml_visual_console($id);
break; break;
default: default:
if ($hook_enterprise === true) { if ($hook_enterprise === true) {
$include_agents = get_parameter('include_agents', 0); $include_agents = get_parameter('include_agents', 0);
@ -76,242 +74,302 @@ function output_xml_resource($hook_enterprise) {
} }
} }
function output_xml_report($id) {
function output_xml_report($id)
{
global $config; global $config;
require_once ($config['homedir'].'/include/functions_agents.php'); include_once $config['homedir'].'/include/functions_agents.php';
$report = db_get_row('treport', 'id_report', $id); $report = db_get_row('treport', 'id_report', $id);
echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n"; echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
echo "<report>\n"; echo "<report>\n";
echo "<name><![CDATA[" . io_safe_output($report['name']) . "]]></name>\n"; echo '<name><![CDATA['.io_safe_output($report['name'])."]]></name>\n";
if (isset($report['description'])) if (isset($report['description'])) {
echo "<description><![CDATA[" . io_safe_output($report['description']) . "]]></description>\n"; echo '<description><![CDATA['.io_safe_output($report['description'])."]]></description>\n";
}
$group = db_get_value('nombre', 'tgrupo', 'id_grupo', $report['id_group']); $group = db_get_value('nombre', 'tgrupo', 'id_grupo', $report['id_group']);
echo "<group><![CDATA[" . io_safe_output($group) . "]]></group>\n"; echo '<group><![CDATA['.io_safe_output($group)."]]></group>\n";
$items = db_get_all_rows_field_filter('treport_content', 'id_report', $report['id_report']); $items = db_get_all_rows_field_filter('treport_content', 'id_report', $report['id_report']);
foreach ($items as $item) { foreach ($items as $item) {
echo "<item>\n"; echo "<item>\n";
echo "<type>" . io_safe_output($item['type']) . "</type>\n"; echo '<type>'.io_safe_output($item['type'])."</type>\n";
echo "<description>" . io_safe_output($item['description']) . "</description>\n"; echo '<description>'.io_safe_output($item['description'])."</description>\n";
echo "<period>" . io_safe_output($item['period']) . "</period>\n"; echo '<period>'.io_safe_output($item['period'])."</period>\n";
if ($item['id_agent'] != 0) { if ($item['id_agent'] != 0) {
$agent = db_get_value ("alias","tagente","id_agente",$item['id_agent']); $agent = db_get_value('alias', 'tagente', 'id_agente', $item['id_agent']);
} }
if ($item['id_agent_module'] != 0) { if ($item['id_agent_module'] != 0) {
$module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $item['id_agent_module']); $module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $item['id_agent_module']);
$id_agent = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $item['id_agent_module']); $id_agent = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $item['id_agent_module']);
$agent = db_get_value ("alias","tagente","id_agente",$item['id_agent']); $agent = db_get_value('alias', 'tagente', 'id_agente', $item['id_agent']);
echo "<module><![CDATA[" . io_safe_output($module) . "]]></module>\n"; echo '<module><![CDATA['.io_safe_output($module)."]]></module>\n";
} }
if (isset($agent))
echo "<agent><![CDATA[" . $agent . "]]></agent>\n"; if (isset($agent)) {
echo '<agent><![CDATA['.$agent."]]></agent>\n";
}
$agent = null; $agent = null;
switch (io_safe_output($item['type'])) { switch (io_safe_output($item['type'])) {
case 1: case 1:
case 'simple_graph': case 'simple_graph':
break; break;
case 'simple_baseline_graph': case 'simple_baseline_graph':
break; break;
case 2: case 2:
case 'custom_graph': case 'custom_graph':
case 'automatic_custom_graph': case 'automatic_custom_graph':
$graph = db_get_value('name', 'tgraph', 'id_graph', $item['id_gs']); $graph = db_get_value('name', 'tgraph', 'id_graph', $item['id_gs']);
echo "<graph><![CDATA[" . io_safe_output($graph) . "]]></graph>\n"; echo '<graph><![CDATA['.io_safe_output($graph)."]]></graph>\n";
break; break;
case 3: case 3:
case 'SLA': case 'SLA':
echo "<only_display_wrong>" . $item['only_display_wrong'] . "</only_display_wrong>\n"; echo '<only_display_wrong>'.$item['only_display_wrong']."</only_display_wrong>\n";
echo "<monday>" . $item['monday'] . "</monday>\n"; echo '<monday>'.$item['monday']."</monday>\n";
echo "<tuesday>" . $item['tuesday'] . "</tuesday>\n"; echo '<tuesday>'.$item['tuesday']."</tuesday>\n";
echo "<wednesday>" . $item['wednesday'] . "</wednesday>\n"; echo '<wednesday>'.$item['wednesday']."</wednesday>\n";
echo "<thursday>" . $item['thursday'] . "</thursday>\n"; echo '<thursday>'.$item['thursday']."</thursday>\n";
echo "<friday>" . $item['friday'] . "</friday>\n"; echo '<friday>'.$item['friday']."</friday>\n";
echo "<saturday>" . $item['saturday'] . "</saturday>\n"; echo '<saturday>'.$item['saturday']."</saturday>\n";
echo "<sunday>" . $item['sunday'] . "</sunday>\n"; echo '<sunday>'.$item['sunday']."</sunday>\n";
echo "<time_from>" . $item['time_from'] . "</time_from>\n"; echo '<time_from>'.$item['time_from']."</time_from>\n";
echo "<time_to>" . $item['time_to'] . "</time_to>\n"; echo '<time_to>'.$item['time_to']."</time_to>\n";
$slas = db_get_all_rows_field_filter('treport_content_sla_combined', 'id_report_content', $item['id_rc']); $slas = db_get_all_rows_field_filter('treport_content_sla_combined', 'id_report_content', $item['id_rc']);
if ($slas === false) $slas = array(); if ($slas === false) {
$slas = [];
}
foreach ($slas as $sla) { foreach ($slas as $sla) {
$module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $sla['id_agent_module']); $module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $sla['id_agent_module']);
$id_agent = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $sla['id_agent_module']); $id_agent = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $sla['id_agent_module']);
$agent = db_get_value ("alias","tagente","id_agente",$item['id_agent']); $agent = db_get_value('alias', 'tagente', 'id_agente', $item['id_agent']);
echo "<sla>"; echo '<sla>';
echo "<agent><![CDATA[" . $agent . "]]></agent>\n"; echo '<agent><![CDATA['.$agent."]]></agent>\n";
echo "<module><![CDATA[" . io_safe_output($module) . "]]></module>\n"; echo '<module><![CDATA['.io_safe_output($module)."]]></module>\n";
echo "<sla_max>" . $sla['sla_max'] . "</sla_max>\n"; echo '<sla_max>'.$sla['sla_max']."</sla_max>\n";
echo "<sla_min>" . $sla['sla_min'] . "</sla_min>\n"; echo '<sla_min>'.$sla['sla_min']."</sla_min>\n";
echo "<sla_limit>" . $sla['sla_limit'] . "</sla_limit>\n"; echo '<sla_limit>'.$sla['sla_limit']."</sla_limit>\n";
echo "</sla>"; echo '</sla>';
} }
break; break;
case 6: case 6:
case 'monitor_report': case 'monitor_report':
break; break;
case 7: case 7:
case 'avg_value': case 'avg_value':
break; break;
case 8: case 8:
case 'max_value': case 'max_value':
break; break;
case 9: case 9:
case 'min_value': case 'min_value':
break; break;
case 10: case 10:
case 'sumatory': case 'sumatory':
break; break;
case 'agent_detailed_event': case 'agent_detailed_event':
case 'event_report_agent': case 'event_report_agent':
break; break;
case 'text': case 'text':
echo "<text><![CDATA[" . io_safe_output($item['text']) . "]]></text>\n"; echo '<text><![CDATA['.io_safe_output($item['text'])."]]></text>\n";
break; break;
case 'sql': case 'sql':
echo "<header_definition><![CDATA[" . io_safe_output($item['header_definition']) . "]]></header_definition>\n"; echo '<header_definition><![CDATA['.io_safe_output($item['header_definition'])."]]></header_definition>\n";
if (!empty($item['external_source'])) { if (!empty($item['external_source'])) {
echo "<sql><![CDATA[" . io_safe_output($item['external_source']) . "]]></sql>\n"; echo '<sql><![CDATA['.io_safe_output($item['external_source'])."]]></sql>\n";
} } else {
else {
$sql = db_get_value('sql', 'treport_custom_sql', 'id', $item['treport_custom_sql_id']); $sql = db_get_value('sql', 'treport_custom_sql', 'id', $item['treport_custom_sql_id']);
echo "<sql>" . io_safe_output($sql) . "</sql>\n"; echo '<sql>'.io_safe_output($sql)."</sql>\n";
} }
break; break;
case 'sql_graph_pie': case 'sql_graph_pie':
case 'sql_graph_vbar': case 'sql_graph_vbar':
case 'sql_graph_hbar': case 'sql_graph_hbar':
echo "<header_definition>" . io_safe_output($item['header_definition']) . "</header_definition>\n"; echo '<header_definition>'.io_safe_output($item['header_definition'])."</header_definition>\n";
if (!empty($item['external_source'])) { if (!empty($item['external_source'])) {
echo "<sql>" . io_safe_output($item['external_source']) . "</sql>\n"; echo '<sql>'.io_safe_output($item['external_source'])."</sql>\n";
} } else {
else {
$sql = db_get_value('sql', 'treport_custom_sql', 'id', $item['treport_custom_sql_id']); $sql = db_get_value('sql', 'treport_custom_sql', 'id', $item['treport_custom_sql_id']);
echo "<sql>" . io_safe_output($sql) . "</sql>\n"; echo '<sql>'.io_safe_output($sql)."</sql>\n";
} }
break; break;
case 'event_report_group': case 'event_report_group':
$group = db_get_value('nombre', 'tgrupo', 'id_grupo', $item['id_agent']); $group = db_get_value('nombre', 'tgrupo', 'id_grupo', $item['id_agent']);
echo "<group><![CDATA[" . io_safe_output($group) . "]]></group>\n"; echo '<group><![CDATA['.io_safe_output($group)."]]></group>\n";
break; break;
case 'event_report_module': case 'event_report_module':
break; break;
case 'alert_report_module': case 'alert_report_module':
break; break;
case 'alert_report_agent': case 'alert_report_agent':
break; break;
case 'alert_report_group': case 'alert_report_group':
break; break;
case 'url': case 'url':
echo "<url><![CDATA[" . io_safe_output($values["external_source"]) . "]]></url>"; echo '<url><![CDATA['.io_safe_output($values['external_source']).']]></url>';
break; break;
case 'database_serialized': case 'database_serialized':
echo "<header_definition><![CDATA[" . io_safe_output($item["header_definition"]) . "]]></header_definition>"; echo '<header_definition><![CDATA['.io_safe_output($item['header_definition']).']]></header_definition>';
echo "<line_separator><![CDATA[" . io_safe_output($item["line_separator"]) . "]]></line_separator>"; echo '<line_separator><![CDATA['.io_safe_output($item['line_separator']).']]></line_separator>';
echo "<column_separator><![CDATA[" . io_safe_output($item["header_definition"]) . "]]></column_separator>"; echo '<column_separator><![CDATA['.io_safe_output($item['header_definition']).']]></column_separator>';
break; break;
case 'TTRT': case 'TTRT':
break; break;
case 'TTO': case 'TTO':
break; break;
case 'MTBF': case 'MTBF':
break; break;
case 'MTTR': case 'MTTR':
break; break;
} }
echo "</item>\n"; echo "</item>\n";
} }
echo "</report>\n"; echo "</report>\n";
} }
function output_xml_visual_console($id) {
function output_xml_visual_console($id)
{
$visual_map = db_get_row('tlayout', 'id', $id); $visual_map = db_get_row('tlayout', 'id', $id);
echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n"; echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
echo "<visual_map>\n"; echo "<visual_map>\n";
echo "<name><![CDATA[" . io_safe_output($visual_map['name']) . "]]></name>\n"; echo '<name><![CDATA['.io_safe_output($visual_map['name'])."]]></name>\n";
if ($visual_map['id_group'] != 0) { if ($visual_map['id_group'] != 0) {
$group = db_get_value('nombre', 'tgrupo', 'id_grupo', $visual_map['id_group']); $group = db_get_value('nombre', 'tgrupo', 'id_grupo', $visual_map['id_group']);
echo "<group><![CDATA[" . io_safe_output($group) . "]]></group>\n"; echo '<group><![CDATA['.io_safe_output($group)."]]></group>\n";
} }
echo "<background><![CDATA[" . io_safe_output($visual_map['background']) . "]]></background>\n";
echo "<height>" . io_safe_output($visual_map['height']) . "</height>\n"; echo '<background><![CDATA['.io_safe_output($visual_map['background'])."]]></background>\n";
echo "<width>" . io_safe_output($visual_map['width']) . "</width>\n"; echo '<height>'.io_safe_output($visual_map['height'])."</height>\n";
echo '<width>'.io_safe_output($visual_map['width'])."</width>\n";
$items = db_get_all_rows_field_filter('tlayout_data', 'id_layout', $visual_map['id']); $items = db_get_all_rows_field_filter('tlayout_data', 'id_layout', $visual_map['id']);
if ($items === false) $items = array(); if ($items === false) {
$items = [];
}
foreach ($items as $item) { foreach ($items as $item) {
echo "<item>\n"; echo "<item>\n";
echo "<other_id>" . $item['id'] . "</other_id>\n"; //OLD ID USE FOR parent item echo '<other_id>'.$item['id']."</other_id>\n";
// OLD ID USE FOR parent item
$agent = ''; $agent = '';
if ($item['id_agent'] != 0) { if ($item['id_agent'] != 0) {
$agent = db_get_value ("nombre","tagente","id_agente",$item['id_agent']); $agent = db_get_value('nombre', 'tagente', 'id_agente', $item['id_agent']);
} }
if (!empty($item['label'])) { if (!empty($item['label'])) {
echo "<label><![CDATA[" . io_safe_output($item['label']) . "]]></label>\n"; echo '<label><![CDATA['.io_safe_output($item['label'])."]]></label>\n";
} }
echo "<x>" . $item['pos_x'] . "</x>\n";
echo "<y>" . $item['pos_y'] . "</y>\n"; echo '<x>'.$item['pos_x']."</x>\n";
echo "<type>" . $item['type'] . "</type>\n"; echo '<y>'.$item['pos_y']."</y>\n";
echo '<type>'.$item['type']."</type>\n";
if ($item['width'] != 0) { if ($item['width'] != 0) {
echo "<width>" . $item['width'] . "</width>\n"; echo '<width>'.$item['width']."</width>\n";
} }
if ($item['height'] != 0) { if ($item['height'] != 0) {
echo "<height>" . $item['height'] . "</height>\n"; echo '<height>'.$item['height']."</height>\n";
} }
if (!empty($item['image'])) { if (!empty($item['image'])) {
echo "<image>" . $item['image'] . "</image>\n"; echo '<image>'.$item['image']."</image>\n";
} }
if ($item['period'] != 0) { if ($item['period'] != 0) {
echo "<period>" . $item['period'] . "</period>\n"; echo '<period>'.$item['period']."</period>\n";
} }
if (isset($item['id_agente_modulo'])) { if (isset($item['id_agente_modulo'])) {
if ($item['id_agente_modulo'] != 0) { if ($item['id_agente_modulo'] != 0) {
$module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $item['id_agente_modulo']); $module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $item['id_agente_modulo']);
$id_agent = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $item['id_agente_modulo']); $id_agent = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $item['id_agente_modulo']);
$agent = db_get_value ("nombre","tagente","id_agente",$id_agent); $agent = db_get_value('nombre', 'tagente', 'id_agente', $id_agent);
echo "<module><![CDATA[" . io_safe_output($module) . "]]></module>\n"; echo '<module><![CDATA['.io_safe_output($module)."]]></module>\n";
} }
} }
if (!empty($agent)) { if (!empty($agent)) {
echo "<agent><![CDATA[" . $agent . "]]></agent>\n"; echo '<agent><![CDATA['.$agent."]]></agent>\n";
} }
if ($item['id_layout_linked'] != 0) { if ($item['id_layout_linked'] != 0) {
echo "<id_layout_linked>" . $item['id_layout_linked'] . "</id_layout_linked>\n"; echo '<id_layout_linked>'.$item['id_layout_linked']."</id_layout_linked>\n";
} }
if ($item['parent_item'] != 0) { if ($item['parent_item'] != 0) {
echo "<parent_item>" . $item['parent_item'] . "</parent_item>\n"; echo '<parent_item>'.$item['parent_item']."</parent_item>\n";
} }
if (!empty($item['clock_animation'])) { if (!empty($item['clock_animation'])) {
echo "<clock_animation>" . $item['clock_animation'] . "</clock_animation>\n"; echo '<clock_animation>'.$item['clock_animation']."</clock_animation>\n";
} }
if (!empty($item['fill_color'])) { if (!empty($item['fill_color'])) {
echo "<fill_color>" . $item['fill_color'] . "</fill_color>\n"; echo '<fill_color>'.$item['fill_color']."</fill_color>\n";
} }
if (!empty($item['type_graph'])) { if (!empty($item['type_graph'])) {
echo "<type_graph>" . $item['type_graph'] . "</type_graph>\n"; echo '<type_graph>'.$item['type_graph']."</type_graph>\n";
} }
if (!empty($item['time_format'])) { if (!empty($item['time_format'])) {
echo "<time_format>" . $item['time_format'] . "</time_format>\n"; echo '<time_format>'.$item['time_format']."</time_format>\n";
} }
if (!empty($item['timezone'])) { if (!empty($item['timezone'])) {
echo "<timezone>" . $item['timezone'] . "</timezone>\n"; echo '<timezone>'.$item['timezone']."</timezone>\n";
} }
if (!empty($item['border_width'])) { if (!empty($item['border_width'])) {
echo "<border_width>" . $item['border_width'] . "</border_width>\n"; echo '<border_width>'.$item['border_width']."</border_width>\n";
} }
if (!empty($item['border_color'])) { if (!empty($item['border_color'])) {
echo "<border_color>" . $item['border_color'] . "</border_color>\n"; echo '<border_color>'.$item['border_color']."</border_color>\n";
} }
echo "</item>\n"; echo "</item>\n";
} }
echo "</visual_map>\n"; echo "</visual_map>\n";
} }
function get_name_xml_resource($hook_enterprise) {
function get_name_xml_resource($hook_enterprise)
{
global $config; global $config;
$type = get_parameter('type'); $type = get_parameter('type');
@ -321,54 +379,59 @@ function get_name_xml_resource($hook_enterprise) {
case 'report': case 'report':
$name = db_get_value('name', 'treport', 'id_report', $id); $name = db_get_value('name', 'treport', 'id_report', $id);
break; break;
case 'visual_console': case 'visual_console':
$name = db_get_value('name', 'tlayout', 'id', $id); $name = db_get_value('name', 'tlayout', 'id', $id);
break; break;
default: default:
if ($hook_enterprise === true) if ($hook_enterprise === true) {
return enterprise_get_name_xml_resource($type, $id); return enterprise_get_name_xml_resource($type, $id);
}
break; break;
} }
$file = $name . ".ptr"; $file = $name.'.ptr';
return $file; return $file;
} }
function get_xml_resource() {
function get_xml_resource()
{
global $config; global $config;
$hook_enterprise = enterprise_include('extensions/resource_exportation/functions.php'); $hook_enterprise = enterprise_include('extensions/resource_exportation/functions.php');
} }
function resource_exportation_extension_main() {
function resource_exportation_extension_main()
{
global $config; global $config;
check_login(); check_login();
if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_user'])) { if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit("ACL Violation", "Trying to access Setup Management"); db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
require ("general/noaccess.php"); include 'general/noaccess.php';
return; return;
} }
$hook_enterprise = enterprise_include('extensions/resource_exportation/functions.php'); $hook_enterprise = enterprise_include('extensions/resource_exportation/functions.php');
ui_print_page_header (__('Resource exportation'), "images/extensions.png", false, "", true, "" ); ui_print_page_header(__('Resource exportation'), 'images/extensions.png', false, '', true, '');
echo "<div class=notify>"; echo '<div class=notify>';
echo __("This extension makes exportation of resource template more easy.") . echo __('This extension makes exportation of resource template more easy.').' '.__('You can export resource templates in .ptr format.');
" " . echo '</div>';
__("You can export resource templates in .ptr format.");
echo "</div>";
echo "<br /><br />"; echo '<br /><br />';
$table = null; $table = null;
$table->width = '100%'; $table->width = '100%';
$table->style[0] = 'width: 30%;'; $table->style[0] = 'width: 30%;';
$table->style[1] = 'width: 10%;'; $table->style[1] = 'width: 10%;';
$table->class = "databox filters"; $table->class = 'databox filters';
$table->data[0][0] = __('Report'); $table->data[0][0] = __('Report');
$table->data[0][1] = html_print_select_from_sql('SELECT id_report, name FROM treport', 'report', '', '', '', 0, true); $table->data[0][1] = html_print_select_from_sql('SELECT id_report, name FROM treport', 'report', '', '', '', 0, true);
$table->data[0][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', 'class="sub config"', true); $table->data[0][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', 'class="sub config"', true);
@ -376,8 +439,9 @@ function resource_exportation_extension_main() {
$table->data[1][1] = html_print_select_from_sql('SELECT id, name FROM tlayout', 'visual_console', '', '', '', 0, true); $table->data[1][1] = html_print_select_from_sql('SELECT id, name FROM tlayout', 'visual_console', '', '', '', 0, true);
$table->data[1][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', 'class="sub config"', true); $table->data[1][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', 'class="sub config"', true);
if ($hook_enterprise === true) if ($hook_enterprise === true) {
add_rows_for_enterprise($table->data); add_rows_for_enterprise($table->data);
}
html_print_table($table); html_print_table($table);
@ -402,4 +466,4 @@ function resource_exportation_extension_main() {
</script> </script>
<?php <?php
} }
?>

File diff suppressed because it is too large Load Diff

View File

@ -4,75 +4,75 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function users_extension_main()
function users_extension_main() { {
users_extension_main_god(false); users_extension_main_god(false);
} }
function users_extension_main_god ($god = true) {
function users_extension_main_god($god=true)
{
global $config; global $config;
if (isset($config["id_user"])) { if (isset($config['id_user'])) {
if (!check_acl ($config["id_user"], 0, "UM")) { if (!check_acl($config['id_user'], 0, 'UM')) {
return; return;
} }
} }
if ($god) { if ($god) {
$image = "images/gm_users.png"; $image = 'images/gm_users.png';
} } else {
else { $image = 'images/op_workspace.png';
$image = "images/op_workspace.png";
} }
// Header // Header
ui_print_page_header (__("Users connected"), $image, false, "", $god); ui_print_page_header(__('Users connected'), $image, false, '', $god);
// Get user conected last 5 minutes // Get user conected last 5 minutes
switch ($config["dbtype"]) { switch ($config['dbtype']) {
case "mysql": case 'mysql':
$sql = "SELECT id_user, last_connect $sql = 'SELECT id_user, last_connect
FROM tusuario FROM tusuario
WHERE last_connect > (UNIX_TIMESTAMP(NOW()) - " . SECONDS_5MINUTES . ") WHERE last_connect > (UNIX_TIMESTAMP(NOW()) - '.SECONDS_5MINUTES.')
ORDER BY last_connect DESC"; ORDER BY last_connect DESC';
break; break;
case "postgresql":
case 'postgresql':
$sql = "SELECT id_user, last_connect $sql = "SELECT id_user, last_connect
FROM tusuario FROM tusuario
WHERE last_connect > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - " . SECONDS_5MINUTES . ") WHERE last_connect > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_5MINUTES.')
ORDER BY last_connect DESC"; ORDER BY last_connect DESC';
break; break;
case "oracle":
case 'oracle':
$sql = "SELECT id_user, last_connect $sql = "SELECT id_user, last_connect
FROM tusuario FROM tusuario
WHERE last_connect > (ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (" . SECONDS_1DAY . ")) - " . SECONDS_5MINUTES . ") WHERE last_connect > (ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_5MINUTES.')
ORDER BY last_connect DESC"; ORDER BY last_connect DESC';
break; break;
} }
$rows = db_get_all_rows_sql($sql); $rows = db_get_all_rows_sql($sql);
if (empty($rows)) { if (empty($rows)) {
$rows = array (); $rows = [];
echo "<div class='nf'>".__('No other users connected')."</div>"; echo "<div class='nf'>".__('No other users connected').'</div>';
} } else {
else {
$table->cellpadding = 4; $table->cellpadding = 4;
$table->cellspacing = 4; $table->cellspacing = 4;
$table->width = '100%'; $table->width = '100%';
$table->class = "databox data"; $table->class = 'databox data';
$table->size = array (); $table->size = [];
$table->data = array (); $table->data = [];
$table->head = array (); $table->head = [];
$table->head[0] = __('User'); $table->head[0] = __('User');
$table->head[1] = __('IP'); $table->head[1] = __('IP');
@ -84,45 +84,58 @@ function users_extension_main_god ($god = true) {
// Get data // Get data
foreach ($rows as $row) { foreach ($rows as $row) {
// Get ip_origin of the last login of the user // Get ip_origin of the last login of the user
switch ($config["dbtype"]) { switch ($config['dbtype']) {
case "mysql": case 'mysql':
case "postgresql": case 'postgresql':
$ip_origin = db_get_value_sql(sprintf("SELECT ip_origen $ip_origin = db_get_value_sql(
sprintf(
"SELECT ip_origen
FROM tsesion FROM tsesion
WHERE id_usuario = '%s' WHERE id_usuario = '%s'
AND descripcion = '".io_safe_input('Logged in')."' AND descripcion = '".io_safe_input('Logged in')."'
ORDER BY fecha DESC",$row["id_user"])); ORDER BY fecha DESC",
$row['id_user']
)
);
break; break;
case "oracle":
$ip_origin = db_get_value_sql(sprintf("SELECT ip_origen case 'oracle':
$ip_origin = db_get_value_sql(
sprintf(
"SELECT ip_origen
FROM tsesion FROM tsesion
WHERE id_usuario = '%s' WHERE id_usuario = '%s'
AND to_char(descripcion) = '".io_safe_input('Logged in')."' AND to_char(descripcion) = '".io_safe_input('Logged in')."'
ORDER BY fecha DESC",$row["id_user"])); ORDER BY fecha DESC",
$row['id_user']
)
);
break; break;
} }
if ($rowPair) if ($rowPair) {
$table->rowclass[$iterator] = 'rowPair'; $table->rowclass[$iterator] = 'rowPair';
else } else {
$table->rowclass[$iterator] = 'rowOdd'; $table->rowclass[$iterator] = 'rowOdd';
}
$rowPair = !$rowPair; $rowPair = !$rowPair;
$iterator++; $iterator++;
$data = array (); $data = [];
$data[0] = '<a href="index.php?sec=gusuarios&amp;sec2=godmode/users/configure_user&amp;id='.$row["id_user"].'">'.$row["id_user"].'</a>'; $data[0] = '<a href="index.php?sec=gusuarios&amp;sec2=godmode/users/configure_user&amp;id='.$row['id_user'].'">'.$row['id_user'].'</a>';
$data[1] = $ip_origin; $data[1] = $ip_origin;
$data[2] = date($config["date_format"], $row['last_connect']); $data[2] = date($config['date_format'], $row['last_connect']);
array_push($table->data, $data); array_push($table->data, $data);
} }
html_print_table($table); html_print_table($table);
} }
} }
extensions_add_godmode_menu_option (__('Users connected'), 'UM','gusuarios',"users/icon.png", "v1r1");
extensions_add_operation_menu_option(__('Users connected'), 'workspace',"users/icon.png", "v1r1", '', "UM");
extensions_add_godmode_menu_option(__('Users connected'), 'UM', 'gusuarios', 'users/icon.png', 'v1r1');
extensions_add_operation_menu_option(__('Users connected'), 'workspace', 'users/icon.png', 'v1r1', '', 'UM');
extensions_add_godmode_function('users_extension_main_god'); extensions_add_godmode_function('users_extension_main_god');
extensions_add_main_function('users_extension_main'); extensions_add_main_function('users_extension_main');
?>

View File

@ -15,7 +15,6 @@ $(document).ready(function(){
// ============================================ // ============================================
// Copyright (c) 2010 Artica Soluciones Tecnologicas, http://www.artica.es // Copyright (c) 2010 Artica Soluciones Tecnologicas, http://www.artica.es
// Please see http://pandora.sourceforge.net for full contribution list // Please see http://pandora.sourceforge.net for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2. // as published by the Free Software Foundation for version 2.
@ -23,13 +22,12 @@ $(document).ready(function(){
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
if (! check_acl($config['id_user'], 0, 'PM')) { if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit("ACL Violation", "Trying to change License settings"); db_pandora_audit('ACL Violation', 'Trying to change License settings');
include ("general/noaccess.php"); include 'general/noaccess.php';
return; return;
} }
@ -39,8 +37,9 @@ if ($update_settings) {
foreach ($_POST['keys'] as $key => $value) { foreach ($_POST['keys'] as $key => $value) {
db_process_sql_update( db_process_sql_update(
'tupdate_settings', 'tupdate_settings',
array(db_escape_key_identifier('value') => $value), [db_escape_key_identifier('value') => $value],
array(db_escape_key_identifier('key') => $key)); [db_escape_key_identifier('key') => $key]
);
} }
ui_print_success_message(__('License updated')); ui_print_success_message(__('License updated'));
@ -58,181 +57,231 @@ foreach ($rows as $row) {
} }
echo '<script type="text/javascript">'; echo '<script type="text/javascript">';
if (enterprise_installed()) if (enterprise_installed()) {
print_js_var_enteprise(); print_js_var_enteprise();
}
echo '</script>'; echo '</script>';
function render_info ($table) {
function render_info($table)
{
global $console_mode; global $console_mode;
$info = db_get_sql("SELECT COUNT(*) FROM $table"); $info = db_get_sql("SELECT COUNT(*) FROM $table");
render_row($info, "DB Table $table"); render_row($info, "DB Table $table");
} }
function render_info_data ($query, $label) {
function render_info_data($query, $label)
{
global $console_mode; global $console_mode;
$info = db_get_sql($query); $info = db_get_sql($query);
render_row($info, $label); render_row($info, $label);
} }
function render_row ($data, $label) {
function render_row($data, $label)
{
global $console_mode; global $console_mode;
if ($console_mode == 1) { if ($console_mode == 1) {
echo $label; echo $label;
echo "|"; echo '|';
echo $data; echo $data;
echo "\n"; echo "\n";
} } else {
else { echo '<tr>';
echo "<tr>";
echo "<td style='padding:2px;border:0px;' width='60%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>".$label; echo "<td style='padding:2px;border:0px;' width='60%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>".$label;
echo "</div></td>"; echo '</div></td>';
echo "<td style='font-weight:bold;padding:2px;border:0px;' width='40%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>".$data; echo "<td style='font-weight:bold;padding:2px;border:0px;' width='40%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>".$data;
echo "</div></td>"; echo '</div></td>';
echo "</tr>"; echo '</tr>';
} }
} }
function get_value_sum($arr){
function get_value_sum($arr)
{
foreach ($arr as $clave) { foreach ($arr as $clave) {
foreach ($clave as $valor) { foreach ($clave as $valor) {
$result += $valor; $result += $valor;
} }
} }
return $result; return $result;
} }
function execution_time(){
$times = db_get_all_rows_sql("SELECT datos FROM tagente_datos WHERE id_agente_modulo = 29 ORDER BY utimestamp DESC LIMIT 2"); function execution_time()
if($times[0]['datos'] > $times[1]['datos'] * 1.2) {
$times = db_get_all_rows_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = 29 ORDER BY utimestamp DESC LIMIT 2');
if ($times[0]['datos'] > ($times[1]['datos'] * 1.2)) {
return "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph</a>"; return "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph</a>";
else } else {
return "<a style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The execution time is correct. For a more extensive information of this data consult the Execution Time graph</a>"; return "<a style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The execution time is correct. For a more extensive information of this data consult the Execution Time graph</a>";
} }
}
function get_logs_size($file){ function get_logs_size($file)
{
$file_name = '/var'.$file.''; $file_name = '/var'.$file.'';
$size_server_log = filesize($file_name); $size_server_log = filesize($file_name);
return $size_server_log; return $size_server_log;
} }
function get_status_logs($path){
$status_server_log = ""; function get_status_logs($path)
{
$status_server_log = '';
$size_server_log = get_logs_size($path); $size_server_log = get_logs_size($path);
if ($size_server_log <= 10240) { if ($size_server_log <= 10240) {
$status_server_log = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have less than 10 MB of logs</a>"; $status_server_log = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have less than 10 MB of logs</a>";
} else { } else {
$status_server_log = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have more than 10 MB of logs</a>"; $status_server_log = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have more than 10 MB of logs</a>";
} }
return $status_server_log; return $status_server_log;
} }
function percentage_modules_per_agent(){
$status_average_modules = "";
function percentage_modules_per_agent()
{
$status_average_modules = '';
$total_agents = db_get_value_sql('SELECT count(*) FROM tagente'); $total_agents = db_get_value_sql('SELECT count(*) FROM tagente');
$total_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo'); $total_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo');
$average_modules_per_agent = $total_modules / $total_agents; $average_modules_per_agent = ($total_modules / $total_agents);
if ($average_modules_per_agent <= 40) { if ($average_modules_per_agent <= 40) {
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The average of modules per agent is less than 40 percent</a>"; $status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The average of modules per agent is less than 40 percent</a>";
} else { } else {
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbspThe average of modules per agent is more than 40 percent. You can have performance problems</a>"; $status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbspThe average of modules per agent is more than 40 percent. You can have performance problems</a>";
} }
return $status_average_modules; return $status_average_modules;
} }
function license_capacity(){
function license_capacity()
{
$license = enterprise_hook('license_get_info'); $license = enterprise_hook('license_get_info');
$license_limit = $license['limit']; $license_limit = $license['limit'];
$status_license_capacity = ""; $status_license_capacity = '';
$current_count = db_get_value_sql('SELECT count(*) FROM tagente'); $current_count = db_get_value_sql('SELECT count(*) FROM tagente');
if ($current_count > $license_limit * 90 /100){ if ($current_count > ($license_limit * 90 / 100)) {
$status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is more than 90 percent</a>"; $status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is more than 90 percent</a>";
} else { } else {
$status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is less than 90 percent</a>"; $status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is less than 90 percent</a>";
} }
return $status_license_capacity; return $status_license_capacity;
} }
function status_license_params($license_param){
$status_license_par =""; function status_license_params($license_param)
if ($license_param <=0) {
$status_license_par = "OFF"; $status_license_par = '';
else if ($license_param <= 0) {
$status_license_par = "ON"; $status_license_par = 'OFF';
} else {
$status_license_par = 'ON';
}
return $status_license_par; return $status_license_par;
} }
function interval_average_of_network_modules(){
$total_network_modules = db_get_value_sql ("SELECT count(*) FROM tagente_modulo WHERE id_tipo_modulo BETWEEN 6 AND 18");
$total_module_interval_time = db_get_value_sql ("SELECT SUM(module_interval) FROM tagente_modulo WHERE id_tipo_modulo BETWEEN 6 AND 18"); function interval_average_of_network_modules()
$average_time= (int) $total_module_interval_time / $total_network_modules; {
$total_network_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo WHERE id_tipo_modulo BETWEEN 6 AND 18');
$total_module_interval_time = db_get_value_sql('SELECT SUM(module_interval) FROM tagente_modulo WHERE id_tipo_modulo BETWEEN 6 AND 18');
$average_time = ((int) $total_module_interval_time / $total_network_modules);
if ($average_time < 180) { if ($average_time < 180) {
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has a lot of load and a very fine configuration is required</a>"; $status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has a lot of load and a very fine configuration is required</a>";
} else { } else {
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has an acceptable charge</a>"; $status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has an acceptable charge</a>";
} }
if ($average_time == 0)
if ($average_time == 0) {
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has no load</a>"; $status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has no load</a>";
}
return $status_average_modules; return $status_average_modules;
} }
$attachment_total_files = count(glob($config['homedir']."/attachment/{*.*}",GLOB_BRACE));
function files_attachment_folder($total_files){ $attachment_total_files = count(glob($config['homedir'].'/attachment/{*.*}', GLOB_BRACE));
function files_attachment_folder($total_files)
{
if ($total_files <= 700) { if ($total_files <= 700) {
$status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has less than 700 files.</a>"; $status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has less than 700 files.</a>";
} else { } else {
$status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has more than 700 files.</a>"; $status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has more than 700 files.</a>";
} }
return $status_total_files; return $status_total_files;
} }
$tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos'); $tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos');
function status_tagente_datos($tagente_datos_size){
function status_tagente_datos($tagente_datos_size)
{
if ($tagente_datos_size <= 3000000) { if ($tagente_datos_size <= 3000000) {
$tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The tagente_datos table has an acceptable amount of data.</a>"; $tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The tagente_datos table has an acceptable amount of data.</a>";
} else { } else {
$tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>&nbsp&nbsp The tagente_datos table has too much data. A historical database is recommended.</a>"; $tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>&nbsp&nbsp The tagente_datos table has too much data. A historical database is recommended.</a>";
} }
return $tagente_datos_size; return $tagente_datos_size;
} }
function status_values($val_rec, $val){
if ($val_rec <= $val) function status_values($val_rec, $val)
return $val . "<a style='text-decoration: none;'> (Min. Recommended Value </a>" . $val_rec. "<a>)</a>"; {
else if ($val_rec <= $val) {
return $val."<a style='text-decoration: none;'> (Min. Recommended Value </a>".$val_rec.'<a>)</a>';
} else {
return $val."<a style='text-decoration: none;'> (Min. Recommended Value </a>".$val_rec."<a>)</a><a class= 'content' style ='color: red;text-decoration: none;'> Warning Status</a>"; return $val."<a style='text-decoration: none;'> (Min. Recommended Value </a>".$val_rec."<a>)</a><a class= 'content' style ='color: red;text-decoration: none;'> Warning Status</a>";
} }
}
$tables_fragmentation=db_get_sql ("SELECT (data_free/(index_length+data_length))
as frag_ratio from information_schema.tables where DATA_FREE > 0 and table_name='tagente_datos' and table_schema='pandora'"); $tables_fragmentation = db_get_sql(
$db_size=db_get_all_rows_sql("SELECT table_schema, "SELECT (data_free/(index_length+data_length))
as frag_ratio from information_schema.tables where DATA_FREE > 0 and table_name='tagente_datos' and table_schema='pandora'"
);
$db_size = db_get_all_rows_sql(
'SELECT table_schema,
ROUND(SUM(data_length+index_length)/1024/1024,3) ROUND(SUM(data_length+index_length)/1024/1024,3)
FROM information_schema.TABLES FROM information_schema.TABLES
GROUP BY table_schema;" GROUP BY table_schema;'
); );
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
$total_server_threads = shell_exec("ps -T aux | grep pandora_server | grep -v grep | wc -l"); $total_server_threads = shell_exec('ps -T aux | grep pandora_server | grep -v grep | wc -l');
$percentage_threads_ram = shell_exec("ps axo pmem,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'"); $percentage_threads_ram = shell_exec("ps axo pmem,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'");
$percentage_threads_cpu = shell_exec("ps axo pcpu,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'"); $percentage_threads_cpu = shell_exec("ps axo pcpu,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'");
$innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'"); $innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'");
} }
$path_server_logs ="/log/pandora/pandora_server.log";
$path_console_logs ="/www/html/pandora_console/pandora_console.log"; $path_server_logs = '/log/pandora/pandora_server.log';
$innodb_log_file_size_min_rec_value = "64M"; $path_console_logs = '/www/html/pandora_console/pandora_console.log';
$innodb_log_buffer_size_min_rec_value = "16M"; $innodb_log_file_size_min_rec_value = '64M';
$innodb_log_buffer_size_min_rec_value = '16M';
$innodb_flush_log_at_trx_commit_min_rec_value = 0; $innodb_flush_log_at_trx_commit_min_rec_value = 0;
$query_cache_limit_min_rec_value = 2; $query_cache_limit_min_rec_value = 2;
$max_allowed_packet_min_rec_value = 32; $max_allowed_packet_min_rec_value = 32;
$innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'"); $innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'");
$sort_buffer_size_min_rec_value = 32; $sort_buffer_size_min_rec_value = 32;
$join_buffer_size_min_rec_value = 265; $join_buffer_size_min_rec_value = 265;
$query_cache_type_min_rec_value = "ON"; $query_cache_type_min_rec_value = 'ON';
$query_cache_size_min_rec_value = 24; $query_cache_size_min_rec_value = 24;
$innodb_lock_wait_timeout_max_rec_value = 120; $innodb_lock_wait_timeout_max_rec_value = 120;
$tables_fragmentation_max_rec_value = 10; $tables_fragmentation_max_rec_value = 10;
@ -245,23 +294,29 @@ $read_rnd_buffer_size_min_rec_value = 32;
$query_cache_min_res_unit_min_rec_value = 2; $query_cache_min_res_unit_min_rec_value = 2;
$innodb_file_per_table_min_rec_value = 0; $innodb_file_per_table_min_rec_value = 0;
function status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation){
$status_tables_frag = ""; function status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation)
if($tables_fragmentation > $tables_fragmentation_max_rec_value) {
$status_tables_frag = '';
if ($tables_fragmentation > $tables_fragmentation_max_rec_value) {
$status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is higher than recommended. You should defragment them.</a>"; $status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is higher than recommended. You should defragment them.</a>";
else } else {
$status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is correct.</a>"; $status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is correct.</a>";
}
return $status_tables_frag; return $status_tables_frag;
} }
$console_mode = 1; $console_mode = 1;
if (!isset($argc)) if (!isset($argc)) {
$console_mode = 0; $console_mode = 0;
}
if ($console_mode == 1) { if ($console_mode == 1) {
echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n"; echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n";
if ($argc == 1 || in_array($argv[1], array('--help', '-help', '-h', '-?'))) { if ($argc == 1 || in_array($argv[1], ['--help', '-help', '-h', '-?'])) {
echo "\nThis command line script gives information about Pandora FMS database. echo "\nThis command line script gives information about Pandora FMS database.
This program only can be executed from console, and need a parameter, the This program only can be executed from console, and need a parameter, the
full path to Pandora FMS 'config.php' file. full path to Pandora FMS 'config.php' file.
@ -275,108 +330,132 @@ full path to Pandora FMS 'config.php' file.
"; ";
exit; exit;
} }
if (preg_match('/[^a-zA-Z0-9_\/\.]|(\/\/)|(\.\.)/', $argv[1])) { if (preg_match('/[^a-zA-Z0-9_\/\.]|(\/\/)|(\.\.)/', $argv[1])) {
echo "Invalid path: $argv[1]. Always use absolute paths."; echo "Invalid path: $argv[1]. Always use absolute paths.";
exit; exit;
} }
include $argv[1]."/include/config.php";
include $argv[1].'/include/config.php';
} else {
if (file_exists('../include/config.php')) {
include '../include/config.php';
} }
else {
if (file_exists("../include/config.php"))
include "../include/config.php";
// Not from console, this is a web session // Not from console, this is a web session
if ((!isset($config["id_user"])) OR (!check_acl ($config["id_user"], 0, "PM"))) { if ((!isset($config['id_user'])) or (!check_acl($config['id_user'], 0, 'PM'))) {
echo "<h2>You don't have privileges to use diagnostic tool</h2>"; echo "<h2>You don't have privileges to use diagnostic tool</h2>";
echo "<p>Please login with an administrator account before try to use this tool</p>"; echo '<p>Please login with an administrator account before try to use this tool</p>';
exit; exit;
} }
// Header // Header
ui_print_page_header (__('Pandora FMS Diagnostic tool'), "", false, "", true); ui_print_page_header(__('Pandora FMS Diagnostic tool'), '', false, '', true);
echo "<table width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>"; echo "<table width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Pandora status info")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Pandora status info').'</th></tr>';
} }
render_row ($build_version, "Pandora FMS Build"); render_row($build_version, 'Pandora FMS Build');
render_row ($pandora_version, "Pandora FMS Version"); render_row($pandora_version, 'Pandora FMS Version');
render_info_data ("SELECT value FROM tconfig where token ='MR'","Minor Release"); render_info_data("SELECT value FROM tconfig where token ='MR'", 'Minor Release');
render_row ($config["homedir"], "Homedir"); render_row($config['homedir'], 'Homedir');
render_row ($config["homeurl"], "HomeUrl"); render_row($config['homeurl'], 'HomeUrl');
render_info_data ("SELECT `value` render_info_data(
"SELECT `value`
FROM tconfig FROM tconfig
WHERE `token` = 'enterprise_installed'", "Enterprise installed"); WHERE `token` = 'enterprise_installed'",
'Enterprise installed'
);
$full_key = db_get_sql("SELECT value $full_key = db_get_sql(
"SELECT value
FROM tupdate_settings FROM tupdate_settings
WHERE `key` = 'customer_key'"); WHERE `key` = 'customer_key'"
);
$compressed_key = substr($full_key, 0, 5).'...'.substr($full_key, -5); $compressed_key = substr($full_key, 0, 5).'...'.substr($full_key, -5);
render_row ($compressed_key,"Update Key"); render_row($compressed_key, 'Update Key');
render_info_data ("SELECT value render_info_data(
"SELECT value
FROM tupdate_settings FROM tupdate_settings
WHERE `key` = 'updating_code_path'", "Updating code path"); WHERE `key` = 'updating_code_path'",
'Updating code path'
);
render_info_data ("SELECT value render_info_data(
"SELECT value
FROM tupdate_settings FROM tupdate_settings
WHERE `key` = 'current_update'", "Current Update #"); WHERE `key` = 'current_update'",
'Current Update #'
);
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("PHP setup")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('PHP setup').'</th></tr>';
render_row (phpversion(), "PHP Version"); render_row(phpversion(), 'PHP Version');
render_row (ini_get('max_execution_time')."&nbspseconds", "PHP Max execution time"); render_row(ini_get('max_execution_time').'&nbspseconds', 'PHP Max execution time');
render_row (ini_get('max_input_time')."&nbspseconds", "PHP Max input time"); render_row(ini_get('max_input_time').'&nbspseconds', 'PHP Max input time');
render_row (ini_get('memory_limit'), "PHP Memory limit"); render_row(ini_get('memory_limit'), 'PHP Memory limit');
render_row (ini_get('session.cookie_lifetime'), "Session cookie lifetime"); render_row(ini_get('session.cookie_lifetime'), 'Session cookie lifetime');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Database size stats")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Database size stats').'</th></tr>';
render_info_data ("SELECT COUNT(*) FROM tagente","Total agents"); render_info_data('SELECT COUNT(*) FROM tagente', 'Total agents');
render_info_data ("SELECT COUNT(*) FROM tagente_modulo","Total modules"); render_info_data('SELECT COUNT(*) FROM tagente_modulo', 'Total modules');
render_info_data ("SELECT COUNT(*) FROM tgrupo","Total groups"); render_info_data('SELECT COUNT(*) FROM tgrupo', 'Total groups');
render_info_data ("SELECT COUNT(*) FROM tagente_datos","Total module data records"); render_info_data('SELECT COUNT(*) FROM tagente_datos', 'Total module data records');
// render_info_data ("SELECT COUNT(*) FROM tagente_datos_string","Total module string data records"); // render_info_data ("SELECT COUNT(*) FROM tagente_datos_string","Total module string data records");
// render_info_data ("SELECT COUNT(*) FROM tagente_datos_log4x","Total module log4x data records"); // render_info_data ("SELECT COUNT(*) FROM tagente_datos_log4x","Total module log4x data records");
render_info_data ("SELECT COUNT(*) FROM tagent_access","Total agent access record"); render_info_data('SELECT COUNT(*) FROM tagent_access', 'Total agent access record');
// render_info ("tagente_estado"); // render_info ("tagente_estado");
// render_info ("talert_template_modules"); // render_info ("talert_template_modules");
render_info_data ("SELECT COUNT(*) FROM tevento","Total events"); render_info_data('SELECT COUNT(*) FROM tevento', 'Total events');
if($config['enterprise_installed']) if ($config['enterprise_installed']) {
render_info_data ("SELECT COUNT(*) FROM ttrap","Total traps"); render_info_data('SELECT COUNT(*) FROM ttrap', 'Total traps');
render_info_data ("SELECT COUNT(*) FROM tusuario","Total users"); }
render_info_data ("SELECT COUNT(*) FROM tsesion","Total sessions");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Database sanity")."</th></tr>"; render_info_data('SELECT COUNT(*) FROM tusuario', 'Total users');
render_info_data('SELECT COUNT(*) FROM tsesion', 'Total sessions');
render_info_data ("SELECT COUNT( DISTINCT tagente.id_agente) echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Database sanity').'</th></tr>';
render_info_data(
'SELECT COUNT( DISTINCT tagente.id_agente)
FROM tagente_estado, tagente, tagente_modulo FROM tagente_estado, tagente, tagente_modulo
WHERE tagente.disabled = 0 WHERE tagente.disabled = 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
AND tagente_modulo.disabled = 0 AND tagente_modulo.disabled = 0
AND tagente_estado.id_agente = tagente.id_agente AND tagente_estado.id_agente = tagente.id_agente
AND tagente_estado.estado = 3","Total unknown agents"); AND tagente_estado.estado = 3',
'Total unknown agents'
);
render_info_data ("SELECT COUNT(tagente_estado.estado) render_info_data(
'SELECT COUNT(tagente_estado.estado)
FROM tagente_estado FROM tagente_estado
WHERE tagente_estado.estado = 4","Total not-init modules"); WHERE tagente_estado.estado = 4',
'Total not-init modules'
);
$last_run_difference = ''; $last_run_difference = '';
$diferencia = time() - date ( $diferencia = (time() - date(
db_get_sql ("SELECT `value` db_get_sql(
"SELECT `value`
FROM tconfig FROM tconfig
WHERE `token` = 'db_maintance'")); WHERE `token` = 'db_maintance'"
)
));
$last_run_difference_months = 0; $last_run_difference_months = 0;
$last_run_difference_weeks = 0; $last_run_difference_weeks = 0;
@ -433,31 +512,46 @@ if ($last_run_difference_minutes > 0) {
$last_run_difference .= $last_run_difference_seconds.' second/s ago'; $last_run_difference .= $last_run_difference_seconds.' second/s ago';
render_row ( date ("Y/m/d H:i:s", render_row(
db_get_sql ("SELECT `value` date(
'Y/m/d H:i:s',
db_get_sql(
"SELECT `value`
FROM tconfig FROM tconfig
WHERE `token` = 'db_maintance'")).' ('.$last_run_difference.')'.' *', "PandoraDB Last run"); WHERE `token` = 'db_maintance'"
)
).' ('.$last_run_difference.')'.' *',
'PandoraDB Last run'
);
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Database status info")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Database status info').'</th></tr>';
switch ($config["dbtype"]) { switch ($config['dbtype']) {
case "mysql": case 'mysql':
render_info_data ("SELECT `value` render_info_data(
"SELECT `value`
FROM tconfig FROM tconfig
WHERE `token` = 'db_scheme_first_version'", "DB Schema Version (first installed)"); WHERE `token` = 'db_scheme_first_version'",
render_info_data ("SELECT `value` 'DB Schema Version (first installed)'
);
render_info_data(
"SELECT `value`
FROM tconfig FROM tconfig
WHERE `token` = 'db_scheme_version'", "DB Schema Version (actual)"); WHERE `token` = 'db_scheme_version'",
render_info_data ("SELECT `value` 'DB Schema Version (actual)'
);
render_info_data(
"SELECT `value`
FROM tconfig FROM tconfig
WHERE `token` = 'db_scheme_build'", "DB Schema Build"); WHERE `token` = 'db_scheme_build'",
'DB Schema Build'
);
render_row(get_value_sum($db_size) . "M", "DB Size"); render_row(get_value_sum($db_size).'M', 'DB Size');
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('System info').'</th></tr>';
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("System info")."</th></tr>";
$output = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"'; $output = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"';
$output2 = 'cat /proc/cpuinfo | grep "processor" | wc -l'; $output2 = 'cat /proc/cpuinfo | grep "processor" | wc -l';
@ -467,79 +561,125 @@ switch ($config["dbtype"]) {
$output = 'cat /proc/meminfo | grep "MemTotal"'; $output = 'cat /proc/meminfo | grep "MemTotal"';
render_row(exec($output), 'RAM'); render_row(exec($output), 'RAM');
}
break;
case 'postgresql':
render_info_data(
"SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'db_scheme_version'",
'DB Schema Version'
);
render_info_data(
"SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'db_scheme_build'",
'DB Schema Build'
);
render_info_data(
"SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'enterprise_installed'",
'Enterprise installed'
);
render_row(
date(
'Y/m/d H:i:s',
db_get_sql(
"SELECT \"value\"
FROM tconfig WHERE \"token\" = 'db_maintance'"
)
),
'PandoraDB Last run'
);
render_info_data(
"SELECT value
FROM tupdate_settings
WHERE \"key\" = 'customer_key';",
'Update Key'
);
render_info_data(
"SELECT value
FROM tupdate_settings
WHERE \"key\" = 'updating_code_path'",
'Updating code path'
);
render_info_data(
"SELECT value
FROM tupdate_settings
WHERE \"key\" = 'current_update'",
'Current Update #'
);
break;
case 'oracle':
render_info_data(
"SELECT value
FROM tconfig
WHERE token = 'db_scheme_version'",
'DB Schema Version'
);
render_info_data(
"SELECT value
FROM tconfig
WHERE token = 'db_scheme_build'",
'DB Schema Build'
);
render_info_data(
"SELECT value
FROM tconfig
WHERE token = 'enterprise_installed'",
'Enterprise installed'
);
render_row(
db_get_sql(
"SELECT value
FROM tconfig
WHERE token = 'db_maintance'"
),
'PandoraDB Last run'
);
render_info_data(
'SELECT '.db_escape_key_identifier('value')." FROM tupdate_settings
WHERE \"key\" = 'customer_key'",
'Update Key'
);
render_info_data(
'SELECT '.db_escape_key_identifier('value')." FROM tupdate_settings
WHERE \"key\" = 'updating_code_path'",
'Updating code path'
);
render_info_data(
'SELECT '.db_escape_key_identifier('value')." FROM tupdate_settings
WHERE \"key\" = 'current_update'",
'Current Update #'
);
break;
} }
break; $innodb_log_file_size = (db_get_value_sql('SELECT @@innodb_log_file_size') / 1048576);
case "postgresql": $innodb_log_buffer_size = (db_get_value_sql('SELECT @@innodb_log_buffer_size') / 1048576);
render_info_data ("SELECT \"value\" $innodb_flush_log_at_trx_commit = db_get_value_sql('SELECT @@innodb_flush_log_at_trx_commit');
FROM tconfig $max_allowed_packet = (db_get_value_sql('SELECT @@max_allowed_packet') / 1048576);
WHERE \"token\" = 'db_scheme_version'", "DB Schema Version"); $innodb_buffer_pool_size = (db_get_value_sql('SELECT @@innodb_buffer_pool_size') / 1024);
render_info_data ("SELECT \"value\" $sort_buffer_size = number_format((db_get_value_sql('SELECT @@sort_buffer_size') / 1024), 2);
FROM tconfig $join_buffer_size = (db_get_value_sql('SELECT @@join_buffer_size') / 1024);
WHERE \"token\" = 'db_scheme_build'", "DB Schema Build"); $query_cache_type = db_get_value_sql('SELECT @@query_cache_type');
render_info_data ("SELECT \"value\" $query_cache_size = (db_get_value_sql('SELECT @@query_cache_size') / 1048576);
FROM tconfig $query_cache_limit = (db_get_value_sql('SELECT @@query_cache_limit') / 1048576);
WHERE \"token\" = 'enterprise_installed'", "Enterprise installed"); $innodb_lock_wait_timeout = db_get_value_sql('SELECT @@innodb_lock_wait_timeout');
render_row ( date ("Y/m/d H:i:s", $thread_cache_size = db_get_value_sql('SELECT @@thread_cache_size');
db_get_sql ("SELECT \"value\" $thread_stack = (db_get_value_sql('SELECT @@thread_stack') / 1024);
FROM tconfig WHERE \"token\" = 'db_maintance'")), "PandoraDB Last run"); $max_connections = db_get_value_sql('SELECT @@max_connections');
$key_buffer_size = (db_get_value_sql('SELECT @@key_buffer_size') / 1024);
render_info_data ("SELECT value $read_buffer_size = (db_get_value_sql('SELECT @@read_buffer_size') / 1024);
FROM tupdate_settings $read_rnd_buffer_size = (db_get_value_sql('SELECT @@read_rnd_buffer_size') / 1024);
WHERE \"key\" = 'customer_key';", "Update Key"); $query_cache_min_res_unit = (db_get_value_sql('SELECT @@query_cache_min_res_unit') / 1024);
render_info_data ("SELECT value $innodb_file_per_table = db_get_value_sql('SELECT @@innodb_file_per_table');
FROM tupdate_settings echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('MySQL Performance metrics').'</th></tr>';
WHERE \"key\" = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE \"key\" = 'current_update'", "Current Update #");
break;
case "oracle":
render_info_data ("SELECT value
FROM tconfig
WHERE token = 'db_scheme_version'", "DB Schema Version");
render_info_data ("SELECT value
FROM tconfig
WHERE token = 'db_scheme_build'", "DB Schema Build");
render_info_data ("SELECT value
FROM tconfig
WHERE token = 'enterprise_installed'", "Enterprise installed");
render_row (db_get_sql ("SELECT value
FROM tconfig
WHERE token = 'db_maintance'"), "PandoraDB Last run");
render_info_data ("SELECT " . db_escape_key_identifier('value') .
" FROM tupdate_settings
WHERE \"key\" = 'customer_key'", "Update Key");
render_info_data ("SELECT " . db_escape_key_identifier('value') .
" FROM tupdate_settings
WHERE \"key\" = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT " . db_escape_key_identifier('value') .
" FROM tupdate_settings
WHERE \"key\" = 'current_update'", "Current Update #");
break;
}
$innodb_log_file_size =db_get_value_sql ("SELECT @@innodb_log_file_size")/1048576;
$innodb_log_buffer_size =db_get_value_sql("SELECT @@innodb_log_buffer_size")/1048576;
$innodb_flush_log_at_trx_commit =db_get_value_sql("SELECT @@innodb_flush_log_at_trx_commit");
$max_allowed_packet =db_get_value_sql("SELECT @@max_allowed_packet")/1048576;
$innodb_buffer_pool_size = db_get_value_sql("SELECT @@innodb_buffer_pool_size")/1024;
$sort_buffer_size =number_format(db_get_value_sql("SELECT @@sort_buffer_size")/1024, 2);
$join_buffer_size =db_get_value_sql("SELECT @@join_buffer_size")/1024;
$query_cache_type =db_get_value_sql("SELECT @@query_cache_type");
$query_cache_size =db_get_value_sql("SELECT @@query_cache_size")/1048576;
$query_cache_limit =db_get_value_sql("SELECT @@query_cache_limit")/1048576;
$innodb_lock_wait_timeout =db_get_value_sql("SELECT @@innodb_lock_wait_timeout");
$thread_cache_size =db_get_value_sql("SELECT @@thread_cache_size");
$thread_stack =db_get_value_sql("SELECT @@thread_stack")/1024;
$max_connections =db_get_value_sql("SELECT @@max_connections");
$key_buffer_size =db_get_value_sql("SELECT @@key_buffer_size")/1024;
$read_buffer_size =db_get_value_sql("SELECT @@read_buffer_size")/1024;
$read_rnd_buffer_size =db_get_value_sql("SELECT @@read_rnd_buffer_size")/1024;
$query_cache_min_res_unit =db_get_value_sql("SELECT @@query_cache_min_res_unit")/1024;
$innodb_file_per_table = db_get_value_sql("SELECT @@innodb_file_per_table");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("MySQL Performance metrics")."</th></tr>";
render_row(status_values($innodb_log_file_size_min_rec_value, $innodb_log_file_size), 'InnoDB log file size ', 'InnoDB log file size '); render_row(status_values($innodb_log_file_size_min_rec_value, $innodb_log_file_size), 'InnoDB log file size ', 'InnoDB log file size ');
render_row(status_values($innodb_log_buffer_size_min_rec_value, $innodb_log_buffer_size), 'InnoDB log buffer size ', 'InnoDB log buffer size '); render_row(status_values($innodb_log_buffer_size_min_rec_value, $innodb_log_buffer_size), 'InnoDB log buffer size ', 'InnoDB log buffer size ');
@ -560,22 +700,22 @@ render_row(status_values($read_buffer_size_min_rec_value,$read_buffer_size), 'Re
render_row(status_values($read_rnd_buffer_size_min_rec_value, $read_rnd_buffer_size), 'Read rnd-buffer size ', 'Read rnd-buffer size '); render_row(status_values($read_rnd_buffer_size_min_rec_value, $read_rnd_buffer_size), 'Read rnd-buffer size ', 'Read rnd-buffer size ');
render_row(status_values($query_cache_min_res_unit_min_rec_value, $query_cache_min_res_unit), 'Query cache min-res-unit ', 'Query cache min-res-unit '); render_row(status_values($query_cache_min_res_unit_min_rec_value, $query_cache_min_res_unit), 'Query cache min-res-unit ', 'Query cache min-res-unit ');
render_row(status_values($innodb_file_per_table_min_rec_value, $innodb_file_per_table), 'InnoDB file per table ', 'InnoDB file per table '); render_row(status_values($innodb_file_per_table_min_rec_value, $innodb_file_per_table), 'InnoDB file per table ', 'InnoDB file per table ');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Tables fragmentation in the PandoraFMS database")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Tables fragmentation in the PandoraFMS database').'</th></tr>';
render_row ($tables_fragmentation_max_rec_value . "%", "Tables fragmentation (maximum recommended value)"); render_row($tables_fragmentation_max_rec_value.'%', 'Tables fragmentation (maximum recommended value)');
render_row (number_format($tables_fragmentation, 2) . "%", "Tables fragmentation (current value)"); render_row(number_format($tables_fragmentation, 2).'%', 'Tables fragmentation (current value)');
render_row (status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), "Status fragmentation tables"); render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Status fragmentation tables');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" PandoraFMS logs dates")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' PandoraFMS logs dates').'</th></tr>';
render_row(number_format(get_logs_size($path_server_logs)/1024, 2) . "M", 'Size server logs (current value)'); render_row(number_format((get_logs_size($path_server_logs) / 1024), 2).'M', 'Size server logs (current value)');
render_row(get_status_logs($path_server_logs), 'Status server logs'); render_row(get_status_logs($path_server_logs), 'Status server logs');
render_row(number_format(get_logs_size($path_console_logs)/1024, 2) . "M", 'Size console logs (current value)'); render_row(number_format((get_logs_size($path_console_logs) / 1024), 2).'M', 'Size console logs (current value)');
render_row(get_status_logs($path_console_logs), 'Status console logs'); render_row(get_status_logs($path_console_logs), 'Status console logs');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" PandoraFMS Licence Information")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' PandoraFMS Licence Information').'</th></tr>';
render_row(html_print_textarea('keys[customer_key]', 10, 255, $settings->customer_key, 'style="height:40px; width:450px;"', true), 'Customer key'); render_row(html_print_textarea('keys[customer_key]', 10, 255, $settings->customer_key, 'style="height:40px; width:450px;"', true), 'Customer key');
render_row($license['expiry_date'], 'Expires'); render_row($license['expiry_date'], 'Expires');
@ -587,35 +727,35 @@ render_row( $license['license_mode'],'License Mode');
render_row(status_license_params($license['nms']), 'Network Management System'); render_row(status_license_params($license['nms']), 'Network Management System');
render_row(status_license_params($license['dhpm']), 'Satellite'); render_row(status_license_params($license['dhpm']), 'Satellite');
render_row($license['licensed_to'], 'Licensed to'); render_row($license['licensed_to'], 'Licensed to');
render_row( license_capacity(), "Status of agents capacity"); render_row(license_capacity(), 'Status of agents capacity');
render_row(percentage_modules_per_agent(), "Status of average modules per agent"); render_row(percentage_modules_per_agent(), 'Status of average modules per agent');
render_row(interval_average_of_network_modules(), "Interval average of the network modules"); render_row(interval_average_of_network_modules(), 'Interval average of the network modules');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" Status of the attachment folder")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Status of the attachment folder').'</th></tr>';
render_row($attachment_total_files, "Total files in the attachment folder"); render_row($attachment_total_files, 'Total files in the attachment folder');
render_row(files_attachment_folder($attachment_total_files), "Status of the attachment folder"); render_row(files_attachment_folder($attachment_total_files), 'Status of the attachment folder');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" Information from the tagente_datos table")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Information from the tagente_datos table').'</th></tr>';
render_row($tagente_datos_size, "Total data in the tagente_datos table"); render_row($tagente_datos_size, 'Total data in the tagente_datos table');
render_row(status_tagente_datos($tagente_datos_size), "Status of the tagente_datos table"); render_row(status_tagente_datos($tagente_datos_size), 'Status of the tagente_datos table');
render_row(execution_time(), "Degradation of the execution time when executing a count"); render_row(execution_time(), 'Degradation of the execution time when executing a count');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" Pandora FMS server threads")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS server threads').'</th></tr>';
render_row($total_server_threads, "Total server threads"); render_row($total_server_threads, 'Total server threads');
render_row($percentage_threads_ram . "%", "Percentage of threads used by the RAM"); render_row($percentage_threads_ram.'%', 'Percentage of threads used by the RAM');
render_row($percentage_threads_cpu . "%", "Percentage of threads used by the CPU"); render_row($percentage_threads_cpu.'%', 'Percentage of threads used by the CPU');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" Graphs modules that represent the self-monitoring system")."</th></tr>"; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Graphs modules that represent the self-monitoring system').'</th></tr>';
$server_name = db_get_value_sql("SELECT name FROM tserver WHERE master = 1"); $server_name = db_get_value_sql('SELECT name FROM tserver WHERE master = 1');
$agent_id = db_get_value_sql("SELECT id_agente FROM tagente WHERE nombre = '$server_name'"); $agent_id = db_get_value_sql("SELECT id_agente FROM tagente WHERE nombre = '$server_name'");
$id_modules = agents_get_modules($agent_id); $id_modules = agents_get_modules($agent_id);
$id_modules = array ( $id_modules = [
modules_get_agentmodule_id('Agents_Unknown', $agent_id), modules_get_agentmodule_id('Agents_Unknown', $agent_id),
modules_get_agentmodule_id('Database&#x20;Maintenance', $agent_id), modules_get_agentmodule_id('Database&#x20;Maintenance', $agent_id),
modules_get_agentmodule_id('FreeDisk_SpoolDir', $agent_id), modules_get_agentmodule_id('FreeDisk_SpoolDir', $agent_id),
@ -623,27 +763,26 @@ $agent_id= db_get_value_sql ("SELECT id_agente FROM tagente WHERE nombre = '$ser
modules_get_agentmodule_id('Queued_Modules', $agent_id), modules_get_agentmodule_id('Queued_Modules', $agent_id),
modules_get_agentmodule_id('Status', $agent_id), modules_get_agentmodule_id('Status', $agent_id),
modules_get_agentmodule_id('System_Load_AVG', $agent_id), modules_get_agentmodule_id('System_Load_AVG', $agent_id),
modules_get_agentmodule_id('Execution_time',$agent_id) modules_get_agentmodule_id('Execution_time', $agent_id),
); ];
foreach ($id_modules as $id_module) { foreach ($id_modules as $id_module) {
$params =array( $params = [
'agent_module_id' => $id_module['id_agente_modulo'], 'agent_module_id' => $id_module['id_agente_modulo'],
'period' => SECONDS_1MONTH, 'period' => SECONDS_1MONTH,
'date' => time(), 'date' => time(),
'height' => '150' 'height' => '150',
); ];
render_row(grafico_modulo_sparse ($params),"Graph of the " . $id_module['nombre']." module."); render_row(grafico_modulo_sparse($params), 'Graph of the '.$id_module['nombre'].' module.');
} }
if ($console_mode == 0) { if ($console_mode == 0) {
echo "</table>"; echo '</table>';
} }
echo "<hr color='#b1b1b1' size=1 width=1000 align=left>"; echo "<hr color='#b1b1b1' size=1 width=1000 align=left>";
echo "<span>".__('(*) Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\' very important to echo '<span>'.__(
keep up-to-date database to get the best performance and results in Pandora')."</span><br><br><br>"; '(*) Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\' very important to
keep up-to-date database to get the best performance and results in Pandora'
).'</span><br><br><br>';
?>

View File

@ -1199,13 +1199,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 23); INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 24);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '730'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '731');
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tconfig_os` -- Table `tconfig_os`

View File

@ -1,9 +1,9 @@
<?php <?php
// Password estatica, se define en ambos extremos // Password estatica, se define en ambos extremos
$pwd = "sistemas"; $pwd = 'sistemas';
$user = "admin"; $user = 'admin';
$data = $user.$pwd; $data = $user.$pwd;
$data = md5($data); $data = md5($data);

View File

@ -1,6 +1,7 @@
<?php <?php
/* Hello there! :) /*
Hello there! :)
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
@ -9,8 +10,6 @@ You can of course remove the warnings, that's why we include the source and do n
*/ */
if (check_login()) { if (check_login()) {
if (!enterprise_installed()) { if (!enterprise_installed()) {
$open = true; $open = true;
} }
@ -23,12 +22,10 @@ echo "
if ($tipo == 'noaccess') { if ($tipo == 'noaccess') {
echo "You don't have access to this page"; echo "You don't have access to this page";
} } else if (!enterprise_installed()) {
elseif(!enterprise_installed()){ echo 'Community version';
echo "Community version"; } else {
} echo 'Enterprise version';
else{
echo "Enterprise version";
} }
echo "</span> echo "</span>
@ -36,51 +33,65 @@ echo "</span>
</div> </div>
<div class='modalcontent'> <div class='modalcontent'>
<img class='modalcontentimg' src='".$config['homeurl']."images/"; <img class='modalcontentimg' src='".$config['homeurl'].'images/';
switch ($tipo) { switch ($tipo) {
case "infomodal": case 'infomodal':
echo "icono_info.png"; echo 'icono_info.png';
break; break;
case "helpmodal":
echo "icono_info.png"; case 'helpmodal':
echo 'icono_info.png';
break; break;
case "modulemodal":
echo "icono_popup.png"; case 'modulemodal':
echo 'icono_popup.png';
break; break;
case "massivemodal":
echo "icono_popup.png"; case 'massivemodal':
echo 'icono_popup.png';
break; break;
case "eventsmodal":
echo "icono_popup.png"; case 'eventsmodal':
echo 'icono_popup.png';
break; break;
case "reportingmodal":
echo "icono_popup.png"; case 'reportingmodal':
echo 'icono_popup.png';
break; break;
case "visualmodal":
echo "icono_popup.png"; case 'visualmodal':
echo 'icono_popup.png';
break; break;
case "updatemodal":
echo "icono_info.png"; case 'updatemodal':
echo 'icono_info.png';
break; break;
case "agentsmodal":
echo "icono_info.png"; case 'agentsmodal':
echo 'icono_info.png';
break; break;
case "monitorcheckmodal":
echo "icono_info.png"; case 'monitorcheckmodal':
echo 'icono_info.png';
break; break;
case "remotemodulesmodal":
echo "icono_info.png"; case 'remotemodulesmodal':
echo 'icono_info.png';
break; break;
case "monitoreventsmodal":
echo "icono_info.png"; case 'monitoreventsmodal':
echo 'icono_info.png';
break; break;
case "alertagentmodal":
echo "icono_info.png"; case 'alertagentmodal':
echo 'icono_info.png';
break; break;
case "noaccess":
echo "access_denied.png"; case 'noaccess':
echo 'access_denied.png';
break; break;
default: default:
break; break;
} }
@ -90,89 +101,85 @@ echo "'>
<div class='modalcontenttext'>"; <div class='modalcontenttext'>";
switch ($tipo) { switch ($tipo) {
case 'helpmodal':
case "helpmodal": echo __(
"This is the online help for %s console. This help is -in best cases- just a brief contextual help, not intented to teach you how to use %s. Official documentation of %s is about 900 pages, and you probably don't need to read it entirely, but sure, you should download it and take a look.<br><br>
echo __("This is the online help for %s console. This help is -in best cases- just a brief contextual help, not intented to teach you how to use %s. Official documentation of %s is about 900 pages, and you probably don't need to read it entirely, but sure, you should download it and take a look.<br><br>
<a href='%s' target='_blanck' style='color: #82b92e; font-size: 10pt; text-decoration: underline;'>Download the official documentation</a>", <a href='%s' target='_blanck' style='color: #82b92e; font-size: 10pt; text-decoration: underline;'>Download the official documentation</a>",
get_product_name(), get_product_name(), get_product_name(), $config['custom_docs_url']); get_product_name(),
get_product_name(),
get_product_name(),
$config['custom_docs_url']
);
break; break;
case "noaccess": case 'noaccess':
echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br> <br> echo __(
'Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br> <br>
Please know that all attempts to access this page are recorded in security logs of %s System Database.', Please know that all attempts to access this page are recorded in security logs of %s System Database.',
get_product_name()); get_product_name()
);
break; break;
case "infomodal": case 'infomodal':
if ($open) { if ($open) {
echo '<p>'.__('The Update Manager client is included on %s. It helps system administrators update their %s automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.', get_product_name(), get_product_name()).'</p>'.'<p>'.__('<b>OpenSource version updates are automated packages generated each week. These updates come WITHOUT ANY warranty or support. If your system is corrupted or a feature stops working properly, you will need to recover a backup by yourself.</b>').'</p>'.'<p>'.__('The Enterprise version comes with a different update system, with fully tested, professionally-supported packages, and our support team is there to help you in case of problems or queries. Update Manager is another feature present in the Enterprise version and not included in the OpenSource version. There are lots of advanced business-oriented features contained in %s Enterprise Edition. For more information visit <a href="http://pandorafms.com">pandorafms.com</a>', get_product_name()).'</p>';
echo
'<p>' .
__('The Update Manager client is included on %s. It helps system administrators update their %s automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.', get_product_name(), get_product_name()) .
'</p>' .
'<p>' .
__('<b>OpenSource version updates are automated packages generated each week. These updates come WITHOUT ANY warranty or support. If your system is corrupted or a feature stops working properly, you will need to recover a backup by yourself.</b>') .
'</p>' .
'<p>' .
__('The Enterprise version comes with a different update system, with fully tested, professionally-supported packages, and our support team is there to help you in case of problems or queries. Update Manager is another feature present in the Enterprise version and not included in the OpenSource version. There are lots of advanced business-oriented features contained in %s Enterprise Edition. For more information visit <a href="http://pandorafms.com">pandorafms.com</a>', get_product_name()) .
'</p>'
;
} else { } else {
echo '<p>'.__('The new <a href="http://updatemanager.sourceforge.net">Update Manager</a> client is included on %s. It helps system administrators update their %s automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.', get_product_name(), get_product_name()).'</p>'.'<p>'.__('The Update Manager is one of the most advanced features on the %s Enterprise Edition. For more information visit <a href="http://pandorafms.com">http://pandorafms.com</a>.', get_product_name()).'</p>'.'<p>'.__('Update Manager sends anonymous information about %s usage (number of agents and modules running). To disable it, please remove the remote server address from the Update Manager plugin setup.', get_product_name()).'</p>';
echo
'<p>' .
__('The new <a href="http://updatemanager.sourceforge.net">Update Manager</a> client is included on %s. It helps system administrators update their %s automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.', get_product_name(), get_product_name()) .
'</p>' .
'<p>' .
__('The Update Manager is one of the most advanced features on the %s Enterprise Edition. For more information visit <a href="http://pandorafms.com">http://pandorafms.com</a>.', get_product_name()) .
'</p>' .
'<p>' .
__('Update Manager sends anonymous information about %s usage (number of agents and modules running). To disable it, please remove the remote server address from the Update Manager plugin setup.', get_product_name()) .
'</p>'
;
} }
break;
case 'modulemodal':
echo __(
"The community version doesn't have the ability to define your own library of local modules, or distribute it to remote agents. You need to make those changes individually on each agent which is possible by using external tools and time and effort. Nor can it distribute local plugins, or have access to the library of enterprise plugins to monitor applications such as VMWare, RHEV or Informix between others. The Enterprise version will have all this, plus the ability to distribute and manage your own local modules on your systems, individually or through policies.
<br><br><img style='width:105px' src='".$config['homeurl']."images/logo_oracle.png'><img style='width:105px' src='".$config['homeurl']."images/logo_citrix.png'><img style='width:105px' src='".$config['homeurl']."images/logo_sap.png'><img style='width:105px' src='".$config['homeurl']."images/logo_exchange.png'><br><br><span style='font-style:italic;'>* Todos los logotipos pertenecen a marcas registradas</span>"
);
break; break;
case "modulemodal":
echo __("The community version doesn't have the ability to define your own library of local modules, or distribute it to remote agents. You need to make those changes individually on each agent which is possible by using external tools and time and effort. Nor can it distribute local plugins, or have access to the library of enterprise plugins to monitor applications such as VMWare, RHEV or Informix between others. The Enterprise version will have all this, plus the ability to distribute and manage your own local modules on your systems, individually or through policies. case 'massivemodal':
<br><br><img style='width:105px' src='".$config['homeurl']."images/logo_oracle.png'><img style='width:105px' src='".$config['homeurl']."images/logo_citrix.png'><img style='width:105px' src='".$config['homeurl']."images/logo_sap.png'><img style='width:105px' src='".$config['homeurl']."images/logo_exchange.png'><br><br><span style='font-style:italic;'>* Todos los logotipos pertenecen a marcas registradas</span>");
break;
case "massivemodal":
echo __("Do you want to consolidate all your system monitoring? Do you have many systems, making it difficult to manage them in a comprehensive manner? Would you like to deploy monitoring, alerts and even local plugins with a single click? %s Enterprise Policies are exactly what you need; you'll save time, effort and annoyances. More information <a href='pandorafms.com'>pandorafms.com</a>", get_product_name()); echo __("Do you want to consolidate all your system monitoring? Do you have many systems, making it difficult to manage them in a comprehensive manner? Would you like to deploy monitoring, alerts and even local plugins with a single click? %s Enterprise Policies are exactly what you need; you'll save time, effort and annoyances. More information <a href='pandorafms.com'>pandorafms.com</a>", get_product_name());
break; break;
case "eventsmodal":
echo __("%s Enterprise also features event correlation. Through correlation you can generate realtime alerts and / or new events based on logical rules. This allows you to automate troubleshooting. If you know the value of working with events, event correlation will take you to a new level.", get_product_name()); case 'eventsmodal':
echo __('%s Enterprise also features event correlation. Through correlation you can generate realtime alerts and / or new events based on logical rules. This allows you to automate troubleshooting. If you know the value of working with events, event correlation will take you to a new level.', get_product_name());
break; break;
case "reportingmodal":
echo __("Report generating on the Enterprise version is also more powerful: it has wizards, you can schedule emails in PDF to be sent according to the schedule you decide, and it has a template system to create personalized reports quickly for each of your customers. It will even allow your customers to generate their own reports from templates created by you. If reports are key to your business, %s Enterprise version is for you.", get_product_name()); case 'reportingmodal':
echo __('Report generating on the Enterprise version is also more powerful: it has wizards, you can schedule emails in PDF to be sent according to the schedule you decide, and it has a template system to create personalized reports quickly for each of your customers. It will even allow your customers to generate their own reports from templates created by you. If reports are key to your business, %s Enterprise version is for you.', get_product_name());
break; break;
case "visualmodal":
echo __("These options are only effective on the Enterprise version."); case 'visualmodal':
echo __('These options are only effective on the Enterprise version.');
break; break;
case "updatemodal":
echo __("WARNING: You are just one click away from an automated update. This may result in a damaged system, including loss of data and operativity. Check you have a recent backup. OpenSource updates are automatically created packages, and there is no WARRANTY or SUPPORT. If you need professional support and warranty, please upgrade to Enterprise Version."); case 'updatemodal':
echo __('WARNING: You are just one click away from an automated update. This may result in a damaged system, including loss of data and operativity. Check you have a recent backup. OpenSource updates are automatically created packages, and there is no WARRANTY or SUPPORT. If you need professional support and warranty, please upgrade to Enterprise Version.');
break; break;
case "agentsmodal":
echo __("This system is heavily loaded. OpenSource version could get a lot more agents but fine tuning requires knowledge and time. Checkout the Enterprise Version for a professional supported system."); case 'agentsmodal':
echo __('This system is heavily loaded. OpenSource version could get a lot more agents but fine tuning requires knowledge and time. Checkout the Enterprise Version for a professional supported system.');
break; break;
case "monitorcheckmodal":
echo __("This system has too many modules per agent. OpenSource version could manage thousands of modules, but is not recommended to have more than 40 modules per agent. This configuration has B/A modules per agent. Checkout the Enterprise Version for a professional supported system."); case 'monitorcheckmodal':
echo __('This system has too many modules per agent. OpenSource version could manage thousands of modules, but is not recommended to have more than 40 modules per agent. This configuration has B/A modules per agent. Checkout the Enterprise Version for a professional supported system.');
break; break;
case "remotemodulesmodal":
echo __("Too much remote modules has been detected on this system. OpenSource version could manage thousands of modules, but performance is limited on high amount of SNMP or ICMP request. Checkout the Enterprise Version for a professional supported system with improved capacity on network monitoring, including distributed servers."); case 'remotemodulesmodal':
echo __('Too much remote modules has been detected on this system. OpenSource version could manage thousands of modules, but performance is limited on high amount of SNMP or ICMP request. Checkout the Enterprise Version for a professional supported system with improved capacity on network monitoring, including distributed servers.');
break; break;
case "monitoreventsmodal":
echo __("This system has too much events in the database. Checkout database purge options. Checkout the Enterprise Version for a professional supported system."); case 'monitoreventsmodal':
echo __('This system has too much events in the database. Checkout database purge options. Checkout the Enterprise Version for a professional supported system.');
break; break;
case "alertagentmodal":
echo __("You have defined a high number of alerts, this may cause you performance problems in the future. In the Enterprise version, you can use event correlation alerts to simplify the alerting system and have easier administration and increased performance."); case 'alertagentmodal':
echo __('You have defined a high number of alerts, this may cause you performance problems in the future. In the Enterprise version, you can use event correlation alerts to simplify the alerting system and have easier administration and increased performance.');
break; break;
default: default:
break; break;
} }
@ -190,7 +197,6 @@ echo "<div class='modalgobutton gopandora'>
<span class='modalgobuttontext'>About Enterprise</span> <span class='modalgobuttontext'>About Enterprise</span>
</div>"; </div>";
} }
} }
?> ?>

View File

@ -2,6 +2,3 @@
$stacked = db_get_sql('select stacked from tgraph where id_graph = '.$_GET['data']); $stacked = db_get_sql('select stacked from tgraph where id_graph = '.$_GET['data']);
$num_items = db_get_sql('select count(*) from tgraph_source where id_graph = '.$_GET['data']); $num_items = db_get_sql('select count(*) from tgraph_source where id_graph = '.$_GET['data']);
echo "$stacked,$num_items"; echo "$stacked,$num_items";
?>

View File

@ -1,9 +1,9 @@
<?php <?php
include_once ('include/config.php'); require_once 'include/config.php';
include_once ('include/functions.php'); require_once 'include/functions.php';
include_once ('include/functions_db.php'); require_once 'include/functions_db.php';
include_once ('include/auth/mysql.php'); require_once 'include/auth/mysql.php';
$id = get_parameter('get_image'); $id = get_parameter('get_image');
@ -15,11 +15,6 @@ $image = strpos($result, 'data:image');
if ($image === false) { if ($image === false) {
echo 0; echo 0;
} } else {
else{
echo 1; echo 1;
} }
?>

View File

@ -4,31 +4,28 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
include_once("include/functions.php"); require_once 'include/functions.php';
include_once("include/functions_html.php"); require_once 'include/functions_html.php';
include_once("include/functions_ui.php"); require_once 'include/functions_ui.php';
include_once("include/functions_io.php"); require_once 'include/functions_io.php';
include_once("include/functions_extensions.php"); require_once 'include/functions_extensions.php';
echo '<html>'; echo '<html>';
ob_start('ui_process_page_head'); ob_start('ui_process_page_head');
echo '<link rel="stylesheet" href="include/styles/pandora.css" type="text/css">'; echo '<link rel="stylesheet" href="include/styles/pandora.css" type="text/css">';
echo '</head>'."\n"; echo '</head>'."\n";
require_once ("include/functions_themes.php"); require_once 'include/functions_themes.php';
ob_start('ui_process_page_body'); ob_start('ui_process_page_body');
// At this point, $login_screen is setted with the error type desired // At this point, $login_screen is setted with the error type desired
require 'login_page.php';
require('login_page.php');
?> ?>
</body> </body>

View File

@ -3,50 +3,48 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2018 Artica Soluciones Tecnologicas // Copyright (c) 2005-2018 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
if (! check_acl ($config['id_user'], 0, "PM")) { if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit("ACL Violation", db_pandora_audit(
"Trying to access HA cluster"); 'ACL Violation',
require ("general/noaccess.php"); 'Trying to access HA cluster'
);
include 'general/noaccess.php';
exit; exit;
} }
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php <?php
ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clusters defined yet.') ]);
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no HA clusters defined yet.') ) );
?> ?>
<div class="new_task_cluster"> <div class="new_task_cluster">
<div class="image_task_cluster"> <div class="image_task_cluster">
<?php echo html_print_image('images/firts_task/slave-mode.png', true, array("title" => __('Clusters')));?> <?php echo html_print_image('images/firts_task/slave-mode.png', true, ['title' => __('Clusters')]); ?>
</div> </div>
<div class="text_task_cluster"> <div class="text_task_cluster">
<h3> <?php echo __('PANDORA FMS DB CLUSTER'); ?></h3> <h3> <?php echo __('PANDORA FMS DB CLUSTER'); ?></h3>
<p id="description_task"> <?php <p id="description_task">
<?php
echo __('With Pandora FMS Enterprise you can add high availability to your Pandora FMS installation by adding redundant MySQL servers').'<br><br>'; echo __('With Pandora FMS Enterprise you can add high availability to your Pandora FMS installation by adding redundant MySQL servers').'<br><br>';
echo __('Click on "add new node" to start transforming your Pandora FMS DB Cluster into a Pandora FMS DB Cluster.').'<br><br>'; echo __('Click on "add new node" to start transforming your Pandora FMS DB Cluster into a Pandora FMS DB Cluster.').'<br><br>';
?>
?></p> </p>
<?php <?php
if(check_acl ($config['id_user'], 0, "AW")) { if (check_acl($config['id_user'], 0, 'AW')) {
echo "<div id='create_master_window'></div>"; echo "<div id='create_master_window'></div>";
?> ?>
<input style="margin-bottom:20px;" onclick="show_create_ha_cluster();" type="submit" class="button_task" value="<?php echo __('Add new node'); ?>" /> <input style="margin-bottom:20px;" onclick="show_create_ha_cluster();" type="submit" class="button_task" value="<?php echo __('Add new node'); ?>" />
@ -67,7 +65,7 @@ ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no HA
url: "ajax.php", url: "ajax.php",
success: function (data) { success: function (data) {
$("#create_master_window").dialog ({ $("#create_master_window").dialog ({
title: '<?php echo __("Add master node");?>', title: '<?php echo __('Add master node'); ?>',
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: true, modal: true,

View File

@ -4,42 +4,40 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
if (! check_acl ($config['id_user'], 0, "AR") && ! check_acl ($config['id_user'], 0, "AW")) { if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit("ACL Violation", db_pandora_audit(
"Trying to access Inventory"); 'ACL Violation',
require ("general/noaccess.php"); 'Trying to access Inventory'
);
include 'general/noaccess.php';
return; return;
} }
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php <?php
ui_print_info_message(['no_close' => true, 'message' => __('There are no clusters defined yet.') ]);
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no clusters defined yet.') ) );
?> ?>
<div class="new_task_cluster"> <div class="new_task_cluster">
<div class="image_task_cluster"> <div class="image_task_cluster">
<?php echo html_print_image('images/firts_task/icono-cluster-activo.png', true, array("title" => __('Clusters')));?> <?php echo html_print_image('images/firts_task/icono-cluster-activo.png', true, ['title' => __('Clusters')]); ?>
</div> </div>
<div class="text_task_cluster"> <div class="text_task_cluster">
<h3> <?php echo __('Create Cluster'); ?></h3> <h3> <?php echo __('Create Cluster'); ?></h3>
<p id="description_task"> <?php <p id="description_task">
<?php
echo __('A cluster is a group of devices that provide the same service in high availability.').'<br><br>'; echo __('A cluster is a group of devices that provide the same service in high availability.').'<br><br>';
echo __('Depending on how they provide that service, we can find two types:').'<br><br>'; echo __('Depending on how they provide that service, we can find two types:').'<br><br>';
@ -47,11 +45,11 @@ ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no cl
echo __('<b>Clusters to balance the service load</b>: these are active - active (A/A) mode clusters. It means that all the nodes (or machines that compose it) are working. They must be working because if one stops working, it will overload the others.').'<br><br>'; echo __('<b>Clusters to balance the service load</b>: these are active - active (A/A) mode clusters. It means that all the nodes (or machines that compose it) are working. They must be working because if one stops working, it will overload the others.').'<br><br>';
echo __('<b>Clusters to guarantee service</b>: these are active - passive (A/P) mode clusters. It means that one of the nodes (or machines that make up the cluster) will be running (primary) and another won\'t (secondary). When the primary goes down, the secondary must take over and give the service instead. Although many of the elements of this cluster are active-passive, it will also have active elements in both of them that indicate that the passive node is "online", so that in the case of a service failure in the master, the active node collects this information.'); echo __('<b>Clusters to guarantee service</b>: these are active - passive (A/P) mode clusters. It means that one of the nodes (or machines that make up the cluster) will be running (primary) and another won\'t (secondary). When the primary goes down, the secondary must take over and give the service instead. Although many of the elements of this cluster are active-passive, it will also have active elements in both of them that indicate that the passive node is "online", so that in the case of a service failure in the master, the active node collects this information.');
?>
?></p> </p>
<?php <?php
if(check_acl ($config['id_user'], 0, "AW")) { if (check_acl($config['id_user'], 0, 'AW')) {
?> ?>
<form action="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&step=1" method="post"> <form action="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&step=1" method="post">

View File

@ -4,35 +4,37 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no collections defined yet.') ) ); ?> <?php ui_print_info_message(['no_close' => true, 'message' => __('There are no collections defined yet.') ]); ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/icono_grande_reconserver.png', true, array("title" => __('Collections')));?> <?php echo html_print_image('images/icono_grande_reconserver.png', true, ['title' => __('Collections')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Collections'); ?></h3> <h3> <?php echo __('Create Collections'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("A file collection is a group of files (e.g. scripts or executables) which are <?php
echo __(
"A file collection is a group of files (e.g. scripts or executables) which are
automatically copied to a specific directory of the agent (under Windows or UNIX). The file collections allow to be propagated automatically copied to a specific directory of the agent (under Windows or UNIX). The file collections allow to be propagated
along with the policies in order to be used by a group of agents, using a 'package' of scripts and modules which use them. along with the policies in order to be used by a group of agents, using a 'package' of scripts and modules which use them.
First we learn how to use the file collections in the agent's view, how to conduct it manually, agent by agent, without using collections, First we learn how to use the file collections in the agent's view, how to conduct it manually, agent by agent, without using collections,
and how to do the same thing by using policies.Our first task is to arrange a compilation of files. In order to do this, please go to the agent's and how to do the same thing by using policies.Our first task is to arrange a compilation of files. In order to do this, please go to the agent's
administrator. Subsequently, we're going to see a 'sub option' called 'Collections'. Please click on it in order to create a new collection as we can see on administrator. Subsequently, we're going to see a 'sub option' called 'Collections'. Please click on it in order to create a new collection as we can see on
the picture below. "); ?></p> the picture below. "
);
?>
</p>
<form action="index.php?sec=gagente&sec2=enterprise/godmode/agentes/collections&action=new" method="post"> <form action="index.php?sec=gagente&sec2=enterprise/godmode/agentes/collections&action=new" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Collections'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Collections'); ?>" />
</form> </form>

View File

@ -4,33 +4,34 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php <?php
ui_print_info_message(['no_close' => true, 'message' => __('There are no custom fields defined yet.') ]);
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no custom fields defined yet.') ) );
?> ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, array("title" => __('Custom Fields')));?> <?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Custom Fields')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Custom Fields'); ?></h3> <h3> <?php echo __('Create Custom Fields'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("Custom fields are an easy way to personalized agent's information. <?php
You're able to create custom fields by klicking on 'Administration' -> 'Manage monitoring' -> 'Manage custom fields'. "); ?></p> echo __(
"Custom fields are an easy way to personalized agent's information.
You're able to create custom fields by klicking on 'Administration' -> 'Manage monitoring' -> 'Manage custom fields'. "
);
?>
</p>
<form action="index.php?sec=gagente&sec2=godmode/agentes/configure_field" method="post"> <form action="index.php?sec=gagente&sec2=godmode/agentes/configure_field" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Custom Fields'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Custom Fields'); ?>" />
</form> </form>

View File

@ -4,35 +4,37 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php <?php
ui_print_info_message(['no_close' => true, 'message' => __('There are no custom graphs defined yet.') ]);
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no custom graphs defined yet.') ) );
?> ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_custom_reporting.png', true, array("title" => __('Custom Graphs')));?> <?php echo html_print_image('images/firts_task/icono_grande_custom_reporting.png', true, ['title' => __('Custom Graphs')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Custom Graph'); ?></h3> <h3> <?php echo __('Create Custom Graph'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("Graphs are designed to show the data collected by %s in a temporary scale defined by the user. <?php
echo __(
"Graphs are designed to show the data collected by %s in a temporary scale defined by the user.
%s Graphs display data in real time. They are generated every time the operator requires any of them and display the up-to-date state. %s Graphs display data in real time. They are generated every time the operator requires any of them and display the up-to-date state.
There are two types of graphs: The agent's automated graphs and the graphs the user customizes by using one or more modules to do so.", There are two types of graphs: The agent's automated graphs and the graphs the user customizes by using one or more modules to do so.",
get_product_name(), get_product_name()); ?></p> get_product_name(),
get_product_name()
);
?>
</p>
<form action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder" method="post"> <form action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Custom Graph'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Custom Graph'); ?>" />
</form> </form>

View File

@ -4,30 +4,32 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no custom fields defined yet.') ) ); ?> <?php ui_print_info_message(['no_close' => true, 'message' => __('There are no custom fields defined yet.') ]); ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, array("title" => __('Fields Manager')));?> <?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Fields Manager')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Fields Manager'); ?></h3> <h3> <?php echo __('Create Fields Manager'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("Custom fields are an easy way to personalized agent's information. <?php
You're able to create custom fields by klicking on 'Administration' -> 'Manage monitoring' -> 'Manage custom fields'. "); ?></p> echo __(
"Custom fields are an easy way to personalized agent's information.
You're able to create custom fields by klicking on 'Administration' -> 'Manage monitoring' -> 'Manage custom fields'. "
);
?>
</p>
<form action="index.php?sec=gagente&sec2=godmode/agentes/configure_field" method="post"> <form action="index.php?sec=gagente&sec2=godmode/agentes/configure_field" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Fields '); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Fields '); ?>" />
</form> </form>

View File

@ -4,16 +4,13 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
global $incident_w; global $incident_w;
global $incident_m; global $incident_m;
@ -21,28 +18,34 @@ check_login ();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php <?php
ui_print_info_message(['no_close' => true, 'message' => __('There are no incidents defined yet.') ]);
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no incidents defined yet.') ) );
if ($incident_w || $incident_m) { if ($incident_w || $incident_m) {
?> ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_incidencia.png', true, array("title" => __('Incidents')));?> <?php echo html_print_image('images/firts_task/icono_grande_incidencia.png', true, ['title' => __('Incidents')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Incidents'); ?></h3> <h3> <?php echo __('Create Incidents'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("Besides receiving and processing data to monitor systems or applications, <?php
echo __(
"Besides receiving and processing data to monitor systems or applications,
you're also required to monitor possible incidents which might take place on these subsystems within the system's monitoring process. you're also required to monitor possible incidents which might take place on these subsystems within the system's monitoring process.
For it, the %s team has designed an incident manager from which any user is able to open incidents, For it, the %s team has designed an incident manager from which any user is able to open incidents,
that explain what's happened on the network, and update them with comments and files, at any time, in case there is a need to do so. that explain what's happened on the network, and update them with comments and files, at any time, in case there is a need to do so.
This system allows users to work as a team, along with different roles and work-flow systems which allow an incident to be This system allows users to work as a team, along with different roles and work-flow systems which allow an incident to be
moved from one group to another, and members from different groups and different people could work on the same incident, sharing information and files. moved from one group to another, and members from different groups and different people could work on the same incident, sharing information and files.
", get_product_name()); ?></p> ",
get_product_name()
);
?>
</p>
<form action="index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form=1" method="post"> <form action="index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form=1" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Incidents'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Incidents'); ?>" />
</form> </form>
</div> </div>
</div> </div>
<?php } ?> <?php
}

View File

@ -4,16 +4,13 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
global $vconsoles_write; global $vconsoles_write;
global $vconsoles_manage; global $vconsoles_manage;
@ -21,31 +18,33 @@ check_login ();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
ui_print_info_message( ui_print_info_message(
array( [
'no_close' => true, 'no_close' => true,
'message'=> __('There are no visual console defined yet.'))); 'message' => __('There are no visual console defined yet.'),
]
);
if ($vconsoles_write || $vconsoles_manage) { if ($vconsoles_write || $vconsoles_manage) {
?> ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_visualconsole.png', true, array("title" => __('Visual Console')));?> <?php echo html_print_image('images/firts_task/icono_grande_visualconsole.png', true, ['title' => __('Visual Console')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Visual Console'); ?></h3> <h3> <?php echo __('Create Visual Console'); ?> <p id="description_task">
<p id="description_task"> <?php echo __( <?php
"%s allows users to create visual maps on which each user is able to create his or her " . echo __(
"own monitoring map. The new visual console editor is much more practical, although the prior " . '%s allows users to create visual maps on which each user is able to create his or her '.'own monitoring map. The new visual console editor is much more practical, although the prior '."visual console editor had its advantages. On the new visual console, we've been successful in "."imitating the sensation and touch of a drawing application like GIMP. We've also simplified the "."editor by dividing it into several subject-divided tabs named 'Data', 'Preview', 'Wizard', 'List of "."Elements' and 'Editor'. The items the %s Visual Map was designed to handle are "."'static images', 'percentage bars', 'module graphs' and 'simple values'.",
"visual console editor had its advantages. On the new visual console, we've been successful in " . get_product_name(),
"imitating the sensation and touch of a drawing application like GIMP. We've also simplified the " . get_product_name()
"editor by dividing it into several subject-divided tabs named 'Data', 'Preview', 'Wizard', 'List of " . );
"Elements' and 'Editor'. The items the %s Visual Map was designed to handle are " . ?>
"'static images', 'percentage bars', 'module graphs' and 'simple values'.", </p>
get_product_name(), get_product_name()); ?></p>
<form action="index.php?sec=network&amp;sec2=godmode/reporting/visual_console_builder" method="post"> <form action="index.php?sec=network&amp;sec2=godmode/reporting/visual_console_builder" method="post">
<?php html_print_input_hidden('edit_layout', 1); ?> <?php html_print_input_hidden('edit_layout', 1); ?>
<input type="submit" class="button_task" value="<?php echo __('Create Visual Console'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Visual Console'); ?>" />
</form> </form>
</div> </div>
</div> </div>
<?php } ?> <?php
}

View File

@ -4,45 +4,46 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php <?php
ui_print_info_message(['no_close' => true, 'message' => __('There are no network map defined yet.') ]);
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no network map defined yet.') ) );
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
$networkmap_types = networkmap_get_types($strict_user); $networkmap_types = networkmap_get_types($strict_user);
?> ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, array("title" => __('Network Map')));?> <?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Network Map')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Network Map'); ?></h3> <h3> <?php echo __('Create Network Map'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("There is also an open-source version of the network map. <?php
echo __(
'There is also an open-source version of the network map.
This functionality allows to graphically display the nodes and relationships, agents, modules and groups available to the user. This functionality allows to graphically display the nodes and relationships, agents, modules and groups available to the user.
There are three types of network maps: There are three types of network maps:
"); '
echo "<li>" . __("Topology Map") . "</li> );
<li>" . __("Group Map") . "</li> echo '<li>'.__('Topology Map').'</li>
<li>" . __("Radial Map (User without strict user)") . "</li> <li>'.__('Group Map').'</li>
<li>" . __("Dinamic Map") . "</li> <li>'.__('Radial Map (User without strict user)').'</li>
<li>" . __("Policy Map (Only Enterprise version)") . "</li>"; <li>'.__('Dinamic Map').'</li>
?> </p> <li>'.__('Policy Map (Only Enterprise version)').'</li>';
?>
</p>
<form id="networkmap_action" method="post" action="index.php?sec=network&amp;sec2=operation/agentes/networkmap&action=create"> <form id="networkmap_action" method="post" action="index.php?sec=network&amp;sec2=operation/agentes/networkmap&action=create">
<?php echo html_print_select($networkmap_types, 'tab', 'topology', '', '', 0); <?php
echo html_print_select($networkmap_types, 'tab', 'topology', '', '', 0);
html_print_input_hidden('add_networkmap', 1); html_print_input_hidden('add_networkmap', 1);
?> ?>

View File

@ -4,33 +4,35 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no planned downtime defined yet.') ) ); ?> <?php ui_print_info_message(['no_close' => true, 'message' => __('There are no planned downtime defined yet.') ]); ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_visualconsole.png', true, array("title" => __('Planned Downtime')));?> <?php echo html_print_image('images/firts_task/icono_grande_visualconsole.png', true, ['title' => __('Planned Downtime')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Planned Downtime'); ?></h3> <h3> <?php echo __('Create Planned Downtime'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("%s contains a scheduled downtime management system. <?php
echo __(
"%s contains a scheduled downtime management system.
This system was designed to deactivate alerts during specific intervals whenever there is down time by deactivating the agent. This system was designed to deactivate alerts during specific intervals whenever there is down time by deactivating the agent.
If an agent is deactivated, it doesn't gather information. During down time, down-time intervals aren't taken into If an agent is deactivated, it doesn't gather information. During down time, down-time intervals aren't taken into
account for most metrics or report types, because agents don't contain any data within those intervals.", account for most metrics or report types, because agents don't contain any data within those intervals.",
get_product_name()); ?></p> get_product_name()
);
?>
</p>
<form action="index.php?sec=estado&amp;sec2=godmode/agentes/planned_downtime.editor" method="post"> <form action="index.php?sec=estado&amp;sec2=godmode/agentes/planned_downtime.editor" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Planned Downtime'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Planned Downtime'); ?>" />
</form> </form>

View File

@ -4,33 +4,35 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no recon task defined yet.') ) ); ?> <?php ui_print_info_message(['no_close' => true, 'message' => __('There are no recon task defined yet.') ]); ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, array("title" => __('Recon server')));?> <?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Recon server')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Recon Task'); ?></h3> <h3> <?php echo __('Create Recon Task'); ?> <p id="description_task">
<p id="description_task"> <?php echo __('The Recon Task definition of Pandora FMS is used to find new elements in the network. <?php
echo __(
'The Recon Task definition of Pandora FMS is used to find new elements in the network.
If it detects any item, it will add that item to the monitoring, and if that item it is already being monitored, then it will If it detects any item, it will add that item to the monitoring, and if that item it is already being monitored, then it will
ignore it or will update its information.There are three types of detection: Based on <strong id="fuerte"> ICMP </strong>(pings), ignore it or will update its information.There are three types of detection: Based on <strong id="fuerte"> ICMP </strong>(pings),
<strong id="fuerte">SNMP</strong> (detecting the topology of networks and their interfaces), and other <strong id="fuerte"> customized </strong> <strong id="fuerte">SNMP</strong> (detecting the topology of networks and their interfaces), and other <strong id="fuerte"> customized </strong>
type. You can define your own customized recon script.'); ?></p> type. You can define your own customized recon script.'
);
?>
</p>
<form action="index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&create" method="post"> <form action="index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&create" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Recon Task'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Recon Task'); ?>" />
</form> </form>

View File

@ -4,37 +4,39 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
global $agent_w; global $agent_w;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no services defined yet.') ) ); ?> <?php ui_print_info_message(['no_close' => true, 'message' => __('There are no services defined yet.') ]); ?>
<?php if ($agent_w) { ?> <?php if ($agent_w) { ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_servicios.png', true, array("title" => __('Services')));?> <?php echo html_print_image('images/firts_task/icono_grande_servicios.png', true, ['title' => __('Services')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Services'); ?></h3> <h3> <?php echo __('Create Services'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("A service is a way to group your IT resources based on their functionalities. <?php
echo __(
"A service is a way to group your IT resources based on their functionalities.
A service could be e.g. your official website, your CRM system, your support application, or even your printers. A service could be e.g. your official website, your CRM system, your support application, or even your printers.
Services are logical groups which can include hosts, routers, switches, firewalls, CRMs, ERPs, websites and numerous other services. Services are logical groups which can include hosts, routers, switches, firewalls, CRMs, ERPs, websites and numerous other services.
By the following example, you're able to see more clearly what a service is: By the following example, you're able to see more clearly what a service is:
A chip manufacturer sells computers by its website all around the world. A chip manufacturer sells computers by its website all around the world.
His company consists of three big departments: A management, an on-line shop and support."); ?></p> His company consists of three big departments: A management, an on-line shop and support."
);
?>
</p>
<form action="index.php?sec=estado&sec2=enterprise/godmode/services/services.service&action=new_service" method="post"> <form action="index.php?sec=estado&sec2=enterprise/godmode/services/services.service&action=new_service" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Services'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Services'); ?>" />
@ -42,4 +44,5 @@ ui_require_css_file ('firts_task');
</div> </div>
</div> </div>
<?php } ?> <?php
}

View File

@ -4,33 +4,35 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no SNMP filter defined yet.') ) ); ?> <?php ui_print_info_message(['no_close' => true, 'message' => __('There are no SNMP filter defined yet.') ]); ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, array("title" => __('SNMP Filter')));?> <?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('SNMP Filter')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create SNMP Filter'); ?></h3> <h3> <?php echo __('Create SNMP Filter'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("Some systems receive a high number of traps. <?php
echo __(
"Some systems receive a high number of traps.
We're only interested in monitoring a tiny percentage of them. From Pandora FMS versions 3.2 and above, We're only interested in monitoring a tiny percentage of them. From Pandora FMS versions 3.2 and above,
it's possible to filter the traps that the server obtains in order to avoid straining the application unnecessarily. it's possible to filter the traps that the server obtains in order to avoid straining the application unnecessarily.
In order to define different filters, please go to 'Administration' -> 'Manage SNMP Console' and 'SNMP Filters'. In order to define different filters, please go to 'Administration' -> 'Manage SNMP Console' and 'SNMP Filters'.
One trap which is going to run in conjunction with any of them - just the ones for the server are going to get ruled out automatically. "); ?></p> One trap which is going to run in conjunction with any of them - just the ones for the server are going to get ruled out automatically. "
);
?>
</p>
<form action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter=-1" method="post"> <form action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter=-1" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create SNMP Filter'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create SNMP Filter'); ?>" />
</form> </form>

View File

@ -4,31 +4,33 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no tags defined yet.') ) ); ?> <?php ui_print_info_message(['no_close' => true, 'message' => __('There are no tags defined yet.') ]); ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_gestiondetags.png', true, array("title" => __('Tags')));?> <?php echo html_print_image('images/firts_task/icono_grande_gestiondetags.png', true, ['title' => __('Tags')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Tags'); ?></h3> <h3> <?php echo __('Create Tags'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("Access to modules can be configured by a tagging system. <?php
echo __(
"Access to modules can be configured by a tagging system.
Tags are configured on the system and are assigned to the chosen modules. Tags are configured on the system and are assigned to the chosen modules.
A user's access can therefore be restricted to modules with certain tags."); ?></p> A user's access can therefore be restricted to modules with certain tags."
);
?>
</p>
<form action="index.php?sec=gmodules&sec2=godmode/tag/edit_tag&action=new" method="post"> <form action="index.php?sec=gmodules&sec2=godmode/tag/edit_tag&action=new" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Tags'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Tags'); ?>" />
</form> </form>

View File

@ -4,39 +4,43 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config; global $config;
global $networkmaps_write; global $networkmaps_write;
global $networkmaps_manage; global $networkmaps_manage;
check_login(); check_login();
ui_require_css_file('firts_task'); ui_require_css_file('firts_task');
?> ?>
<?php ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no transactions defined yet.') ) ); <?php
ui_print_info_message(['no_close' => true, 'message' => __('There are no transactions defined yet.') ]);
if ($networkmaps_write || $networkmaps_manage) { if ($networkmaps_write || $networkmaps_manage) {
?> ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_topology.png', true, array("title" => __('Transactions')));?> <?php echo html_print_image('images/firts_task/icono_grande_topology.png', true, ['title' => __('Transactions')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Transactions'); ?></h3> <h3> <?php echo __('Create Transactions'); ?> <p id="description_task">
<p id="description_task"> <?php echo __("The new transactional server allows you to execute tasks dependent on the others following a user-defined design. This means that it is possible to coordinate several executions to check a target at a given time. <?php
echo __(
'The new transactional server allows you to execute tasks dependent on the others following a user-defined design. This means that it is possible to coordinate several executions to check a target at a given time.
Transaction graphs represent the different processes within our infrastructure that we use to deliver our service."); ?></p> Transaction graphs represent the different processes within our infrastructure that we use to deliver our service.'
);
?>
</p>
<form action="index.php?sec=network&sec2=enterprise/operation/agentes/manage_transmap_creation&create_transaction=1" method="post"> <form action="index.php?sec=network&sec2=enterprise/operation/agentes/manage_transmap_creation&create_transaction=1" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Transactions'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Transactions'); ?>" />
</form> </form>
</div> </div>
</div> </div>
<?php } ?> <?php
}

View File

@ -4,55 +4,48 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
if (isset($_SERVER['REQUEST_TIME'])) { if (isset($_SERVER['REQUEST_TIME'])) {
$time = $_SERVER['REQUEST_TIME']; $time = $_SERVER['REQUEST_TIME'];
} } else {
else {
$time = get_system_time(); $time = get_system_time();
} }
$license_file = 'general/license/pandora_info_'.$config["language"].'.html'; $license_file = 'general/license/pandora_info_'.$config['language'].'.html';
if (! file_exists ($config["homedir"] . $license_file)) { if (! file_exists($config['homedir'].$license_file)) {
$license_file = 'general/license/pandora_info_en.html'; $license_file = 'general/license/pandora_info_en.html';
} }
if (!$config["MR"]) { if (!$config['MR']) {
$config["MR"] = 0; $config['MR'] = 0;
} }
echo '<a class="white_bold footer" target="_blank" href="' . $config["homeurl"] . $license_file. '">'; echo '<a class="white_bold footer" target="_blank" href="'.$config['homeurl'].$license_file.'">';
include_once ($config["homedir"]."/include/functions_update_manager.php"); require_once $config['homedir'].'/include/functions_update_manager.php';
$current_package = update_manager_get_current_package(); $current_package = update_manager_get_current_package();
if ($current_package == 0) { if ($current_package == 0) {
$build_package_version = $build_version; $build_package_version = $build_version;
} } else {
else{
$build_package_version = $current_package; $build_package_version = $current_package;
} }
echo sprintf(__('%s %s - Build %s - MR %s', get_product_name(), $pandora_version, $build_package_version, $config["MR"])); echo sprintf(__('%s %s - Build %s - MR %s', get_product_name(), $pandora_version, $build_package_version, $config['MR']));
echo '</a><br />'; echo '</a><br />';
echo '<a class="white footer">'. __('Page generated at') . ' '. date($config["date_format"]); echo '<a class="white footer">'.__('Page generated at').' '.date($config['date_format']);
echo '</a><br /><span style="color:#eff">&reg; '.get_copyright_notice().'</span>'; echo '</a><br /><span style="color:#eff">&reg; '.get_copyright_notice().'</span>';
if (isset($config['debug'])) { if (isset($config['debug'])) {
$cache_info = array(); $cache_info = [];
$cache_info = db_get_cached_queries(); $cache_info = db_get_cached_queries();
echo ' - Saved '.$cache_info[0].' Queries'; echo ' - Saved '.$cache_info[0].' Queries';
} }
?>

View File

@ -4,21 +4,17 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
require_once 'include/functions_messages.php';
require_once ("include/functions_messages.php"); require_once 'include/functions_servers.php';
require_once ('include/functions_servers.php');
// Check permissions // Check permissions
// Global errors/warnings checking. // Global errors/warnings checking.
config_check(); config_check();
@ -33,82 +29,81 @@ config_check();
if (!defined('PANDORA_ENTERPRISE')) { if (!defined('PANDORA_ENTERPRISE')) {
$logo_title = get_product_name().' Opensource'; $logo_title = get_product_name().' Opensource';
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png'; $custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
} } else {
else {
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) { if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) {
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo; $custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
} }
$logo_title = get_product_name().' Enterprise'; $logo_title = get_product_name().' Enterprise';
} }
echo html_print_image($custom_logo, true, echo html_print_image(
array("alt" => $logo_title, "border" => '0')); $custom_logo,
true,
[
'alt' => $logo_title,
'border' => '0',
]
);
?> ?>
</a> </a>
</td> </td>
<td style="min-width:200px;"> <td style="min-width:200px;">
<?php <?php
$table = new stdClass(); $table = new stdClass();
$table->id = "header_table"; $table->id = 'header_table';
$table->class = "none"; $table->class = 'none';
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
$table->head = array (); $table->head = [];
$table->data = array (); $table->data = [];
$table->style[0] = $table->style[0] = $table->style['clippy'] = $table->style[1] = $table->style[3] = $table->style[4] = $table->style[5] = $table->style[6] = $table->style[8] = $table->style[9] = $table->style['qr'] = 'width: 22px; text-align:center; height: 22px; padding-right: 9px;padding-left: 9px;';
$table->style['clippy'] =
$table->style[1] =
$table->style[3] =
$table->style[4] =
$table->style[5] =
$table->style[6] =
$table->style[8] =
$table->style[9] =
$table->style['qr'] =
'width: 22px; text-align:center; height: 22px; padding-right: 9px;padding-left: 9px;';
$table->style[7] = 'width: 20px; padding-right: 9px;'; $table->style[7] = 'width: 20px; padding-right: 9px;';
$table->style['searchbar'] = 'width: 180px; min-width: 180px;'; $table->style['searchbar'] = 'width: 180px; min-width: 180px;';
$table->style[11] = 'padding-left: 10px; padding-right: 5px;width: 16px;'; $table->style[11] = 'padding-left: 10px; padding-right: 5px;width: 16px;';
$table->width = "100%"; $table->width = '100%';
$table->styleTable = 'margin: auto; margin-top: 0px;'; $table->styleTable = 'margin: auto; margin-top: 0px;';
$table->rowclass[0] = ''; $table->rowclass[0] = '';
$acl_head_search = true; $acl_head_search = true;
if ($config["acl_enterprise"] == 1 && !users_is_admin()) { if ($config['acl_enterprise'] == 1 && !users_is_admin()) {
$acl_head_search = db_get_sql("SELECT sec FROM tusuario $acl_head_search = db_get_sql(
"SELECT sec FROM tusuario
INNER JOIN tusuario_perfil ON tusuario.id_user = tusuario_perfil.id_usuario INNER JOIN tusuario_perfil ON tusuario.id_user = tusuario_perfil.id_usuario
INNER JOIN tprofile_view ON tprofile_view.id_profile = tusuario_perfil.id_perfil INNER JOIN tprofile_view ON tprofile_view.id_profile = tusuario_perfil.id_perfil
WHERE tusuario.id_user = '".$config['id_user']."' AND (sec = '*' OR sec = 'head_search')"); WHERE tusuario.id_user = '".$config['id_user']."' AND (sec = '*' OR sec = 'head_search')"
);
} }
if ($acl_head_search) { if ($acl_head_search) {
$table->data[0][11] = ui_print_help_tip (__("Blank characters are used as AND conditions"), true); $table->data[0][11] = ui_print_help_tip(__('Blank characters are used as AND conditions'), true);
// Search bar // Search bar
$search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">'; $search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">';
if (!isset($config['search_keywords'])) { if (!isset($config['search_keywords'])) {
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>'; $search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
} } else {
else { if (strlen($config['search_keywords']) == 0) {
if (strlen($config['search_keywords']) == 0)
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>'; $search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
else } else {
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = false; </script>'; $search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = false; </script>';
} }
}
$search_bar .= '<input type="text" id="keywords" name="keywords"'; $search_bar .= '<input type="text" id="keywords" name="keywords"';
if (!isset($config['search_keywords'])) if (!isset($config['search_keywords'])) {
$search_bar .= "value='" . __("Enter keywords to search") . "'"; $search_bar .= "value='".__('Enter keywords to search')."'";
else if (strlen($config['search_keywords']) == 0) } else if (strlen($config['search_keywords']) == 0) {
$search_bar .= "value='" . __("Enter keywords to search") . "'"; $search_bar .= "value='".__('Enter keywords to search')."'";
else } else {
$search_bar .= "value='".$config['search_keywords']."'"; $search_bar .= "value='".$config['search_keywords']."'";
}
$search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" $search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');"
onkeyup="javascript: fieldKeyWordEmpty = false;" onkeyup="javascript: fieldKeyWordEmpty = false;"
style="margin-top:5px;" class="search_input" />'; style="margin-top:5px;" class="search_input" />';
// $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"';
$search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />"; $search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />";
$search_bar .= '</form>'; $search_bar .= '</form>';
@ -116,48 +111,44 @@ config_check();
} }
// Servers check // Servers check
$servers = array(); $servers = [];
$servers["all"] = (int) db_get_value ('COUNT(id_server)','tserver'); $servers['all'] = (int) db_get_value('COUNT(id_server)', 'tserver');
$servers["up"] = (int) servers_check_status (); $servers['up'] = (int) servers_check_status();
$servers["down"] = $servers["all"] - $servers["up"]; $servers['down'] = ($servers['all'] - $servers['up']);
if ($servers["up"] == 0) { if ($servers['up'] == 0) {
// All Servers down or no servers at all // All Servers down or no servers at all
$servers_check_img = html_print_image("images/header_down.png", true, array("alt" => 'cross', "class" => 'bot', 'title' => __('All systems').': '.__('Down'))); $servers_check_img = html_print_image('images/header_down.png', true, ['alt' => 'cross', 'class' => 'bot', 'title' => __('All systems').': '.__('Down')]);
} } else if ($servers['down'] != 0) {
elseif ($servers["down"] != 0) {
// Some servers down // Some servers down
$servers_check_img = html_print_image("images/header_warning.png", true, array("alt" => 'error', "class" => 'bot', 'title' => $servers["down"].' '.__('servers down'))); $servers_check_img = html_print_image('images/header_warning.png', true, ['alt' => 'error', 'class' => 'bot', 'title' => $servers['down'].' '.__('servers down')]);
} } else {
else {
// All servers up // All servers up
$servers_check_img = html_print_image("images/header_ready.png", true, array("alt" => 'ok', "class" => 'bot', 'title' => __('All systems').': '.__('Ready'))); $servers_check_img = html_print_image('images/header_ready.png', true, ['alt' => 'ok', 'class' => 'bot', 'title' => __('All systems').': '.__('Ready')]);
} }
unset ($servers); // Since this is the header, we don't like to trickle down variables.
unset($servers);
// Since this is the header, we don't like to trickle down variables.
$servers_link_open = '<a class="white" href="index.php?sec=gservers&amp;sec2=godmode/servers/modificar_server&amp;refr=60">'; $servers_link_open = '<a class="white" href="index.php?sec=gservers&amp;sec2=godmode/servers/modificar_server&amp;refr=60">';
$servers_link_close = '</a>'; $servers_link_close = '</a>';
if ($config['show_qr_code_header'] == 0) { if ($config['show_qr_code_header'] == 0) {
$show_qr_code_header = 'display: none;'; $show_qr_code_header = 'display: none;';
} } else {
else {
$show_qr_code_header = 'display: inline;'; $show_qr_code_header = 'display: inline;';
} }
$table->data[0]['qr'] = $table->data[0]['qr'] = '<div style="'.$show_qr_code_header.'" id="qr_code_container" style="">'.'<a href="javascript: show_dialog_qrcode();">'.html_print_image(
'<div style="' . $show_qr_code_header . '" id="qr_code_container" style="">' . 'images/qrcode_icon.png',
'<a href="javascript: show_dialog_qrcode();">' .
html_print_image(
"images/qrcode_icon.png",
true, true,
array("alt" => __('QR Code of the page'), [
'title' => __('QR Code of the page'))) . 'alt' => __('QR Code of the page'),
'</a>' . 'title' => __('QR Code of the page'),
'</div>'; ]
).'</a>'.'</div>';
echo "<div style='display: none;' id='qrcode_container' title='".__('QR code of the page')."'>"; echo "<div style='display: none;' id='qrcode_container' title='".__('QR code of the page')."'>";
echo "<div id='qrcode_container_image'></div>"; echo "<div id='qrcode_container_image'></div>";
echo "</div>"; echo '</div>';
?> ?>
<script type='text/javascript'> <script type='text/javascript'>
$(document).ready(function() { $(document).ready(function() {
@ -168,23 +159,24 @@ config_check();
}); });
</script> </script>
<?php <?php
if ($config['tutorial_mode'] !== 'expert' && !$config['disable_help']) { if ($config['tutorial_mode'] !== 'expert' && !$config['disable_help']) {
$table->data[0]['clippy'] = $table->data[0]['clippy'] = '<a href="javascript: show_clippy();">'.html_print_image(
'<a href="javascript: show_clippy();">' . 'images/clippy_icon.png',
html_print_image(
"images/clippy_icon.png",
true, true,
array("id" => 'clippy', [
"class" => 'clippy', 'id' => 'clippy',
"alt" => __('%s assistant', get_product_name()), 'class' => 'clippy',
'title' => __('%s assistant', get_product_name()))) . 'alt' => __('%s assistant', get_product_name()),
'</a>'; 'title' => __(
'%s assistant',
get_product_name()
),
]
).'</a>';
} }
$table->data[0][0] = $servers_link_open . $table->data[0][0] = $servers_link_open.$servers_check_img.$servers_link_close;
$servers_check_img . $servers_link_close;
@ -193,11 +185,15 @@ config_check();
$autorefresh_txt = ''; $autorefresh_txt = '';
$autorefresh_additional = ''; $autorefresh_additional = '';
$ignored_params = array ('agent_config' => false, 'code' => false); $ignored_params = [
'agent_config' => false,
'code' => false,
];
if (!isset($_GET['sec2'])) { if (!isset($_GET['sec2'])) {
$_GET['sec2'] = ''; $_GET['sec2'] = '';
} }
if (!isset($_GET['refr'])) { if (!isset($_GET['refr'])) {
$_GET['refr'] = null; $_GET['refr'] = null;
} }
@ -214,10 +210,10 @@ config_check();
} }
if ($do_refresh) { if ($do_refresh) {
$autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh'))); $autorefresh_img = html_print_image('images/header_refresh.png', true, ['class' => 'bot', 'alt' => 'lightning', 'title' => __('Configure autorefresh')]);
if ($_GET['refr']) { if ($_GET['refr']) {
$autorefresh_txt .= ' (<span id="refrcounter">'.date ("i:s", $config["refr"]).'</span>)'; $autorefresh_txt .= ' (<span id="refrcounter">'.date('i:s', $config['refr']).'</span>)';
} }
$ignored_params['refr'] = ''; $ignored_params['refr'] = '';
@ -227,21 +223,17 @@ config_check();
$autorefresh_additional .= '</span>'; $autorefresh_additional .= '</span>';
unset($values); unset($values);
$autorefresh_link_open_img = $autorefresh_link_open_img = '<a class="white autorefresh" href="'.ui_get_url_refresh($ignored_params).'">';
'<a class="white autorefresh" href="' . ui_get_url_refresh ($ignored_params) . '">';
if ($_GET['refr']) { if ($_GET['refr']) {
$autorefresh_link_open_txt = $autorefresh_link_open_txt = '<a class="white autorefresh autorefresh_txt" href="'.ui_get_url_refresh($ignored_params).'">';
'<a class="white autorefresh autorefresh_txt" href="' . ui_get_url_refresh ($ignored_params) . '">'; } else {
}
else {
$autorefresh_link_open_txt = '<a>'; $autorefresh_link_open_txt = '<a>';
} }
$autorefresh_link_close = '</a>'; $autorefresh_link_close = '</a>';
} } else {
else { $autorefresh_img = html_print_image('images/header_refresh_disabled.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]);
$autorefresh_img = html_print_image("images/header_refresh_disabled.png", true, array("class" => 'bot autorefresh_disabled', "alt" => 'lightning', 'title' => __('Disabled autorefresh')));
$ignored_params['refr'] = false; $ignored_params['refr'] = false;
@ -249,9 +241,8 @@ config_check();
$autorefresh_link_open_txt = ''; $autorefresh_link_open_txt = '';
$autorefresh_link_close = ''; $autorefresh_link_close = '';
} }
} } else {
else { $autorefresh_img = html_print_image('images/header_refresh_disabled.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]);
$autorefresh_img = html_print_image("images/header_refresh_disabled.png", true, array("class" => 'bot autorefresh_disabled', "alt" => 'lightning', 'title' => __('Disabled autorefresh')));
$ignored_params['refr'] = false; $ignored_params['refr'] = false;
@ -263,55 +254,52 @@ config_check();
$table->data[0][1] = $autorefresh_link_open_img.$autorefresh_img.$autorefresh_link_close; $table->data[0][1] = $autorefresh_link_open_img.$autorefresh_img.$autorefresh_link_close;
$table->data[0][2] = $autorefresh_link_open_txt.$autorefresh_txt.$autorefresh_link_close.$autorefresh_additional; $table->data[0][2] = $autorefresh_link_open_txt.$autorefresh_txt.$autorefresh_link_close.$autorefresh_additional;
// ====================================================== // ======================================================
$check_minor_release_available = false; $check_minor_release_available = false;
$pandora_management = check_acl($config['id_user'], 0, "PM"); $pandora_management = check_acl($config['id_user'], 0, 'PM');
$check_minor_release_available = db_check_minor_relase_available(); $check_minor_release_available = db_check_minor_relase_available();
if ($check_minor_release_available) { if ($check_minor_release_available) {
if (users_is_admin($config['id_user'])) { if (users_is_admin($config['id_user'])) {
if ($config['language'] == 'es') { if ($config['language'] == 'es') {
set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. <a style="font-size:8pt;font-style:italic;" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Actualizacion#Versi.C3.B3n_7.0NG_.28_Rolling_Release_.29">'.__('Sobre actualización de revisión menor').'</a>', 'Revisión/es menor/es disponible/s'); set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. <a style="font-size:8pt;font-style:italic;" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Actualizacion#Versi.C3.B3n_7.0NG_.28_Rolling_Release_.29">'.__('Sobre actualización de revisión menor').'</a>', 'Revisión/es menor/es disponible/s');
} } else {
else{
set_pandora_error_for_header('There are one or more minor releases waiting for update. <a style="font-size:8pt;font-style:italic;" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Anexo_Upgrade#Version_7.0NG_.28_Rolling_Release_.29">'.__('About minor release update').'</a>', 'minor release/s available'); set_pandora_error_for_header('There are one or more minor releases waiting for update. <a style="font-size:8pt;font-style:italic;" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Anexo_Upgrade#Version_7.0NG_.28_Rolling_Release_.29">'.__('About minor release update').'</a>', 'minor release/s available');
} }
} }
} }
echo '<div id="alert_messages" style="display: none"></div>'; echo '<div id="alert_messages" style="display: none"></div>';
if ($config["alert_cnt"] > 0) { if ($config['alert_cnt'] > 0) {
$maintenance_link = 'javascript:'; $maintenance_link = 'javascript:';
$maintenance_title = __("System alerts detected - Please fix as soon as possible"); $maintenance_title = __('System alerts detected - Please fix as soon as possible');
$maintenance_class = $maintenance_id = 'show_systemalert_dialog white'; $maintenance_class = $maintenance_id = 'show_systemalert_dialog white';
$maintenance_link_open_txt = $maintenance_link_open_txt = '<a href="'.$maintenance_link.'" title="'.$maintenance_title.'" class="'.$maintenance_class.'" id="show_systemalert_dialog">';
'<a href="' . $maintenance_link . '" title="' . $maintenance_title . '" class="' . $maintenance_class . '" id="show_systemalert_dialog">'; $maintenance_link_open_img = '<a href="'.$maintenance_link.'" title="'.$maintenance_title.'" class="'.$maintenance_class.'">';
$maintenance_link_open_img =
'<a href="' . $maintenance_link . '" title="' . $maintenance_title . '" class="' . $maintenance_class . '">';
$maintenance_link_close = '</a>'; $maintenance_link_close = '</a>';
if (!$pandora_management) { if (!$pandora_management) {
$maintenance_img = ''; $maintenance_img = '';
} else {
$maintenance_img = $maintenance_link_open_img.html_print_image(
'images/header_yellow.png',
true,
[
'title' => __(
'You have %d warning(s)',
$config['alert_cnt']
),
'id' => 'yougotalert',
'class' => 'bot',
]
).$maintenance_link_close;
} }
else { } else {
$maintenance_img = $maintenance_link_open_img .
html_print_image("images/header_yellow.png",
true, array(
"title" => __('You have %d warning(s)',
$config["alert_cnt"]),
"id" => "yougotalert",
"class" => "bot")) . $maintenance_link_close;
}
}
else {
if (!$pandora_management) { if (!$pandora_management) {
$maintenance_img = ''; $maintenance_img = '';
} } else {
else { $maintenance_img = html_print_image('images/header_ready.png', true, ['title' => __('There are not warnings'), 'id' => 'yougotalert', 'class' => 'bot']);
$maintenance_img = html_print_image ("images/header_ready.png", true, array ("title" => __('There are not warnings'), "id" => "yougotalert", "class" => "bot"));
} }
} }
@ -319,44 +307,47 @@ config_check();
// Main help icon // Main help icon
if (!$config['disable_help']) { if (!$config['disable_help']) {
$table->data[0][4] = $table->data[0][4] = '<a href="#" class="modalpopup" id="helpmodal">'.html_print_image(
'<a href="#" class="modalpopup" id="helpmodal">' . 'images/header_help.png',
html_print_image("images/header_help.png", true, array( true,
"title" => __('Main help'), [
"id" => "helpmodal", 'title' => __('Main help'),
"class" => "modalpopup")) . 'id' => 'helpmodal',
'</a>'; 'class' => 'modalpopup',
]
).'</a>';
} }
// Logout // Logout
$table->data[0][5] = '<a class="white" href="'.ui_get_full_url('index.php?bye=bye').'">'; $table->data[0][5] = '<a class="white" href="'.ui_get_full_url('index.php?bye=bye').'">';
$table->data[0][5] .= html_print_image("images/header_logout.png", true, array("alt" => __('Logout'), "class" => 'bot', "title" => __('Logout'))); $table->data[0][5] .= html_print_image('images/header_logout.png', true, ['alt' => __('Logout'), 'class' => 'bot', 'title' => __('Logout')]);
$table->data[0][5] .= '</a>'; $table->data[0][5] .= '</a>';
// User // User
if (is_user_admin ($config["id_user"]) == 1) if (is_user_admin($config['id_user']) == 1) {
$table->data[0][6] = html_print_image("images/header_user_admin.png" , true, array("title" => __('Edit my user'), "class" => 'bot', "alt" => 'user')); $table->data[0][6] = html_print_image('images/header_user_admin.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']);
else } else {
$table->data[0][6] = html_print_image("images/header_user.png" , true, array("title" => __('Edit my user'), "class" => 'bot', "alt" => 'user')); $table->data[0][6] = html_print_image('images/header_user.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']);
}
$table->data[0][6] = '<a href="index.php?sec=workspace&sec2=operation/users/user_edit">'.$table->data[0][6].'</a>'; $table->data[0][6] = '<a href="index.php?sec=workspace&sec2=operation/users/user_edit">'.$table->data[0][6].'</a>';
$table->data[0][7] = '<a href="index.php?sec=workspace&amp;sec2=operation/users/user_edit" class="white_bold"> (' . $config["id_user"] . ')</a>'; $table->data[0][7] = '<a href="index.php?sec=workspace&amp;sec2=operation/users/user_edit" class="white_bold"> ('.$config['id_user'].')</a>';
// Chat messages // Chat messages
$table->data[0][8] = "<span id='icon_new_messages_chat' style='display: none;'>"; $table->data[0][8] = "<span id='icon_new_messages_chat' style='display: none;'>";
$table->data[0][8] .= "<a href='index.php?sec=workspace&sec2=operation/users/webchat'>"; $table->data[0][8] .= "<a href='index.php?sec=workspace&sec2=operation/users/webchat'>";
$table->data[0][8] .= html_print_image('images/header_chat.png', true, array("title" => __('New chat message'))); $table->data[0][8] .= html_print_image('images/header_chat.png', true, ['title' => __('New chat message')]);
$table->data[0][8] .= "</a>"; $table->data[0][8] .= '</a>';
$table->data[0][8] .= "</span>"; $table->data[0][8] .= '</span>';
// Messages // Messages
$msg_cnt = messages_get_count ($config["id_user"]); $msg_cnt = messages_get_count($config['id_user']);
if ($msg_cnt > 0) { if ($msg_cnt > 0) {
echo '<div id="dialog_messages" style="display: none"></div>'; echo '<div id="dialog_messages" style="display: none"></div>';
$table->data[0][9] = '<a href="ajax.php?page=operation/messages/message_list" title="' . __("Message overview") . '" id="show_messages_dialog">'; $table->data[0][9] = '<a href="ajax.php?page=operation/messages/message_list" title="'.__('Message overview').'" id="show_messages_dialog">';
$table->data[0][9] .= html_print_image ("images/header_email.png", true, array ("title" => __('You have %d unread message(s)', $msg_cnt), "id" => "yougotmail", "class" => "bot", 'style' => 'width:24px;')); $table->data[0][9] .= html_print_image('images/header_email.png', true, ['title' => __('You have %d unread message(s)', $msg_cnt), 'id' => 'yougotmail', 'class' => 'bot', 'style' => 'width:24px;']);
$table->data[0][9] .= '</a>'; $table->data[0][9] .= '</a>';
} }
@ -371,10 +362,11 @@ config_check();
<td style="text-align:center"> <td style="text-align:center">
<?php <?php
echo "<a href='index.php?sec=main'>"; echo "<a href='index.php?sec=main'>";
if (isset($config["custom_logo"])) { if (isset($config['custom_logo'])) {
echo html_print_image("images/custom_logo/" . $config["custom_logo"], true, array("height" => '60', "width" => '139', "alt" => 'Logo')); echo html_print_image('images/custom_logo/'.$config['custom_logo'], true, ['height' => '60', 'width' => '139', 'alt' => 'Logo']);
} }
echo "</a>";
echo '</a>';
?> ?>
</td> </td>
--> -->
@ -396,7 +388,7 @@ config_check();
var new_chat = <?php echo (int) $_SESSION['new_chat']; ?>; var new_chat = <?php echo (int) $_SESSION['new_chat']; ?>;
$(document).ready (function () { $(document).ready (function () {
<?php <?php
if (($autorefresh_list !== null) && (array_search($_GET['sec2'], $autorefresh_list) !== false) && (!isset($_GET["refr"]))) { if (($autorefresh_list !== null) && (array_search($_GET['sec2'], $autorefresh_list) !== false) && (!isset($_GET['refr']))) {
$do_refresh = true; $do_refresh = true;
if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') { if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') {
if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) { if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) {
@ -419,7 +411,7 @@ config_check();
<?php <?php
if ($select[0]['time_autorefresh']) { if ($select[0]['time_autorefresh']) {
?> ?>
var refresh = '<?php echo $select[0]["time_autorefresh"] ?>'; var refresh = '<?php echo $select[0]['time_autorefresh']; ?>';
$(document).attr ("location", href + refresh); $(document).attr ("location", href + refresh);
<?php <?php
} }
@ -466,7 +458,7 @@ config_check();
<?php <?php
if ($config["alert_cnt"] > 0) { if ($config['alert_cnt'] > 0) {
?> ?>
blinkalert(); blinkalert();
<?php <?php
@ -475,12 +467,12 @@ config_check();
blinkpubli(); blinkpubli();
<?php <?php
if ($_GET["refr"]) { if ($_GET['refr']) {
?> ?>
var refr_time = <?php echo (int) get_parameter("refr", 0); ?>; var refr_time = <?php echo (int) get_parameter('refr', 0); ?>;
var t = new Date(); var t = new Date();
t.setTime (t.getTime () + t.setTime (t.getTime () +
parseInt(<?php echo $config["refr"] * 1000; ?>)); parseInt(<?php echo ($config['refr'] * 1000); ?>));
$("#refrcounter").countdown ({until: t, $("#refrcounter").countdown ({until: t,
layout: '%M%nn%M:%S%nn%S', layout: '%M%nn%M:%S%nn%S',
labels: ['', '', '', '', '', '', ''], labels: ['', '', '', '', '', '', ''],

View File

@ -4,11 +4,9 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2016 Artica Soluciones Tecnologicas // Copyright (c) 2005-2016 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ -20,34 +18,35 @@
global $config; global $config;
include_once("include/functions_update_manager.php"); require_once 'include/functions_update_manager.php';
$message = array(); $message = [];
if (is_ajax()) { if (is_ajax()) {
$message_id = get_parameter('message_id', false); $message_id = get_parameter('message_id', false);
if ($message_id === false) return false; if ($message_id === false) {
return false;
}
$message = update_manger_get_single_message($message_id); $message = update_manger_get_single_message($message_id);
} else { } else {
$message = update_manger_get_last_message(); $message = update_manger_get_last_message();
if ($message === false) return false; if ($message === false) {
return false;
}
update_manger_set_read_message($message["svn_version"], 1); update_manger_set_read_message($message['svn_version'], 1);
update_manager_remote_read_messages ($message["svn_version"]); update_manager_remote_read_messages($message['svn_version']);
} }
// Prints first step pandora registration // Prints first step pandora registration
echo '<div id="message_id_dialog" title="' . echo '<div id="message_id_dialog" title="'.io_safe_output($message['db_field_value']).'">';
io_safe_output($message['db_field_value']) . '">';
echo '<div>'; echo '<div>';
echo io_safe_output_html($message["data"]); echo io_safe_output_html($message['data']);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';

View File

@ -3,390 +3,540 @@
<title>Licencia P&uacute;blica GNU</title> <title>Licencia P&uacute;blica GNU</title>
</head> </head>
<body> <body>
<h2>Licencia P&uacute;blica GNU</h2> <h2>Licencia P&uacute;blica GNU</h2>
<h3>Contenido</h3> <h3>Contenido</h3>
<ul> <ul>
<li><a href="#SEC1">Licencia P&uacute;blica GNU</a></li> <li><a href="#SEC1">Licencia P&uacute;blica GNU</a></li>
<li><a href="#SEC2">Pre&aacute;mbulo</a></li> <li><a href="#SEC2">Pre&aacute;mbulo</a></li>
<li><a href="#SEC3">T&eacute;rminos y condiciones para la copia, <li>
distribuci&oacute;n y modificaci&oacute;n</a></li> <a href="#SEC3"
<li><a href="#APPENDIX">Ap&eacute;ndice: C&oacute;mo aplicar estos >T&eacute;rminos y condiciones para la copia, distribuci&oacute;n y
t&eacute;rminos a sus nuevos programas</a></li> modificaci&oacute;n</a
>
</li>
<li>
<a href="#APPENDIX"
>Ap&eacute;ndice: C&oacute;mo aplicar estos t&eacute;rminos a sus
nuevos programas</a
>
</li>
</ul> </ul>
<br> <br />
<h3><a name="SEC1">Licencia P&uacute;blica GNU</a></h3> <h3><a name="SEC1">Licencia P&uacute;blica GNU</a></h3>
<p> <p>
Esta es la conocida GNU Public License (GPL), versi&oacute;n 2 (de junio Esta es la conocida GNU Public License (GPL), versi&oacute;n 2 (de junio
de 1.991), que cubre la mayor parte del software de la Free Software Foundation, de 1.991), que cubre la mayor parte del software de la Free Software
y muchos m&aacute;s programas.</p> Foundation, y muchos m&aacute;s programas.
</p>
<p>Los autores de esta traducci&oacute;n son:</p> <p>Los autores de esta traducci&oacute;n son:</p>
<ul><li><a href="mailto:jgb@computer.org">Jes&uacute;s Gonz&aacute;lez Barahona</a> <ul>
</li><li><a href="mailto:pheras@acm.org">Pedro de las Heras Quir&oacute;s</a> <li>
</li></ul> <a href="mailto:jgb@computer.org"
>Jes&uacute;s Gonz&aacute;lez Barahona</a
>
</li>
<li>
<a href="mailto:pheras@acm.org">Pedro de las Heras Quir&oacute;s</a>
</li>
</ul>
<blockquote> <blockquote>
<hr> <hr />
<b>NOTA IMPORTANTE:</b> <b>NOTA IMPORTANTE:</b>
<p> <p>
Esta es una traducci&oacute;n no oficial al espa&ntilde;ol de la GNU General Public Esta es una traducci&oacute;n no oficial al espa&ntilde;ol de la GNU
License. No ha sido publicada por la Free Software Foundation, y no General Public License. No ha sido publicada por la Free Software
establece legalmente las condiciones de distribuci&oacute;n para el software Foundation, y no establece legalmente las condiciones de
que usa la GNU GPL. Estas condiciones se establecen solamente por distribuci&oacute;n para el software que usa la GNU GPL. Estas
el texto original, en ingl&eacute;s, de la GNU GPL. Sin embargo, esperamos condiciones se establecen solamente por el texto original, en
que esta traducci&oacute;n ayude a los hispanohablantes a entender mejor la ingl&eacute;s, de la GNU GPL. Sin embargo, esperamos que esta
GNU GPL. traducci&oacute;n ayude a los hispanohablantes a entender mejor la GNU
</p><p> GPL.
</p>
<b>IMPORTANT NOTICE:</b> <p><b>IMPORTANT NOTICE:</b></p>
</p><p> <p>
This is an unofficial translation of the GNU General Public License This is an unofficial translation of the GNU General Public License into
into Spanish. It was not published by the Free Software Spanish. It was not published by the Free Software Foundation, and does
Foundation, and does not legally state the distribution terms for not legally state the distribution terms for software that uses the GNU
software that uses the GNU GPL--only the original English text of GPL--only the original English text of the GNU GPL does that. However,
the GNU GPL does that. However, we hope that this translation will we hope that this translation will help Spanish speakers understand the
help Spanish speakers understand the GNU GPL better. GNU GPL better.
</p><p> </p>
</p><hr> <p></p>
<hr />
</blockquote> </blockquote>
<p>Copyright (C) 1989, 1991 Free Software Foundation, Inc. <p>Copyright (C) 1989, 1991 Free Software Foundation, Inc.</p>
</p><p>675 Mass Ave, Cambridge, MA 02139, EEUU <p>675 Mass Ave, Cambridge, MA 02139, EEUU</p>
</p><p>Se permite la copia y distribuci&oacute;n de copias literales de este <p>
Se permite la copia y distribuci&oacute;n de copias literales de este
documento, pero no se permite su modificaci&oacute;n. documento, pero no se permite su modificaci&oacute;n.
</p> </p>
<h3><a name="SEC2">Pre&aacute;mbulo</a></h3> <h3><a name="SEC2">Pre&aacute;mbulo</a></h3>
<p> <p>
Las licencias que cubren la mayor parte del software est&aacute;n dise&ntilde;adas Las licencias que cubren la mayor parte del software est&aacute;n
para quitarle a usted la libertad de compartirlo y modificarlo. Por el dise&ntilde;adas para quitarle a usted la libertad de compartirlo y
contrario, la Licencia P&uacute;blica General de GNU pretende garantizarle modificarlo. Por el contrario, la Licencia P&uacute;blica General de GNU
la libertad de compartir y modificar software libre, para asegurar que pretende garantizarle la libertad de compartir y modificar software libre,
el software es libre para todos sus usuarios. Esta Licencia P&uacute;blica para asegurar que el software es libre para todos sus usuarios. Esta
General se aplica a la mayor parte del software del la Free Software Foundation Licencia P&uacute;blica General se aplica a la mayor parte del software
y a cualquier otro programa si sus autores se comprometen a utilizarla. del la Free Software Foundation y a cualquier otro programa si sus autores
(Existe otro software de la Free Software Foundation que est&aacute; cubierto se comprometen a utilizarla. (Existe otro software de la Free Software
por la Licencia P&uacute;blica General de GNU para Bibliotecas). Si quiere, Foundation que est&aacute; cubierto por la Licencia P&uacute;blica General
tambi&eacute;n puede aplicarla a sus propios programas.</p> de GNU para Bibliotecas). Si quiere, tambi&eacute;n puede aplicarla a sus
<p>Cuando hablamos de software libre, estamos refiri&eacute;ndonos a libertad, propios programas.
no a precio. Nuestras Licencias P&uacute;blicas Generales est&aacute;n </p>
dise&ntilde;adas para asegurarnos de que tenga la libertad de distribuir
copias de software libre (y cobrar por ese servicio si quiere), de que
reciba el c&oacute;digo fuente o que pueda conseguirlo si lo quiere, de
que pueda modificar el software o usar fragmentos de &eacute;l en nuevos
programas libres, y de que sepa que puede hacer todas estas cosas.
</p><p>Para proteger sus derechos necesitamos algunas restricciones que prohiban
a cualquiera negarle a usted estos derechos o pedirle que renuncie a ellos.
Estas restricciones se traducen en ciertas obligaciones que le afectan
si distribuye copias del software, o si lo modifica.
</p><p>Por ejemplo, si distribuye copias de uno de estos programas, sea gratuitamente,
o a cambio de una contraprestaci&oacute;n, debe dar a los receptores todos
los derechos que tiene. Debe asegurarse de que ellos tambi&eacute;n reciben,
o pueden conseguir, el c&oacute;digo fuente. Y debe mostrarles estas condiciones
de forma que conozcan sus derechos.
</p><p>Protegemos sus derechos con la combinaci&oacute;n de dos medidas:
</p><ol type="1">
<li>Ponemos el software bajo copyright y
</li><li>le ofrecemos esta licencia, que le da permiso legal para copiar, distribuir
y/o modificar el software.</li></ol>
<p> <p>
Tambi&eacute;n, para la protecci&oacute;n de cada autor y la nuestra propia, Cuando hablamos de software libre, estamos refiri&eacute;ndonos a
queremos asegurarnos de que todo el mundo comprende que no se proporciona libertad, no a precio. Nuestras Licencias P&uacute;blicas Generales
ninguna garant&iacute;a para este software libre. Si el software se modifica est&aacute;n dise&ntilde;adas para asegurarnos de que tenga la libertad de
por cualquiera y &eacute;ste a su vez lo distribuye, queremos que sus receptores distribuir copias de software libre (y cobrar por ese servicio si quiere),
sepan que lo que tienen no es el original, de forma que cualquier problema de que reciba el c&oacute;digo fuente o que pueda conseguirlo si lo
introducido por otros no afecte a la reputaci&oacute;n de los autores originales.</p> quiere, de que pueda modificar el software o usar fragmentos de &eacute;l
<p>Por &uacute;ltimo, cualquier programa libre est&aacute; constantemente en nuevos programas libres, y de que sepa que puede hacer todas estas
cosas.
</p>
<p>
Para proteger sus derechos necesitamos algunas restricciones que prohiban
a cualquiera negarle a usted estos derechos o pedirle que renuncie a
ellos. Estas restricciones se traducen en ciertas obligaciones que le
afectan si distribuye copias del software, o si lo modifica.
</p>
<p>
Por ejemplo, si distribuye copias de uno de estos programas, sea
gratuitamente, o a cambio de una contraprestaci&oacute;n, debe dar a los
receptores todos los derechos que tiene. Debe asegurarse de que ellos
tambi&eacute;n reciben, o pueden conseguir, el c&oacute;digo fuente. Y
debe mostrarles estas condiciones de forma que conozcan sus derechos.
</p>
<p>Protegemos sus derechos con la combinaci&oacute;n de dos medidas:</p>
<ol type="1">
<li>Ponemos el software bajo copyright y</li>
<li>
le ofrecemos esta licencia, que le da permiso legal para copiar,
distribuir y/o modificar el software.
</li>
</ol>
<p>
Tambi&eacute;n, para la protecci&oacute;n de cada autor y la nuestra
propia, queremos asegurarnos de que todo el mundo comprende que no se
proporciona ninguna garant&iacute;a para este software libre. Si el
software se modifica por cualquiera y &eacute;ste a su vez lo distribuye,
queremos que sus receptores sepan que lo que tienen no es el original, de
forma que cualquier problema introducido por otros no afecte a la
reputaci&oacute;n de los autores originales.
</p>
<p>
Por &uacute;ltimo, cualquier programa libre est&aacute; constantemente
amenazado por patentes sobre el software. Queremos evitar el peligro de amenazado por patentes sobre el software. Queremos evitar el peligro de
que los redistribuidores de un programa libre obtengan patentes por su que los redistribuidores de un programa libre obtengan patentes por su
cuenta, convirtiendo de facto el programa en propietario. Para evitar esto, cuenta, convirtiendo de facto el programa en propietario. Para evitar
hemos dejado claro que cualquier patente debe ser pedida para el uso libre esto, hemos dejado claro que cualquier patente debe ser pedida para el uso
de cualquiera, o no ser pedida. libre de cualquiera, o no ser pedida.
</p><p>Los t&eacute;rminos exactos y las condiciones para la copia, distribuci&oacute;n </p>
y modificaci&oacute;n se exponen a continuaci&oacute;n.</p> <p>
Los t&eacute;rminos exactos y las condiciones para la copia,
distribuci&oacute;n y modificaci&oacute;n se exponen a
continuaci&oacute;n.
</p>
<h3><a name="SEC3">T&eacute;rminos y condiciones para la copia, <h3>
distribuci&oacute;n y modificaci&oacute;n</a></h3> <a name="SEC3"
>T&eacute;rminos y condiciones para la copia, distribuci&oacute;n y
modificaci&oacute;n</a
>
</h3>
<ol type="1"> <ol type="1">
<li>Esta Licencia se aplica a cualquier programa u otro tipo <li>
de trabajo que contenga una nota colocada por el tenedor del copyright Esta Licencia se aplica a cualquier programa u otro tipo de trabajo que
diciendo que puede ser distribuido bajo los t&eacute;rminos de esta Licencia contenga una nota colocada por el tenedor del copyright diciendo que
P&uacute;blica General. En adelante, &laquo;Programa&raquo; se referir&aacute; puede ser distribuido bajo los t&eacute;rminos de esta Licencia
a cualquier programa o trabajo que cumpla esa condici&oacute;n y &laquo;trabajo P&uacute;blica General. En adelante, &laquo;Programa&raquo; se
basado en el Programa&raquo; se referir&aacute; bien al Programa o a cualquier referir&aacute; a cualquier programa o trabajo que cumpla esa
trabajo derivado de &eacute;l seg&uacute;n la ley de copyright. Esto es, condici&oacute;n y &laquo;trabajo basado en el Programa&raquo; se
un trabajo que contenga el programa o una proci&oacute;n de &eacute;l, referir&aacute; bien al Programa o a cualquier trabajo derivado de
bien en forma literal o con modificaciones y/o traducido en otro lenguaje. &eacute;l seg&uacute;n la ley de copyright. Esto es, un trabajo que
Por lo tanto, la traducci&oacute;n est&aacute; incluida sin limitaciones contenga el programa o una proci&oacute;n de &eacute;l, bien en forma
en el t&eacute;rmino &laquo;modificaci&oacute;n&raquo;. Cada concesionario literal o con modificaciones y/o traducido en otro lenguaje. Por lo
tanto, la traducci&oacute;n est&aacute; incluida sin limitaciones en el
t&eacute;rmino &laquo;modificaci&oacute;n&raquo;. Cada concesionario
(licenciatario) ser&aacute; denominado &laquo;usted&raquo;. (licenciatario) ser&aacute; denominado &laquo;usted&raquo;.
<p>Cualquier otra actividad que no sea la copia, distribuci&oacute;n o <p>
modificaci&oacute;n no est&aacute; cubierta por esta Licencia, est&aacute; Cualquier otra actividad que no sea la copia, distribuci&oacute;n o
fuera de su &aacute;mbito. El acto de ejecutar el Programa no est&aacute; modificaci&oacute;n no est&aacute; cubierta por esta Licencia,
restringido, y los resultados del Programa est&aacute;n cubiertos &uacute;nicamente est&aacute; fuera de su &aacute;mbito. El acto de ejecutar el Programa
si sus contenidos constituyen un trabajo basado en el Programa, independientemente no est&aacute; restringido, y los resultados del Programa est&aacute;n
de haberlo producido mediante la ejecuci&oacute;n del programa. El que cubiertos &uacute;nicamente si sus contenidos constituyen un trabajo
esto se cumpla, depende de lo que haga el programa. basado en el Programa, independientemente de haberlo producido
</p></li><li>Usted puede copiar y distribuir copias literales del c&oacute;digo fuente mediante la ejecuci&oacute;n del programa. El que esto se cumpla,
del Programa, seg&uacute;n lo has recibido, en cualquier medio, supuesto depende de lo que haga el programa.
que de forma adecuada y bien visible publique en cada copia un anuncio </p>
de copyright adecuado y un repudio de garant&iacute;a, mantenga intactos </li>
todos los anuncios que se refieran a esta Licencia y a la ausencia de garant&iacute;a, <li>
y proporcione a cualquier otro receptor del programa una copia de esta Usted puede copiar y distribuir copias literales del c&oacute;digo
Licencia junto con el Programa. fuente del Programa, seg&uacute;n lo has recibido, en cualquier medio,
<p>Puede cobrar un precio por el acto f&iacute;sico de transferir una copia, supuesto que de forma adecuada y bien visible publique en cada copia un
y puede, seg&uacute;n su libre albedr&iacute;o, ofrecer garant&iacute;a anuncio de copyright adecuado y un repudio de garant&iacute;a, mantenga
a cambio de unos honorarios. intactos todos los anuncios que se refieran a esta Licencia y a la
</p></li><li>Puede modificar su copia o copias del Programa o de cualquier porci&oacute;n ausencia de garant&iacute;a, y proporcione a cualquier otro receptor del
de &eacute;l, formando de esta manera un trabajo basado en el Programa, programa una copia de esta Licencia junto con el Programa.
y copiar y distribuir esa modificaci&oacute;n o trabajo bajo los t&eacute;rminos <p>
del apartado 1, antedicho, supuesto que adem&aacute;s cumpla las siguientes Puede cobrar un precio por el acto f&iacute;sico de transferir una
copia, y puede, seg&uacute;n su libre albedr&iacute;o, ofrecer
garant&iacute;a a cambio de unos honorarios.
</p>
</li>
<li>
Puede modificar su copia o copias del Programa o de cualquier
porci&oacute;n de &eacute;l, formando de esta manera un trabajo basado
en el Programa, y copiar y distribuir esa modificaci&oacute;n o trabajo
bajo los t&eacute;rminos del apartado 1, antedicho, supuesto que
adem&aacute;s cumpla las siguientes condiciones:
<ol type="a">
<li>
Debe hacer que los ficheros modificados lleven anuncios prominentes
indicando que los ha cambiado y la fecha de cualquier cambio.
</li>
<li>
Debe hacer que cualquier trabajo que distribuya o publique y que en
todo o en parte contenga o sea derivado del Programa o de cualquier
parte de &eacute;l sea licenciada como un todo, sin carga alguna, a
todas las terceras partes y bajo los t&eacute;rminos de esta
Licencia.
</li>
<li>
Si el programa modificado lee normalmente &oacute;rdenes
interactivamente cuando es ejecutado, debe hacer que, cuando
comience su ejecuci&oacute;n para ese uso interactivo de la forma
m&aacute;s habitual, muestre o escriba un mensaje que incluya un
anuncio de copyright y un anuncio de que no se ofrece ninguna
garant&iacute;a (o por el contrario que s&iacute; se ofrece
garant&iacute;a) y que los usuarios pueden redistribuir el programa
bajo estas condiciones, e indicando al usuario c&oacute;mo ver una
copia de esta licencia. (Excepci&oacute;n: si el propio programa es
interactivo pero normalmente no muestra ese anuncio, no se requiere
que su trabajo basado en el Programa muestre ning&uacute;n anuncio).
</li>
</ol>
Estos requisitos se aplican al trabajo modificado como un todo. Si
partes identificables de ese trabajo no son derivadas del Programa, y
pueden, razonablemente, ser consideradas trabajos independientes y
separados por ellos mismos, entonces esta Licencia y sus t&eacute;rminos
no se aplican a esas partes cuando sean distribuidas como trabajos
separados. Pero cuando distribuya esas mismas secciones como partes de
un todo que es un trabajo basado en el Programa, la distribuci&oacute;n
del todo debe ser seg&uacute;n los t&eacute;rminos de esta licencia,
cuyos permisos para otros licenciatarios se extienden al todo completo,
y por lo tanto a todas y cada una de sus partes, con independencia de
qui&eacute;n la escribi&oacute;.
<p>
Por lo tanto, no es la intenci&oacute;n de este apartado reclamar
derechos o desafiar sus derechos sobre trabajos escritos totalmente
por usted mismo. El intento es ejercer el derecho a controlar la
distribuci&oacute;n de trabajos derivados o colectivos basados en el
Programa.
</p>
<p>
Adem&aacute;s, el simple hecho de reunir un trabajo no basado en el
Programa con el Programa (o con un trabajo basado en el Programa) en
un volumen de almacenamiento o en un medio de distribuci&oacute;n no
hace que dicho trabajo entre dentro del &aacute;mbito cubierto por
esta Licencia.
</p>
</li>
<li>
Puede copiar y distribuir el Programa (o un trabajo basado en &eacute;l,
seg&uacute;n se especifica en el apartado 2, como c&oacute;digo objeto o
en formato ejecutable seg&uacute;n los t&eacute;rminos de los apartados
1 y 2, supuesto que adem&aacute;s cumpla una de las siguientes
condiciones: condiciones:
<ol type="a"><li>Debe hacer que los ficheros modificados lleven anuncios <ol type="a">
prominentes indicando que los ha cambiado y la fecha de cualquier cambio. <li>
</li><li>Debe hacer que cualquier trabajo que distribuya o publique y que en Acompa&ntilde;arlo con el c&oacute;digo fuente completo
todo o en parte contenga o sea derivado del Programa o de cualquier parte correspondiente, en formato electr&oacute;nico, que debe ser
de &eacute;l sea licenciada como un todo, sin carga alguna, a todas las distribuido seg&uacute;n se especifica en los apartados 1 y 2 de
terceras partes y bajo los t&eacute;rminos de esta Licencia. esta Licencia en un medio habitualmente utilizado para el
</li><li>Si el programa modificado lee normalmente &oacute;rdenes interactivamente intercambio de programas, o
cuando es ejecutado, debe hacer que, cuando comience su ejecuci&oacute;n </li>
para ese uso interactivo de la forma m&aacute;s habitual, muestre o escriba <li>
un mensaje que incluya un anuncio de copyright y un anuncio de que no se Acompa&ntilde;arlo con una oferta por escrito, v&aacute;lida durante
ofrece ninguna garant&iacute;a (o por el contrario que s&iacute; se ofrece al menos tres a&ntilde;os, de proporcionar a cualquier tercera parte
garant&iacute;a) y que los usuarios pueden redistribuir el programa bajo una copia completa en formato electr&oacute;nico del c&oacute;digo
estas condiciones, e indicando al usuario c&oacute;mo ver una copia de fuente correspondiente, a un coste no mayor que el de realizar
esta licencia. (Excepci&oacute;n: si el propio programa es interactivo f&iacute;sicamente la distribuci&oacute;n del fuente, que
pero normalmente no muestra ese anuncio, no se requiere que su trabajo ser&aacute; distribuido bajo las condiciones descritas en los
basado en el Programa muestre ning&uacute;n anuncio).</li></ol> apartados 1 y 2 anteriores, en un medio habitualmente utilizado para
Estos requisitos se aplican al trabajo modificado como un todo. Si partes el intercambio de programas, o
identificables de ese trabajo no son derivadas del Programa, y pueden, </li>
razonablemente, ser consideradas trabajos independientes y separados por <li>
ellos mismos, entonces esta Licencia y sus t&eacute;rminos no se aplican Acompa&ntilde;arlo con la informaci&oacute;n que recibiste
a esas partes cuando sean distribuidas como trabajos separados. Pero cuando ofreciendo distribuir el c&oacute;digo fuente correspondiente. (Esta
distribuya esas mismas secciones como partes de un todo que es un trabajo opci&oacute;n se permite s&oacute;lo para distribuci&oacute;n no
basado en el Programa, la distribuci&oacute;n del todo debe ser seg&uacute;n comercial y s&oacute;lo si usted recibi&oacute; el programa como
los t&eacute;rminos de esta licencia, cuyos permisos para otros licenciatarios c&oacute;digo objeto o en formato ejecutable con tal oferta, de
se extienden al todo completo, y por lo tanto a todas y cada una de sus acuerdo con el apartado b anterior).
partes, con independencia de qui&eacute;n la escribi&oacute;. </li>
<p>Por lo tanto, no es la intenci&oacute;n de este apartado reclamar derechos </ol>
o desafiar sus derechos sobre trabajos escritos totalmente por usted mismo. Por c&oacute;digo fuente de un trabajo se entiende la forma preferida
El intento es ejercer el derecho a controlar la distribuci&oacute;n de del trabajo cuando se le hacen modificaciones. Para un trabajo
trabajos derivados o colectivos basados en el Programa. ejecutable, se entiende por c&oacute;digo fuente completo todo el
</p><p>Adem&aacute;s, el simple hecho de reunir un trabajo no basado en el c&oacute;digo fuente para todos los m&oacute;dulos que contiene,
Programa con el Programa (o con un trabajo basado en el Programa) en un m&aacute;s cualquier fichero asociado de definici&oacute;n de
volumen de almacenamiento o en un medio de distribuci&oacute;n no hace interfaces, m&aacute;s los guiones utilizados para controlar la
que dicho trabajo entre dentro del &aacute;mbito cubierto por esta Licencia. compilaci&oacute;n e instalaci&oacute;n del ejecutable. Como
</p></li><li>Puede copiar y distribuir el Programa (o un trabajo basado en &eacute;l, excepci&oacute;n especial el c&oacute;digo fuente distribuido no
seg&uacute;n se especifica en el apartado 2, como c&oacute;digo objeto necesita incluir nada que sea distribuido normalmente (bien como fuente,
o en formato ejecutable seg&uacute;n los t&eacute;rminos de los apartados bien en forma binaria) con los componentes principales (compilador,
1 y 2, supuesto que adem&aacute;s cumpla una de las siguientes condiciones: kernel y similares) del sistema operativo en el cual funciona el
<ol type="a"><li>Acompa&ntilde;arlo con el c&oacute;digo fuente completo ejecutable, a no ser que el propio componente acompa&ntilde;e al
correspondiente, en formato electr&oacute;nico, que debe ser distribuido ejecutable.
seg&uacute;n se especifica en los apartados 1 y 2 de esta Licencia en un <p>
medio habitualmente utilizado para el intercambio de programas, o Si la distribuci&oacute;n del ejecutable o del c&oacute;digo objeto se
</li><li>Acompa&ntilde;arlo con una oferta por escrito, v&aacute;lida durante hace mediante la oferta acceso para copiarlo de un cierto lugar,
al menos tres a&ntilde;os, de proporcionar a cualquier tercera parte una entonces se considera la oferta de acceso para copiar el c&oacute;digo
copia completa en formato electr&oacute;nico del c&oacute;digo fuente correspondiente, fuente del mismo lugar como distribuci&oacute;n del c&oacute;digo
a un coste no mayor que el de realizar f&iacute;sicamente la distribuci&oacute;n fuente, incluso aunque terceras partes no est&eacute;n forzadas a
del fuente, que ser&aacute; distribuido bajo las condiciones descritas copiar el fuente junto con el c&oacute;digo objeto.
en los apartados 1 y 2 anteriores, en un medio habitualmente utilizado </p>
para el intercambio de programas, o </li>
</li><li>Acompa&ntilde;arlo con la informaci&oacute;n que recibiste ofreciendo <li>
distribuir el c&oacute;digo fuente correspondiente. (Esta opci&oacute;n No puede copiar, modificar, sublicenciar o distribuir el Programa
se permite s&oacute;lo para distribuci&oacute;n no comercial y s&oacute;lo excepto como prev&eacute; expresamente esta Licencia. Cualquier intento
si usted recibi&oacute; el programa como c&oacute;digo objeto o en formato de copiar, modificar sublicenciar o distribuir el Programa de otra forma
ejecutable con tal oferta, de acuerdo con el apartado b anterior).</li></ol> es inv&aacute;lida, y har&aacute; que cesen autom&aacute;ticamente los
Por c&oacute;digo fuente de un trabajo se entiende la forma preferida del derechos que te proporciona esta Licencia. En cualquier caso, las partes
trabajo cuando se le hacen modificaciones. Para un trabajo ejecutable, que hayan recibido copias o derechos de usted bajo esta Licencia no
se entiende por c&oacute;digo fuente completo todo el c&oacute;digo fuente cesar&aacute;n en sus derechos mientras esas partes contin&uacute;en
para todos los m&oacute;dulos que contiene, m&aacute;s cualquier fichero cumpli&eacute;ndola.
asociado de definici&oacute;n de interfaces, m&aacute;s los guiones utilizados </li>
para controlar la compilaci&oacute;n e instalaci&oacute;n del ejecutable. <li>
Como excepci&oacute;n especial el c&oacute;digo fuente distribuido no necesita No est&aacute; obligado a aceptar esta licencia, ya que no la ha
incluir nada que sea distribuido normalmente (bien como fuente, bien en firmado. Sin embargo, no hay hada m&aacute;s que le proporcione permiso
forma binaria) con los componentes principales (compilador, kernel y similares) para modificar o distribuir el Programa o sus trabajos derivados. Estas
del sistema operativo en el cual funciona el ejecutable, a no ser que el acciones est&aacute;n prohibidas por la ley si no acepta esta Licencia.
propio componente acompa&ntilde;e al ejecutable. Por lo tanto, si modifica o distribuye el Programa (o cualquier trabajo
<p>Si la distribuci&oacute;n del ejecutable o del c&oacute;digo objeto basado en el Programa), est&aacute; indicando que acepta esta Licencia
se hace mediante la oferta acceso para copiarlo de un cierto lugar, entonces para poder hacerlo, y todos sus t&eacute;rminos y condiciones para
se considera la oferta de acceso para copiar el c&oacute;digo fuente del copiar, distribuir o modificar el Programa o trabajos basados en
mismo lugar como distribuci&oacute;n del c&oacute;digo fuente, incluso &eacute;l.
aunque terceras partes no est&eacute;n forzadas a copiar el fuente junto </li>
con el c&oacute;digo objeto. <li>
</p></li><li>No puede copiar, modificar, sublicenciar o distribuir el Programa excepto Cada vez que redistribuya el Programa (o cualquier trabajo basado en el
como prev&eacute; expresamente esta Licencia. Cualquier intento de copiar, Programa), el receptor recibe autom&aacute;ticamente una licencia del
modificar sublicenciar o distribuir el Programa de otra forma es inv&aacute;lida,
y har&aacute; que cesen autom&aacute;ticamente los derechos que te proporciona
esta Licencia. En cualquier caso, las partes que hayan recibido copias
o derechos de usted bajo esta Licencia no cesar&aacute;n en sus derechos
mientras esas partes contin&uacute;en cumpli&eacute;ndola.
</li><li>No est&aacute; obligado a aceptar esta licencia, ya que no la ha firmado.
Sin embargo, no hay hada m&aacute;s que le proporcione permiso para modificar
o distribuir el Programa o sus trabajos derivados. Estas acciones est&aacute;n
prohibidas por la ley si no acepta esta Licencia. Por lo tanto, si modifica
o distribuye el Programa (o cualquier trabajo basado en el Programa), est&aacute;
indicando que acepta esta Licencia para poder hacerlo, y todos sus t&eacute;rminos
y condiciones para copiar, distribuir o modificar el Programa o trabajos
basados en &eacute;l.
</li><li>Cada vez que redistribuya el Programa (o cualquier trabajo basado en
el Programa), el receptor recibe autom&aacute;ticamente una licencia del
licenciatario original para copiar, distribuir o modificar el Programa, licenciatario original para copiar, distribuir o modificar el Programa,
de forma sujeta a estos t&eacute;rminos y condiciones. No puede imponer de forma sujeta a estos t&eacute;rminos y condiciones. No puede imponer
al receptor ninguna restricci&oacute;n m&aacute;s sobre el ejercicio de al receptor ninguna restricci&oacute;n m&aacute;s sobre el ejercicio de
los derechos aqu&iacute; garantizados. No es usted responsable de hacer los derechos aqu&iacute; garantizados. No es usted responsable de hacer
cumplir esta licencia por terceras partes. cumplir esta licencia por terceras partes.
</li><li>Si como consecuencia de una resoluci&oacute;n judicial o de una alegaci&oacute;n </li>
de infracci&oacute;n de patente o por cualquier otra raz&oacute;n (no limitada <li>
a asuntos relacionados con patentes) se le imponen condiciones (ya sea Si como consecuencia de una resoluci&oacute;n judicial o de una
por mandato judicial, por acuerdo o por cualquier otra causa) que contradigan alegaci&oacute;n de infracci&oacute;n de patente o por cualquier otra
las condiciones de esta Licencia, ello no le exime de cumplir las condiciones raz&oacute;n (no limitada a asuntos relacionados con patentes) se le
de esta Licencia. Si no puede realizar distribuciones de forma que se satisfagan imponen condiciones (ya sea por mandato judicial, por acuerdo o por
cualquier otra causa) que contradigan las condiciones de esta Licencia,
ello no le exime de cumplir las condiciones de esta Licencia. Si no
puede realizar distribuciones de forma que se satisfagan
simult&aacute;neamente sus obligaciones bajo esta licencia y cualquier simult&aacute;neamente sus obligaciones bajo esta licencia y cualquier
otra obligaci&oacute;n pertinente entonces, como consecuencia, no puede otra obligaci&oacute;n pertinente entonces, como consecuencia, no puede
distribuir el Programa de ninguna forma. Por ejemplo, si una patente no distribuir el Programa de ninguna forma. Por ejemplo, si una patente no
permite la redistribuci&oacute;n libre de derechos de autor del Programa permite la redistribuci&oacute;n libre de derechos de autor del Programa
por parte de todos aquellos que reciban copias directa o indirectamente por parte de todos aquellos que reciban copias directa o indirectamente
a trav&eacute;s de usted, entonces la &uacute;nica forma en que podr&iacute;a a trav&eacute;s de usted, entonces la &uacute;nica forma en que
satisfacer tanto esa condici&oacute;n como esta Licencia ser&iacute;a evitar podr&iacute;a satisfacer tanto esa condici&oacute;n como esta Licencia
completamente la distribuci&oacute;n del Programa. ser&iacute;a evitar completamente la distribuci&oacute;n del Programa.
<p>Si cualquier porci&oacute;n de este apartado se considera inv&aacute;lida <p>
o imposible de cumplir bajo cualquier circunstancia particular ha de cumplirse Si cualquier porci&oacute;n de este apartado se considera
el resto y la secci&oacute;n por entero ha de cumplirse en cualquier otra inv&aacute;lida o imposible de cumplir bajo cualquier circunstancia
circunstancia. particular ha de cumplirse el resto y la secci&oacute;n por entero ha
</p><p>No es el prop&oacute;sito de este apartado inducirle a infringir ninguna de cumplirse en cualquier otra circunstancia.
reivindicaci&oacute;n de patente ni de ning&uacute;n otro derecho de propiedad </p>
o impugnar la validez de ninguna de dichas reivindicaciones. Este apartado <p>
tiene el &uacute;nico prop&oacute;sito de proteger la integridad del sistema No es el prop&oacute;sito de este apartado inducirle a infringir
de distribuci&oacute;n de software libre, que se realiza mediante pr&aacute;cticas ninguna reivindicaci&oacute;n de patente ni de ning&uacute;n otro
de licencia p&uacute;blica. Mucha gente ha hecho contribuciones generosas derecho de propiedad o impugnar la validez de ninguna de dichas
a la gran variedad de software distribuido mediante ese sistema con la reivindicaciones. Este apartado tiene el &uacute;nico prop&oacute;sito
confianza de que el sistema se aplicar&aacute; consistentemente. Ser&aacute; de proteger la integridad del sistema de distribuci&oacute;n de
el autor/donante quien decida si quiere distribuir software mediante cualquier software libre, que se realiza mediante pr&aacute;cticas de licencia
otro sistema y una licencia no puede imponer esa elecci&oacute;n. p&uacute;blica. Mucha gente ha hecho contribuciones generosas a la
</p><p>Este apartado pretende dejar completamente claro lo que se cree que gran variedad de software distribuido mediante ese sistema con la
es una consecuencia del resto de esta Licencia. confianza de que el sistema se aplicar&aacute; consistentemente.
</p></li><li>Si la distribuci&oacute;n y/o uso de el Programa est&aacute; restringida Ser&aacute; el autor/donante quien decida si quiere distribuir
en ciertos pa&iacute;ses, bien por patentes o por interfaces bajo copyright, software mediante cualquier otro sistema y una licencia no puede
el tenedor del copyright que coloca este Programa bajo esta Licencia puede imponer esa elecci&oacute;n.
a&ntilde;adir una limitaci&oacute;n expl&iacute;cita de distribuci&oacute;n </p>
geogr&aacute;fica excluyendo esos pa&iacute;ses, de forma que la distribuci&oacute;n <p>
se permita s&oacute;lo en o entre los pa&iacute;ses no excluidos de esta Este apartado pretende dejar completamente claro lo que se cree que es
manera. En ese caso, esta Licencia incorporar&aacute; la limitaci&oacute;n una consecuencia del resto de esta Licencia.
como si estuviese escrita en el cuerpo de esta Licencia. </p>
</li><li>La Free Software Foundation puede publicar versiones revisadas y/o nuevas </li>
de la Licencia P&uacute;blica General de tiempo en tiempo. Dichas nuevas <li>
versiones ser&aacute;n similares en esp&iacute;ritu a la presente versi&oacute;n, Si la distribuci&oacute;n y/o uso de el Programa est&aacute; restringida
pero pueden ser diferentes en detalles para considerar nuevos problemas en ciertos pa&iacute;ses, bien por patentes o por interfaces bajo
o situaciones. copyright, el tenedor del copyright que coloca este Programa bajo esta
<p>Cada versi&oacute;n recibe un n&uacute;mero de versi&oacute;n que la Licencia puede a&ntilde;adir una limitaci&oacute;n expl&iacute;cita de
distingue de otras. Si el Programa especifica un n&uacute;mero de versi&oacute;n distribuci&oacute;n geogr&aacute;fica excluyendo esos pa&iacute;ses, de
de esta Licencia que se refiere a ella y a &laquo;cualquier versi&oacute;n forma que la distribuci&oacute;n se permita s&oacute;lo en o entre los
posterior&raquo;, tienes la opci&oacute;n de seguir los t&eacute;rminos pa&iacute;ses no excluidos de esta manera. En ese caso, esta Licencia
y condiciones, bien de esa versi&oacute;n, bien de cualquier versi&oacute;n incorporar&aacute; la limitaci&oacute;n como si estuviese escrita en el
posterior publicada por la Free Software Foundation. Si el Programa no cuerpo de esta Licencia.
especifica un n&uacute;mero de versi&oacute;n de esta Licencia, puedes </li>
escoger cualquier versi&oacute;n publicada por la Free Software Foundation. <li>
</p></li><li>Si quiere incorporar partes del Programa en otros programas libres cuyas La Free Software Foundation puede publicar versiones revisadas y/o
nuevas de la Licencia P&uacute;blica General de tiempo en tiempo. Dichas
nuevas versiones ser&aacute;n similares en esp&iacute;ritu a la presente
versi&oacute;n, pero pueden ser diferentes en detalles para considerar
nuevos problemas o situaciones.
<p>
Cada versi&oacute;n recibe un n&uacute;mero de versi&oacute;n que la
distingue de otras. Si el Programa especifica un n&uacute;mero de
versi&oacute;n de esta Licencia que se refiere a ella y a
&laquo;cualquier versi&oacute;n posterior&raquo;, tienes la
opci&oacute;n de seguir los t&eacute;rminos y condiciones, bien de esa
versi&oacute;n, bien de cualquier versi&oacute;n posterior publicada
por la Free Software Foundation. Si el Programa no especifica un
n&uacute;mero de versi&oacute;n de esta Licencia, puedes escoger
cualquier versi&oacute;n publicada por la Free Software Foundation.
</p>
</li>
<li>
Si quiere incorporar partes del Programa en otros programas libres cuyas
condiciones de distribuci&oacute;n son diferentes, escribe al autor para condiciones de distribuci&oacute;n son diferentes, escribe al autor para
pedirle permiso. Si el software tiene copyright de la Free Software Foundation, pedirle permiso. Si el software tiene copyright de la Free Software
escribe a la Free Software Foundation: algunas veces hacemos excepciones Foundation, escribe a la Free Software Foundation: algunas veces hacemos
en estos casos. Nuestra decisi&oacute;n estar&aacute; guiada por el doble excepciones en estos casos. Nuestra decisi&oacute;n estar&aacute; guiada
objetivo de de preservar la libertad de todos los derivados de nuestro por el doble objetivo de de preservar la libertad de todos los derivados
software libre y promover el que se comparta y reutilice el software en de nuestro software libre y promover el que se comparta y reutilice el
general.</li></ol> software en general.
</li>
</ol>
<h3>AUSENCIA DE GARANT&Iacute;A</h3> <h3>AUSENCIA DE GARANT&Iacute;A</h3>
<ol start="12" type="1"> <ol start="12" type="1">
<li>Como el programa se licencia libre de cargas, <li>
no se ofrece ninguna garant&iacute;a sobre el programa, en todas la extensi&oacute;n Como el programa se licencia libre de cargas, no se ofrece ninguna
garant&iacute;a sobre el programa, en todas la extensi&oacute;n
permitida por la legislaci&oacute;n aplicable. Excepto cuando se indique permitida por la legislaci&oacute;n aplicable. Excepto cuando se indique
de otra forma por escrito, los tenedores del copyright y/u otras partes de otra forma por escrito, los tenedores del copyright y/u otras partes
proporcionan el programa &laquo;tal cual&raquo;, sin garant&iacute;a de proporcionan el programa &laquo;tal cual&raquo;, sin garant&iacute;a de
ninguna clase, bien expresa o impl&iacute;cita, con inclusi&oacute;n, pero ninguna clase, bien expresa o impl&iacute;cita, con inclusi&oacute;n,
sin limitaci&oacute;n a las garant&iacute;as mercantiles impl&iacute;citas pero sin limitaci&oacute;n a las garant&iacute;as mercantiles
o a la conveniencia para un prop&oacute;sito particular. Cualquier riesgo impl&iacute;citas o a la conveniencia para un prop&oacute;sito
referente a la calidad y prestaciones del programa es asumido por usted. particular. Cualquier riesgo referente a la calidad y prestaciones del
Si se probase que el Programa es defectuoso, asume el coste de cualquier programa es asumido por usted. Si se probase que el Programa es
servicio, reparaci&oacute;n o correcci&oacute;n. defectuoso, asume el coste de cualquier servicio, reparaci&oacute;n o
</li><li>En ning&uacute;n caso, salvo que lo requiera la legislaci&oacute;n aplicable correcci&oacute;n.
o haya sido acordado por escrito, ning&uacute;n tenedor del copyright ni </li>
ninguna otra parte que modifique y/o redistribuya el Programa seg&uacute;n <li>
se permite en esta Licencia ser&aacute; responsable ante usted por da&ntilde;os, En ning&uacute;n caso, salvo que lo requiera la legislaci&oacute;n
incluyendo cualquier da&ntilde;o general, especial, incidental o resultante aplicable o haya sido acordado por escrito, ning&uacute;n tenedor del
producido por el uso o la imposibilidad de uso del Programa (con inclusi&oacute;n, copyright ni ninguna otra parte que modifique y/o redistribuya el
pero sin limitaci&oacute;n a la p&eacute;rdida de datos o a la generaci&oacute;n Programa seg&uacute;n se permite en esta Licencia ser&aacute;
incorrecta de datos o a p&eacute;rdidas sufridas por usted o por terceras responsable ante usted por da&ntilde;os, incluyendo cualquier
partes o a un fallo del Programa al funcionar en combinaci&oacute;n con da&ntilde;o general, especial, incidental o resultante producido por el
cualquier otro programa), incluso si dicho tenedor u otra parte ha sido uso o la imposibilidad de uso del Programa (con inclusi&oacute;n, pero
advertido de la posibilidad de dichos da&ntilde;os.</li></ol> sin limitaci&oacute;n a la p&eacute;rdida de datos o a la
generaci&oacute;n incorrecta de datos o a p&eacute;rdidas sufridas por
usted o por terceras partes o a un fallo del Programa al funcionar en
combinaci&oacute;n con cualquier otro programa), incluso si dicho
tenedor u otra parte ha sido advertido de la posibilidad de dichos
da&ntilde;os.
</li>
</ol>
<h3>FIN DE T&Eacute;RMINOS Y CONDICIONES</h3> <h3>FIN DE T&Eacute;RMINOS Y CONDICIONES</h3>
<h3><a name="APPENDIX">Ap&eacute;ndice</a>: C&oacute;mo aplicar estos <h3>
t&eacute;rminos a sus nuevos programas.</h3> <a name="APPENDIX">Ap&eacute;ndice</a>: C&oacute;mo aplicar estos
t&eacute;rminos a sus nuevos programas.
</h3>
<p> <p>
Si usted desarrolla un nuevo Programa, y quiere que sea del mayor uso posible Si usted desarrolla un nuevo Programa, y quiere que sea del mayor uso
para el p&uacute;blico en general, la mejor forma de conseguirlo es convirti&eacute;ndolo posible para el p&uacute;blico en general, la mejor forma de conseguirlo
en software libre que cualquiera pueda redistribuir y cambiar bajo estos es convirti&eacute;ndolo en software libre que cualquiera pueda
t&eacute;rminos.</p> redistribuir y cambiar bajo estos t&eacute;rminos.
<p>Para hacerlo, a&ntilde;ada los siguientes anuncios al programa. Lo m&aacute;s </p>
seguro es a&ntilde;adirlos al principio de cada fichero fuente para transmitir <p>
lo m&aacute;s efectivamente posible la ausencia de garant&iacute;a. Adem&aacute;s Para hacerlo, a&ntilde;ada los siguientes anuncios al programa. Lo
cada fichero deber&iacute;a tener al menos la l&iacute;nea de &laquo;copyright&raquo; m&aacute;s seguro es a&ntilde;adirlos al principio de cada fichero fuente
y un indicador a d&oacute;nde puede encontrarse el anuncio completo. para transmitir lo m&aacute;s efectivamente posible la ausencia de
</p><div>&lt;una l&iacute;nea para indicar el nombre garant&iacute;a. Adem&aacute;s cada fichero deber&iacute;a tener al menos
del programa y una r&aacute;pida idea de qu&eacute; hace.&gt; la l&iacute;nea de &laquo;copyright&raquo; y un indicador a d&oacute;nde
<p>Copyright (C) 19aa &lt;nombre del autor&gt; puede encontrarse el anuncio completo.
</p><p>Este programa es software libre. Puede redistribuirlo y/o modificarlo </p>
bajo los t&eacute;rminos de la Licencia P&uacute;blica General de GNU seg&uacute;n <div>
es publicada por la Free Software Foundation, bien de la versi&oacute;n &lt;una l&iacute;nea para indicar el nombre del programa y una
2 de dicha Licencia o bien (seg&uacute;n su elecci&oacute;n) de cualquier r&aacute;pida idea de qu&eacute; hace.&gt;
versi&oacute;n posterior. <p>Copyright (C) 19aa &lt;nombre del autor&gt;</p>
</p><p>Este programa se distribuye con la esperanza de que sea &uacute;til, <p>
pero SIN NINGUNA GARANT&Iacute;A, incluso sin la garant&iacute;a MERCANTIL Este programa es software libre. Puede redistribuirlo y/o modificarlo
impl&iacute;cita o sin garantizar la CONVENIENCIA PARA UN PROP&Oacute;SITO bajo los t&eacute;rminos de la Licencia P&uacute;blica General de GNU
PARTICULAR. V&eacute;ase la Licencia P&uacute;blica General de GNU para seg&uacute;n es publicada por la Free Software Foundation, bien de la
m&aacute;s detalles. versi&oacute;n 2 de dicha Licencia o bien (seg&uacute;n su
</p><p>Deber&iacute;a haber recibido una copia de la Licencia P&uacute;blica elecci&oacute;n) de cualquier versi&oacute;n posterior.
</p>
<p>
Este programa se distribuye con la esperanza de que sea &uacute;til,
pero SIN NINGUNA GARANT&Iacute;A, incluso sin la garant&iacute;a
MERCANTIL impl&iacute;cita o sin garantizar la CONVENIENCIA PARA UN
PROP&Oacute;SITO PARTICULAR. V&eacute;ase la Licencia P&uacute;blica
General de GNU para m&aacute;s detalles.
</p>
<p>
Deber&iacute;a haber recibido una copia de la Licencia P&uacute;blica
General junto con este programa. Si no ha sido as&iacute;, escriba a la General junto con este programa. Si no ha sido as&iacute;, escriba a la
Free Software Foundation, Inc., en 675 Mass Ave, Cambridge, MA 02139, EEUU.</p></div> Free Software Foundation, Inc., en 675 Mass Ave, Cambridge, MA 02139,
EEUU.
</p>
</div>
<p> <p>
A&ntilde;ada tambi&eacute;n informaci&oacute;n sobre c&oacute;mo contactar A&ntilde;ada tambi&eacute;n informaci&oacute;n sobre c&oacute;mo contactar
con usted mediante correo electr&oacute;nico y postal.</p> con usted mediante correo electr&oacute;nico y postal.
<p>Si el programa es interactivo, haga que muestre un peque&ntilde;o anuncio </p>
como el siguiente, cuando comienza a funcionar en modo interactivo:
</p><div>Gnomovision versi&oacute;n 69, Copyright
(C) 19aa nombre del autor
<p>Gnomovision no ofrece ABSOLUTAMENTE NINGUNA GARANT&Iacute;A. Para m&aacute;s
detalles escriba &laquo;show w&raquo;.</p></div>
<p> <p>
Los comandos hipot&eacute;ticos &laquo;show w&raquo; y &laquo;show c&raquo; Si el programa es interactivo, haga que muestre un peque&ntilde;o anuncio
deber&iacute;an mostrar las partes adecuadas de la Licencia P&uacute;blica como el siguiente, cuando comienza a funcionar en modo interactivo:
General. Por supuesto, los comandos que use pueden llamarse de cualquier </p>
otra manera. Podr&iacute;an incluso ser pulsaciones del rat&oacute;n o <div>
elementos de un men&uacute; (lo que sea apropiado para su programa).</p> Gnomovision versi&oacute;n 69, Copyright (C) 19aa nombre del autor
<p>Tambi&eacute;n deber&iacute;as conseguir que su empleador (si trabaja <p>
como programador) o tu Universidad (si es el caso) firme un &laquo;renuncia Gnomovision no ofrece ABSOLUTAMENTE NINGUNA GARANT&Iacute;A. Para
de copyright&raquo; para el programa, si es necesario. A continuaci&oacute;n m&aacute;s detalles escriba &laquo;show w&raquo;.
</p>
</div>
<p>
Los comandos hipot&eacute;ticos &laquo;show w&raquo; y &laquo;show
c&raquo; deber&iacute;an mostrar las partes adecuadas de la Licencia
P&uacute;blica General. Por supuesto, los comandos que use pueden llamarse
de cualquier otra manera. Podr&iacute;an incluso ser pulsaciones del
rat&oacute;n o elementos de un men&uacute; (lo que sea apropiado para su
programa).
</p>
<p>
Tambi&eacute;n deber&iacute;as conseguir que su empleador (si trabaja como
programador) o tu Universidad (si es el caso) firme un &laquo;renuncia de
copyright&raquo; para el programa, si es necesario. A continuaci&oacute;n
se ofrece un ejemplo, altere los nombres seg&uacute;n sea conveniente: se ofrece un ejemplo, altere los nombres seg&uacute;n sea conveniente:
</p> </p>
<div style="margin-left: 30px;"> <div style="margin-left: 30px;">
Yoyodyne, Inc. mediante este documento renuncia Yoyodyne, Inc. mediante este documento renuncia a cualquier inter&eacute;s
a cualquier inter&eacute;s de derechos de copyright con respecto al programa de derechos de copyright con respecto al programa Gnomovision (que hace
Gnomovision (que hace pasadas a compiladores) escrito por Pepe Programador. pasadas a compiladores) escrito por Pepe Programador.
<p>&lt;firma de Pepito Grillo&gt;, 20 de diciembre de 1996 <p>&lt;firma de Pepito Grillo&gt;, 20 de diciembre de 1996</p>
</p><p>Pepito Grillo, Presidente de Asuntillos Varios.</p> <p>Pepito Grillo, Presidente de Asuntillos Varios.</p>
</div> </div>
<p> <p>
Esta Licencia P&uacute;blica General no permite que incluya sus programas Esta Licencia P&uacute;blica General no permite que incluya sus programas
en programas propietarios. Si su programa es una biblioteca de subrutinas, en programas propietarios. Si su programa es una biblioteca de subrutinas,
puede considerar m&aacute;s &uacute;til el permitir el enlazado de aplicaciones puede considerar m&aacute;s &uacute;til el permitir el enlazado de
propietarias con la biblioteca. Si este es el caso, use la Licencia P&uacute;blica aplicaciones propietarias con la biblioteca. Si este es el caso, use la
General de GNU para Bibliotecas en lugar de esta Licencia.</p> Licencia P&uacute;blica General de GNU para Bibliotecas en lugar de esta
Licencia.
</body></html> </p>
</body>
</html>

View File

@ -3,108 +3,146 @@
<title>Llic&egrave;ncia P&uacute;blica General de GNU</title> <title>Llic&egrave;ncia P&uacute;blica General de GNU</title>
</head> </head>
<body> <body>
<h2>Llic&egrave;ncia P&uacute;blica General de GNU</h2> <h2>Llic&egrave;ncia P&uacute;blica General de GNU</h2>
<h3>Advertiment</h3> <h3>Advertiment</h3>
This is an unofficial translation of the GNU General Public License into This is an unofficial translation of the GNU General Public License into
Catalan. It was not published by the Free Software Foundation, and does Catalan. It was not published by the Free Software Foundation, and does not
not legally state the distribution terms for software that uses the GNU legally state the distribution terms for software that uses the GNU
GPL--only the original English text of the GNU GPL does that. However, GPL--only the original English text of the GNU GPL does that. However, we
we hope that this translation will help Catalan speakers understand the hope that this translation will help Catalan speakers understand the GNU GPL
GNU GPL better better
<p>Ve't aqu&iacute; una traducci&oacute; no oficial al catal&agrave; de <p>
la llic&egrave;ncia p&uacute;blica general (GPL) de GNU. No ha estat publicada Ve't aqu&iacute; una traducci&oacute; no oficial al catal&agrave; de la
per la Free Software Foundation (fundaci&oacute; per al programari lliure), llic&egrave;ncia p&uacute;blica general (GPL) de GNU. No ha estat
i no defineix legalment els termes de distribuci&oacute; del programari publicada per la Free Software Foundation (fundaci&oacute; per al
que utilitza la GPL de GNU -- nom&eacute;s el text original en angl&egrave;s programari lliure), i no defineix legalment els termes de
ho fa. Tot i aix&ograve;, esperem que aquesta traducci&oacute; ajudi els distribuci&oacute; del programari que utilitza la GPL de GNU --
catalanoparlants a entendre millor la GPL de GNU.</p> nom&eacute;s el text original en angl&egrave;s ho fa. Tot i aix&ograve;,
esperem que aquesta traducci&oacute; ajudi els catalanoparlants a entendre
millor la GPL de GNU.
</p>
<h3>&Iacute;ndex</h3> <h3>&Iacute;ndex</h3>
<p> <p></p>
<ul> <ul>
<li> <li>
<a NAME="TOC1" HREF="#SEC1" NAME="TOC1">LLIC&Egrave;NCIA <a name="TOC1" href="#SEC1" name="TOC1"
P&Uacute;BLICA GENERAL DE GNU</a></li> >LLIC&Egrave;NCIA P&Uacute;BLICA GENERAL DE GNU</a
>
</li>
</ul> </ul>
<ul> <ul>
<li><a name="TOC2" href="#SEC2" name="TOC2">Pre&agrave;mbul</a></li>
<li> <li>
<a NAME="TOC2" HREF="#SEC2" NAME="TOC2">Pre&agrave;mbul</a></li> <a name="TOC3" href="#SEC3" name="TOC3"
>TERMES I CONDICIONS PER A LA C&Ograve;PIA, DISTRIBUCI&Oacute; I
MODIFICACI&Oacute;</a
>
</li>
<li> <li>
<a NAME="TOC3" HREF="#SEC3" NAME="TOC3">TERMES I CONDICIONS PER A LA C&Ograve;PIA, DISTRIBUCI&Oacute; I MODIFICACI&Oacute;</a></li> <a name="TOC4" href="#SEC4" name="TOC4"
<li> >Com podeu aplicar aquests termes als vostres programes nous</a
<a NAME="TOC4" HREF="#SEC4" NAME="TOC4">Com >
podeu aplicar aquests termes als vostres programes nous</a></li> </li>
</ul> </ul>
<hr> <hr />
<h2> <h2>
<a NAME="SEC1" HREF="gpl-cat.html#TOC1"></a><a NAME="SEC1" href="http://www.fsf.org/copyleft/gpl-cat.html#TOC1"></a><a NAME="SEC1" href="http://www.fsf.org/copyleft/gpl-cat.html#TOC1"></a><a href="http://www.fsf.org/copyleft/gpl-cat.html#TOC1" NAME="SEC1">LLIC&Egrave;NCIA <a name="SEC1" href="gpl-cat.html#TOC1"></a
P&Uacute;BLICA GENERAL DE GNU</a></h2> ><a name="SEC1" href="http://www.fsf.org/copyleft/gpl-cat.html#TOC1"></a
><a name="SEC1" href="http://www.fsf.org/copyleft/gpl-cat.html#TOC1"></a
><a href="http://www.fsf.org/copyleft/gpl-cat.html#TOC1" name="SEC1"
>LLIC&Egrave;NCIA P&Uacute;BLICA GENERAL DE GNU</a
>
</h2>
Versi&oacute; 2, Juny de 1991 Versi&oacute; 2, Juny de 1991
<pre>Copyright (C) 1989, 1991 Free Software Foundation, Inc.&nbsp;&nbsp; <pre>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.&nbsp;&nbsp;
59 Temple Place - Suite 330, Boston, MA&nbsp; 02111-1307, USA 59 Temple Place - Suite 330, Boston, MA&nbsp; 02111-1307, USA
Es permet que tothom faci c&ograve;pies literals d'aquest document de Es permet que tothom faci c&ograve;pies literals d'aquest document de
&nbsp;llic&egrave;ncia i les distribueixi, per&ograve; no &eacute;s perm&egrave;s modificar-lo. &nbsp;llic&egrave;ncia i les distribueixi, per&ograve; no &eacute;s perm&egrave;s modificar-lo.
</pre> </pre
>
<h3><a NAME="SEC2" HREF="#TOC2" NAME="SEC2">Pre&agrave;mbul</a></h3> <h3><a name="SEC2" href="#TOC2" name="SEC2">Pre&agrave;mbul</a></h3>
Les llic&egrave;ncies de la major part de programari estan pensades per Les llic&egrave;ncies de la major part de programari estan pensades per
prendre-us la llibertat de compartir-lo i modificar-lo. Contr&agrave;riament, prendre-us la llibertat de compartir-lo i modificar-lo.
la Llic&egrave;ncia p&uacute;blica general de GNU pret&eacute;n garantir-vos Contr&agrave;riament, la Llic&egrave;ncia p&uacute;blica general de GNU
la llibertat de compartir i modificar el programari lliure -- assegurar-se pret&eacute;n garantir-vos la llibertat de compartir i modificar el
que el programari sigui lliure per a tots els seus usuaris i usu&agrave;ries. programari lliure -- assegurar-se que el programari sigui lliure per a tots
Aquesta Llic&egrave;ncia p&uacute;blica general de GNU afecta la majoria els seus usuaris i usu&agrave;ries. Aquesta Llic&egrave;ncia p&uacute;blica
del programari de la Free Software Foundation (fundaci&oacute; pel programari general de GNU afecta la majoria del programari de la Free Software
lliure) i a qualsevol altre programa els autors o autores del qual decideixin Foundation (fundaci&oacute; pel programari lliure) i a qualsevol altre
usar-la (algun altre programari de la Free Software Foundation, en canvi, programa els autors o autores del qual decideixin usar-la (algun altre
est&agrave; protegit per la Llic&egrave;ncia p&uacute;blica general per programari de la Free Software Foundation, en canvi, est&agrave; protegit
a biblioteques de GNU [NdeT: aquesta llic&egrave;ncia, la LGPL, &eacute;s per la Llic&egrave;ncia p&uacute;blica general per a biblioteques de GNU
la que actualment la FSF anomena Llic&egrave;ncia p&uacute;blica menys [NdeT: aquesta llic&egrave;ncia, la LGPL, &eacute;s la que actualment la FSF
general]). Tamb&eacute; podeu aplicar-la als vostres programes. anomena Llic&egrave;ncia p&uacute;blica menys general]). Tamb&eacute; podeu
<p>Quan parlem de programari lliure (free software) ens referim a la llibertat, aplicar-la als vostres programes.
no al preu [NdeT: en catal&agrave; no hi ha l'ambig&uuml;itat que hi ha <p>
en angl&egrave;s]. Les nostres llic&egrave;ncies p&uacute;bliques generals Quan parlem de programari lliure (free software) ens referim a la
estan pensades per assegurar que tingueu la llibertat de distribuir c&ograve;pies llibertat, no al preu [NdeT: en catal&agrave; no hi ha l'ambig&uuml;itat
del programari lliure (i cobrar per aquest servei si aix&iacute; ho voleu), que hi ha en angl&egrave;s]. Les nostres llic&egrave;ncies
que rebeu el codi font o que el pugueu rebre si el voleu, que pugueu modificar p&uacute;bliques generals estan pensades per assegurar que tingueu la
el programari o fer-ne servir parts en programes lliures nous; i que sapigueu</p> llibertat de distribuir c&ograve;pies del programari lliure (i cobrar per
aquest servei si aix&iacute; ho voleu), que rebeu el codi font o que el
pugueu rebre si el voleu, que pugueu modificar el programari o fer-ne
servir parts en programes lliures nous; i que sapigueu
</p>
que podeu fer aquestes coses. que podeu fer aquestes coses.
<p>Per protegir els vostres drets, hem d'imposar restriccions que prohibeixin <p>
a tothom denegar-vos aquests drets o demanar-vos que hi renuncieu. Aquestes Per protegir els vostres drets, hem d'imposar restriccions que prohibeixin
restriccions suposen algunes responsabilitats per a v&oacute;s si distribu&iuml;u a tothom denegar-vos aquests drets o demanar-vos que hi renuncieu.
c&ograve;pies del programari o si el modifiqueu.</p> Aquestes restriccions suposen algunes responsabilitats per a v&oacute;s si
<p>Per exemple, si distribu&iuml;u c&ograve;pies d'un aquests programes, distribu&iuml;u c&ograve;pies del programari o si el modifiqueu.
tant si &eacute;s de franc com per un preu, heu de donar als destinataris </p>
els mateixos drets que teniu v&oacute;s. Us heu d'assegurar que tamb&eacute; <p>
Per exemple, si distribu&iuml;u c&ograve;pies d'un aquests programes, tant
si &eacute;s de franc com per un preu, heu de donar als destinataris els
mateixos drets que teniu v&oacute;s. Us heu d'assegurar que tamb&eacute;
ells rebin o puguin obtenir el codi font. I els heu de fer saber aquests ells rebin o puguin obtenir el codi font. I els heu de fer saber aquests
termes per tal que coneguin els seus drets.</p> termes per tal que coneguin els seus drets.
<p>Protegim els vostres drets en dos passos: (1) Ens reservem el copyright </p>
del programari, i (2) us oferim aquesta llic&egrave;ncia que us d&oacute;na <p>
perm&iacute;s legal per copiar, distribuir i/o modificar el programari.</p> Protegim els vostres drets en dos passos: (1) Ens reservem el copyright
<p>A m&eacute;s a m&eacute;s, per protegir-nos i protegir l'autor o autora, del programari, i (2) us oferim aquesta llic&egrave;ncia que us
volem estar segurs que tothom ent&eacute;n que no hi ha cap garantia per d&oacute;na perm&iacute;s legal per copiar, distribuir i/o modificar el
a aquest programari lliure. Si alg&uacute; modifica el programari i el programari.
passa, volem que els destinataris s&agrave;piguen que el que tenen no &eacute;s </p>
l'original, per tal que qualsevol problema que haguessin pogut introduir <p>
terceres persones no repercuteixi en la reputaci&oacute; de l'autor o autora A m&eacute;s a m&eacute;s, per protegir-nos i protegir l'autor o autora,
original.</p> volem estar segurs que tothom ent&eacute;n que no hi ha cap garantia per a
<p>Finalment, qualsevol programa lliure est&agrave; constantment amena&ccedil;at aquest programari lliure. Si alg&uacute; modifica el programari i el
per les patents de programari. Volem evitar el perill de que els redistribu&iuml;dors passa, volem que els destinataris s&agrave;piguen que el que tenen no
d'un programa lliure acabin obtenint llic&egrave;ncies de patents, i de &eacute;s l'original, per tal que qualsevol problema que haguessin pogut
resultes el programa esdevingui propietat exclusiva d'alg&uacute;. Per introduir terceres persones no repercuteixi en la reputaci&oacute; de
evitar-ho, he deixat clar que de qualsevol patent se n'han d'emetre llic&egrave;ncies l'autor o autora original.
per a tothom o no emetre'n cap.</p> </p>
<p>Les condicions exactes per a la c&ograve;pia, distribuci&oacute; i modificaci&oacute; <p>
s&oacute;n les seg&uuml;ents.</p> Finalment, qualsevol programa lliure est&agrave; constantment
amena&ccedil;at per les patents de programari. Volem evitar el perill de
que els redistribu&iuml;dors d'un programa lliure acabin obtenint
llic&egrave;ncies de patents, i de resultes el programa esdevingui
propietat exclusiva d'alg&uacute;. Per evitar-ho, he deixat clar que de
qualsevol patent se n'han d'emetre llic&egrave;ncies per a tothom o no
emetre'n cap.
</p>
<p>
Les condicions exactes per a la c&ograve;pia, distribuci&oacute; i
modificaci&oacute; s&oacute;n les seg&uuml;ents.
</p>
<h3><a NAME="SEC3" HREF="#TOC3" NAME="SEC3">TERMES <h3>
I CONDICIONS PER A LA C&Ograve;PIA, DISTRIBUCI&Oacute; I MODIFICACI&Oacute;</a></h3> <a name="SEC3" href="#TOC3" name="SEC3"
>TERMES I CONDICIONS PER A LA C&Ograve;PIA, DISTRIBUCI&Oacute; I
MODIFICACI&Oacute;</a
>
</h3>
<p> <p>
<b>0.</b> Aquesta llic&egrave;ncia afecta a qualsevol programa o altra <b>0.</b> Aquesta llic&egrave;ncia afecta a qualsevol programa o altra
@ -114,234 +152,308 @@ p&uacute;blica general. D'ara endavant, el "programa" es refereix a aquest
programa o obra, i una "obra basada en el programa" voldr&agrave; dir el programa o obra, i una "obra basada en el programa" voldr&agrave; dir el
programa o qualsevol obra derivada segons la llei de copyright: &eacute;s programa o qualsevol obra derivada segons la llei de copyright: &eacute;s
a dir una obra que contingui el programa o alguna part d'ell, ja sigui a dir una obra que contingui el programa o alguna part d'ell, ja sigui
literalment o amb modificacions o b&eacute; tradu&iuml;t a altres lleng&uuml;es. literalment o amb modificacions o b&eacute; tradu&iuml;t a altres
(Per aix&ograve; mateix, les traduccions s'inclouen sense cap limitaci&oacute; lleng&uuml;es. (Per aix&ograve; mateix, les traduccions s'inclouen sense
en el terme "modificaci&oacute;"). Ens referim a Cada beneficiari de la cap limitaci&oacute; en el terme "modificaci&oacute;"). Ens referim a Cada
llic&egrave;ncia com a "v&oacute;s".</p> beneficiari de la llic&egrave;ncia com a "v&oacute;s".
<p>Les activitats que no siguin c&ograve;pia, distribuci&oacute; o modificaci&oacute; </p>
no estan contemplades en aquesta llic&egrave;ncia, queden fora del seu <p>
&agrave;mbit. No es restringeix l'acte d'executar el programa, i la sortida Les activitats que no siguin c&ograve;pia, distribuci&oacute; o
del programa queda contemplada nom&eacute;s si el seu contingut constitueix modificaci&oacute; no estan contemplades en aquesta llic&egrave;ncia,
una obra basada en el programa (independentment de que s'hagi creat executant queden fora del seu &agrave;mbit. No es restringeix l'acte d'executar el
el programa). Que aquest sigui el cas o no dep&egrave;n de qu&egrave; faci programa, i la sortida del programa queda contemplada nom&eacute;s si el
el programa.</p> seu contingut constitueix una obra basada en el programa (independentment
<p><b>1.</b> Podeu copiar i distribuir c&ograve;pies literals del codi de que s'hagi creat executant el programa). Que aquest sigui el cas o no
font del programa tal i com el rebeu, en qualsevol mitj&agrave;, sempre dep&egrave;n de qu&egrave; faci el programa.
i quan publiqueu en cada c&ograve;pia, de manera adient i ben visible, </p>
una nota de copyright i una ren&uacute;ncia de garantia; manteniu intactes <p>
tots els avisos que fan refer&egrave;ncia a aquesta llic&egrave;ncia i <b>1.</b> Podeu copiar i distribuir c&ograve;pies literals del codi font
a l'abs&egrave;ncia de garanties de cap mena; i lliureu a qualsevol altre del programa tal i com el rebeu, en qualsevol mitj&agrave;, sempre i quan
destinatari del programa una c&ograve;pia d'aquesta llic&egrave;ncia juntament publiqueu en cada c&ograve;pia, de manera adient i ben visible, una nota
amb el programa.</p> de copyright i una ren&uacute;ncia de garantia; manteniu intactes tots els
<p>Podeu cobrar un preu per l'acte f&iacute;sic de trametre una c&ograve;pia avisos que fan refer&egrave;ncia a aquesta llic&egrave;ncia i a
i podeu, si aix&iacute; ho voleu, oferir alguna garantia a canvi d'un preu.</p> l'abs&egrave;ncia de garanties de cap mena; i lliureu a qualsevol altre
<p><b>2.</b> Podeu modificar la c&ograve;pia o c&ograve;pies del programa destinatari del programa una c&ograve;pia d'aquesta llic&egrave;ncia
o qualsevol tros, tot fornint una obra basada en el programa, i podeu copiar juntament amb el programa.
i distribuir aquestes modificacions o obres sota els termes de la Secci&oacute; </p>
1 anterior, sempre i quan tamb&eacute; compliu les seg&uuml;ents condicions:</p> <p>
Podeu cobrar un preu per l'acte f&iacute;sic de trametre una c&ograve;pia
i podeu, si aix&iacute; ho voleu, oferir alguna garantia a canvi d'un
preu.
</p>
<p>
<b>2.</b> Podeu modificar la c&ograve;pia o c&ograve;pies del programa o
qualsevol tros, tot fornint una obra basada en el programa, i podeu copiar
i distribuir aquestes modificacions o obres sota els termes de la
Secci&oacute; 1 anterior, sempre i quan tamb&eacute; compliu les
seg&uuml;ents condicions:
</p>
<ul> <ul>
<li> <li>
<b>a)</b> Heu de fer que els fitxers modificats portin indicacions ben <b>a)</b> Heu de fer que els fitxers modificats portin indicacions ben
visibles que diguin que heu modificat els fitxers i la data de la modificaci&oacute;.</li> visibles que diguin que heu modificat els fitxers i la data de la
modificaci&oacute;.
</li>
<li> <li>
<b>b)</b> Heu d'atorgar gratu&iuml;tament a totes les terceres parts els <b>b)</b> Heu d'atorgar gratu&iuml;tament a totes les terceres parts els
termes d'aquesta mateixa llic&egrave;ncia sobre la totalitat de qualsevol termes d'aquesta mateixa llic&egrave;ncia sobre la totalitat de
obra que distribu&iuml;u o publiqueu, que completament o en part contingui qualsevol obra que distribu&iuml;u o publiqueu, que completament o en
o sigui un derivat del programa o qualsevol part d'aquest.</li> part contingui o sigui un derivat del programa o qualsevol part
d'aquest.
</li>
<li> <li>
<b>c)</b> Si el programa modificat normalment llegeix instruccions interactivament <b>c)</b> Si el programa modificat normalment llegeix instruccions
quan s'executa, heu de fer que quan s'arrenqui per a aquest &uacute;s interactiu interactivament quan s'executa, heu de fer que quan s'arrenqui per a
de la manera m&eacute;s habitual, imprimeixi o mostri un missatge que inclogui aquest &uacute;s interactiu de la manera m&eacute;s habitual, imprimeixi
una nota de copyright adient i un av&iacute;s de que no hi ha garantia o mostri un missatge que inclogui una nota de copyright adient i un
(o, si de cas, que digui que la garantia l'oferiu v&oacute;s mateix) i av&iacute;s de que no hi ha garantia (o, si de cas, que digui que la
que els usuaris poden redistribuir el programa sota aquestes condicions, garantia l'oferiu v&oacute;s mateix) i que els usuaris poden
i que indiqui a l'usuari o usu&agrave;ria com veure una c&ograve;pia d'aquesta redistribuir el programa sota aquestes condicions, i que indiqui a
llic&egrave;ncia. (Excepci&oacute;: si el mateix programa &eacute;s interactiu l'usuari o usu&agrave;ria com veure una c&ograve;pia d'aquesta
per&ograve; normalment no escriu un missatge d'aquesta mena, la vostra llic&egrave;ncia. (Excepci&oacute;: si el mateix programa &eacute;s
obra basada en el programa tampoc cal que l'escrigui).</li> interactiu per&ograve; normalment no escriu un missatge d'aquesta mena,
la vostra obra basada en el programa tampoc cal que l'escrigui).
</li>
</ul> </ul>
<p> <p>
Aquests requeriments afecten a l'obra modificada com un tot. Si hi ha parts Aquests requeriments afecten a l'obra modificada com un tot. Si hi ha
identificables que no estan derivades del programa, i es poden considerar parts identificables que no estan derivades del programa, i es poden
raonablement com a obres independents i separades en si mateixes, aleshores considerar raonablement com a obres independents i separades en si
aquesta llic&egrave;ncia i els seus termes no s'apliquen a aquelles parts mateixes, aleshores aquesta llic&egrave;ncia i els seus termes no
quan les distribu&iuml;u com a obres separades. Per&ograve; quan distribu&iuml;u s'apliquen a aquelles parts quan les distribu&iuml;u com a obres
aquestes mateixes parts integrades en un tot que sigui una obra basada separades. Per&ograve; quan distribu&iuml;u aquestes mateixes parts
en el programa, la distribuci&oacute; del tot s'ha de fer d'acord amb els integrades en un tot que sigui una obra basada en el programa, la
termes d'aquesta llic&egrave;ncia, i els permisos atorgats a altres beneficiaris distribuci&oacute; del tot s'ha de fer d'acord amb els termes d'aquesta
abasten el tot sencer i, per tant, totes i cadascuna de les parts, independentment llic&egrave;ncia, i els permisos atorgats a altres beneficiaris abasten el
de qui les hagi escrites.. tot sencer i, per tant, totes i cadascuna de les parts, independentment de
<p>Aix&iacute; doncs, la intenci&oacute; d'aquesta secci&oacute; no &eacute;s qui les hagi escrites..
reclamar o disputar-vos cap dret a codi que hagueu escrit del tot v&oacute;s </p>
mateix. La intenci&oacute; &eacute;s m&eacute;s aviat exercir el dret a
controlar la distribuci&oacute; d'obres derivades o col&middot;lectives <p>
basades en el programa.</p> Aix&iacute; doncs, la intenci&oacute; d'aquesta secci&oacute; no &eacute;s
<p>A m&eacute;s a m&eacute;s, la simple agregaci&oacute; amb el programa reclamar o disputar-vos cap dret a codi que hagueu escrit del tot
(o amb una obra basada en el programa) d'altres obres no basades en el v&oacute;s mateix. La intenci&oacute; &eacute;s m&eacute;s aviat exercir
programa en un volum d'un mitj&agrave; d'emmagatzemament o de distribuci&oacute; el dret a controlar la distribuci&oacute; d'obres derivades o
no posa aquestes altres obres sota l'&agrave;mbit de la llic&egrave;ncia.</p> col&middot;lectives basades en el programa.
<p><b>3.</b> Podeu copiar i distribuir el programa (o una obra basada en </p>
el programa, segons la secci&oacute; 2) en forma executable o de codi objecte <p>
d'acord amb els termes de les Seccions 1 i 2 anteriors, sempre i quan tamb&eacute; A m&eacute;s a m&eacute;s, la simple agregaci&oacute; amb el programa (o
feu una de les coses seg&uuml;ents:&nbsp;<!-- we use this doubled UL to get the sub-sections indented, --><!-- while making the bullets as unobvious as amb una obra basada en el programa) d'altres obres no basades en el
possible. --></p> programa en un volum d'un mitj&agrave; d'emmagatzemament o de
distribuci&oacute; no posa aquestes altres obres sota l'&agrave;mbit de la
llic&egrave;ncia.
</p>
<p>
<b>3.</b> Podeu copiar i distribuir el programa (o una obra basada en el
programa, segons la secci&oacute; 2) en forma executable o de codi objecte
d'acord amb els termes de les Seccions 1 i 2 anteriors, sempre i quan
tamb&eacute; feu una de les coses seg&uuml;ents:&nbsp;<!-- we use this doubled UL to get the sub-sections indented, --><!-- while making the bullets as unobvious as
possible. -->
</p>
<ul> <ul>
<li> <li>
<b>a)</b> L'acompanyeu amb el codi font complet corresponent, capa&ccedil; <b>a)</b> L'acompanyeu amb el codi font complet corresponent,
de ser llegit per un ordinador i en un mitj&agrave; utilitzat habitualment capa&ccedil; de ser llegit per un ordinador i en un mitj&agrave;
per a l'intercanvi de programari; o</li> utilitzat habitualment per a l'intercanvi de programari; o
</li>
<li> <li>
<b>b)</b> L'acompanyeu amb un oferiment per escrit, amb validesa com a <b>b)</b> L'acompanyeu amb un oferiment per escrit, amb validesa com a
m&iacute;nim fins al cap de tres anys, de subministrar a tota tercera part, m&iacute;nim fins al cap de tres anys, de subministrar a tota tercera
i per un preu no superior al que us costi f&iacute;sicament realitzar la part, i per un preu no superior al que us costi f&iacute;sicament
distribuci&oacute;, el codi font complet corresponent, que es distribuir&agrave; realitzar la distribuci&oacute;, el codi font complet corresponent, que
d'acord amb els termes de les seccions 1 i 2 anteriors en un mitj&agrave; es distribuir&agrave; d'acord amb els termes de les seccions 1 i 2
utilitzat habitualment per a l'intercanvi de programari; o,</li> anteriors en un mitj&agrave; utilitzat habitualment per a l'intercanvi
de programari; o,
</li>
<li> <li>
<b>c)</b> L'acompanyeu amb la informaci&oacute; que hagueu rebut de l'oferiment <b>c)</b> L'acompanyeu amb la informaci&oacute; que hagueu rebut de
de distribuir el codi font corresponent (Aquesta alternativa nom&eacute;s l'oferiment de distribuir el codi font corresponent (Aquesta alternativa
&eacute;s permesa per a la distribuci&oacute; no comercial i nom&eacute;s nom&eacute;s &eacute;s permesa per a la distribuci&oacute; no comercial
si heu rebut el programa en forma executable o de codi objecte amb aquest i nom&eacute;s si heu rebut el programa en forma executable o de codi
oferiment, d'acord amb la subsecci&oacute; b anterior).</li> objecte amb aquest oferiment, d'acord amb la subsecci&oacute; b
anterior).
</li>
</ul> </ul>
El codi font per a una obra vol dir la forma preferida de l'obra per tal El codi font per a una obra vol dir la forma preferida de l'obra per tal de
de fer-hi modificacions. Per una obra executable, el codi font complet fer-hi modificacions. Per una obra executable, el codi font complet vol dir
vol dir tot el codi font per tots els m&ograve;duls que cont&eacute;, m&eacute;s tot el codi font per tots els m&ograve;duls que cont&eacute;, m&eacute;s
tots els fitxers de definici&oacute; d'interf&iacute;cies associats si tots els fitxers de definici&oacute; d'interf&iacute;cies associats si
s'escau, m&eacute;s els <i>scripts</i> que es facin servir per controlar s'escau, m&eacute;s els <i>scripts</i> que es facin servir per controlar la
la compilaci&oacute; i la instal&middot;laci&oacute; de l'executable si compilaci&oacute; i la instal&middot;laci&oacute; de l'executable si
s'escau. Tanmateix, fent una excepci&oacute; especial, el codi font que s'escau. Tanmateix, fent una excepci&oacute; especial, el codi font que es
es distribueixi no cal que inclogui res del que normalment es distribueixi distribueixi no cal que inclogui res del que normalment es distribueixi (sia
(sia en forma bin&agrave;ria o de codi font) amb els components principals en forma bin&agrave;ria o de codi font) amb els components principals
(compilador, nucli o similars) del sistema operatiu en qu&egrave; s'executa (compilador, nucli o similars) del sistema operatiu en qu&egrave; s'executa
el programa, tret que el component en q&uuml;esti&oacute; acompanyi l'executable. el programa, tret que el component en q&uuml;esti&oacute; acompanyi
<p>Si la distribuci&oacute; de l'executable consisteix en donar acc&eacute;s l'executable.
per copiar-lo d'un lloc determinat, aleshores serveix com a distribuci&oacute; <p>
del codi font el fet de donar un acc&eacute;s equivalent per copiar el Si la distribuci&oacute; de l'executable consisteix en donar acc&eacute;s
codi font, encara que les terceres parts no estiguin obligades a copiar per copiar-lo d'un lloc determinat, aleshores serveix com a
el codi font en copiar el codi objecte.</p> distribuci&oacute; del codi font el fet de donar un acc&eacute;s
<p><b>4.</b> No podeu copiar, modificar, reemetre llic&egrave;ncies, o equivalent per copiar el codi font, encara que les terceres parts no
estiguin obligades a copiar el codi font en copiar el codi objecte.
</p>
<p>
<b>4.</b> No podeu copiar, modificar, reemetre llic&egrave;ncies, o
distribuir el programa si no &eacute;s de la forma expressa que atorga distribuir el programa si no &eacute;s de la forma expressa que atorga
aquesta Llic&egrave;ncia. Qualsevol altre intent de copiar, modificar, aquesta Llic&egrave;ncia. Qualsevol altre intent de copiar, modificar,
reemetre llic&egrave;ncies, o distribuir el programa &eacute;s il&middot;l&iacute;cit reemetre llic&egrave;ncies, o distribuir el programa &eacute;s
i finalitzar&agrave; autom&agrave;ticament els drets que hagueu obtingut il&middot;l&iacute;cit i finalitzar&agrave; autom&agrave;ticament els
d'aquesta llic&egrave;ncia. Tanmateix, les parts que hagin rebut de v&oacute;s drets que hagueu obtingut d'aquesta llic&egrave;ncia. Tanmateix, les parts
c&ograve;pies o drets d'acord amb aquesta llic&egrave;ncia no veuran les que hagin rebut de v&oacute;s c&ograve;pies o drets d'acord amb aquesta
seves llic&egrave;ncies finalitzades mentre segueixin observant-les estrictament.</p> llic&egrave;ncia no veuran les seves llic&egrave;ncies finalitzades mentre
<p><b>5.</b> No esteu obligat a acceptar aquesta llic&egrave;ncia, donat segueixin observant-les estrictament.
que no l'heu signada. Tanmateix, no hi ha cap altra opci&oacute; que us </p>
doni perm&iacute;s per modificar o distribuir el programa o les seves obres <p>
<b>5.</b> No esteu obligat a acceptar aquesta llic&egrave;ncia, donat que
no l'heu signada. Tanmateix, no hi ha cap altra opci&oacute; que us doni
perm&iacute;s per modificar o distribuir el programa o les seves obres
derivades. Aquestes accions queden prohibides per la llei si no accepteu derivades. Aquestes accions queden prohibides per la llei si no accepteu
aquesta llic&egrave;ncia. Aix&iacute; doncs, en modificar o distribuir aquesta llic&egrave;ncia. Aix&iacute; doncs, en modificar o distribuir el
el programa o les seves obres derivades, esteu indicant que accepteu aquesta programa o les seves obres derivades, esteu indicant que accepteu aquesta
llic&egrave;ncia per fer-ho, i tots els seus termes i condicions per copiar, llic&egrave;ncia per fer-ho, i tots els seus termes i condicions per
distribuir o modificar el programa o obres basades en ell.</p> copiar, distribuir o modificar el programa o obres basades en ell.
<p><b>6.</b> Cada cop que distribu&iuml;u el programa (o qualsevol obra </p>
<p>
<b>6.</b> Cada cop que distribu&iuml;u el programa (o qualsevol obra
basada en el programa), el destinatari rep autom&agrave;ticament, de qui basada en el programa), el destinatari rep autom&agrave;ticament, de qui
va emetre la llic&egrave;ncia origin&agrave;riament, una llic&egrave;ncia va emetre la llic&egrave;ncia origin&agrave;riament, una llic&egrave;ncia
per copiar, distribuir o modificar el programa sotmesa a aquests termes per copiar, distribuir o modificar el programa sotmesa a aquests termes i
i condicions. No podeu imposar cap m&eacute;s restricci&oacute; a l'exercici condicions. No podeu imposar cap m&eacute;s restricci&oacute; a l'exercici
dels drets que aqu&iacute; es confereixen. No sou responsable de fer complir dels drets que aqu&iacute; es confereixen. No sou responsable de fer
aquesta llic&egrave;ncia a terceres parts.</p> complir aquesta llic&egrave;ncia a terceres parts.
<p><b>7.</b> Si, a conseq&uuml;&egrave;ncia d'una decisi&oacute; judicial, </p>
una demanda per infracci&oacute; d'una patent o per qualsevol altra ra&oacute; <p>
(no exclusivament relacionada amb patents), se us imposen condicions (tant <b>7.</b> Si, a conseq&uuml;&egrave;ncia d'una decisi&oacute; judicial,
si &eacute;s per ordre judicial, acord, o el que sigui) que contradiuen una demanda per infracci&oacute; d'una patent o per qualsevol altra
les condicions d'aquesta llic&egrave;ncia, no quedeu excusat de les condicions ra&oacute; (no exclusivament relacionada amb patents), se us imposen
d'aquesta llic&egrave;ncia. Si no us &eacute;s possible distribuir de manera condicions (tant si &eacute;s per ordre judicial, acord, o el que sigui)
que satisfeu alhora les obligacions que us imposa aquesta llic&egrave;ncia que contradiuen les condicions d'aquesta llic&egrave;ncia, no quedeu
i qualsevol altra obligaci&oacute; pertinent, aleshores resulta que no excusat de les condicions d'aquesta llic&egrave;ncia. Si no us &eacute;s
podeu distribuir el programa en absolut. Per exemple, si una llic&egrave;ncia possible distribuir de manera que satisfeu alhora les obligacions que us
de patent no permet&eacute;s redistribuir gratu&iuml;tament el programa imposa aquesta llic&egrave;ncia i qualsevol altra obligaci&oacute;
a aquells que hagin rebut c&ograve;pies de v&oacute;s directament o indirecta, pertinent, aleshores resulta que no podeu distribuir el programa en
aleshores la &uacute;nica manera en qu&egrave; podr&iacute;eu satisfer absolut. Per exemple, si una llic&egrave;ncia de patent no permet&eacute;s
tant aix&ograve; com aquesta llic&egrave;ncia seria abstenir-vos completament redistribuir gratu&iuml;tament el programa a aquells que hagin rebut
de distribuir el programa.</p> c&ograve;pies de v&oacute;s directament o indirecta, aleshores la
<p>Si qualsevol fragment d'aquesta secci&oacute; qued&eacute;s invalidat &uacute;nica manera en qu&egrave; podr&iacute;eu satisfer tant aix&ograve;
o no es pogu&eacute;s fer complir en qualsevol circumst&agrave;ncia particular, com aquesta llic&egrave;ncia seria abstenir-vos completament de distribuir
la intenci&oacute; &eacute;s que s'apliqui el balan&ccedil; de la secci&oacute;, el programa.
i que s'apliqui la secci&oacute; en la seva totalitat en altres circumst&agrave;ncies.</p> </p>
<p>El prop&ograve;sit d'aquesta secci&oacute; no &eacute;s induir-vos a <p>
infringir cap patent ni cap altre requeriment del dret a la propietat, Si qualsevol fragment d'aquesta secci&oacute; qued&eacute;s invalidat o no
o a discutir-ne la validesa; l'&uacute;nic prop&ograve;sit d'aquesta secci&oacute; es pogu&eacute;s fer complir en qualsevol circumst&agrave;ncia particular,
&eacute;s protegir la integritat del sistema de distribuci&oacute; de programari la intenci&oacute; &eacute;s que s'apliqui el balan&ccedil; de la
lliure, que s'implementa amb pr&agrave;ctiques de llic&egrave;ncia p&uacute;blica. secci&oacute;, i que s'apliqui la secci&oacute; en la seva totalitat en
Molta gent ha fet generoses contribucions a l'ampli ventall de programari altres circumst&agrave;ncies.
distribu&iuml;t per aquest sistema refiant-se de l'aplicaci&oacute; consistent </p>
del sistema; li pertoca a l'autor, autora o donant decidir si vol distribuir <p>
programari per algun altre sistema, i un beneficiari de la llic&egrave;ncia El prop&ograve;sit d'aquesta secci&oacute; no &eacute;s induir-vos a
no pot imposar aquesta opci&oacute;.</p> infringir cap patent ni cap altre requeriment del dret a la propietat, o a
<p>Aquesta secci&oacute; pret&eacute;n deixar del tot clar el que es considera discutir-ne la validesa; l'&uacute;nic prop&ograve;sit d'aquesta
una conseq&uuml;&egrave;ncia de la resta de la llic&egrave;ncia.</p> secci&oacute; &eacute;s protegir la integritat del sistema de
<p><b>8.</b> Si hi ha pa&iuml;sos que restringeixen la distribuci&oacute; distribuci&oacute; de programari lliure, que s'implementa amb
o l'&uacute;s del programari, ja sigui per patents o per interf&iacute;cies pr&agrave;ctiques de llic&egrave;ncia p&uacute;blica. Molta gent ha fet
sota copyright, el posse&iuml;dor del copyright original que posi el programa generoses contribucions a l'ampli ventall de programari distribu&iuml;t
sota aquesta llic&egrave;ncia pot afegir limitacions geogr&agrave;fiques per aquest sistema refiant-se de l'aplicaci&oacute; consistent del
expl&iacute;cites que excloguin aquests pa&iuml;sos, de manera que la distribuci&oacute; sistema; li pertoca a l'autor, autora o donant decidir si vol distribuir
nom&eacute;s quedi permesa dintre dels pa&iuml;sos no exclosos, o entre programari per algun altre sistema, i un beneficiari de la
ells. En tal cas, aquesta llic&egrave;ncia incorpora la limitaci&oacute; llic&egrave;ncia no pot imposar aquesta opci&oacute;.
com si estigu&eacute;s escrita en el text de la llic&egrave;ncia.</p> </p>
<p><b>9.</b> La Free Software Foundation (Fundaci&oacute; per al programari <p>
Aquesta secci&oacute; pret&eacute;n deixar del tot clar el que es
considera una conseq&uuml;&egrave;ncia de la resta de la llic&egrave;ncia.
</p>
<p>
<b>8.</b> Si hi ha pa&iuml;sos que restringeixen la distribuci&oacute; o
l'&uacute;s del programari, ja sigui per patents o per interf&iacute;cies
sota copyright, el posse&iuml;dor del copyright original que posi el
programa sota aquesta llic&egrave;ncia pot afegir limitacions
geogr&agrave;fiques expl&iacute;cites que excloguin aquests pa&iuml;sos,
de manera que la distribuci&oacute; nom&eacute;s quedi permesa dintre dels
pa&iuml;sos no exclosos, o entre ells. En tal cas, aquesta
llic&egrave;ncia incorpora la limitaci&oacute; com si estigu&eacute;s
escrita en el text de la llic&egrave;ncia.
</p>
<p>
<b>9.</b> La Free Software Foundation (Fundaci&oacute; per al programari
lliure) pot publicar versions revisades o noves de la llic&egrave;ncia lliure) pot publicar versions revisades o noves de la llic&egrave;ncia
p&uacute;blica general de tant en tant. Aquestes versions noves seran semblants p&uacute;blica general de tant en tant. Aquestes versions noves seran
en esperit a la versi&oacute; present, per&ograve; poden diferir en detalls semblants en esperit a la versi&oacute; present, per&ograve; poden diferir
per tractar nous neguits o problemes.</p> en detalls per tractar nous neguits o problemes.
<p>Cada versi&oacute; rep un n&uacute;mero de versi&oacute; distintiu. </p>
Si el programa especifica un n&uacute;mero de versi&oacute; d'aquesta llic&egrave;ncia <p>
que li &eacute;s aplicable i "qualsevol versi&oacute; posterior", teniu Cada versi&oacute; rep un n&uacute;mero de versi&oacute; distintiu. Si el
l'opci&oacute; de seguir els termes i condicions de la versi&oacute; especificada programa especifica un n&uacute;mero de versi&oacute; d'aquesta
o de qualsevol versi&oacute; publicada posteriorment per la Free Software llic&egrave;ncia que li &eacute;s aplicable i "qualsevol versi&oacute;
Foundation. Si el programa no especifica un n&uacute;mero de versi&oacute; posterior", teniu l'opci&oacute; de seguir els termes i condicions de la
d'aquesta llic&egrave;ncia, podeu triar qualsevol versi&oacute; que hagi versi&oacute; especificada o de qualsevol versi&oacute; publicada
publicat la Free Software Foundation en qualsevol data.</p> posteriorment per la Free Software Foundation. Si el programa no
<p><b>10.</b> Si voleu incorporar parts del programa en altres programes especifica un n&uacute;mero de versi&oacute; d'aquesta llic&egrave;ncia,
lliures les condicions de distribuci&oacute; dels quals s&oacute;n diferents, podeu triar qualsevol versi&oacute; que hagi publicat la Free Software
escriviu a l'autor per demanar-li perm&iacute;s. Per al programari que Foundation en qualsevol data.
est&agrave; sota copyright de la Free Software Foundation, escriviu a la </p>
Free Software Foundation; de vegades fem excepcions per permetre-ho. Prendrem <p>
la nostra decisi&oacute; guiats pels dos objectius de mantenir la condici&oacute; <b>10.</b> Si voleu incorporar parts del programa en altres programes
de lliure de tots els derivats del nostre programari lliure i de promoure lliures les condicions de distribuci&oacute; dels quals s&oacute;n
la compartici&oacute; i la reutilitzaci&oacute; del programari en general.</p> diferents, escriviu a l'autor per demanar-li perm&iacute;s. Per al
programari que est&agrave; sota copyright de la Free Software Foundation,
escriviu a la Free Software Foundation; de vegades fem excepcions per
permetre-ho. Prendrem la nostra decisi&oacute; guiats pels dos objectius
de mantenir la condici&oacute; de lliure de tots els derivats del nostre
programari lliure i de promoure la compartici&oacute; i la
reutilitzaci&oacute; del programari en general.
</p>
<p><b>ABS&Egrave;NCIA DE GARANTIES</b></p> <p><b>ABS&Egrave;NCIA DE GARANTIES</b></p>
<p><b>11.</b> COM QUE LA LLIC&Egrave;NCIA DEL PROGRAMA &Eacute;S GRATU&Iuml;TA, <p>
NO HI HA GARANTIA PER AL PROGRAMA, EN LA MESURA QUE HO PERMETI LA LLEI <b>11.</b> COM QUE LA LLIC&Egrave;NCIA DEL PROGRAMA &Eacute;S
APLICABLE. EXCEPTE EL QUE ALTRAMENT ES DIGUI PER ESCRIT, ELS POSSE&Iuml;DORS GRATU&Iuml;TA, NO HI HA GARANTIA PER AL PROGRAMA, EN LA MESURA QUE HO
DEL COPYRIGHT I/O ALTRES PARTS SUBMINISTREN EL PROGRAMA "TAL QUAL" SENSE PERMETI LA LLEI APLICABLE. EXCEPTE EL QUE ALTRAMENT ES DIGUI PER ESCRIT,
CAP MENA DE GARANTIA, NI EXPL&Iacute;CITA NI IMPL&Iacute;CITA, INCLOSES, ELS POSSE&Iuml;DORS DEL COPYRIGHT I/O ALTRES PARTS SUBMINISTREN EL
ENTRE ALTRES, LES GARANTIES IMPL&Iacute;CITES DE COMERCIALITZABILITAT I PROGRAMA "TAL QUAL" SENSE CAP MENA DE GARANTIA, NI EXPL&Iacute;CITA NI
APTITUD PER A PROP&Ograve;SITS DETERMINATS. TOT EL RISC PEL QUE FA A LA IMPL&Iacute;CITA, INCLOSES, ENTRE ALTRES, LES GARANTIES IMPL&Iacute;CITES
QUALITAT I RENDIMENT DEL PROGRAMA &Eacute;S VOSTRE. EN CAS QUE EL PROGRAMA DE COMERCIALITZABILITAT I APTITUD PER A PROP&Ograve;SITS DETERMINATS. TOT
RESULT&Eacute;S DEFECTU&Oacute;S, V&Oacute;S ASSUMIU TOT EL COST D'ASSIST&Egrave;NCIA, EL RISC PEL QUE FA A LA QUALITAT I RENDIMENT DEL PROGRAMA &Eacute;S
REPARACI&Oacute; O CORRECCI&Oacute;.</p> VOSTRE. EN CAS QUE EL PROGRAMA RESULT&Eacute;S DEFECTU&Oacute;S,
<p><b>12.</b> EL POSSE&Iuml;DOR DEL COPYRIGHT, O QUALSEVOL ALTRA PART QUE V&Oacute;S ASSUMIU TOT EL COST D'ASSIST&Egrave;NCIA, REPARACI&Oacute; O
CORRECCI&Oacute;.
</p>
<p>
<b>12.</b> EL POSSE&Iuml;DOR DEL COPYRIGHT, O QUALSEVOL ALTRA PART QUE
PUGUI MODIFICAR O REDISTRIBUIR EL PROGRAMA TAL I COM ES PERMET M&Eacute;S PUGUI MODIFICAR O REDISTRIBUIR EL PROGRAMA TAL I COM ES PERMET M&Eacute;S
AMUNT NO US HAUR&Agrave; DE RESPONDRE EN CAP CAS, TRET DEL QUE REQUEREIXI AMUNT NO US HAUR&Agrave; DE RESPONDRE EN CAP CAS, TRET DEL QUE REQUEREIXI
LA LLEI APLICABLE O ELS ACORDS PER ESCRIT, PER PERJUDICIS, INCLOSOS ELS LA LLEI APLICABLE O ELS ACORDS PER ESCRIT, PER PERJUDICIS, INCLOSOS ELS
INCIDENTALS, DERIVATS, ESPECIALS O GENERALS QUE ES DERIVIN DE L'&Uacute;S INCIDENTALS, DERIVATS, ESPECIALS O GENERALS QUE ES DERIVIN DE L'&Uacute;S
O DE LA IMPOSSIBILITAT D'&Uacute;S DEL PROGRAMA (INCLOSES ENTRE D'ALTRES O DE LA IMPOSSIBILITAT D'&Uacute;S DEL PROGRAMA (INCLOSES ENTRE D'ALTRES
LES P&Egrave;RDUES DE DADES, LES DADES QUE EL PROGRAMA HAGI MALM&Egrave;S, LES P&Egrave;RDUES DE DADES, LES DADES QUE EL PROGRAMA HAGI MALM&Egrave;S,
LES P&Egrave;RDUES QUE US HAGI PROVOCAT A V&Oacute;S O A TERCERS O LA IMPOSSIBILITAT LES P&Egrave;RDUES QUE US HAGI PROVOCAT A V&Oacute;S O A TERCERS O LA
DE QUE EL PROGRAMA FUNCIONI AMB QUALSEVOL ALTRE PROGRAMA), FINS I TOT SI IMPOSSIBILITAT DE QUE EL PROGRAMA FUNCIONI AMB QUALSEVOL ALTRE PROGRAMA),
AQUEST POSSE&Iuml;DOR O ALTRA PART HA ESTAT ADVERTIDA DE LA POSSIBILITAT FINS I TOT SI AQUEST POSSE&Iuml;DOR O ALTRA PART HA ESTAT ADVERTIDA DE LA
D'AQUESTS PERJUDICIS.</p> POSSIBILITAT D'AQUESTS PERJUDICIS.
</p>
<h3>FINAL DELS TERMES I CONDICIONS</h3> <h3>FINAL DELS TERMES I CONDICIONS</h3>
<h3> <h3>
<a NAME="SEC4" HREF="#TOC4" NAME="SEC4">Com <a name="SEC4" href="#TOC4" name="SEC4"
podeu aplicar aquests termes als vostres programes nous</a></h3> >Com podeu aplicar aquests termes als vostres programes nous</a
>
</h3>
Si desenvolupeu un programa nou, i voleu que tingui l'&uacute;s m&eacute;s Si desenvolupeu un programa nou, i voleu que tingui l'&uacute;s m&eacute;s
gran possible per part del p&uacute;blic, la millor manera d'aconseguir-ho gran possible per part del p&uacute;blic, la millor manera d'aconseguir-ho
&eacute;s fer-lo programari lliure que tothom podr&agrave; redistribuir &eacute;s fer-lo programari lliure que tothom podr&agrave; redistribuir i
i modificar d'acord amb aquests termes. modificar d'acord amb aquests termes.
<p>Per fer-ho, afegiu els avisos seg&uuml;ents al programa. El m&eacute;s <p>
Per fer-ho, afegiu els avisos seg&uuml;ents al programa. El m&eacute;s
segur &eacute;s posar-los al comen&ccedil;ament de cada fitxer font per segur &eacute;s posar-los al comen&ccedil;ament de cada fitxer font per
transmetre de la manera m&eacute;s efectiva l'exclusi&oacute; de garanties; transmetre de la manera m&eacute;s efectiva l'exclusi&oacute; de
i cada fitxer hauria de portar com a m&iacute;nim la l&iacute;nia de "copyright" garanties; i cada fitxer hauria de portar com a m&iacute;nim la
i un apuntador que indiqui on es pot trobar la nota sencera.</p> l&iacute;nia de "copyright" i un apuntador que indiqui on es pot trobar la
nota sencera.
</p>
<pre><i>Una l&iacute;nia amb el nom del programa i una idea de qu&egrave; fa. <pre><i>Una l&iacute;nia amb el nom del programa i una idea de qu&egrave; fa.
</i>Copyright (C) <i>any</i>&nbsp; <i>nom de l'autor o autora </i>Copyright (C) <i>any</i>&nbsp; <i>nom de l'autor o autora
@ -362,49 +474,65 @@ de GNU amb aquest programa; si no, escriviu a la Free Software&nbsp;
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA&nbsp; 02111-1307, USA.</pre> Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA&nbsp; 02111-1307, USA.</pre>
Poseu-hi la informaci&oacute; que calgui per contactar amb v&oacute;s per Poseu-hi la informaci&oacute; que calgui per contactar amb v&oacute;s per
correu electr&ograve;nic i de paper. correu electr&ograve;nic i de paper.
<p>Si el programa &eacute;s interactiu, feu-lo treure una breu nota com <p>
aquesta quan arrenca en mode interactiu:</p> Si el programa &eacute;s interactiu, feu-lo treure una breu nota com
aquesta quan arrenca en mode interactiu:
</p>
<pre>Gnomovisi&oacute; versi&oacute; 69, Copyright (C) <i>any</i> <i>nom de l'autor o autora <pre>Gnomovisi&oacute; versi&oacute; 69, Copyright (C) <i>any</i> <i>nom de l'autor o autora
</i>El Gnomovisi&oacute; va SENSE CAP MENA DE GARANTIA; premeu 'mostra g' per saber-ne&nbsp; </i>El Gnomovisi&oacute; va SENSE CAP MENA DE GARANTIA; premeu 'mostra g' per saber-ne&nbsp;
els detalls.&nbsp; Aix&ograve; &eacute;s programari lliure, i se us convida a redistribuir-lo els detalls.&nbsp; Aix&ograve; &eacute;s programari lliure, i se us convida a redistribuir-lo
d'acord amb certes condicions; piqueu 'mostra c' per saber-ne els detalls.</pre> d'acord amb certes condicions; piqueu 'mostra c' per saber-ne els detalls.</pre>
<p></p>Les instruccions hipot&egrave;tiques <tt>'mostra g'</tt> i <tt>'mostra <p></p>
c'</tt> haurien de mostrar les parts escaients de la llic&egrave;ncia p&uacute;blica Les instruccions hipot&egrave;tiques <tt>'mostra g'</tt> i
general. Naturalment, les instruccions poden tenir altres noms que no siguin <tt>'mostra c'</tt> haurien de mostrar les parts escaients de la
<tt>'mostra llic&egrave;ncia p&uacute;blica general. Naturalment, les instruccions poden
g'</tt> i tenir altres noms que no siguin <tt>'mostra g'</tt> i <tt>'mostra c'</tt>;
<tt>'mostra c'</tt>; fins i tot podrien ser pics amb el ratol&iacute; fins i tot podrien ser pics amb el ratol&iacute; o opcions de men&uacute;, o
o opcions de men&uacute;, o el que li vagi b&eacute; al vostre programa. el que li vagi b&eacute; al vostre programa.
<p>Tamb&eacute; haur&iacute;eu d'aconseguir que l'empresari per qui treballeu <p>
Tamb&eacute; haur&iacute;eu d'aconseguir que l'empresari per qui treballeu
(si treballeu de programador) o la vostra escola, si &eacute;s el cas, (si treballeu de programador) o la vostra escola, si &eacute;s el cas,
signin una "ren&uacute;ncia de copyright" pel programa, si s'escau. Aqu&iacute; signin una "ren&uacute;ncia de copyright" pel programa, si s'escau.
teniu un exemple, canvieu-hi els noms:</p> Aqu&iacute; teniu un exemple, canvieu-hi els noms:
</p>
<pre>Ioiodina, S.A. , per la present renuncia a tot inter&egrave;s&nbsp; <pre>Ioiodina, S.A. , per la present renuncia a tot inter&egrave;s&nbsp;
en el copyright del programa `Gnomovisi&oacute;' (que fa l'aleta&nbsp; en el copyright del programa `Gnomovisi&oacute;' (que fa l'aleta&nbsp;
als compiladors) escrit&nbsp;&nbsp; pel Jordi Pica Codi als compiladors) escrit&nbsp;&nbsp; pel Jordi Pica Codi
<i>signat per Mag Nat</i>, 28 de desembre de 1989 <i>signat per Mag Nat</i>, 28 de desembre de 1989
Mag Nat, Vici-President</pre> Mag Nat, Vici-President</pre>
Aquesta Llic&egrave;ncia p&uacute;blica general no us permet incorporar Aquesta Llic&egrave;ncia p&uacute;blica general no us permet incorporar el
el vostre programa en programes de propietat. Si el vostre programa &eacute;s vostre programa en programes de propietat. Si el vostre programa &eacute;s
una biblioteca de subrutines, potser trobeu m&eacute;s &uacute;til permetre una biblioteca de subrutines, potser trobeu m&eacute;s &uacute;til permetre
enlla&ccedil;ar (link) aplicacions de propietat amb la biblioteca. Si &eacute;s enlla&ccedil;ar (link) aplicacions de propietat amb la biblioteca. Si
aix&ograve; el que voleu, feu servir la Llic&egrave;ncia p&uacute;blica &eacute;s aix&ograve; el que voleu, feu servir la Llic&egrave;ncia
general per a biblioteques de GNU per comptes d'aquesta llic&egrave;ncia p&uacute;blica general per a biblioteques de GNU per comptes d'aquesta
[NdeT: la FSF ara li diu llic&egrave;ncia p&uacute;blica menys general llic&egrave;ncia [NdeT: la FSF ara li diu llic&egrave;ncia p&uacute;blica
per comptes de llic&egrave;ncia p&uacute;blica general per a biblioteques].&nbsp; menys general per comptes de llic&egrave;ncia p&uacute;blica general per a
<hr>Torna a <a href="http://www.fsf.org/home.html">la p&agrave;gina principal biblioteques].&nbsp;
de GNU</a>. <hr />
<p>Per preguntes i aclariments de GNU i la FSF escriviu a: <i><a href="mailto:gnu@gnu.org">gnu@gnu.org</a></i>. Torna a
Altres <a href="http://www.fsf.org/home.html#ContactInfo">maneres de contactar <a href="http://www.fsf.org/home.html">la p&agrave;gina principal de GNU</a
</a>amb >.
la FSF:</p> <p>
<p>Envieu comentaris sobre aquestes planes de web a <i><a href="mailto:webmasters@www.gnu.org">webmasters@www.gnu.org</a></i>, Per preguntes i aclariments de GNU i la FSF escriviu a:
Envieu altres preguntes a <i><a href="mailto:gnu@gnu.org">gnu@gnu.org</a></i>.</p> <i><a href="mailto:gnu@gnu.org">gnu@gnu.org</a></i
>. Altres
<a href="http://www.fsf.org/home.html#ContactInfo"
>maneres de contactar </a
>amb la FSF:
</p>
<p>
Envieu comentaris sobre aquestes planes de web a
<i><a href="mailto:webmasters@www.gnu.org">webmasters@www.gnu.org</a></i
>, Envieu altres preguntes a
<i><a href="mailto:gnu@gnu.org">gnu@gnu.org</a></i
>.
</p>
<p>La nota de Copyright &eacute;s m&eacute;s amunt.</p> <p>La nota de Copyright &eacute;s m&eacute;s amunt.</p>
<br>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, <br />Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111, USA MA 02111, USA
<p>Actualitzat:<!-- hhmts start -->3 Jan 2000 rms<!-- hhmts end --></p> <p>Actualitzat:<!-- hhmts start -->3 Jan 2000 rms<!-- hhmts end --></p>
<hr> <hr />
</body> </body>
</html> </html>

View File

@ -8,192 +8,196 @@
<ul> <ul>
<li><a href="#SEC1">GNU GENERAL PUBLIC LICENSE</a></li> <li><a href="#SEC1">GNU GENERAL PUBLIC LICENSE</a></li>
<li><a href="#SEC2">Preamble</a></li> <li><a href="#SEC2">Preamble</a></li>
<li><a href="#SEC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a> <li>
<a href="#SEC3"
>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a
>
</li>
</ul> </ul>
<hr /> <hr />
<p></p> <p></p>
<h3><a name="SEC1">GNU GENERAL PUBLIC LICENSE</a></h3> <h3><a name="SEC1">GNU GENERAL PUBLIC LICENSE</a></h3>
<p>Version 2, June 1991</p> <p>Version 2, June 1991</p>
<pre>Copyright (C) 1989, 1991 Free Software Foundation, Inc. <pre>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</pre> of this license document, but changing it is not allowed.</pre
>
<h3><a name="SEC2">Preamble</a></h3> <h3><a name="SEC2">Preamble</a></h3>
<p> <p>
The licenses for most software are designed to take away your The licenses for most software are designed to take away your freedom to
freedom to share and change it. By contrast, the GNU General Public share and change it. By contrast, the GNU General Public License is
License is intended to guarantee your freedom to share and change free intended to guarantee your freedom to share and change free software--to
software--to make sure the software is free for all its users. This make sure the software is free for all its users. This General Public
General Public License applies to most of the Free Software License applies to most of the Free Software Foundation's software and to
Foundation's software and to any other program whose authors commit to any other program whose authors commit to using it. (Some other Free
using it. (Some other Free Software Foundation software is covered by Software Foundation software is covered by the GNU Library General Public
the GNU Library General Public License instead.) You can apply it to License instead.) You can apply it to your programs, too.
your programs, too.
</p> </p>
<p> <p>
When we speak of free software, we are referring to freedom, not When we speak of free software, we are referring to freedom, not price.
price. Our General Public Licenses are designed to make sure that you Our General Public Licenses are designed to make sure that you have the
have the freedom to distribute copies of free software (and charge for freedom to distribute copies of free software (and charge for this service
this service if you wish), that you receive source code or can get it if you wish), that you receive source code or can get it if you want it,
if you want it, that you can change the software or use pieces of it that you can change the software or use pieces of it in new free programs;
in new free programs; and that you know you can do these things. and that you know you can do these things.
</p> </p>
<p> <p>
To protect your rights, we need to make restrictions that forbid To protect your rights, we need to make restrictions that forbid anyone to
anyone to deny you these rights or to ask you to surrender the rights. deny you these rights or to ask you to surrender the rights. These
These restrictions translate to certain responsibilities for you if you restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it. distribute copies of the software, or if you modify it.
</p> </p>
<p> <p>
For example, if you distribute copies of such a program, whether For example, if you distribute copies of such a program, whether gratis or
gratis or for a fee, you must give the recipients all the rights that for a fee, you must give the recipients all the rights that you have. You
you have. You must make sure that they, too, receive or can get the must make sure that they, too, receive or can get the source code. And you
source code. And you must show them these terms so they know their must show them these terms so they know their rights.
rights.
</p> </p>
<p> <p>
We protect your rights with two steps: (1) copyright the software, and We protect your rights with two steps: (1) copyright the software, and (2)
(2) offer you this license which gives you legal permission to copy, offer you this license which gives you legal permission to copy,
distribute and/or modify the software. distribute and/or modify the software.
</p> </p>
<p> <p>
Also, for each author's protection and ours, we want to make certain Also, for each author's protection and ours, we want to make certain that
that everyone understands that there is no warranty for this free everyone understands that there is no warranty for this free software. If
software. If the software is modified by someone else and passed on, we the software is modified by someone else and passed on, we want its
want its recipients to know that what they have is not the original, so recipients to know that what they have is not the original, so that any
that any problems introduced by others will not reflect on the original problems introduced by others will not reflect on the original authors'
authors' reputations. reputations.
</p> </p>
<p> <p>
Finally, any free program is threatened constantly by software Finally, any free program is threatened constantly by software patents. We
patents. We wish to avoid the danger that redistributors of a free wish to avoid the danger that redistributors of a free program will
program will individually obtain patent licenses, in effect making the individually obtain patent licenses, in effect making the program
program proprietary. To prevent this, we have made it clear that any proprietary. To prevent this, we have made it clear that any patent must
patent must be licensed for everyone's free use or not licensed at all. be licensed for everyone's free use or not licensed at all.
</p> </p>
<p> <p>
The precise terms and conditions for copying, distribution and The precise terms and conditions for copying, distribution and
modification follow. modification follow.
</p> </p>
<h3><a name="SEC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a></h3> <h3>
<a name="SEC3"
>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a
>
</h3>
<p> <p>
<strong>0.</strong> <strong>0.</strong> This License applies to any program or other work
This License applies to any program or other work which contains which contains a notice placed by the copyright holder saying it may be
a notice placed by the copyright holder saying it may be distributed distributed under the terms of this General Public License. The "Program",
under the terms of this General Public License. The "Program", below, below, refers to any such program or work, and a "work based on the
refers to any such program or work, and a "work based on the Program" Program" means either the Program or any derivative work under copyright
means either the Program or any derivative work under copyright law: law: that is to say, a work containing the Program or a portion of it,
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in language. (Hereinafter, translation is included without limitation in the
the term "modification".) Each licensee is addressed as "you". term "modification".) Each licensee is addressed as "you".
</p> </p>
<p> <p>
Activities other than copying, distribution and modification are not Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of covered by this License; they are outside its scope. The act of running
running the Program is not restricted, and the output from the Program the Program is not restricted, and the output from the Program is covered
is covered only if its contents constitute a work based on the only if its contents constitute a work based on the Program (independent
Program (independent of having been made by running the Program). of having been made by running the Program). Whether that is true depends
Whether that is true depends on what the Program does. on what the Program does.
</p> </p>
<p> <p>
<strong>1.</strong> <strong>1.</strong> You may copy and distribute verbatim copies of the
You may copy and distribute verbatim copies of the Program's Program's source code as you receive it, in any medium, provided that you
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the copyright notice and disclaimer of warranty; keep intact all the notices
notices that refer to this License and to the absence of any warranty; that refer to this License and to the absence of any warranty; and give
and give any other recipients of the Program a copy of this License any other recipients of the Program a copy of this License along with the
along with the Program. Program.
</p> </p>
<p> <p>
You may charge a fee for the physical act of transferring a copy, and You may charge a fee for the physical act of transferring a copy, and you
you may at your option offer warranty protection in exchange for a fee. may at your option offer warranty protection in exchange for a fee.
</p> </p>
<p> <p>
<strong>2.</strong> <strong>2.</strong> You may modify your copy or copies of the Program or
You may modify your copy or copies of the Program or any portion any portion of it, thus forming a work based on the Program, and copy and
of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above,
distribute such modifications or work under the terms of Section 1 provided that you also meet all of these conditions:
above, provided that you also meet all of these conditions:
</p> </p>
<p></p> <p></p>
<dl> <dl>
<dd> <dd>
<strong>a)</strong> <strong>a)</strong> You must cause the modified files to carry prominent
You must cause the modified files to carry prominent notices notices stating that you changed the files and the date of any change.
stating that you changed the files and the date of any change.
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dd> <dd>
<strong>b)</strong> <strong>b)</strong> You must cause any work that you distribute or
You must cause any work that you distribute or publish, that in publish, that in whole or in part contains or is derived from the
whole or in part contains or is derived from the Program or any Program or any part thereof, to be licensed as a whole at no charge to
part thereof, to be licensed as a whole at no charge to all third all third parties under the terms of this License.
parties under the terms of this License.
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dd> <dd>
<strong>c)</strong> <strong>c)</strong> If the modified program normally reads commands
If the modified program normally reads commands interactively interactively when run, you must cause it, when started running for such
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a announcement including an appropriate copyright notice and a notice that
notice that there is no warranty (or else, saying that you provide there is no warranty (or else, saying that you provide a warranty) and
a warranty) and that users may redistribute the program under that users may redistribute the program under these conditions, and
these conditions, and telling the user how to view a copy of this telling the user how to view a copy of this License. (Exception: if the
License. (Exception: if the Program itself is interactive but Program itself is interactive but does not normally print such an
does not normally print such an announcement, your work based on announcement, your work based on the Program is not required to print an
the Program is not required to print an announcement.) announcement.)
</dd> </dd>
</dl> </dl>
<p> <p>
These requirements apply to the modified work as a whole. If These requirements apply to the modified work as a whole. If identifiable
identifiable sections of that work are not derived from the Program, sections of that work are not derived from the Program, and can be
and can be reasonably considered independent and separate works in reasonably considered independent and separate works in themselves, then
themselves, then this License, and its terms, do not apply to those this License, and its terms, do not apply to those sections when you
sections when you distribute them as separate works. But when you distribute them as separate works. But when you distribute the same
distribute the same sections as part of a whole which is a work based sections as part of a whole which is a work based on the Program, the
on the Program, the distribution of the whole must be on the terms of distribution of the whole must be on the terms of this License, whose
this License, whose permissions for other licensees extend to the permissions for other licensees extend to the entire whole, and thus to
entire whole, and thus to each and every part regardless of who wrote it. each and every part regardless of who wrote it.
</p> </p>
<p> <p>
Thus, it is not the intent of this section to claim rights or contest Thus, it is not the intent of this section to claim rights or contest your
your rights to work written entirely by you; rather, the intent is to rights to work written entirely by you; rather, the intent is to exercise
exercise the right to control the distribution of derivative or the right to control the distribution of derivative or collective works
collective works based on the Program. based on the Program.
</p> </p>
<p>In addition, mere aggregation of another work not based on the Program <p>
with the Program (or with a work based on the Program) on a volume of In addition, mere aggregation of another work not based on the Program
a storage or distribution medium does not bring the other work under with the Program (or with a work based on the Program) on a volume of a
the scope of this License. storage or distribution medium does not bring the other work under the
scope of this License.
</p> </p>
<p><strong>3.</strong> <p>
You may copy and distribute the Program (or a work based on it, <strong>3.</strong> You may copy and distribute the Program (or a work
under Section 2) in object code or executable form under the terms of based on it, under Section 2) in object code or executable form under the
Sections 1 and 2 above provided that you also do one of the following: terms of Sections 1 and 2 above provided that you also do one of the
following:
</p> </p>
<dl> <dl>
<dd> <dd>
<strong>a)</strong> <strong>a)</strong> Accompany it with the complete corresponding
Accompany it with the complete corresponding machine-readable machine-readable source code, which must be distributed under the terms
source code, which must be distributed under the terms of Sections of Sections 1 and 2 above on a medium customarily used for software
1 and 2 above on a medium customarily used for software interchange; or, interchange; or,
</dd> </dd>
<dd> <dd>
<strong>b)</strong> <strong>b)</strong> Accompany it with a written offer, valid for at
Accompany it with a written offer, valid for at least three least three years, to give any third party, for a charge no more than
years, to give any third party, for a charge no more than your your cost of physically performing source distribution, a complete
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or, customarily used for software interchange; or,
@ -201,117 +205,106 @@ Sections 1 and 2 above provided that you also do one of the following:
</dl> </dl>
<dl> <dl>
<dd> <dd>
<strong>c)</strong> <strong>c)</strong> Accompany it with the information you received as to
Accompany it with the information you received as to the offer the offer to distribute corresponding source code. (This alternative is
to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the
allowed only for noncommercial distribution and only if you program in object code or executable form with such an offer, in accord
received the program in object code or executable form with such with Subsection b above.)
an offer, in accord with Subsection b above.)
</dd> </dd>
</dl> </dl>
<p> <p>
The source code for a work means the preferred form of the work for The source code for a work means the preferred form of the work for making
making modifications to it. For an executable work, complete source modifications to it. For an executable work, complete source code means
code means all the source code for all modules it contains, plus any all the source code for all modules it contains, plus any associated
associated interface definition files, plus the scripts used to interface definition files, plus the scripts used to control compilation
control compilation and installation of the executable. However, as a and installation of the executable. However, as a special exception, the
special exception, the source code distributed need not include source code distributed need not include anything that is normally
anything that is normally distributed (in either source or binary distributed (in either source or binary form) with the major components
form) with the major components (compiler, kernel, and so on) of the (compiler, kernel, and so on) of the operating system on which the
operating system on which the executable runs, unless that component executable runs, unless that component itself accompanies the executable.
itself accompanies the executable.
</p> </p>
<p> <p>
If distribution of executable or object code is made by offering If distribution of executable or object code is made by offering access to
access to copy from a designated place, then offering equivalent copy from a designated place, then offering equivalent access to copy the
access to copy the source code from the same place counts as source code from the same place counts as distribution of the source code,
distribution of the source code, even though third parties are not even though third parties are not compelled to copy the source along with
compelled to copy the source along with the object code. the object code.
</p> </p>
<p> <p>
<strong>4.</strong> <strong>4.</strong> You may not copy, modify, sublicense, or distribute
You may not copy, modify, sublicense, or distribute the Program the Program except as expressly provided under this License. Any attempt
except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void,
otherwise to copy, modify, sublicense or distribute the Program is and will automatically terminate your rights under this License. However,
void, and will automatically terminate your rights under this License. parties who have received copies, or rights, from you under this License
However, parties who have received copies, or rights, from you under will not have their licenses terminated so long as such parties remain in
this License will not have their licenses terminated so long as such full compliance.
parties remain in full compliance.
</p> </p>
<p> <p>
<strong>5.</strong> <strong>5.</strong> You are not required to accept this License, since you
You are not required to accept this License, since you have not have not signed it. However, nothing else grants you permission to modify
signed it. However, nothing else grants you permission to modify or or distribute the Program or its derivative works. These actions are
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the modifying or distributing the Program (or any work based on the Program),
Program), you indicate your acceptance of this License to do so, and you indicate your acceptance of this License to do so, and all its terms
all its terms and conditions for copying, distributing or modifying and conditions for copying, distributing or modifying the Program or works
the Program or works based on it. based on it.
</p> </p>
<p> <p>
<strong>6.</strong> <strong>6.</strong> Each time you redistribute the Program (or any work
Each time you redistribute the Program (or any work based on the based on the Program), the recipient automatically receives a license from
Program), the recipient automatically receives a license from the the original licensor to copy, distribute or modify the Program subject to
original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on
these terms and conditions. You may not impose any further the recipients' exercise of the rights granted herein. You are not
restrictions on the recipients' exercise of the rights granted herein. responsible for enforcing compliance by third parties to this License.
You are not responsible for enforcing compliance by third parties to
this License.
</p> </p>
<p> <p>
<strong>7.</strong> <strong>7.</strong> If, as a consequence of a court judgment or allegation
If, as a consequence of a court judgment or allegation of patent of patent infringement or for any other reason (not limited to patent
infringement or for any other reason (not limited to patent issues), issues), conditions are imposed on you (whether by court order, agreement
conditions are imposed on you (whether by court order, agreement or or otherwise) that contradict the conditions of this License, they do not
otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute
excuse you from the conditions of this License. If you cannot so as to satisfy simultaneously your obligations under this License and
distribute so as to satisfy simultaneously your obligations under this any other pertinent obligations, then as a consequence you may not
License and any other pertinent obligations, then as a consequence you distribute the Program at all. For example, if a patent license would not
may not distribute the Program at all. For example, if a patent permit royalty-free redistribution of the Program by all those who receive
license would not permit royalty-free redistribution of the Program by copies directly or indirectly through you, then the only way you could
all those who receive copies directly or indirectly through you, then satisfy both it and this License would be to refrain entirely from
the only way you could satisfy both it and this License would be to distribution of the Program.
refrain entirely from distribution of the Program.
</p> </p>
<p> <p>
If any portion of this section is held invalid or unenforceable under If any portion of this section is held invalid or unenforceable under any
any particular circumstance, the balance of the section is intended to particular circumstance, the balance of the section is intended to apply
apply and the section as a whole is intended to apply in other and the section as a whole is intended to apply in other circumstances.
circumstances.
</p> </p>
<p> <p>
It is not the purpose of this section to induce you to infringe any It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any patents or other property right claims or to contest validity of any such
such claims; this section has the sole purpose of protecting the claims; this section has the sole purpose of protecting the integrity of
integrity of the free software distribution system, which is the free software distribution system, which is implemented by public
implemented by public license practices. Many people have made license practices. Many people have made generous contributions to the
generous contributions to the wide range of software distributed wide range of software distributed through that system in reliance on
through that system in reliance on consistent application of that consistent application of that system; it is up to the author/donor to
system; it is up to the author/donor to decide if he or she is willing decide if he or she is willing to distribute software through any other
to distribute software through any other system and a licensee cannot system and a licensee cannot impose that choice.
impose that choice.
</p> </p>
<p> <p>
This section is intended to make thoroughly clear what is believed to This section is intended to make thoroughly clear what is believed to be a
be a consequence of the rest of this License. consequence of the rest of this License.
</p> </p>
<p> <p>
<strong>8.</strong> <strong>8.</strong> If the distribution and/or use of the Program is
If the distribution and/or use of the Program is restricted in restricted in certain countries either by patents or by copyrighted
certain countries either by patents or by copyrighted interfaces, the interfaces, the original copyright holder who places the Program under
original copyright holder who places the Program under this License this License may add an explicit geographical distribution limitation
may add an explicit geographical distribution limitation excluding excluding those countries, so that distribution is permitted only in or
those countries, so that distribution is permitted only in or among among countries not thus excluded. In such case, this License incorporates
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License. the limitation as if written in the body of this License.
</p> </p>
<p> <p>
<strong>9.</strong> <strong>9.</strong> The Free Software Foundation may publish revised
The Free Software Foundation may publish revised and/or new versions and/or new versions of the General Public License from time to time. Such
of the General Public License from time to time. Such new versions will new versions will be similar in spirit to the present version, but may
be similar in spirit to the present version, but may differ in detail to differ in detail to address new problems or concerns.
address new problems or concerns.
</p> </p>
<p> <p>
Each version is given a distinguishing version number. If the Program Each version is given a distinguishing version number. If the Program
@ -319,46 +312,42 @@ specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software this License, you may choose any version ever published by the Free
Foundation. Software Foundation.
</p> </p>
<p> <p>
<strong>10.</strong> <strong>10.</strong> If you wish to incorporate parts of the Program into
If you wish to incorporate parts of the Program into other free other free programs whose distribution conditions are different, write to
programs whose distribution conditions are different, write to the author the author to ask for permission. For software which is copyrighted by the
to ask for permission. For software which is copyrighted by the Free Free Software Foundation, write to the Free Software Foundation; we
Software Foundation, write to the Free Software Foundation; we sometimes sometimes make exceptions for this. Our decision will be guided by the two
make exceptions for this. Our decision will be guided by the two goals goals of preserving the free status of all derivatives of our free
of preserving the free status of all derivatives of our free software and software and of promoting the sharing and reuse of software generally.
of promoting the sharing and reuse of software generally. </p>
<p><strong>NO WARRANTY</strong></p>
<p>
<strong>11.</strong> BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE
IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
SERVICING, REPAIR OR CORRECTION.
</p> </p>
<p> <p>
<strong>NO WARRANTY</strong> <strong>12.</strong> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
</p> AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
<p> MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO
<strong>11.</strong> YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
</p>
<p>
<strong>12.</strong>
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
</p> </p>
<p></p> <p></p>
<h3>END OF TERMS AND CONDITIONS</h3> <h3>END OF TERMS AND CONDITIONS</h3>
</body></html> </body>
</html>

View File

@ -3,389 +3,540 @@
<title>Licencia P&uacute;blica GNU</title> <title>Licencia P&uacute;blica GNU</title>
</head> </head>
<body> <body>
<h2>Licencia P&uacute;blica GNU</h2> <h2>Licencia P&uacute;blica GNU</h2>
<h3>Contenido</h3> <h3>Contenido</h3>
<ul> <ul>
<li><a href="#SEC1">Licencia P&uacute;blica GNU</a></li> <li><a href="#SEC1">Licencia P&uacute;blica GNU</a></li>
<li><a href="#SEC2">Pre&aacute;mbulo</a></li> <li><a href="#SEC2">Pre&aacute;mbulo</a></li>
<li><a href="#SEC3">T&eacute;rminos y condiciones para la copia, <li>
distribuci&oacute;n y modificaci&oacute;n</a></li> <a href="#SEC3"
<li><a href="#APPENDIX">Ap&eacute;ndice: C&oacute;mo aplicar estos >T&eacute;rminos y condiciones para la copia, distribuci&oacute;n y
t&eacute;rminos a sus nuevos programas</a></li> modificaci&oacute;n</a
>
</li>
<li>
<a href="#APPENDIX"
>Ap&eacute;ndice: C&oacute;mo aplicar estos t&eacute;rminos a sus
nuevos programas</a
>
</li>
</ul> </ul>
<br> <br />
<h3><a name="SEC1">Licencia P&uacute;blica GNU</a></h3> <h3><a name="SEC1">Licencia P&uacute;blica GNU</a></h3>
<p> <p>
Esta es la conocida GNU Public License (GPL), versi&oacute;n 2 (de junio Esta es la conocida GNU Public License (GPL), versi&oacute;n 2 (de junio
de 1.991), que cubre la mayor parte del software de la Free Software Foundation, de 1.991), que cubre la mayor parte del software de la Free Software
y muchos m&aacute;s programas.</p> Foundation, y muchos m&aacute;s programas.
</p>
<p>Los autores de esta traducci&oacute;n son: <p>Los autores de esta traducci&oacute;n son:</p>
</p><ul><li><a href="mailto:jgb@computer.org">Jes&uacute;s Gonz&aacute;lez Barahona</a> <ul>
</li><li><a href="mailto:pheras@acm.org">Pedro de las Heras Quir&oacute;s</a> <li>
</li></ul> <a href="mailto:jgb@computer.org"
>Jes&uacute;s Gonz&aacute;lez Barahona</a
>
</li>
<li>
<a href="mailto:pheras@acm.org">Pedro de las Heras Quir&oacute;s</a>
</li>
</ul>
<blockquote> <blockquote>
<hr> <hr />
<b>NOTA IMPORTANTE:</b> <b>NOTA IMPORTANTE:</b>
<p> <p>
Esta es una traducci&oacute;n no oficial al espa&ntilde;ol de la GNU General Public Esta es una traducci&oacute;n no oficial al espa&ntilde;ol de la GNU
License. No ha sido publicada por la Free Software Foundation, y no General Public License. No ha sido publicada por la Free Software
establece legalmente las condiciones de distribuci&oacute;n para el software Foundation, y no establece legalmente las condiciones de
que usa la GNU GPL. Estas condiciones se establecen solamente por distribuci&oacute;n para el software que usa la GNU GPL. Estas
el texto original, en ingl&eacute;s, de la GNU GPL. Sin embargo, esperamos condiciones se establecen solamente por el texto original, en
que esta traducci&oacute;n ayude a los hispanohablantes a entender mejor la ingl&eacute;s, de la GNU GPL. Sin embargo, esperamos que esta
GNU GPL. traducci&oacute;n ayude a los hispanohablantes a entender mejor la GNU
</p><p> GPL.
</p>
<b>IMPORTANT NOTICE:</b> <p><b>IMPORTANT NOTICE:</b></p>
</p><p> <p>
This is an unofficial translation of the GNU General Public License This is an unofficial translation of the GNU General Public License into
into Spanish. It was not published by the Free Software Spanish. It was not published by the Free Software Foundation, and does
Foundation, and does not legally state the distribution terms for not legally state the distribution terms for software that uses the GNU
software that uses the GNU GPL--only the original English text of GPL--only the original English text of the GNU GPL does that. However,
the GNU GPL does that. However, we hope that this translation will we hope that this translation will help Spanish speakers understand the
help Spanish speakers understand the GNU GPL better. GNU GPL better.
</p><p> </p>
</p><hr> <p></p>
<hr />
</blockquote> </blockquote>
<p>Copyright (C) 1989, 1991 Free Software Foundation, Inc. <p>Copyright (C) 1989, 1991 Free Software Foundation, Inc.</p>
</p><p>675 Mass Ave, Cambridge, MA 02139, EEUU <p>675 Mass Ave, Cambridge, MA 02139, EEUU</p>
</p><p>Se permite la copia y distribuci&oacute;n de copias literales de este <p>
Se permite la copia y distribuci&oacute;n de copias literales de este
documento, pero no se permite su modificaci&oacute;n. documento, pero no se permite su modificaci&oacute;n.
</p> </p>
<h3><a name="SEC2">Pre&aacute;mbulo</a></h3> <h3><a name="SEC2">Pre&aacute;mbulo</a></h3>
<p> <p>
Las licencias que cubren la mayor parte del software est&aacute;n dise&ntilde;adas Las licencias que cubren la mayor parte del software est&aacute;n
para quitarle a usted la libertad de compartirlo y modificarlo. Por el dise&ntilde;adas para quitarle a usted la libertad de compartirlo y
contrario, la Licencia P&uacute;blica General de GNU pretende garantizarle modificarlo. Por el contrario, la Licencia P&uacute;blica General de GNU
la libertad de compartir y modificar software libre, para asegurar que pretende garantizarle la libertad de compartir y modificar software libre,
el software es libre para todos sus usuarios. Esta Licencia P&uacute;blica para asegurar que el software es libre para todos sus usuarios. Esta
General se aplica a la mayor parte del software del la Free Software Foundation Licencia P&uacute;blica General se aplica a la mayor parte del software
y a cualquier otro programa si sus autores se comprometen a utilizarla. del la Free Software Foundation y a cualquier otro programa si sus autores
(Existe otro software de la Free Software Foundation que est&aacute; cubierto se comprometen a utilizarla. (Existe otro software de la Free Software
por la Licencia P&uacute;blica General de GNU para Bibliotecas). Si quiere, Foundation que est&aacute; cubierto por la Licencia P&uacute;blica General
tambi&eacute;n puede aplicarla a sus propios programas.</p> de GNU para Bibliotecas). Si quiere, tambi&eacute;n puede aplicarla a sus
<p>Cuando hablamos de software libre, estamos refiri&eacute;ndonos a libertad, propios programas.
no a precio. Nuestras Licencias P&uacute;blicas Generales est&aacute;n </p>
dise&ntilde;adas para asegurarnos de que tenga la libertad de distribuir
copias de software libre (y cobrar por ese servicio si quiere), de que
reciba el c&oacute;digo fuente o que pueda conseguirlo si lo quiere, de
que pueda modificar el software o usar fragmentos de &eacute;l en nuevos
programas libres, y de que sepa que puede hacer todas estas cosas.
</p><p>Para proteger sus derechos necesitamos algunas restricciones que prohiban
a cualquiera negarle a usted estos derechos o pedirle que renuncie a ellos.
Estas restricciones se traducen en ciertas obligaciones que le afectan
si distribuye copias del software, o si lo modifica.
</p><p>Por ejemplo, si distribuye copias de uno de estos programas, sea gratuitamente,
o a cambio de una contraprestaci&oacute;n, debe dar a los receptores todos
los derechos que tiene. Debe asegurarse de que ellos tambi&eacute;n reciben,
o pueden conseguir, el c&oacute;digo fuente. Y debe mostrarles estas condiciones
de forma que conozcan sus derechos.
</p><p>Protegemos sus derechos con la combinaci&oacute;n de dos medidas:
</p><ol type="1">
<li>Ponemos el software bajo copyright y
</li><li>le ofrecemos esta licencia, que le da permiso legal para copiar, distribuir
y/o modificar el software.</li></ol>
<p> <p>
Tambi&eacute;n, para la protecci&oacute;n de cada autor y la nuestra propia, Cuando hablamos de software libre, estamos refiri&eacute;ndonos a
queremos asegurarnos de que todo el mundo comprende que no se proporciona libertad, no a precio. Nuestras Licencias P&uacute;blicas Generales
ninguna garant&iacute;a para este software libre. Si el software se modifica est&aacute;n dise&ntilde;adas para asegurarnos de que tenga la libertad de
por cualquiera y &eacute;ste a su vez lo distribuye, queremos que sus receptores distribuir copias de software libre (y cobrar por ese servicio si quiere),
sepan que lo que tienen no es el original, de forma que cualquier problema de que reciba el c&oacute;digo fuente o que pueda conseguirlo si lo
introducido por otros no afecte a la reputaci&oacute;n de los autores originales.</p> quiere, de que pueda modificar el software o usar fragmentos de &eacute;l
<p>Por &uacute;ltimo, cualquier programa libre est&aacute; constantemente en nuevos programas libres, y de que sepa que puede hacer todas estas
cosas.
</p>
<p>
Para proteger sus derechos necesitamos algunas restricciones que prohiban
a cualquiera negarle a usted estos derechos o pedirle que renuncie a
ellos. Estas restricciones se traducen en ciertas obligaciones que le
afectan si distribuye copias del software, o si lo modifica.
</p>
<p>
Por ejemplo, si distribuye copias de uno de estos programas, sea
gratuitamente, o a cambio de una contraprestaci&oacute;n, debe dar a los
receptores todos los derechos que tiene. Debe asegurarse de que ellos
tambi&eacute;n reciben, o pueden conseguir, el c&oacute;digo fuente. Y
debe mostrarles estas condiciones de forma que conozcan sus derechos.
</p>
<p>Protegemos sus derechos con la combinaci&oacute;n de dos medidas:</p>
<ol type="1">
<li>Ponemos el software bajo copyright y</li>
<li>
le ofrecemos esta licencia, que le da permiso legal para copiar,
distribuir y/o modificar el software.
</li>
</ol>
<p>
Tambi&eacute;n, para la protecci&oacute;n de cada autor y la nuestra
propia, queremos asegurarnos de que todo el mundo comprende que no se
proporciona ninguna garant&iacute;a para este software libre. Si el
software se modifica por cualquiera y &eacute;ste a su vez lo distribuye,
queremos que sus receptores sepan que lo que tienen no es el original, de
forma que cualquier problema introducido por otros no afecte a la
reputaci&oacute;n de los autores originales.
</p>
<p>
Por &uacute;ltimo, cualquier programa libre est&aacute; constantemente
amenazado por patentes sobre el software. Queremos evitar el peligro de amenazado por patentes sobre el software. Queremos evitar el peligro de
que los redistribuidores de un programa libre obtengan patentes por su que los redistribuidores de un programa libre obtengan patentes por su
cuenta, convirtiendo de facto el programa en propietario. Para evitar esto, cuenta, convirtiendo de facto el programa en propietario. Para evitar
hemos dejado claro que cualquier patente debe ser pedida para el uso libre esto, hemos dejado claro que cualquier patente debe ser pedida para el uso
de cualquiera, o no ser pedida. libre de cualquiera, o no ser pedida.
</p><p>Los t&eacute;rminos exactos y las condiciones para la copia, distribuci&oacute;n </p>
y modificaci&oacute;n se exponen a continuaci&oacute;n.</p> <p>
Los t&eacute;rminos exactos y las condiciones para la copia,
distribuci&oacute;n y modificaci&oacute;n se exponen a
continuaci&oacute;n.
</p>
<h3><a name="SEC3">T&eacute;rminos y condiciones para la copia, <h3>
distribuci&oacute;n y modificaci&oacute;n</a></h3> <a name="SEC3"
>T&eacute;rminos y condiciones para la copia, distribuci&oacute;n y
modificaci&oacute;n</a
>
</h3>
<ol type="1"> <ol type="1">
<li>Esta Licencia se aplica a cualquier programa u otro tipo <li>
de trabajo que contenga una nota colocada por el tenedor del copyright Esta Licencia se aplica a cualquier programa u otro tipo de trabajo que
diciendo que puede ser distribuido bajo los t&eacute;rminos de esta Licencia contenga una nota colocada por el tenedor del copyright diciendo que
P&uacute;blica General. En adelante, <20>Programa<6D> se referir&aacute; puede ser distribuido bajo los t&eacute;rminos de esta Licencia
a cualquier programa o trabajo que cumpla esa condici&oacute;n y <20>trabajo P&uacute;blica General. En adelante, <20>Programa<6D> se referir&aacute; a
cualquier programa o trabajo que cumpla esa condici&oacute;n y <20>trabajo
basado en el Programa<6D> se referir&aacute; bien al Programa o a cualquier basado en el Programa<6D> se referir&aacute; bien al Programa o a cualquier
trabajo derivado de &eacute;l seg&uacute;n la ley de copyright. Esto es, trabajo derivado de &eacute;l seg&uacute;n la ley de copyright. Esto es,
un trabajo que contenga el programa o una proci&oacute;n de &eacute;l, un trabajo que contenga el programa o una proci&oacute;n de &eacute;l,
bien en forma literal o con modificaciones y/o traducido en otro lenguaje. bien en forma literal o con modificaciones y/o traducido en otro
Por lo tanto, la traducci&oacute;n est&aacute; incluida sin limitaciones lenguaje. Por lo tanto, la traducci&oacute;n est&aacute; incluida sin
en el t&eacute;rmino <20>modificaci&oacute;n<EFBFBD>. Cada concesionario limitaciones en el t&eacute;rmino <20>modificaci&oacute;n<EFBFBD>. Cada
(licenciatario) ser&aacute; denominado <20>usted<65>. concesionario (licenciatario) ser&aacute; denominado <20>usted<65>.
<p>Cualquier otra actividad que no sea la copia, distribuci&oacute;n o <p>
modificaci&oacute;n no est&aacute; cubierta por esta Licencia, est&aacute; Cualquier otra actividad que no sea la copia, distribuci&oacute;n o
fuera de su &aacute;mbito. El acto de ejecutar el Programa no est&aacute; modificaci&oacute;n no est&aacute; cubierta por esta Licencia,
restringido, y los resultados del Programa est&aacute;n cubiertos &uacute;nicamente est&aacute; fuera de su &aacute;mbito. El acto de ejecutar el Programa
si sus contenidos constituyen un trabajo basado en el Programa, independientemente no est&aacute; restringido, y los resultados del Programa est&aacute;n
de haberlo producido mediante la ejecuci&oacute;n del programa. El que cubiertos &uacute;nicamente si sus contenidos constituyen un trabajo
esto se cumpla, depende de lo que haga el programa. basado en el Programa, independientemente de haberlo producido
</p></li><li>Usted puede copiar y distribuir copias literales del c&oacute;digo fuente mediante la ejecuci&oacute;n del programa. El que esto se cumpla,
del Programa, seg&uacute;n lo has recibido, en cualquier medio, supuesto depende de lo que haga el programa.
que de forma adecuada y bien visible publique en cada copia un anuncio </p>
de copyright adecuado y un repudio de garant&iacute;a, mantenga intactos </li>
todos los anuncios que se refieran a esta Licencia y a la ausencia de garant&iacute;a, <li>
y proporcione a cualquier otro receptor del programa una copia de esta Usted puede copiar y distribuir copias literales del c&oacute;digo
Licencia junto con el Programa. fuente del Programa, seg&uacute;n lo has recibido, en cualquier medio,
<p>Puede cobrar un precio por el acto f&iacute;sico de transferir una copia, supuesto que de forma adecuada y bien visible publique en cada copia un
y puede, seg&uacute;n su libre albedr&iacute;o, ofrecer garant&iacute;a anuncio de copyright adecuado y un repudio de garant&iacute;a, mantenga
a cambio de unos honorarios. intactos todos los anuncios que se refieran a esta Licencia y a la
</p></li><li>Puede modificar su copia o copias del Programa o de cualquier porci&oacute;n ausencia de garant&iacute;a, y proporcione a cualquier otro receptor del
de &eacute;l, formando de esta manera un trabajo basado en el Programa, programa una copia de esta Licencia junto con el Programa.
y copiar y distribuir esa modificaci&oacute;n o trabajo bajo los t&eacute;rminos <p>
del apartado 1, antedicho, supuesto que adem&aacute;s cumpla las siguientes Puede cobrar un precio por el acto f&iacute;sico de transferir una
copia, y puede, seg&uacute;n su libre albedr&iacute;o, ofrecer
garant&iacute;a a cambio de unos honorarios.
</p>
</li>
<li>
Puede modificar su copia o copias del Programa o de cualquier
porci&oacute;n de &eacute;l, formando de esta manera un trabajo basado
en el Programa, y copiar y distribuir esa modificaci&oacute;n o trabajo
bajo los t&eacute;rminos del apartado 1, antedicho, supuesto que
adem&aacute;s cumpla las siguientes condiciones:
<ol type="a">
<li>
Debe hacer que los ficheros modificados lleven anuncios prominentes
indicando que los ha cambiado y la fecha de cualquier cambio.
</li>
<li>
Debe hacer que cualquier trabajo que distribuya o publique y que en
todo o en parte contenga o sea derivado del Programa o de cualquier
parte de &eacute;l sea licenciada como un todo, sin carga alguna, a
todas las terceras partes y bajo los t&eacute;rminos de esta
Licencia.
</li>
<li>
Si el programa modificado lee normalmente &oacute;rdenes
interactivamente cuando es ejecutado, debe hacer que, cuando
comience su ejecuci&oacute;n para ese uso interactivo de la forma
m&aacute;s habitual, muestre o escriba un mensaje que incluya un
anuncio de copyright y un anuncio de que no se ofrece ninguna
garant&iacute;a (o por el contrario que s&iacute; se ofrece
garant&iacute;a) y que los usuarios pueden redistribuir el programa
bajo estas condiciones, e indicando al usuario c&oacute;mo ver una
copia de esta licencia. (Excepci&oacute;n: si el propio programa es
interactivo pero normalmente no muestra ese anuncio, no se requiere
que su trabajo basado en el Programa muestre ning&uacute;n anuncio).
</li>
</ol>
Estos requisitos se aplican al trabajo modificado como un todo. Si
partes identificables de ese trabajo no son derivadas del Programa, y
pueden, razonablemente, ser consideradas trabajos independientes y
separados por ellos mismos, entonces esta Licencia y sus t&eacute;rminos
no se aplican a esas partes cuando sean distribuidas como trabajos
separados. Pero cuando distribuya esas mismas secciones como partes de
un todo que es un trabajo basado en el Programa, la distribuci&oacute;n
del todo debe ser seg&uacute;n los t&eacute;rminos de esta licencia,
cuyos permisos para otros licenciatarios se extienden al todo completo,
y por lo tanto a todas y cada una de sus partes, con independencia de
qui&eacute;n la escribi&oacute;.
<p>
Por lo tanto, no es la intenci&oacute;n de este apartado reclamar
derechos o desafiar sus derechos sobre trabajos escritos totalmente
por usted mismo. El intento es ejercer el derecho a controlar la
distribuci&oacute;n de trabajos derivados o colectivos basados en el
Programa.
</p>
<p>
Adem&aacute;s, el simple hecho de reunir un trabajo no basado en el
Programa con el Programa (o con un trabajo basado en el Programa) en
un volumen de almacenamiento o en un medio de distribuci&oacute;n no
hace que dicho trabajo entre dentro del &aacute;mbito cubierto por
esta Licencia.
</p>
</li>
<li>
Puede copiar y distribuir el Programa (o un trabajo basado en &eacute;l,
seg&uacute;n se especifica en el apartado 2, como c&oacute;digo objeto o
en formato ejecutable seg&uacute;n los t&eacute;rminos de los apartados
1 y 2, supuesto que adem&aacute;s cumpla una de las siguientes
condiciones: condiciones:
<ol type="a"><li>Debe hacer que los ficheros modificados lleven anuncios <ol type="a">
prominentes indicando que los ha cambiado y la fecha de cualquier cambio. <li>
</li><li>Debe hacer que cualquier trabajo que distribuya o publique y que en Acompa&ntilde;arlo con el c&oacute;digo fuente completo
todo o en parte contenga o sea derivado del Programa o de cualquier parte correspondiente, en formato electr&oacute;nico, que debe ser
de &eacute;l sea licenciada como un todo, sin carga alguna, a todas las distribuido seg&uacute;n se especifica en los apartados 1 y 2 de
terceras partes y bajo los t&eacute;rminos de esta Licencia. esta Licencia en un medio habitualmente utilizado para el
</li><li>Si el programa modificado lee normalmente &oacute;rdenes interactivamente intercambio de programas, o
cuando es ejecutado, debe hacer que, cuando comience su ejecuci&oacute;n </li>
para ese uso interactivo de la forma m&aacute;s habitual, muestre o escriba <li>
un mensaje que incluya un anuncio de copyright y un anuncio de que no se Acompa&ntilde;arlo con una oferta por escrito, v&aacute;lida durante
ofrece ninguna garant&iacute;a (o por el contrario que s&iacute; se ofrece al menos tres a&ntilde;os, de proporcionar a cualquier tercera parte
garant&iacute;a) y que los usuarios pueden redistribuir el programa bajo una copia completa en formato electr&oacute;nico del c&oacute;digo
estas condiciones, e indicando al usuario c&oacute;mo ver una copia de fuente correspondiente, a un coste no mayor que el de realizar
esta licencia. (Excepci&oacute;n: si el propio programa es interactivo f&iacute;sicamente la distribuci&oacute;n del fuente, que
pero normalmente no muestra ese anuncio, no se requiere que su trabajo ser&aacute; distribuido bajo las condiciones descritas en los
basado en el Programa muestre ning&uacute;n anuncio).</li></ol> apartados 1 y 2 anteriores, en un medio habitualmente utilizado para
Estos requisitos se aplican al trabajo modificado como un todo. Si partes el intercambio de programas, o
identificables de ese trabajo no son derivadas del Programa, y pueden, </li>
razonablemente, ser consideradas trabajos independientes y separados por <li>
ellos mismos, entonces esta Licencia y sus t&eacute;rminos no se aplican Acompa&ntilde;arlo con la informaci&oacute;n que recibiste
a esas partes cuando sean distribuidas como trabajos separados. Pero cuando ofreciendo distribuir el c&oacute;digo fuente correspondiente. (Esta
distribuya esas mismas secciones como partes de un todo que es un trabajo opci&oacute;n se permite s&oacute;lo para distribuci&oacute;n no
basado en el Programa, la distribuci&oacute;n del todo debe ser seg&uacute;n comercial y s&oacute;lo si usted recibi&oacute; el programa como
los t&eacute;rminos de esta licencia, cuyos permisos para otros licenciatarios c&oacute;digo objeto o en formato ejecutable con tal oferta, de
se extienden al todo completo, y por lo tanto a todas y cada una de sus acuerdo con el apartado b anterior).
partes, con independencia de qui&eacute;n la escribi&oacute;. </li>
<p>Por lo tanto, no es la intenci&oacute;n de este apartado reclamar derechos </ol>
o desafiar sus derechos sobre trabajos escritos totalmente por usted mismo. Por c&oacute;digo fuente de un trabajo se entiende la forma preferida
El intento es ejercer el derecho a controlar la distribuci&oacute;n de del trabajo cuando se le hacen modificaciones. Para un trabajo
trabajos derivados o colectivos basados en el Programa. ejecutable, se entiende por c&oacute;digo fuente completo todo el
</p><p>Adem&aacute;s, el simple hecho de reunir un trabajo no basado en el c&oacute;digo fuente para todos los m&oacute;dulos que contiene,
Programa con el Programa (o con un trabajo basado en el Programa) en un m&aacute;s cualquier fichero asociado de definici&oacute;n de
volumen de almacenamiento o en un medio de distribuci&oacute;n no hace interfaces, m&aacute;s los guiones utilizados para controlar la
que dicho trabajo entre dentro del &aacute;mbito cubierto por esta Licencia. compilaci&oacute;n e instalaci&oacute;n del ejecutable. Como
</p></li><li>Puede copiar y distribuir el Programa (o un trabajo basado en &eacute;l, excepci&oacute;n especial el c&oacute;digo fuente distribuido no
seg&uacute;n se especifica en el apartado 2, como c&oacute;digo objeto necesita incluir nada que sea distribuido normalmente (bien como fuente,
o en formato ejecutable seg&uacute;n los t&eacute;rminos de los apartados bien en forma binaria) con los componentes principales (compilador,
1 y 2, supuesto que adem&aacute;s cumpla una de las siguientes condiciones: kernel y similares) del sistema operativo en el cual funciona el
<ol type="a"><li>Acompa&ntilde;arlo con el c&oacute;digo fuente completo ejecutable, a no ser que el propio componente acompa&ntilde;e al
correspondiente, en formato electr&oacute;nico, que debe ser distribuido ejecutable.
seg&uacute;n se especifica en los apartados 1 y 2 de esta Licencia en un <p>
medio habitualmente utilizado para el intercambio de programas, o Si la distribuci&oacute;n del ejecutable o del c&oacute;digo objeto se
</li><li>Acompa&ntilde;arlo con una oferta por escrito, v&aacute;lida durante hace mediante la oferta acceso para copiarlo de un cierto lugar,
al menos tres a&ntilde;os, de proporcionar a cualquier tercera parte una entonces se considera la oferta de acceso para copiar el c&oacute;digo
copia completa en formato electr&oacute;nico del c&oacute;digo fuente correspondiente, fuente del mismo lugar como distribuci&oacute;n del c&oacute;digo
a un coste no mayor que el de realizar f&iacute;sicamente la distribuci&oacute;n fuente, incluso aunque terceras partes no est&eacute;n forzadas a
del fuente, que ser&aacute; distribuido bajo las condiciones descritas copiar el fuente junto con el c&oacute;digo objeto.
en los apartados 1 y 2 anteriores, en un medio habitualmente utilizado </p>
para el intercambio de programas, o </li>
</li><li>Acompa&ntilde;arlo con la informaci&oacute;n que recibiste ofreciendo <li>
distribuir el c&oacute;digo fuente correspondiente. (Esta opci&oacute;n No puede copiar, modificar, sublicenciar o distribuir el Programa
se permite s&oacute;lo para distribuci&oacute;n no comercial y s&oacute;lo excepto como prev&eacute; expresamente esta Licencia. Cualquier intento
si usted recibi&oacute; el programa como c&oacute;digo objeto o en formato de copiar, modificar sublicenciar o distribuir el Programa de otra forma
ejecutable con tal oferta, de acuerdo con el apartado b anterior).</li></ol> es inv&aacute;lida, y har&aacute; que cesen autom&aacute;ticamente los
Por c&oacute;digo fuente de un trabajo se entiende la forma preferida del derechos que te proporciona esta Licencia. En cualquier caso, las partes
trabajo cuando se le hacen modificaciones. Para un trabajo ejecutable, que hayan recibido copias o derechos de usted bajo esta Licencia no
se entiende por c&oacute;digo fuente completo todo el c&oacute;digo fuente cesar&aacute;n en sus derechos mientras esas partes contin&uacute;en
para todos los m&oacute;dulos que contiene, m&aacute;s cualquier fichero cumpli&eacute;ndola.
asociado de definici&oacute;n de interfaces, m&aacute;s los guiones utilizados </li>
para controlar la compilaci&oacute;n e instalaci&oacute;n del ejecutable. <li>
Como excepci&oacute;n especial el c&oacute;digo fuente distribuido no necesita No est&aacute; obligado a aceptar esta licencia, ya que no la ha
incluir nada que sea distribuido normalmente (bien como fuente, bien en firmado. Sin embargo, no hay hada m&aacute;s que le proporcione permiso
forma binaria) con los componentes principales (compilador, kernel y similares) para modificar o distribuir el Programa o sus trabajos derivados. Estas
del sistema operativo en el cual funciona el ejecutable, a no ser que el acciones est&aacute;n prohibidas por la ley si no acepta esta Licencia.
propio componente acompa&ntilde;e al ejecutable. Por lo tanto, si modifica o distribuye el Programa (o cualquier trabajo
<p>Si la distribuci&oacute;n del ejecutable o del c&oacute;digo objeto basado en el Programa), est&aacute; indicando que acepta esta Licencia
se hace mediante la oferta acceso para copiarlo de un cierto lugar, entonces para poder hacerlo, y todos sus t&eacute;rminos y condiciones para
se considera la oferta de acceso para copiar el c&oacute;digo fuente del copiar, distribuir o modificar el Programa o trabajos basados en
mismo lugar como distribuci&oacute;n del c&oacute;digo fuente, incluso &eacute;l.
aunque terceras partes no est&eacute;n forzadas a copiar el fuente junto </li>
con el c&oacute;digo objeto. <li>
</p></li><li>No puede copiar, modificar, sublicenciar o distribuir el Programa excepto Cada vez que redistribuya el Programa (o cualquier trabajo basado en el
como prev&eacute; expresamente esta Licencia. Cualquier intento de copiar, Programa), el receptor recibe autom&aacute;ticamente una licencia del
modificar sublicenciar o distribuir el Programa de otra forma es inv&aacute;lida,
y har&aacute; que cesen autom&aacute;ticamente los derechos que te proporciona
esta Licencia. En cualquier caso, las partes que hayan recibido copias
o derechos de usted bajo esta Licencia no cesar&aacute;n en sus derechos
mientras esas partes contin&uacute;en cumpli&eacute;ndola.
</li><li>No est&aacute; obligado a aceptar esta licencia, ya que no la ha firmado.
Sin embargo, no hay hada m&aacute;s que le proporcione permiso para modificar
o distribuir el Programa o sus trabajos derivados. Estas acciones est&aacute;n
prohibidas por la ley si no acepta esta Licencia. Por lo tanto, si modifica
o distribuye el Programa (o cualquier trabajo basado en el Programa), est&aacute;
indicando que acepta esta Licencia para poder hacerlo, y todos sus t&eacute;rminos
y condiciones para copiar, distribuir o modificar el Programa o trabajos
basados en &eacute;l.
</li><li>Cada vez que redistribuya el Programa (o cualquier trabajo basado en
el Programa), el receptor recibe autom&aacute;ticamente una licencia del
licenciatario original para copiar, distribuir o modificar el Programa, licenciatario original para copiar, distribuir o modificar el Programa,
de forma sujeta a estos t&eacute;rminos y condiciones. No puede imponer de forma sujeta a estos t&eacute;rminos y condiciones. No puede imponer
al receptor ninguna restricci&oacute;n m&aacute;s sobre el ejercicio de al receptor ninguna restricci&oacute;n m&aacute;s sobre el ejercicio de
los derechos aqu&iacute; garantizados. No es usted responsable de hacer los derechos aqu&iacute; garantizados. No es usted responsable de hacer
cumplir esta licencia por terceras partes. cumplir esta licencia por terceras partes.
</li><li>Si como consecuencia de una resoluci&oacute;n judicial o de una alegaci&oacute;n </li>
de infracci&oacute;n de patente o por cualquier otra raz&oacute;n (no limitada <li>
a asuntos relacionados con patentes) se le imponen condiciones (ya sea Si como consecuencia de una resoluci&oacute;n judicial o de una
por mandato judicial, por acuerdo o por cualquier otra causa) que contradigan alegaci&oacute;n de infracci&oacute;n de patente o por cualquier otra
las condiciones de esta Licencia, ello no le exime de cumplir las condiciones raz&oacute;n (no limitada a asuntos relacionados con patentes) se le
de esta Licencia. Si no puede realizar distribuciones de forma que se satisfagan imponen condiciones (ya sea por mandato judicial, por acuerdo o por
cualquier otra causa) que contradigan las condiciones de esta Licencia,
ello no le exime de cumplir las condiciones de esta Licencia. Si no
puede realizar distribuciones de forma que se satisfagan
simult&aacute;neamente sus obligaciones bajo esta licencia y cualquier simult&aacute;neamente sus obligaciones bajo esta licencia y cualquier
otra obligaci&oacute;n pertinente entonces, como consecuencia, no puede otra obligaci&oacute;n pertinente entonces, como consecuencia, no puede
distribuir el Programa de ninguna forma. Por ejemplo, si una patente no distribuir el Programa de ninguna forma. Por ejemplo, si una patente no
permite la redistribuci&oacute;n libre de derechos de autor del Programa permite la redistribuci&oacute;n libre de derechos de autor del Programa
por parte de todos aquellos que reciban copias directa o indirectamente por parte de todos aquellos que reciban copias directa o indirectamente
a trav&eacute;s de usted, entonces la &uacute;nica forma en que podr&iacute;a a trav&eacute;s de usted, entonces la &uacute;nica forma en que
satisfacer tanto esa condici&oacute;n como esta Licencia ser&iacute;a evitar podr&iacute;a satisfacer tanto esa condici&oacute;n como esta Licencia
completamente la distribuci&oacute;n del Programa. ser&iacute;a evitar completamente la distribuci&oacute;n del Programa.
<p>Si cualquier porci&oacute;n de este apartado se considera inv&aacute;lida <p>
o imposible de cumplir bajo cualquier circunstancia particular ha de cumplirse Si cualquier porci&oacute;n de este apartado se considera
el resto y la secci&oacute;n por entero ha de cumplirse en cualquier otra inv&aacute;lida o imposible de cumplir bajo cualquier circunstancia
circunstancia. particular ha de cumplirse el resto y la secci&oacute;n por entero ha
</p><p>No es el prop&oacute;sito de este apartado inducirle a infringir ninguna de cumplirse en cualquier otra circunstancia.
reivindicaci&oacute;n de patente ni de ning&uacute;n otro derecho de propiedad </p>
o impugnar la validez de ninguna de dichas reivindicaciones. Este apartado <p>
tiene el &uacute;nico prop&oacute;sito de proteger la integridad del sistema No es el prop&oacute;sito de este apartado inducirle a infringir
de distribuci&oacute;n de software libre, que se realiza mediante pr&aacute;cticas ninguna reivindicaci&oacute;n de patente ni de ning&uacute;n otro
de licencia p&uacute;blica. Mucha gente ha hecho contribuciones generosas derecho de propiedad o impugnar la validez de ninguna de dichas
a la gran variedad de software distribuido mediante ese sistema con la reivindicaciones. Este apartado tiene el &uacute;nico prop&oacute;sito
confianza de que el sistema se aplicar&aacute; consistentemente. Ser&aacute; de proteger la integridad del sistema de distribuci&oacute;n de
el autor/donante quien decida si quiere distribuir software mediante cualquier software libre, que se realiza mediante pr&aacute;cticas de licencia
otro sistema y una licencia no puede imponer esa elecci&oacute;n. p&uacute;blica. Mucha gente ha hecho contribuciones generosas a la
</p><p>Este apartado pretende dejar completamente claro lo que se cree que gran variedad de software distribuido mediante ese sistema con la
es una consecuencia del resto de esta Licencia. confianza de que el sistema se aplicar&aacute; consistentemente.
</p></li><li>Si la distribuci&oacute;n y/o uso de el Programa est&aacute; restringida Ser&aacute; el autor/donante quien decida si quiere distribuir
en ciertos pa&iacute;ses, bien por patentes o por interfaces bajo copyright, software mediante cualquier otro sistema y una licencia no puede
el tenedor del copyright que coloca este Programa bajo esta Licencia puede imponer esa elecci&oacute;n.
a&ntilde;adir una limitaci&oacute;n expl&iacute;cita de distribuci&oacute;n </p>
geogr&aacute;fica excluyendo esos pa&iacute;ses, de forma que la distribuci&oacute;n <p>
se permita s&oacute;lo en o entre los pa&iacute;ses no excluidos de esta Este apartado pretende dejar completamente claro lo que se cree que es
manera. En ese caso, esta Licencia incorporar&aacute; la limitaci&oacute;n una consecuencia del resto de esta Licencia.
como si estuviese escrita en el cuerpo de esta Licencia. </p>
</li><li>La Free Software Foundation puede publicar versiones revisadas y/o nuevas </li>
de la Licencia P&uacute;blica General de tiempo en tiempo. Dichas nuevas <li>
versiones ser&aacute;n similares en esp&iacute;ritu a la presente versi&oacute;n, Si la distribuci&oacute;n y/o uso de el Programa est&aacute; restringida
pero pueden ser diferentes en detalles para considerar nuevos problemas en ciertos pa&iacute;ses, bien por patentes o por interfaces bajo
o situaciones. copyright, el tenedor del copyright que coloca este Programa bajo esta
<p>Cada versi&oacute;n recibe un n&uacute;mero de versi&oacute;n que la Licencia puede a&ntilde;adir una limitaci&oacute;n expl&iacute;cita de
distingue de otras. Si el Programa especifica un n&uacute;mero de versi&oacute;n distribuci&oacute;n geogr&aacute;fica excluyendo esos pa&iacute;ses, de
de esta Licencia que se refiere a ella y a <20>cualquier versi&oacute;n forma que la distribuci&oacute;n se permita s&oacute;lo en o entre los
posterior<EFBFBD>, tienes la opci&oacute;n de seguir los t&eacute;rminos pa&iacute;ses no excluidos de esta manera. En ese caso, esta Licencia
y condiciones, bien de esa versi&oacute;n, bien de cualquier versi&oacute;n incorporar&aacute; la limitaci&oacute;n como si estuviese escrita en el
posterior publicada por la Free Software Foundation. Si el Programa no cuerpo de esta Licencia.
especifica un n&uacute;mero de versi&oacute;n de esta Licencia, puedes </li>
escoger cualquier versi&oacute;n publicada por la Free Software Foundation. <li>
</p></li><li>Si quiere incorporar partes del Programa en otros programas libres cuyas La Free Software Foundation puede publicar versiones revisadas y/o
nuevas de la Licencia P&uacute;blica General de tiempo en tiempo. Dichas
nuevas versiones ser&aacute;n similares en esp&iacute;ritu a la presente
versi&oacute;n, pero pueden ser diferentes en detalles para considerar
nuevos problemas o situaciones.
<p>
Cada versi&oacute;n recibe un n&uacute;mero de versi&oacute;n que la
distingue de otras. Si el Programa especifica un n&uacute;mero de
versi&oacute;n de esta Licencia que se refiere a ella y a <20>cualquier
versi&oacute;n posterior<6F>, tienes la opci&oacute;n de seguir los
t&eacute;rminos y condiciones, bien de esa versi&oacute;n, bien de
cualquier versi&oacute;n posterior publicada por la Free Software
Foundation. Si el Programa no especifica un n&uacute;mero de
versi&oacute;n de esta Licencia, puedes escoger cualquier
versi&oacute;n publicada por la Free Software Foundation.
</p>
</li>
<li>
Si quiere incorporar partes del Programa en otros programas libres cuyas
condiciones de distribuci&oacute;n son diferentes, escribe al autor para condiciones de distribuci&oacute;n son diferentes, escribe al autor para
pedirle permiso. Si el software tiene copyright de la Free Software Foundation, pedirle permiso. Si el software tiene copyright de la Free Software
escribe a la Free Software Foundation: algunas veces hacemos excepciones Foundation, escribe a la Free Software Foundation: algunas veces hacemos
en estos casos. Nuestra decisi&oacute;n estar&aacute; guiada por el doble excepciones en estos casos. Nuestra decisi&oacute;n estar&aacute; guiada
objetivo de de preservar la libertad de todos los derivados de nuestro por el doble objetivo de de preservar la libertad de todos los derivados
software libre y promover el que se comparta y reutilice el software en de nuestro software libre y promover el que se comparta y reutilice el
general.</li></ol> software en general.
</li>
</ol>
<h3>AUSENCIA DE GARANT&Iacute;A</h3> <h3>AUSENCIA DE GARANT&Iacute;A</h3>
<ol start="12" type="1"> <ol start="12" type="1">
<li>Como el programa se licencia libre de cargas, <li>
no se ofrece ninguna garant&iacute;a sobre el programa, en todas la extensi&oacute;n Como el programa se licencia libre de cargas, no se ofrece ninguna
garant&iacute;a sobre el programa, en todas la extensi&oacute;n
permitida por la legislaci&oacute;n aplicable. Excepto cuando se indique permitida por la legislaci&oacute;n aplicable. Excepto cuando se indique
de otra forma por escrito, los tenedores del copyright y/u otras partes de otra forma por escrito, los tenedores del copyright y/u otras partes
proporcionan el programa <20>tal cual<61>, sin garant&iacute;a de proporcionan el programa <20>tal cual<61>, sin garant&iacute;a de ninguna
ninguna clase, bien expresa o impl&iacute;cita, con inclusi&oacute;n, pero clase, bien expresa o impl&iacute;cita, con inclusi&oacute;n, pero sin
sin limitaci&oacute;n a las garant&iacute;as mercantiles impl&iacute;citas limitaci&oacute;n a las garant&iacute;as mercantiles impl&iacute;citas o
o a la conveniencia para un prop&oacute;sito particular. Cualquier riesgo a la conveniencia para un prop&oacute;sito particular. Cualquier riesgo
referente a la calidad y prestaciones del programa es asumido por usted. referente a la calidad y prestaciones del programa es asumido por usted.
Si se probase que el Programa es defectuoso, asume el coste de cualquier Si se probase que el Programa es defectuoso, asume el coste de cualquier
servicio, reparaci&oacute;n o correcci&oacute;n. servicio, reparaci&oacute;n o correcci&oacute;n.
</li><li>En ning&uacute;n caso, salvo que lo requiera la legislaci&oacute;n aplicable </li>
o haya sido acordado por escrito, ning&uacute;n tenedor del copyright ni <li>
ninguna otra parte que modifique y/o redistribuya el Programa seg&uacute;n En ning&uacute;n caso, salvo que lo requiera la legislaci&oacute;n
se permite en esta Licencia ser&aacute; responsable ante usted por da&ntilde;os, aplicable o haya sido acordado por escrito, ning&uacute;n tenedor del
incluyendo cualquier da&ntilde;o general, especial, incidental o resultante copyright ni ninguna otra parte que modifique y/o redistribuya el
producido por el uso o la imposibilidad de uso del Programa (con inclusi&oacute;n, Programa seg&uacute;n se permite en esta Licencia ser&aacute;
pero sin limitaci&oacute;n a la p&eacute;rdida de datos o a la generaci&oacute;n responsable ante usted por da&ntilde;os, incluyendo cualquier
incorrecta de datos o a p&eacute;rdidas sufridas por usted o por terceras da&ntilde;o general, especial, incidental o resultante producido por el
partes o a un fallo del Programa al funcionar en combinaci&oacute;n con uso o la imposibilidad de uso del Programa (con inclusi&oacute;n, pero
cualquier otro programa), incluso si dicho tenedor u otra parte ha sido sin limitaci&oacute;n a la p&eacute;rdida de datos o a la
advertido de la posibilidad de dichos da&ntilde;os.</li></ol> generaci&oacute;n incorrecta de datos o a p&eacute;rdidas sufridas por
usted o por terceras partes o a un fallo del Programa al funcionar en
combinaci&oacute;n con cualquier otro programa), incluso si dicho
tenedor u otra parte ha sido advertido de la posibilidad de dichos
da&ntilde;os.
</li>
</ol>
<h3>FIN DE T&Eacute;RMINOS Y CONDICIONES</h3> <h3>FIN DE T&Eacute;RMINOS Y CONDICIONES</h3>
<h3><a name="APPENDIX">Ap&eacute;ndice</a>: C&oacute;mo aplicar estos <h3>
t&eacute;rminos a sus nuevos programas.</h3> <a name="APPENDIX">Ap&eacute;ndice</a>: C&oacute;mo aplicar estos
t&eacute;rminos a sus nuevos programas.
</h3>
<p> <p>
Si usted desarrolla un nuevo Programa, y quiere que sea del mayor uso posible Si usted desarrolla un nuevo Programa, y quiere que sea del mayor uso
para el p&uacute;blico en general, la mejor forma de conseguirlo es convirti&eacute;ndolo posible para el p&uacute;blico en general, la mejor forma de conseguirlo
en software libre que cualquiera pueda redistribuir y cambiar bajo estos es convirti&eacute;ndolo en software libre que cualquiera pueda
t&eacute;rminos.</p> redistribuir y cambiar bajo estos t&eacute;rminos.
<p>Para hacerlo, a&ntilde;ada los siguientes anuncios al programa. Lo m&aacute;s </p>
seguro es a&ntilde;adirlos al principio de cada fichero fuente para transmitir <p>
lo m&aacute;s efectivamente posible la ausencia de garant&iacute;a. Adem&aacute;s Para hacerlo, a&ntilde;ada los siguientes anuncios al programa. Lo
cada fichero deber&iacute;a tener al menos la l&iacute;nea de <20>copyright<68> m&aacute;s seguro es a&ntilde;adirlos al principio de cada fichero fuente
y un indicador a d&oacute;nde puede encontrarse el anuncio completo. para transmitir lo m&aacute;s efectivamente posible la ausencia de
</p><div>&lt;una l&iacute;nea para indicar el nombre garant&iacute;a. Adem&aacute;s cada fichero deber&iacute;a tener al menos
del programa y una r&aacute;pida idea de qu&eacute; hace.&gt; la l&iacute;nea de <20>copyright<68> y un indicador a d&oacute;nde puede
<p>Copyright (C) 19aa &lt;nombre del autor&gt; encontrarse el anuncio completo.
</p><p>Este programa es software libre. Puede redistribuirlo y/o modificarlo </p>
bajo los t&eacute;rminos de la Licencia P&uacute;blica General de GNU seg&uacute;n <div>
es publicada por la Free Software Foundation, bien de la versi&oacute;n &lt;una l&iacute;nea para indicar el nombre del programa y una
2 de dicha Licencia o bien (seg&uacute;n su elecci&oacute;n) de cualquier r&aacute;pida idea de qu&eacute; hace.&gt;
versi&oacute;n posterior. <p>Copyright (C) 19aa &lt;nombre del autor&gt;</p>
</p><p>Este programa se distribuye con la esperanza de que sea &uacute;til, <p>
Este programa es software libre. Puede redistribuirlo y/o modificarlo
bajo los t&eacute;rminos de la Licencia P&uacute;blica General de GNU
seg&uacute;n es publicada por la Free Software Foundation, bien de la
versi&oacute;n 2 de dicha Licencia o bien (seg&uacute;n su
elecci&oacute;n) de cualquier versi&oacute;n posterior.
</p>
<p>
Este programa se distribuye con la esperanza de que sea &uacute;til,
pero SIN NINGUNA GARANT<4E>A, incluso sin la garant&iacute;a MERCANTIL pero SIN NINGUNA GARANT<4E>A, incluso sin la garant&iacute;a MERCANTIL
impl&iacute;cita o sin garantizar la CONVENIENCIA PARA UN PROP<4F>SITO impl&iacute;cita o sin garantizar la CONVENIENCIA PARA UN PROP<4F>SITO
PARTICULAR. V&eacute;ase la Licencia P&uacute;blica General de GNU para PARTICULAR. V&eacute;ase la Licencia P&uacute;blica General de GNU para
m&aacute;s detalles. m&aacute;s detalles.
</p><p>Deber&iacute;a haber recibido una copia de la Licencia P&uacute;blica </p>
<p>
Deber&iacute;a haber recibido una copia de la Licencia P&uacute;blica
General junto con este programa. Si no ha sido as&iacute;, escriba a la General junto con este programa. Si no ha sido as&iacute;, escriba a la
Free Software Foundation, Inc., en 675 Mass Ave, Cambridge, MA 02139, EEUU.</p></div> Free Software Foundation, Inc., en 675 Mass Ave, Cambridge, MA 02139,
EEUU.
</p>
</div>
<p> <p>
A&ntilde;ada tambi&eacute;n informaci&oacute;n sobre c&oacute;mo contactar A&ntilde;ada tambi&eacute;n informaci&oacute;n sobre c&oacute;mo contactar
con usted mediante correo electr&oacute;nico y postal.</p> con usted mediante correo electr&oacute;nico y postal.
<p>Si el programa es interactivo, haga que muestre un peque&ntilde;o anuncio </p>
como el siguiente, cuando comienza a funcionar en modo interactivo:
</p><div>Gnomovision versi&oacute;n 69, Copyright
(C) 19aa nombre del autor
<p>Gnomovision no ofrece ABSOLUTAMENTE NINGUNA GARANT&Iacute;A. Para m&aacute;s
detalles escriba <20>show w<>.</p></div>
<p> <p>
Los comandos hipot&eacute;ticos <20>show w<> y <20>show c<> Si el programa es interactivo, haga que muestre un peque&ntilde;o anuncio
deber&iacute;an mostrar las partes adecuadas de la Licencia P&uacute;blica como el siguiente, cuando comienza a funcionar en modo interactivo:
General. Por supuesto, los comandos que use pueden llamarse de cualquier </p>
otra manera. Podr&iacute;an incluso ser pulsaciones del rat&oacute;n o <div>
elementos de un men&uacute; (lo que sea apropiado para su programa).</p> Gnomovision versi&oacute;n 69, Copyright (C) 19aa nombre del autor
<p>Tambi&eacute;n deber&iacute;as conseguir que su empleador (si trabaja <p>
como programador) o tu Universidad (si es el caso) firme un <20>renuncia Gnomovision no ofrece ABSOLUTAMENTE NINGUNA GARANT&Iacute;A. Para
de copyright<68> para el programa, si es necesario. A continuaci&oacute;n m&aacute;s detalles escriba <20>show w<>.
se ofrece un ejemplo, altere los nombres seg&uacute;n sea conveniente: </p>
</p><ol> </div>
<p>
Los comandos hipot&eacute;ticos <20>show w<> y <20>show c<> deber&iacute;an
mostrar las partes adecuadas de la Licencia P&uacute;blica General. Por
supuesto, los comandos que use pueden llamarse de cualquier otra manera.
Podr&iacute;an incluso ser pulsaciones del rat&oacute;n o elementos de un
men&uacute; (lo que sea apropiado para su programa).
</p>
<p>
Tambi&eacute;n deber&iacute;as conseguir que su empleador (si trabaja como
programador) o tu Universidad (si es el caso) firme un <20>renuncia de
copyright<68> para el programa, si es necesario. A continuaci&oacute;n se
ofrece un ejemplo, altere los nombres seg&uacute;n sea conveniente:
</p>
<ol>
<li> <li>
Yoyodyne, Inc. mediante este documento renuncia Yoyodyne, Inc. mediante este documento renuncia a cualquier
a cualquier inter&eacute;s de derechos de copyright con respecto al programa inter&eacute;s de derechos de copyright con respecto al programa
Gnomovision (que hace pasadas a compiladores) escrito por Pepe Programador. Gnomovision (que hace pasadas a compiladores) escrito por Pepe
<p>&lt;firma de Pepito Grillo&gt;, 20 de diciembre de 1996 Programador.
</p><p>Pepito Grillo, Presidente de Asuntillos Varios.</p></li></ol> <p>&lt;firma de Pepito Grillo&gt;, 20 de diciembre de 1996</p>
<p>Pepito Grillo, Presidente de Asuntillos Varios.</p>
</li>
</ol>
<p> <p>
Esta Licencia P&uacute;blica General no permite que incluya sus programas Esta Licencia P&uacute;blica General no permite que incluya sus programas
en programas propietarios. Si su programa es una biblioteca de subrutinas, en programas propietarios. Si su programa es una biblioteca de subrutinas,
puede considerar m&aacute;s &uacute;til el permitir el enlazado de aplicaciones puede considerar m&aacute;s &uacute;til el permitir el enlazado de
propietarias con la biblioteca. Si este es el caso, use la Licencia P&uacute;blica aplicaciones propietarias con la biblioteca. Si este es el caso, use la
General de GNU para Bibliotecas en lugar de esta Licencia.</p> Licencia P&uacute;blica General de GNU para Bibliotecas en lugar de esta
Licencia.
</body></html> </p>
</body>
</html>

View File

@ -5,433 +5,549 @@
<body> <body>
<h2>Licence Publique G&eacute;n&eacute;rale GNU</h2> <h2>Licence Publique G&eacute;n&eacute;rale GNU</h2>
<p><b>Benjamin Drieu, APRIL (<a href="mailto:bdrieu@april.org">bdrieu@april.org</a>), M&eacute;lanie <p>
Cl&eacute;ment-Fontaine (<a href="mailto:melanie@amberlab.net">melanie@amberlab.net</a>), <b
Arnaud Fontaine (<a href="mailto:arnaud@crao.net">arnaud@crao.net</a>), Lo<4C>c Dachary >Benjamin Drieu, APRIL (<a href="mailto:bdrieu@april.org"
(<a href="mailto:loic@gnu.org">loic@gnu.org</a>), Fr&eacute;d&eacute;ric Couchet (<a href="mailto:fcouchet@fsffrance.org">fcouchet@fsffrance.org</a>). >bdrieu@april.org</a
</b></p> >), M&eacute;lanie Cl&eacute;ment-Fontaine (<a
href="mailto:melanie@amberlab.net"
>melanie@amberlab.net</a
>), Arnaud Fontaine (<a href="mailto:arnaud@crao.net">arnaud@crao.net</a
>), Lo<4C>c Dachary (<a href="mailto:loic@gnu.org">loic@gnu.org</a>),
Fr&eacute;d&eacute;ric Couchet (<a href="mailto:fcouchet@fsffrance.org"
>fcouchet@fsffrance.org</a
>).
</b>
</p>
<h3>Advertiment</h3> <h3>Advertiment</h3>
<p> <p>
This is an unofficial translation of the GNU General Public This is an unofficial translation of the GNU General Public License into
License into French. It was not published by the Free Software French. It was not published by the Free Software Foundation, and does not
Foundation, and does not legally state the distribution terms legally state the distribution terms for software that uses the GNU
for software that uses the GNU GPL--only the original English GPL--only the original English text of the GNU GPL does that. However, we
text of the GNU GPL does that. However, we hope that this hope that this translation will help French speakers understand the GNU
translation will help French speakers understand the GNU GPL GPL better.
better.
</p> </p>
<p> <p>
Ceci est une traduction non officielle de la GNU General Public Ceci est une traduction non officielle de la GNU General Public License en
License en fran<61>ais. Elle n'a pas &eacute;t&eacute; publi&eacute;e par la Free fran<61>ais. Elle n'a pas &eacute;t&eacute; publi&eacute;e par la Free
Software Foundation, et ne d&eacute;termine pas les termes de Software Foundation, et ne d&eacute;termine pas les termes de distribution
distribution pour les logiciels qui utilisent la GNU GPL, seul pour les logiciels qui utilisent la GNU GPL, seul le texte anglais
le texte anglais original de la GNU GPL d&eacute;terminent ces original de la GNU GPL d&eacute;terminent ces termes. Cependant, nous
termes. Cependant, nous esp&eacute;rons que cette traduction aidera les esp&eacute;rons que cette traduction aidera les francophones &agrave;
francophones &agrave; mieux comprendre la GNU GPL. mieux comprendre la GNU GPL.
</p> </p>
<h2>Licence Publique G&eacute;n&eacute;rale GNU</h2> <h2>Licence Publique G&eacute;n&eacute;rale GNU</h2>
<p>Les licences de la plupart des logiciels sont <p>
con<EFBFBD>ues pour vous enlever toute libert&eacute; de les partager et de les Les licences de la plupart des logiciels sont con<6F>ues pour vous enlever
modifier. </p> toute libert&eacute; de les partager et de les modifier.
<p>A contrario, la Licence Publique G&eacute;n&eacute;rale est destin&eacute;e &agrave; garantir </p>
votre libert&eacute; de partager et de modifier les logiciels libres, <p>
et &agrave; assurer que ces logiciels soient libres pour tous leurs A contrario, la Licence Publique G&eacute;n&eacute;rale est
utilisateurs.</p> destin&eacute;e &agrave; garantir votre libert&eacute; de partager et de
<p>La pr&eacute;sente Licence Publique G&eacute;n&eacute;rale s'applique &agrave; la modifier les logiciels libres, et &agrave; assurer que ces logiciels
plupart des logiciels de la Free Software Foundation, ainsi soient libres pour tous leurs utilisateurs.
qu'&agrave; tout autre programme pour lequel ses auteurs s'engagent &agrave; </p>
l'utiliser.</p> <p>
<p>(Certains autres logiciels de la Free Software Foundation La pr&eacute;sente Licence Publique G&eacute;n&eacute;rale s'applique
sont couverts par la GNU Lesser General Public License &agrave; la place.)</p> &agrave; la plupart des logiciels de la Free Software Foundation, ainsi
qu'&agrave; tout autre programme pour lequel ses auteurs s'engagent
&agrave; l'utiliser.
</p>
<p>
(Certains autres logiciels de la Free Software Foundation sont couverts
par la GNU Lesser General Public License &agrave; la place.)
</p>
<p>Vous pouvez aussi l'appliquer aux programmes qui sont les v<>tres.</p> <p>Vous pouvez aussi l'appliquer aux programmes qui sont les v<>tres.</p>
<p>Quand nous parlons de logiciels libres, nous parlons de <p>
libert&eacute;, non de prix.</p> Quand nous parlons de logiciels libres, nous parlons de libert&eacute;,
<p>Nos licences publiques g&eacute;n&eacute;rales sont con<6F>ues pour vous donner non de prix.
l'assurance d'<27>tre libres de distribuer des copies des </p>
logiciels libres (et de facturer ce service, si vous le <p>
souhaitez), de recevoir le code source ou de pouvoir Nos licences publiques g&eacute;n&eacute;rales sont con<6F>ues pour vous
l'obtenir si vous le souhaitez, de pouvoir modifier les donner l'assurance d'<27>tre libres de distribuer des copies des logiciels
logiciels ou en utiliser des &eacute;l&eacute;ments dans de nouveaux libres (et de facturer ce service, si vous le souhaitez), de recevoir le
programmes libres et de savoir que vous pouvez le code source ou de pouvoir l'obtenir si vous le souhaitez, de pouvoir
faire. </p> modifier les logiciels ou en utiliser des &eacute;l&eacute;ments dans de
<p>Pour prot&eacute;ger vos droits, il nous est n&eacute;cessaire d'imposer nouveaux programmes libres et de savoir que vous pouvez le faire.
des limitations qui interdisent &agrave; quiconque de vous refuser </p>
ces droits ou de vous demander d'y renoncer.</p> <p>
<p>Certaines responsabilit&eacute;s vous incombent en raison de ces Pour prot&eacute;ger vos droits, il nous est n&eacute;cessaire d'imposer
limitations si vous distribuez des copies de ces logiciels, ou des limitations qui interdisent &agrave; quiconque de vous refuser ces
si vous les modifiez.</p> droits ou de vous demander d'y renoncer.
<p>Par exemple, si vous distribuez des copies d'un tel </p>
programme, &agrave; titre gratuit ou contre une r&eacute;mun&eacute;ration, vous devez <p>
Certaines responsabilit&eacute;s vous incombent en raison de ces
limitations si vous distribuez des copies de ces logiciels, ou si vous les
modifiez.
</p>
<p>
Par exemple, si vous distribuez des copies d'un tel programme, &agrave;
titre gratuit ou contre une r&eacute;mun&eacute;ration, vous devez
accorder aux destinataires tous les droits dont vous disposez. accorder aux destinataires tous les droits dont vous disposez.
</p> </p>
<p>Vous devez vous assurer qu'eux aussi re<72>oivent ou puissent <p>
disposer du code source.</p> Vous devez vous assurer qu'eux aussi re<72>oivent ou puissent disposer du
<p>Et vous devez leur montrer les pr&eacute;sentes conditions afin code source.
qu'ils aient connaissance de leurs droits.</p>
<p>Nous prot&eacute;geons vos droits en deux &eacute;tapes : (1) nous sommes
titulaires des droits d'auteur du logiciel, et
(2) nous vous delivrons cette licence, qui vous donne
l'autorisation l&eacute;gale de copier, distribuer et/ou modifier
le logiciel.</p>
<p>En outre, pour la protection de chaque auteur ainsi que la n<>tre,
nous voulons nous assurer que chacun comprenne que ce logiciel libre ne fait l'objet
d'aucune garantie.</p>
<p>Si le logiciel est modifi&eacute; par quelqu'un d'autre puis
transmis &agrave; des tiers, nous voulons que les destinataires
soient mis au courant que ce qu'ils ont re<72>u n'est pas le logiciel d'origine, de sorte
que tout probl&egrave;me introduit par d'autres ne puisse entacher
la r&eacute;putation de
l'auteur originel.</p>
<p>En d&eacute;finitive, un programme libre restera &agrave; la merci des
brevets de logiciels.</p>
<p>Nous souhaitons &eacute;viter le risque que les redistributeurs
d'un programme libre fassent des demandes individuelles de
licence de brevet, ceci ayant pour effet de rendre le programme
propri&eacute;taire.
</p> </p>
<p>Pour &eacute;viter cela, nous &eacute;tablissons clairement que toute licence de brevet <p>
doit <20>tre conc&eacute;d&eacute;e de fa<66>on a ce que l'usage en soit libre pour tous Et vous devez leur montrer les pr&eacute;sentes conditions afin qu'ils
ou bien qu'aucune licence ne soit conc&eacute;d&eacute;e.</p> aient connaissance de leurs droits.
<p>Les termes exacts et les conditions de copie, distribution et </p>
modification sont les suivants:</p> <p>
<h2>Conditions de copie, distribution Nous prot&eacute;geons vos droits en deux &eacute;tapes : (1) nous sommes
et modification de la Licence Publique G&eacute;n&eacute;rale GNU.</h2> titulaires des droits d'auteur du logiciel, et (2) nous vous delivrons
<p>0. La pr&eacute;sente Licence s'applique &agrave; tout programme cette licence, qui vous donne l'autorisation l&eacute;gale de copier,
ou tout autre ouvrage contenant un avis, appos&eacute; par le titulaire des distribuer et/ou modifier le logiciel.
droits d'auteur, stipulant qu'il peut <20>tre distribu&eacute; au titre </p>
des conditions de la pr&eacute;sente Licence Publique <p>
G&eacute;n&eacute;rale.</p> En outre, pour la protection de chaque auteur ainsi que la n<>tre, nous
<p>Ci-apr&egrave;s, le "Programme" d&eacute;signe l'un quelconque de ces voulons nous assurer que chacun comprenne que ce logiciel libre ne fait
l'objet d'aucune garantie.
</p>
<p>
Si le logiciel est modifi&eacute; par quelqu'un d'autre puis transmis
&agrave; des tiers, nous voulons que les destinataires soient mis au
courant que ce qu'ils ont re<72>u n'est pas le logiciel d'origine, de sorte
que tout probl&egrave;me introduit par d'autres ne puisse entacher la
r&eacute;putation de l'auteur originel.
</p>
<p>
En d&eacute;finitive, un programme libre restera &agrave; la merci des
brevets de logiciels.
</p>
<p>
Nous souhaitons &eacute;viter le risque que les redistributeurs d'un
programme libre fassent des demandes individuelles de licence de brevet,
ceci ayant pour effet de rendre le programme propri&eacute;taire.
</p>
<p>
Pour &eacute;viter cela, nous &eacute;tablissons clairement que toute
licence de brevet doit <20>tre conc&eacute;d&eacute;e de fa<66>on a ce que
l'usage en soit libre pour tous ou bien qu'aucune licence ne soit
conc&eacute;d&eacute;e.
</p>
<p>
Les termes exacts et les conditions de copie, distribution et modification
sont les suivants:
</p>
<h2>
Conditions de copie, distribution et modification de la Licence Publique
G&eacute;n&eacute;rale GNU.
</h2>
<p>
0. La pr&eacute;sente Licence s'applique &agrave; tout programme ou tout
autre ouvrage contenant un avis, appos&eacute; par le titulaire des droits
d'auteur, stipulant qu'il peut <20>tre distribu&eacute; au titre des
conditions de la pr&eacute;sente Licence Publique G&eacute;n&eacute;rale.
</p>
<p>
Ci-apr&egrave;s, le "Programme" d&eacute;signe l'un quelconque de ces
programmes ou ouvrages, et un "ouvrage fond&eacute; sur le Programme" programmes ou ouvrages, et un "ouvrage fond&eacute; sur le Programme"
d&eacute;signe soit le Programme, soit un ouvrage qui en d&eacute;rive au d&eacute;signe soit le Programme, soit un ouvrage qui en d&eacute;rive au
titre des lois sur le droit d'auteur: en d'autres termes, titre des lois sur le droit d'auteur: en d'autres termes, un ouvrage
un ouvrage contenant le Programme ou une partie de contenant le Programme ou une partie de ce dernier, soit &agrave;
ce dernier, soit &agrave; l'identique, soit avec des modifications et/ou l'identique, soit avec des modifications et/ou traduit dans un autre
traduit dans un autre langage.</p> langage.
<p>(Ci-apr&egrave;s, le terme "modification" implique, sans s'y r&eacute;duire, le terme traduction)</p> </p>
<p>Chaque concessionaire sera d&eacute;sign&eacute; par "vous".</p> <p>
<p>Les activit&eacute;s autres que la copie, la distribution et (Ci-apr&egrave;s, le terme "modification" implique, sans s'y
la modification ne sont pas couvertes par la pr&eacute;sente Licence r&eacute;duire, le terme traduction)
; elles sont hors de son champ d'application.</p> </p>
<p>L'op&eacute;ration consistant &agrave; ex&eacute;cuter le Programme n'est soumise &agrave; aucune limitation <p>Chaque concessionaire sera d&eacute;sign&eacute; par "vous".</p>
et les sorties du programme ne sont couvertes que si leur <p>
contenu constitue un ouvrage fond&eacute; sur le Programme Les activit&eacute;s autres que la copie, la distribution et la
(ind&eacute;pendamment du fait qu'il ait &eacute;t&eacute; r&eacute;alis&eacute; par l'ex&eacute;cution modification ne sont pas couvertes par la pr&eacute;sente Licence ; elles
du Programme).</p> sont hors de son champ d'application.
<p>La validit&eacute; de ce qui pr&eacute;c&egrave;de d&eacute;pend de ce que fait le </p>
Programme.</p> <p>
<p>1. Vous pouvez copier et distribuer des copies &agrave; L'op&eacute;ration consistant &agrave; ex&eacute;cuter le Programme n'est
l'identique du code source du Programme tel que vous l'avez soumise &agrave; aucune limitation et les sorties du programme ne sont
re<EFBFBD>u, sur n'importe quel support, du moment que vous apposiez couvertes que si leur contenu constitue un ouvrage fond&eacute; sur le
sur chaque copie, de mani&egrave;re ad hoc et parfaitement Programme (ind&eacute;pendamment du fait qu'il ait &eacute;t&eacute;
visible, l'avis de droit d'auteur ad&eacute;quat et r&eacute;alis&eacute; par l'ex&eacute;cution du Programme).
une exon&eacute;ration de garantie ; que vous gardiez intacts tous les </p>
avis faisant r&eacute;f&eacute;rence &agrave; la pr&eacute;sente Licence et &agrave; l'absence de <p>
toute garantie ; et que vous fournissiez &agrave; tout destinataire du La validit&eacute; de ce qui pr&eacute;c&egrave;de d&eacute;pend de ce que
Programme autre que vous m<>me un exemplaire de la pr&eacute;sente fait le Programme.
Licence en m<>me temps que le Programme.</p> </p>
<p>Vous pouvez faire payer l'acte physique de <p>
transmission d'une copie, et vous pouvez, &agrave; votre discr&eacute;tion, 1. Vous pouvez copier et distribuer des copies &agrave; l'identique du
proposer une garantie contre r&eacute;mun&eacute;ration.</p> code source du Programme tel que vous l'avez re<72>u, sur n'importe quel
<p>2. Vous pouvez modifier votre copie ou des copies du Programme support, du moment que vous apposiez sur chaque copie, de mani&egrave;re
ou n'importe quelle partie de celui-ci, cr&eacute;ant ainsi un ouvrage ad hoc et parfaitement visible, l'avis de droit d'auteur ad&eacute;quat et
fond&eacute; sur le Programme, et copier et distribuer de telles modifications ou ouvrage selon les une exon&eacute;ration de garantie ; que vous gardiez intacts tous les
termes de l'Article 1 ci-dessus, &agrave; condition de vous conformer &eacute;galement avis faisant r&eacute;f&eacute;rence &agrave; la pr&eacute;sente Licence
&agrave; chacune des obligations suivantes:</p> et &agrave; l'absence de toute garantie ; et que vous fournissiez &agrave;
<p>a) Vous devez munir les fichiers modifi&eacute;s d'avis bien visibles tout destinataire du Programme autre que vous m<>me un exemplaire de la
stipulants que vous avez modifi&eacute; ces pr&eacute;sente Licence en m<>me temps que le Programme.
fichiers, ainsi que la date de chaque modification;</p> </p>
<p>b) Vous devez prendre les dispositions n&eacute;cessaires pour que <p>
tout ouvrage Vous pouvez faire payer l'acte physique de transmission d'une copie, et
que vous distribuez ou publiez, et qui, en totalit&eacute; ou en partie, vous pouvez, &agrave; votre discr&eacute;tion, proposer une garantie
contient ou est fond&eacute; sur le Programme - ou une partie contre r&eacute;mun&eacute;ration.
quelconque de ce dernier - soit conc&eacute;d&eacute; comme un tout, </p>
&agrave; titre gratuit, &agrave; n'importe quel tiers, au titre des conditions <p>
de la pr&eacute;sente Licence.</p> 2. Vous pouvez modifier votre copie ou des copies du Programme ou
<p>c) Si le programme modifi&eacute; lit habituellement des instructions n'importe quelle partie de celui-ci, cr&eacute;ant ainsi un ouvrage
de fa<66>on interactive lorsqu'on l'ex&eacute;cute, vous devez, fond&eacute; sur le Programme, et copier et distribuer de telles
quand il commence son ex&eacute;cution pour ladite modifications ou ouvrage selon les termes de l'Article 1 ci-dessus,
utilisation interactive de la mani&egrave;re la plus usuelle, faire &agrave; condition de vous conformer &eacute;galement &agrave; chacune des
en sorte qu'il imprime ou affiche une annonce obligations suivantes:
comprenant un avis de droit d'auteur ad hoc, et un avis </p>
stipulant qu'il n'y a pas de garantie (ou bien indiquant que <p>
c'est vous qui fournissez la garantie), et que a) Vous devez munir les fichiers modifi&eacute;s d'avis bien visibles
les utilisateurs peuvent redistribuer le programme en respectant stipulants que vous avez modifi&eacute; ces fichiers, ainsi que la date de
les pr&eacute;sentes obligations, et expliquant &agrave; l'utilisateur comment chaque modification;
voir une copie de la pr&eacute;sente Licence.</p> </p>
<p>(Exception : si le Programme est lui-m<>me interactif <p>
mais n'imprime pas habituellement une telle annonce, votre b) Vous devez prendre les dispositions n&eacute;cessaires pour que tout
ouvrage fond&eacute; sur le Programme n'est pas oblig&eacute; ouvrage que vous distribuez ou publiez, et qui, en totalit&eacute; ou en
d'imprimer une annonce).</p> partie, contient ou est fond&eacute; sur le Programme - ou une partie
<p>Ces obligations s'appliquent &agrave; l'ouvrage modifi&eacute; quelconque de ce dernier - soit conc&eacute;d&eacute; comme un tout,
pris comme un tout. &agrave; titre gratuit, &agrave; n'importe quel tiers, au titre des
conditions de la pr&eacute;sente Licence.
</p>
<p>
c) Si le programme modifi&eacute; lit habituellement des instructions de
fa<66>on interactive lorsqu'on l'ex&eacute;cute, vous devez, quand il
commence son ex&eacute;cution pour ladite utilisation interactive de la
mani&egrave;re la plus usuelle, faire en sorte qu'il imprime ou affiche
une annonce comprenant un avis de droit d'auteur ad hoc, et un avis
stipulant qu'il n'y a pas de garantie (ou bien indiquant que c'est vous
qui fournissez la garantie), et que les utilisateurs peuvent redistribuer
le programme en respectant les pr&eacute;sentes obligations, et expliquant
&agrave; l'utilisateur comment voir une copie de la pr&eacute;sente
Licence.
</p>
<p>
(Exception : si le Programme est lui-m<>me interactif mais n'imprime pas
habituellement une telle annonce, votre ouvrage fond&eacute; sur le
Programme n'est pas oblig&eacute; d'imprimer une annonce).
</p>
<p>
Ces obligations s'appliquent &agrave; l'ouvrage modifi&eacute; pris comme
un tout.
</p>
<p>
Si des &eacute;l&eacute;ments identifiables de cet ouvrage ne sont pas
fond&eacute;es sur le Programme et peuvent raisonnablement <20>tre
consid&eacute;r&eacute;es comme des ouvrages ind&eacute;pendants distincts
en eux m<>mes, alors la pr&eacute;sente Licence et ses conditions ne
s'appliquent pas &agrave; ces &eacute;l&eacute;ments lorsque vous les
distribuez en tant qu'ouvrages distincts.
</p> </p>
<p>Si des &eacute;l&eacute;ments identifiables
de cet ouvrage ne sont pas fond&eacute;es sur le Programme et peuvent
raisonnablement <20>tre consid&eacute;r&eacute;es comme des ouvrages ind&eacute;pendants
distincts en eux m<>mes, alors la pr&eacute;sente Licence et
ses conditions ne
s'appliquent pas &agrave; ces &eacute;l&eacute;ments lorsque vous les distribuez
en tant qu'ouvrages distincts.</p>
<p> <p>
Mais lorsque vous distribuez ces m<>mes &eacute;l&eacute;ments comme partie Mais lorsque vous distribuez ces m<>mes &eacute;l&eacute;ments comme partie
d'un tout, lequel constitue un ouvrage fond&eacute; sur le Programme, d'un tout, lequel constitue un ouvrage fond&eacute; sur le Programme, la
la distribution de ce tout doit <20>tre soumise aux conditions de distribution de ce tout doit <20>tre soumise aux conditions de la
la pr&eacute;sente Licence, et les autorisations qu'elle octroie aux pr&eacute;sente Licence, et les autorisations qu'elle octroie aux autres
autres concessionaires s'&eacute;tendent &agrave; l'ensemble de l'ouvrage et concessionaires s'&eacute;tendent &agrave; l'ensemble de l'ouvrage et par
par cons&eacute;quent &agrave; chaque et toute partie indiff&eacute;rement de qui cons&eacute;quent &agrave; chaque et toute partie indiff&eacute;rement de
l'a &eacute;crite. qui l'a &eacute;crite.
</p>
<p>Par cons&eacute;quent, l'objet du pr&eacute;sent article n'est pas de revendiquer des droits
ou de contester vos droits sur un ouvrage enti&egrave;rement &eacute;crit par
vous; son objet est plut<75>t d'exercer le droit de contr<74>ler
la distribution d'ouvrages d&eacute;riv&eacute;s ou d'ouvrages collectifs fond&eacute;s
sur le Programme.
</p> </p>
<p> <p>
De plus, la simple proximit&eacute; du Programme avec un autre Par cons&eacute;quent, l'objet du pr&eacute;sent article n'est pas de
ouvrage qui n'est pas fond&eacute; sur le Programme (ou un ouvrage revendiquer des droits ou de contester vos droits sur un ouvrage
fond&eacute; sur le Programme) sur une partition d'un espace de enti&egrave;rement &eacute;crit par vous; son objet est plut<75>t d'exercer
stockage ou un support de distribution ne place pas cet autre le droit de contr<74>ler la distribution d'ouvrages d&eacute;riv&eacute;s ou
ouvrage dans le champ d'application de la pr&eacute;sente Licence. d'ouvrages collectifs fond&eacute;s sur le Programme.
</p> </p>
<p>3. Vous pouvez copier et distribuer le Programme (ou un <p>
ouvrage fond&eacute; sur lui, selon l'Article 2) sous forme de code De plus, la simple proximit&eacute; du Programme avec un autre ouvrage qui
objet ou d'ex&eacute;cutable, selon les termes des Articles 1 et 2 n'est pas fond&eacute; sur le Programme (ou un ouvrage fond&eacute; sur le
ci-dessus, &agrave; condition que vous accomplissiez l'un des points Programme) sur une partition d'un espace de stockage ou un support de
suivants :</p> distribution ne place pas cet autre ouvrage dans le champ d'application de
<p>a) L'accompagner de l'int&eacute;gralit&eacute; du code source correspondant, la pr&eacute;sente Licence.
sous une forme lisible par un ordinateur, lequel doit <20>tre distribu&eacute;
au titre
des termes des Articles 1 et 2 ci-dessus, sur un support
habituellement utilis&eacute; pour l'&eacute;change de logiciels; ou,</p>
<p>b) L'accompagner d'une proposition &eacute;crite, valable pendant
au moins trois ans, de fournir &agrave; tout tiers, &agrave; un tarif qui
ne soit pas sup&eacute;rieur &agrave; ce que vous co<63>te l'acte physique de
r&eacute;aliser une distribution source, une copie int&eacute;grale du code
source correspondant sous une forme lisible par un
ordinateur, qui sera distribu&eacute;e au titre des termes des
Articles 1 et 2 ci-dessus, sur un support habituellement
utilis&eacute; pour l'&eacute;change de logiciels; ou,
</p> </p>
<p>c) L'accompagner des informations re<72>ues par vous concernant la proposition de distribution du code source correspondant. (Cette <p>
solution n'est autoris&eacute;e que dans le cas d'une distribution non-commerciale 3. Vous pouvez copier et distribuer le Programme (ou un ouvrage
fond&eacute; sur lui, selon l'Article 2) sous forme de code objet ou
d'ex&eacute;cutable, selon les termes des Articles 1 et 2 ci-dessus,
&agrave; condition que vous accomplissiez l'un des points suivants :
</p>
<p>
a) L'accompagner de l'int&eacute;gralit&eacute; du code source
correspondant, sous une forme lisible par un ordinateur, lequel doit <20>tre
distribu&eacute; au titre des termes des Articles 1 et 2 ci-dessus, sur un
support habituellement utilis&eacute; pour l'&eacute;change de logiciels;
ou,
</p>
<p>
b) L'accompagner d'une proposition &eacute;crite, valable pendant au moins
trois ans, de fournir &agrave; tout tiers, &agrave; un tarif qui ne soit
pas sup&eacute;rieur &agrave; ce que vous co<63>te l'acte physique de
r&eacute;aliser une distribution source, une copie int&eacute;grale du
code source correspondant sous une forme lisible par un ordinateur, qui
sera distribu&eacute;e au titre des termes des Articles 1 et 2 ci-dessus,
sur un support habituellement utilis&eacute; pour l'&eacute;change de
logiciels; ou,
</p>
<p>
c) L'accompagner des informations re<72>ues par vous concernant la
proposition de distribution du code source correspondant. (Cette solution
n'est autoris&eacute;e que dans le cas d'une distribution non-commerciale
et seulement si vous avez re<72>u le programme sous forme de code objet ou et seulement si vous avez re<72>u le programme sous forme de code objet ou
d'&eacute;x&eacute;cutable accompagn&eacute; d'une telle proposition - en conformit&eacute; avec le d'&eacute;x&eacute;cutable accompagn&eacute; d'une telle proposition - en
sous-Article b ci-dessus.) conformit&eacute; avec le sous-Article b ci-dessus.)
</p> </p>
<p>Le code source d'un ouvrage d&eacute;signe la forme favorite pour <p>
travailler &agrave; des modifications de cet ouvrage. Pour un Le code source d'un ouvrage d&eacute;signe la forme favorite pour
ouvrage ex&eacute;cutable, le code source int&eacute;gral d&eacute;signe la travailler &agrave; des modifications de cet ouvrage. Pour un ouvrage
ex&eacute;cutable, le code source int&eacute;gral d&eacute;signe la
totalit&eacute; du code source de la totalit&eacute; des modules qu'il totalit&eacute; du code source de la totalit&eacute; des modules qu'il
contient, ainsi que les &eacute;ventuels fichiers de d&eacute;finition des contient, ainsi que les &eacute;ventuels fichiers de d&eacute;finition des
interfaces qui y sont associ&eacute;s, ainsi que les scripts utilis&eacute;s interfaces qui y sont associ&eacute;s, ainsi que les scripts
pour contr<74>ler la compilation et l'installation de utilis&eacute;s pour contr<74>ler la compilation et l'installation de
l'ex&eacute;cutable. Cependant, par exception sp&eacute;ciale, le code l'ex&eacute;cutable. Cependant, par exception sp&eacute;ciale, le code
source distribu&eacute; n'est pas cens&eacute; inclure quoi que ce soit de source distribu&eacute; n'est pas cens&eacute; inclure quoi que ce soit de
normalement distribu&eacute; (que ce soit sous forme source ou normalement distribu&eacute; (que ce soit sous forme source ou binaire)
binaire) avec les composants principaux (compilateur, noyau, avec les composants principaux (compilateur, noyau, et autre) du
et autre) du syst&egrave;me d'exploitation sur lequel l'ex&eacute;cutable syst&egrave;me d'exploitation sur lequel l'ex&eacute;cutable tourne,
tourne, &agrave; moins que ce composant lui-m<>me n'accompagne &agrave; moins que ce composant lui-m<>me n'accompagne l'ex&eacute;cutable.
l'ex&eacute;cutable.
</p> </p>
<p> <p>
Si distribuer un ex&eacute;cutable ou un code objet consiste &agrave; Si distribuer un ex&eacute;cutable ou un code objet consiste &agrave;
offrir un acc&egrave;s permettant leur copie depuis un offrir un acc&egrave;s permettant leur copie depuis un endroit
endroit particulier, alors l'offre d'un acc&egrave;s &eacute;quivalent pour particulier, alors l'offre d'un acc&egrave;s &eacute;quivalent pour copier
copier le code source depuis le m<>me endroit compte comme une le code source depuis le m<>me endroit compte comme une distribution du
distribution du code source - m<>me si les tiers ne sont pas code source - m<>me si les tiers ne sont pas contraints de copier le source
contraints de copier le source en m<>me temps que le code en m<>me temps que le code objet.
objet.
</p> </p>
<p>4. Vous ne pouvez copier, modifier, conc&eacute;der en sous-licence, ou distribuer <p>
le Programme, sauf tel qu'express&eacute;ment pr&eacute;vu par la pr&eacute;sente Licence. 4. Vous ne pouvez copier, modifier, conc&eacute;der en sous-licence, ou
Toute tentative de copier, modifier, conc&eacute;der en sous-licence, ou distribuer le Programme, sauf tel qu'express&eacute;ment pr&eacute;vu par
distribuer le Programme d'une autre mani&egrave;re est r&eacute;put&eacute;e non valable, et met la pr&eacute;sente Licence. Toute tentative de copier, modifier,
imm&eacute;diatement fin &agrave; vos droits au titre de la pr&eacute;sente Licence. conc&eacute;der en sous-licence, ou distribuer le Programme d'une autre
Toutefois, les tiers ayant re<72>u de vous des copies, ou des droits, mani&egrave;re est r&eacute;put&eacute;e non valable, et met
au titre de la pr&eacute;sente Licence ne verront pas leurs autorisations r&eacute;sili&eacute;es imm&eacute;diatement fin &agrave; vos droits au titre de la
aussi longtemps que ledits tiers se conforment pleinement &agrave; elle. pr&eacute;sente Licence. Toutefois, les tiers ayant re<72>u de vous des
copies, ou des droits, au titre de la pr&eacute;sente Licence ne verront
pas leurs autorisations r&eacute;sili&eacute;es aussi longtemps que ledits
tiers se conforment pleinement &agrave; elle.
</p> </p>
<p>5. Vous n'<27>tes pas oblig&eacute; d'accepter la pr&eacute;sente Licence &eacute;tant donn&eacute; que vous ne <p>
l'avez pas sign&eacute;e. Cependant, rien d'autre 5. Vous n'<27>tes pas oblig&eacute; d'accepter la pr&eacute;sente Licence
ne vous accorde l'autorisation de modifier ou &eacute;tant donn&eacute; que vous ne l'avez pas sign&eacute;e. Cependant,
distribuer le Programme ou les ouvrages fond&eacute;s sur lui. Ces actions sont rien d'autre ne vous accorde l'autorisation de modifier ou distribuer le
Programme ou les ouvrages fond&eacute;s sur lui. Ces actions sont
interdites par la loi si vous n'acceptez pas la pr&eacute;sente Licence. interdites par la loi si vous n'acceptez pas la pr&eacute;sente Licence.
En cons&eacute;quence, en modifiant ou En cons&eacute;quence, en modifiant ou distribuant le Programme (ou un
distribuant le Programme (ou un ouvrage quelconque fond&eacute; sur ouvrage quelconque fond&eacute; sur le Programme), vous signifiez votre
le Programme), vous signifiez votre acceptation de la pr&eacute;sente Licence en le faisant, acceptation de la pr&eacute;sente Licence en le faisant, et de toutes ses
et de toutes ses conditions concernant la copie, la conditions concernant la copie, la distribution ou la modification du
distribution ou la modification du Programme ou d'ouvrages fond&eacute;s Programme ou d'ouvrages fond&eacute;s sur lui.
sur lui.</p> </p>
<p> <p>
6. Chaque fois que vous redistribuez le Programme (ou n'importe quel 6. Chaque fois que vous redistribuez le Programme (ou n'importe quel
ouvrage fond&eacute; sur le Programme), une licence est automatiquement ouvrage fond&eacute; sur le Programme), une licence est automatiquement
conc&eacute;d&eacute;e au destinataire par le conc&eacute;dant originel de la licence, conc&eacute;d&eacute;e au destinataire par le conc&eacute;dant originel de
l'autorisant &agrave; la licence, l'autorisant &agrave; copier, distribuer ou modifier le
copier, distribuer ou modifier le Programme, sous r&eacute;serve Programme, sous r&eacute;serve des pr&eacute;sentes conditions. Vous ne
des pr&eacute;sentes conditions. Vous ne pouvez imposer pouvez imposer une quelconque limitation suppl&eacute;mentaire &agrave;
une quelconque limitation suppl&eacute;mentaire &agrave; l'exercice des l'exercice des droits octroy&eacute;s au titre des pr&eacute;sentes par le
droits octroy&eacute;s au titre des pr&eacute;sentes par le destinataire. Vous destinataire. Vous n'avez pas la responsabilit&eacute; d'imposer le
n'avez pas la responsabilit&eacute; d'imposer le respect de respect de la pr&eacute;sente Licence &agrave; des tiers.
la pr&eacute;sente Licence &agrave; des tiers. </p> </p>
<p> <p>
7. Si, cons&eacute;quement &agrave; une d&eacute;cision de justice ou l'all&eacute;gation 7. Si, cons&eacute;quement &agrave; une d&eacute;cision de justice ou
d'une transgression de brevet ou pour toute autre raison (non limit&eacute;e &agrave; un l'all&eacute;gation d'une transgression de brevet ou pour toute autre
probleme de brevet), des obligations vous sont impos&eacute;es (que ce soit par jugement, raison (non limit&eacute;e &agrave; un probleme de brevet), des
conciliation ou autre) qui contredisent les conditions de la pr&eacute;sente Licence, elles obligations vous sont impos&eacute;es (que ce soit par jugement,
ne vous excusent pas des conditions de la pr&eacute;sente Licence. Si vous ne pouvez conciliation ou autre) qui contredisent les conditions de la
distribuer de mani&egrave;re &agrave; satisfaire simultan&eacute;ment vos obligations au titre pr&eacute;sente Licence, elles ne vous excusent pas des conditions de la
de la pr&eacute;sente Licence et toute autre obligation pertinente, alors il en d&eacute;coule que vous ne pouvez pas du tout distribuer le Programme. Par exemple, pr&eacute;sente Licence. Si vous ne pouvez distribuer de mani&egrave;re
si une licence de brevet ne permettait pas une redistribution sans redevance du &agrave; satisfaire simultan&eacute;ment vos obligations au titre de la
Programme par tous ceux qui re<72>oivent une copie directement ou indirectement pr&eacute;sente Licence et toute autre obligation pertinente, alors il en
par votre interm&eacute;diaire, alors la seule fa<66>on pour vous de satisfaire &agrave; la d&eacute;coule que vous ne pouvez pas du tout distribuer le Programme. Par
fois &agrave; la licence du brevet et &agrave; la pr&eacute;sente Licence serait de vous abstenir exemple, si une licence de brevet ne permettait pas une redistribution
sans redevance du Programme par tous ceux qui re<72>oivent une copie
directement ou indirectement par votre interm&eacute;diaire, alors la
seule fa<66>on pour vous de satisfaire &agrave; la fois &agrave; la licence
du brevet et &agrave; la pr&eacute;sente Licence serait de vous abstenir
totalement de toute distribution du Programme. totalement de toute distribution du Programme.
</p> </p>
<p>Si une partie quelconque de cet article est tenue pour <p>
nulle ou inopposable dans une circonstance particuli&egrave;re Si une partie quelconque de cet article est tenue pour nulle ou
quelconque, l'intention est que le reste de l'article inopposable dans une circonstance particuli&egrave;re quelconque,
s'applique. La totalit&eacute; de la section s'appliquera dans toutes les l'intention est que le reste de l'article s'applique. La totalit&eacute;
autres circonstances.</p> de la section s'appliquera dans toutes les autres circonstances.
<p>Cet article n'a pas pour but de vous induire &agrave; transgresser un
quelconque brevet ou d'autres revendications &agrave; un droit de propri&eacute;t&eacute; ou
&agrave; contester la validit&eacute; de la moindre de ces revendications ; cet article a pour
seul objectif de prot&eacute;ger l'int&eacute;grit&eacute; du syst&egrave;me de distribution
du logiciel libre, qui est mis en oeuvre par la pratique des licenses
publiques. De nombreuses personnes ont fait de g&eacute;n&eacute;reuses contributions
au large spectre de logiciels distribu&eacute;s par ce syst&egrave;me en se fiant &agrave;
l'application coh&eacute;rente de ce syst&egrave;me ; il appartient &agrave; chaque auteur/donateur
de d&eacute;cider si il ou elle veut distribuer du logiciel par l'interm&eacute;diaire
d'un quelconque autre syst&egrave;me et un concessionaire ne peut imposer ce
choix.
</p> </p>
<p>Cet article a pour but de rendre totalement limpide ce que l'on pense <p>
<EFBFBD>tre une cons&eacute;quence du reste de la pr&eacute;sente Licence.</p> Cet article n'a pas pour but de vous induire &agrave; transgresser un
<p>8. Si la distribution et/ou l'utilisation du Programme est limit&eacute;e quelconque brevet ou d'autres revendications &agrave; un droit de
dans certains pays que ce soit par des brevets ou par des interfaces soumises propri&eacute;t&eacute; ou &agrave; contester la validit&eacute; de la
au droit d'auteur, le titulaire originel des droits d'auteur moindre de ces revendications ; cet article a pour seul objectif de
qui d&eacute;cide de couvrir le Programme par la pr&eacute;sente Licence peut ajouter prot&eacute;ger l'int&eacute;grit&eacute; du syst&egrave;me de
une limitation g&eacute;ographique de distribution explicite qui exclue ces pays afin distribution du logiciel libre, qui est mis en oeuvre par la pratique des
que la distribution soit permise seulement dans ou entre les pays qui ne sont licenses publiques. De nombreuses personnes ont fait de
pas ainsi exclus. Dans ce cas, la pr&eacute;sente Licence incorpore la limitation g&eacute;n&eacute;reuses contributions au large spectre de logiciels
comme si elle &eacute;tait &eacute;crite dans le corps de la pr&eacute;sente Licence. distribu&eacute;s par ce syst&egrave;me en se fiant &agrave; l'application
coh&eacute;rente de ce syst&egrave;me ; il appartient &agrave; chaque
auteur/donateur de d&eacute;cider si il ou elle veut distribuer du
logiciel par l'interm&eacute;diaire d'un quelconque autre syst&egrave;me
et un concessionaire ne peut imposer ce choix.
</p> </p>
<p>9. La Free Software Foundation peut, de temps &agrave; autre, publier des <p>
versions r&eacute;vis&eacute;es et/ou nouvelles de la Licence Publique G&eacute;n&eacute;rale. De telles Cet article a pour but de rendre totalement limpide ce que l'on pense <20>tre
nouvelles versions seront similaires &agrave; la pr&eacute;sente version dans l'esprit une cons&eacute;quence du reste de la pr&eacute;sente Licence.
mais pourront diff&eacute;rer dans le d&eacute;tail pour prendre en compte
de nouvelles probl&eacute;matiques ou inqui&eacute;tudes.
</p> </p>
<p>Chaque version poss&egrave;de un num&eacute;ro de version la distinguant. Si le Programme <p>
pr&eacute;cise le num&eacute;ro de version de la pr&eacute;sente Licence qui s'y applique 8. Si la distribution et/ou l'utilisation du Programme est limit&eacute;e
et "une version ult&eacute;rieure quelconque", vous avez le choix dans certains pays que ce soit par des brevets ou par des interfaces
de suivre les soumises au droit d'auteur, le titulaire originel des droits d'auteur qui
conditions de d&eacute;cide de couvrir le Programme par la pr&eacute;sente Licence peut
la pr&eacute;sente version ou de toute autre version ult&eacute;rieure publi&eacute;e par la ajouter une limitation g&eacute;ographique de distribution explicite qui
Free Software Foundation. Si le Programme ne sp&eacute;cifie aucun num&eacute;ro de exclue ces pays afin que la distribution soit permise seulement dans ou
version de la pr&eacute;sente Licence, vous pouvez choisir une version quelconque entre les pays qui ne sont pas ainsi exclus. Dans ce cas, la
publi&eacute;e par la Free Software Foundation &agrave; quelque moment que ce soit.</p> pr&eacute;sente Licence incorpore la limitation comme si elle &eacute;tait
<p>10. Si vous souhaitez incorporer des parties du Programme &eacute;crite dans le corps de la pr&eacute;sente Licence.
dans d'autres programmes libres dont les conditions de </p>
distribution sont diff&eacute;rentes, &eacute;crivez &agrave; l'auteur pour lui en demander <p>
9. La Free Software Foundation peut, de temps &agrave; autre, publier des
versions r&eacute;vis&eacute;es et/ou nouvelles de la Licence Publique
G&eacute;n&eacute;rale. De telles nouvelles versions seront similaires
&agrave; la pr&eacute;sente version dans l'esprit mais pourront
diff&eacute;rer dans le d&eacute;tail pour prendre en compte de nouvelles
probl&eacute;matiques ou inqui&eacute;tudes.
</p>
<p>
Chaque version poss&egrave;de un num&eacute;ro de version la distinguant.
Si le Programme pr&eacute;cise le num&eacute;ro de version de la
pr&eacute;sente Licence qui s'y applique et "une version ult&eacute;rieure
quelconque", vous avez le choix de suivre les conditions de la
pr&eacute;sente version ou de toute autre version ult&eacute;rieure
publi&eacute;e par la Free Software Foundation. Si le Programme ne
sp&eacute;cifie aucun num&eacute;ro de version de la pr&eacute;sente
Licence, vous pouvez choisir une version quelconque publi&eacute;e par la
Free Software Foundation &agrave; quelque moment que ce soit.
</p>
<p>
10. Si vous souhaitez incorporer des parties du Programme dans d'autres
programmes libres dont les conditions de distribution sont
diff&eacute;rentes, &eacute;crivez &agrave; l'auteur pour lui en demander
l'autorisation. Pour les logiciels dont la Free Software Foundation est l'autorisation. Pour les logiciels dont la Free Software Foundation est
titulaire des droits d'auteur, &eacute;crivez &agrave; la Free Software Foundation ; titulaire des droits d'auteur, &eacute;crivez &agrave; la Free Software
nous faisons parfois des exceptions dans ce sens. Notre d&eacute;cision sera guid&eacute;e Foundation ; nous faisons parfois des exceptions dans ce sens. Notre
par le double objectif de pr&eacute;server le statut libre de tous les d&eacute;riv&eacute;s de nos d&eacute;cision sera guid&eacute;e par le double objectif de
logiciels libres et de promouvoir le partage et la r&eacute;utilisation des logiciels pr&eacute;server le statut libre de tous les d&eacute;riv&eacute;s de nos
en g&eacute;n&eacute;ral. logiciels libres et de promouvoir le partage et la r&eacute;utilisation
des logiciels en g&eacute;n&eacute;ral.
</p> </p>
<h2>ABSENCE DE GARANTIE</h2> <h2>ABSENCE DE GARANTIE</h2>
<p>11. COMME LA LICENCE DU PROGRAMME EST CONCEDEE A TITRE GRATUIT, <p>
AUCUNE GARANTIE NE S'APPLIQUE AU PROGRAMME, DANS LES LIMITES 11. COMME LA LICENCE DU PROGRAMME EST CONCEDEE A TITRE GRATUIT, AUCUNE
AUTORISEES PAR LA LOI APPLICABLE. SAUF MENTION CONTRAIRE ECRITE, GARANTIE NE S'APPLIQUE AU PROGRAMME, DANS LES LIMITES AUTORISEES PAR LA
LES TITULAIRES DU DROIT D'AUTEUR ET/OU LES AUTRES PARTIES FOURNISSENT LOI APPLICABLE. SAUF MENTION CONTRAIRE ECRITE, LES TITULAIRES DU DROIT
LE PROGRAMME "EN L'ETAT", SANS AUCUNE GARANTIE DE D'AUTEUR ET/OU LES AUTRES PARTIES FOURNISSENT LE PROGRAMME "EN L'ETAT",
QUELQUE NATURE QUE CE SOIT, EXPRESSE OU IMPLICITE, Y COMPRIS, MAIS SANS AUCUNE GARANTIE DE QUELQUE NATURE QUE CE SOIT, EXPRESSE OU IMPLICITE,
SANS Y ETRE LIMITE, LES GARANTIES IMPLICITES DE COMMERCIABILITE ET Y COMPRIS, MAIS SANS Y ETRE LIMITE, LES GARANTIES IMPLICITES DE
DE LA CONFORMITE A UNE UTILISATION PARTICULIERE. VOUS COMMERCIABILITE ET DE LA CONFORMITE A UNE UTILISATION PARTICULIERE. VOUS
ASSUMEZ LA TOTALITE DES RISQUES LIES A LA QUALITE ET AUX PERFORMANCES DU PROGRAMME. ASSUMEZ LA TOTALITE DES RISQUES LIES A LA QUALITE ET AUX PERFORMANCES DU
SI LE PROGRAMME SE REVELAIT DEFECTUEUX, LE COUT DE L'ENTRETIEN, PROGRAMME. SI LE PROGRAMME SE REVELAIT DEFECTUEUX, LE COUT DE L'ENTRETIEN,
DES REPARATIONS OU DES CORRECTIONS NECESSAIRES DES REPARATIONS OU DES CORRECTIONS NECESSAIRES VOUS INCOMBENT
VOUS INCOMBENT INTEGRALEMENT.</p> INTEGRALEMENT.
<p>12. EN AUCUN CAS, SAUF LORSQUE LA LOI APPLICABLE OU UNE CONVENTION ECRITE L'EXIGE, UN TITULAIRE DE DROIT D'AUTEUR QUEL QU'IL SOIT, OU TOUTE PARTIE QUI POURRAIT MODIFIER ET/OU REDISTRIBUER LE PROGRAMME COMME PERMIS CI-DESSUS, NE POURRAIT ETRE TENU POUR RESPONSABLE A VOTRE EGARD DES DOMMAGES, INCLUANT LES DOMMAGES GENERIQUES, SPECIFIQUES, SECONDAIRES OU CONSECUTIFS, RESULTANT DE L'UTILISATION OU DE L'INCAPACITE D'UTILISER LE PROGRAMME (Y COMPRIS, MAIS SANS Y ETRE LIMITE, LA PERTE DE DONNEES, OU LE FAIT QUE DES DONNEES SOIENT RENDUES IMPRECISES, OU LES PERTES EPROUVEES PAR VOUS OU PAR DES TIERS, OU LE FAIT QUE LE PROGRAMME ECHOUE A INTEROPERER AVEC UN AUTRE PROGRAMME QUEL QU'IL SOIT) MEME SI LE DIT TITULAIRE DU DROIT D'AUTEUR OU LE PARTIE CONCERNEE A ETE AVERTI DE L'EVENTUALITE DE TELS DOMMAGES. </p>
<p>
12. EN AUCUN CAS, SAUF LORSQUE LA LOI APPLICABLE OU UNE CONVENTION ECRITE
L'EXIGE, UN TITULAIRE DE DROIT D'AUTEUR QUEL QU'IL SOIT, OU TOUTE PARTIE
QUI POURRAIT MODIFIER ET/OU REDISTRIBUER LE PROGRAMME COMME PERMIS
CI-DESSUS, NE POURRAIT ETRE TENU POUR RESPONSABLE A VOTRE EGARD DES
DOMMAGES, INCLUANT LES DOMMAGES GENERIQUES, SPECIFIQUES, SECONDAIRES OU
CONSECUTIFS, RESULTANT DE L'UTILISATION OU DE L'INCAPACITE D'UTILISER LE
PROGRAMME (Y COMPRIS, MAIS SANS Y ETRE LIMITE, LA PERTE DE DONNEES, OU LE
FAIT QUE DES DONNEES SOIENT RENDUES IMPRECISES, OU LES PERTES EPROUVEES
PAR VOUS OU PAR DES TIERS, OU LE FAIT QUE LE PROGRAMME ECHOUE A
INTEROPERER AVEC UN AUTRE PROGRAMME QUEL QU'IL SOIT) MEME SI LE DIT
TITULAIRE DU DROIT D'AUTEUR OU LE PARTIE CONCERNEE A ETE AVERTI DE
L'EVENTUALITE DE TELS DOMMAGES.
</p> </p>
<h2>FIN DES CONDITIONS</h2> <h2>FIN DES CONDITIONS</h2>
<h2>Comment appliquer ces conditions &agrave; vos nouveaux programmes</h2> <h2>Comment appliquer ces conditions &agrave; vos nouveaux programmes</h2>
<p> Si vous d&eacute;veloppez un nouveau programme, et si vous voulez qu'il soit de la plus grande utilit&eacute; possible pour le public, le meilleur moyen d'y parvenir est d'en faire un logiciel libre que chacun peut redistribuer et modifier au titre des pr&eacute;sentes conditions.</p> <p>
<p>Pour ce faire, munissez le programme des avis qui suivent. Si vous d&eacute;veloppez un nouveau programme, et si vous voulez qu'il
Le plus s<>r est de les ajouter au d&eacute;but de chaque fichier source soit de la plus grande utilit&eacute; possible pour le public, le meilleur
pour v&eacute;hiculer le plus efficacement possible l'absence moyen d'y parvenir est d'en faire un logiciel libre que chacun peut
de toute garantie; chaque fichier devrait aussi contenir au moins redistribuer et modifier au titre des pr&eacute;sentes conditions.
la ligne "copyright" et une indication de l'endroit o&ugrave; se trouve l'avis </p>
<p>
Pour ce faire, munissez le programme des avis qui suivent. Le plus s<>r est
de les ajouter au d&eacute;but de chaque fichier source pour
v&eacute;hiculer le plus efficacement possible l'absence de toute
garantie; chaque fichier devrait aussi contenir au moins la ligne
"copyright" et une indication de l'endroit o&ugrave; se trouve l'avis
compl<70>t. compl<70>t.
</p> </p>
<p> [Une ligne donnant le nom du programme et une courte id&eacute;e de ce qu'il fait.] <p>
[Une ligne donnant le nom du programme et une courte id&eacute;e de ce
qu'il fait.]
</p>
<p>Copyright (C) [ann&eacute;e] [nom de l'auteur]</p>
<p>
Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le
modifier au titre des clauses de la Licence Publique
G&eacute;n&eacute;rale GNU, telle que publi&eacute;e par la Free Software
Foundation ; soit la version 2 de la Licence, ou (&agrave; votre
discr&eacute;tion) une version ult&eacute;rieure quelconque.
</p> </p>
<p> <p>
Copyright (C) [ann&eacute;e] [nom de l'auteur] Ce programme est distribu&eacute; dans l'espoir qu'il sera utile, mais
</p> SANS AUCUNE GARANTIE ; sans m<>me une garantie implicite de COMMERCIABILITE
<p> ou DE CONFORMITE A UNE UTILISATION PARTICULIERE. Voir la Licence Publique
Ce programme est un logiciel libre ; vous pouvez le
redistribuer et/ou le modifier au titre des clauses de la
Licence Publique G&eacute;n&eacute;rale GNU, telle que publi&eacute;e par la Free
Software Foundation ; soit la version 2 de la Licence, ou (&agrave;
votre discr&eacute;tion) une version ult&eacute;rieure quelconque.
</p>
<p>
Ce programme est distribu&eacute; dans l'espoir qu'il sera utile,
mais SANS AUCUNE GARANTIE ; sans m<>me une garantie implicite de
COMMERCIABILITE ou DE CONFORMITE A UNE UTILISATION
PARTICULIERE. Voir la Licence Publique
G&eacute;n&eacute;rale GNU pour plus de d&eacute;tails. G&eacute;n&eacute;rale GNU pour plus de d&eacute;tails.
</p> </p>
<p> <p>
Vous devriez avoir re<72>u un exemplaire de la Licence Publique Vous devriez avoir re<72>u un exemplaire de la Licence Publique
G&eacute;n&eacute;rale GNU avec ce programme ; si ce n'est pas le cas, G&eacute;n&eacute;rale GNU avec ce programme ; si ce n'est pas le cas,
&eacute;crivez &agrave; la Free Software Foundation Inc., 51 Franklin &eacute;crivez &agrave; la Free Software Foundation Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.</p> Street, Fifth Floor, Boston, MA 02110-1301, USA.
<p>Ajoutez aussi des informations sur la mani&egrave;re de vous contacter
par courrier &eacute;lectronique et courrier postal.</p>
<p>Si le programme est interactif, faites en sorte qu'il
affiche un court avis tel que celui-ci lorsqu'il d&eacute;marre en
mode interactif :
</p>
<p>Gnomovision version 69, Copyright (C) ann&eacute;e nom de l'auteur
Gnomovision n'est accompagn&eacute; d'ABSOLUMENT AUCUNE GARANTIE ; pour plus de
d&eacute;tails tapez "show w". Ceci est un logiciel libre et vous <20>tes
invit&eacute; &agrave; le redistribuer en respectant certaines obligations ; pour plus
de d&eacute;tails tapez "show c".</p>
<p>Les instructions hypoth&eacute;tiques "show w" et "show c" sont suppos&eacute;es montrer
les parties ad hoc de la Licence Publique G&eacute;n&eacute;rale. Bien
entendu, les instructions que vous utilisez peuvent porter d'autres
noms que "show w" et "show c" ; elles peuvent m<>me <20>tre des
clics de souris ou des &eacute;l&eacute;ments d'un menu ou tout ce qui convient &agrave;
votre programme.</p>
<p>Vous devriez aussi obtenir de votre employeur (si vous
travaillez en tant que d&eacute;veloppeur) ou de votre &eacute;cole, si c'est
le cas, qu'il (ou elle) signe une "renonciation aux droits
d'auteur" concernant le programme, si n&eacute;cessaire. Voici un
exemple (changez les noms) :
</p>
<p>Yoyodyne, Inc., d&eacute;clare par la pr&eacute;sente renoncer &agrave; toute pr&eacute;tention
sur les droits d'auteur du programme "Gnomovision" (qui fait des
avances aux compilateurs) &eacute;crit par James Hacker.
</p> </p>
<p> <p>
[signature de Ty Coon], 1er avril 1989 Ajoutez aussi des informations sur la mani&egrave;re de vous contacter par
courrier &eacute;lectronique et courrier postal.
</p> </p>
<p> <p>
Ty Coon, President du Vice</p> Si le programme est interactif, faites en sorte qu'il affiche un court
<p>La pr&eacute;sente Licence Publique G&eacute;n&eacute;rale n'autorise pas l'incorporation de votre avis tel que celui-ci lorsqu'il d&eacute;marre en mode interactif :
programme dans des programmes </p>
<p>
Gnomovision version 69, Copyright (C) ann&eacute;e nom de l'auteur
Gnomovision n'est accompagn&eacute; d'ABSOLUMENT AUCUNE GARANTIE ; pour
plus de d&eacute;tails tapez "show w". Ceci est un logiciel libre et vous
<20>tes invit&eacute; &agrave; le redistribuer en respectant certaines
obligations ; pour plus de d&eacute;tails tapez "show c".
</p>
<p>
Les instructions hypoth&eacute;tiques "show w" et "show c" sont
suppos&eacute;es montrer les parties ad hoc de la Licence Publique
G&eacute;n&eacute;rale. Bien entendu, les instructions que vous utilisez
peuvent porter d'autres noms que "show w" et "show c" ; elles peuvent m<>me
<20>tre des clics de souris ou des &eacute;l&eacute;ments d'un menu ou tout
ce qui convient &agrave; votre programme.
</p>
<p>
Vous devriez aussi obtenir de votre employeur (si vous travaillez en tant
que d&eacute;veloppeur) ou de votre &eacute;cole, si c'est le cas, qu'il
(ou elle) signe une "renonciation aux droits d'auteur" concernant le
programme, si n&eacute;cessaire. Voici un exemple (changez les noms) :
</p>
<p>
Yoyodyne, Inc., d&eacute;clare par la pr&eacute;sente renoncer &agrave;
toute pr&eacute;tention sur les droits d'auteur du programme "Gnomovision"
(qui fait des avances aux compilateurs) &eacute;crit par James Hacker.
</p>
<p>[signature de Ty Coon], 1er avril 1989</p>
<p>Ty Coon, President du Vice</p>
<p>
La pr&eacute;sente Licence Publique G&eacute;n&eacute;rale n'autorise pas
l'incorporation de votre programme dans des programmes
propri&eacute;taires. Si votre programme est une biblioth&egrave;que de propri&eacute;taires. Si votre programme est une biblioth&egrave;que de
sous-programmes, vous pouvez consid&eacute;rer plus utile sous-programmes, vous pouvez consid&eacute;rer plus utile d'autoriser
d'autoriser l'&eacute;dition de liens d'applications propri&eacute;taires avec l'&eacute;dition de liens d'applications propri&eacute;taires avec la
la biblioth&egrave;que. Si c'est ce que vous voulez faire, utilisez la biblioth&egrave;que. Si c'est ce que vous voulez faire, utilisez la GNU
GNU Lesser General Public License au lieu de la pr&eacute;sente Licence. Lesser General Public License au lieu de la pr&eacute;sente Licence.
</p> </p>
</body> </body>
</html> </html>

View File

@ -3,28 +3,41 @@
<title>Licenze GNU</title> <title>Licenze GNU</title>
</head> </head>
<body> <body>
<h3>Licenze GNU</h3> <h3>Licenze GNU</h3>
<h4>Sommario</h4> <h4>Sommario</h4>
<ul> <ul>
<li><a href="#Intro" id="TOIntro">Introduzione</a></li> <li><a href="#Intro" id="TOIntro">Introduzione</a></li>
<li><a href="#GPL" id="TOCGPL"> <li><a href="#GPL" id="TOCGPL"> La Licenza Pubblica Generica GNU</a></li>
La Licenza Pubblica Generica GNU</a></li> <li>
<li><a href="#LGPL" <a href="#LGPL" id="TOCLGPL"
id="TOCLGPL">La Licenza Pubblica Generica Attenuata GNU</a></li> >La Licenza Pubblica Generica Attenuata GNU</a
<li><a href="#FDL" >
id="TOCFDL">La Licenza per Documentazione Libera GNU</a></li> </li>
<li><a href="#VerbatimCopying" <li>
id="TOCVerbatimCopying">Copie letterali e distribuzione</a></li> <a href="#FDL" id="TOCFDL">La Licenza per Documentazione Libera GNU</a>
<li><a href="#LicenseList" </li>
id="TOCLicenseList">Elenco di licenze per il software libero</a></li> <li>
<li><a href="#WhatIsCopyleft" <a href="#VerbatimCopying" id="TOCVerbatimCopying"
id="TOCWhatIsCopyleft">Cos'&egrave; il permesso d'autore (copyleft)?</a></li> >Copie letterali e distribuzione</a
<li><a href="#OtherWorks" >
id="TOCOtherWorks">Licenze per altri tipi di opere</a></li> </li>
<li>
<a href="#LicenseList" id="TOCLicenseList"
>Elenco di licenze per il software libero</a
>
</li>
<li>
<a href="#WhatIsCopyleft" id="TOCWhatIsCopyleft"
>Cos'&egrave; il permesso d'autore (copyleft)?</a
>
</li>
<li>
<a href="#OtherWorks" id="TOCOtherWorks"
>Licenze per altri tipi di opere</a
>
</li>
</ul> </ul>
<hr /> <hr />
@ -32,85 +45,93 @@
<h3><a href="TOCIntro" id="Intro">Introduzione</a></h3> <h3><a href="TOCIntro" id="Intro">Introduzione</a></h3>
<p> <p>
Tutto il software pubblicato dovrebbe essere software libero. Perch&eacute; sia Tutto il software pubblicato dovrebbe essere software libero.
libero, bisogna pubblicarlo con una licenza per il software libero. Perch&eacute; sia libero, bisogna pubblicarlo con una licenza per il
Normalmente utilizziamo la <a href="GPL">Licenza software libero. Normalmente utilizziamo la
Pubblica Generica GNU</a> (GNU GPL), ma talvolta utilizziamo anche <a <a href="GPL">Licenza Pubblica Generica GNU</a> (GNU GPL), ma talvolta
href="LicenseList">altre licenze per software utilizziamo anche
libero</a>. Per il software GNU utilizziamo solo licenze compatibili <a href="LicenseList">altre licenze per software libero</a>. Per il
con la GNU GPL. software GNU utilizziamo solo licenze compatibili con la GNU GPL.
</p> </p>
<p> <p>
La documentazione per il software libero dovrebbe La documentazione per il software libero dovrebbe essere documentazione
essere documentazione libera, in modo che si possa distribuire e migliorare assieme al software
libera, in modo che si possa distribuire e migliorare assieme al che essa descrive. Per rendere libera la documentazione occorre
software che essa descrive. Per rendere libera la documentazione rilasciarla con una licenza di documentazione libera. Normalmente
occorre rilasciarla con una licenza di documentazione utilizziamo la
libera. Normalmente utilizziamo <a href="FDL">Licenza per Documentazione Libera GNU</a> (GNU FDL), ma
la <a href="FDL">Licenza per Documentazione Libera talvolta utilizziamo anche
GNU</a> (GNU FDL), ma talvolta utilizziamo <a href="LicenseList">altre licenze per la documentazione libera</a>.
anche <a href="LicenseList">altre licenze per la
documentazione libera</a>.
</p> </p>
<h3><a href="TOCGPL" <h3><a href="TOCGPL" id="GPL">La Licenza Pubblica Generica GNU</a></h3>
id="GPL">La Licenza Pubblica Generica GNU</a></h3>
<p> <p>
La Licenza Pubblica Generica GNU &egrave; spesso indicata brevemente come GNU La Licenza Pubblica Generica GNU &egrave; spesso indicata brevemente come
GPL; &egrave; usata dalla maggioranza dei programmi GNU, e da pi&ugrave; della met&agrave; di GNU GPL; &egrave; usata dalla maggioranza dei programmi GNU, e da
tutti i pacchetti di software libero. pi&ugrave; della met&agrave; di tutti i pacchetti di software libero.
</p> </p>
<h3><a href="TOCLGPL" <h3>
id="LGPL">Licenza Pubblica Generica Attenuata GNU</a></h3> <a href="TOCLGPL" id="LGPL">Licenza Pubblica Generica Attenuata GNU</a>
</h3>
<p> <p>
La Licenza Pubblica Generica Attenuata GNU &egrave; utilizzata da alcune (non La Licenza Pubblica Generica Attenuata GNU &egrave; utilizzata da alcune
tutte) delle librerie GNU. Questa licenza era originariamente chiamata (non tutte) delle librerie GNU. Questa licenza era originariamente
la GPL per Librerie, ma in seguito le cambiammo nome perch&eacute; il vecchio chiamata la GPL per Librerie, ma in seguito le cambiammo nome
nome ne incoraggiava un uso pi&ugrave; frequente del dovuto. perch&eacute; il vecchio nome ne incoraggiava un uso pi&ugrave; frequente
del dovuto.
</p> </p>
<h3>
<h3><a href="TOCFDL" <a href="TOCFDL" id="FDL">La Licenza per Documentazione Libera GNU</a>
id="FDL">La Licenza per Documentazione Libera GNU</a></h3> </h3>
<p> <p>
La licenza di Documentazione Libera &egrave; una forma di permesso d'autore La licenza di Documentazione Libera &egrave; una forma di permesso
(copyleft) pensata per un manuale, libro di testo o altro documento, in d'autore (copyleft) pensata per un manuale, libro di testo o altro
modo da garantire a chiunque l'effettiva libert&agrave; di usarlo e documento, in modo da garantire a chiunque l'effettiva libert&agrave; di
distribuirlo, con o senza modifiche, commercialmente o meno. usarlo e distribuirlo, con o senza modifiche, commercialmente o meno.
</p> </p>
<h3><a href="TOCVerbatimCopying" <h3>
id="VerbatimCopying">Copie letterali e distribuzione</a></h3> <a href="TOCVerbatimCopying" id="VerbatimCopying"
>Copie letterali e distribuzione</a
>
</h3>
<p> <p>
La nota standard di copyright per le pagine web GNU recita: <em>La copia La nota standard di copyright per le pagine web GNU recita:
letterale e la distribuzione di questo articolo nella sua integrit&agrave; sono <em
permesse con qualsiasi mezzo, a condizione che questa nota sia >La copia letterale e la distribuzione di questo articolo nella sua
riprodotta</em>. Si tenga presente questo commento di Eben Moglen: integrit&agrave; sono permesse con qualsiasi mezzo, a condizione che
questa nota sia riprodotta</em
>. Si tenga presente questo commento di Eben Moglen:
</p> </p>
<p> <p>
&laquo;Con la frase "copia letterale con qualsiasi mezzo" non intendiamo &laquo;Con la frase "copia letterale con qualsiasi mezzo" non intendiamo
richiedere il mantenimento di intestazioni, pi&egrave; di pagina o altre richiedere il mantenimento di intestazioni, pi&egrave; di pagina o altre
caratteristiche di formattazione. Si richiede tuttavia di mantenere link caratteristiche di formattazione. Si richiede tuttavia di mantenere link
web sia per i media ipertestuali sia per quelli non ipertestuali (in web sia per i media ipertestuali sia per quelli non ipertestuali (in forma
forma di note o URL riportate letteralmente su media non HTML).&raquo; di note o URL riportate letteralmente su media non HTML).&raquo;
</p> </p>
<h3><a href="TOCLicenseList" <h3>
id="LicenseList">Elenco di licenze per il software libero</a></h3> <a href="TOCLicenseList" id="LicenseList"
>Elenco di licenze per il software libero</a
>
</h3>
<ul> <ul>
<li> <li>
Elenco di licenze per il software libero Elenco di licenze per il software libero
<p> Se state pensando di scrivere una nuova licenza, vi preghiamo di <p>
contattare la FSF scrivendo a <a Se state pensando di scrivere una nuova licenza, vi preghiamo di
href="mailto:licensing@fsf.org">&lt;licensing@fsf.org&gt;</a>. Il contattare la FSF scrivendo a
<a href="mailto:licensing@fsf.org">&lt;licensing@fsf.org&gt;</a>. Il
proliferare di diverse licenze di software libero significa un aumento proliferare di diverse licenze di software libero significa un aumento
di lavoro per gli utenti per la loro comprensione. Potremmo essere in di lavoro per gli utenti per la loro comprensione. Potremmo essere in
grado di aiutarvi a trovare una licenza esistente per software libero grado di aiutarvi a trovare una licenza esistente per software libero
@ -118,72 +139,73 @@ che soddisfi le vostre esigenze.
</p> </p>
<p> <p>
Nel caso ci&ograve; non sia possibile, se effettivamente avete bisogno di una Nel caso ci&ograve; non sia possibile, se effettivamente avete bisogno
nuova licenza con il nostro aiuto potete assicuravi che la vostra di una nuova licenza con il nostro aiuto potete assicuravi che la
licenza sia effettivamente una licenza per software libero, ed evitare vostra licenza sia effettivamente una licenza per software libero, ed
vari problemi pratici. evitare vari problemi pratici.
</p> </p>
</li> </li>
</ul> </ul>
<h3><a href="TOCWhatIsCopyleft" <h3>
id="WhatIsCopyleft">Cos'&egrave; il permesso d'autore (copyleft)?</a></h3> <a href="TOCWhatIsCopyleft" id="WhatIsCopyleft"
>Cos'&egrave; il permesso d'autore (copyleft)?</a
>
</h3>
<p> <p>
Il <em>permesso d'autore</em> (<em>copyleft</em>) &egrave; un metodo generico Il <em>permesso d'autore</em> (<em>copyleft</em>) &egrave; un metodo
per rendere un programma libero ed imporre che tutte le modifiche e generico per rendere un programma libero ed imporre che tutte le modifiche
versioni estese del programma siano anch'esse software libero. e versioni estese del programma siano anch'esse software libero.
</p> </p>
<p> <p>
[NdT: si tratta di un gioco di parole, che qui viene reso con "permesso [NdT: si tratta di un gioco di parole, che qui viene reso con "permesso di
di autore": copyright (diritto di autore) &egrave; formato dalle parola "copy" autore": copyright (diritto di autore) &egrave; formato dalle parola
(copia) e "right" (diritto, ma anche destra), opposto di "left" "copy" (copia) e "right" (diritto, ma anche destra), opposto di "left"
(sinistra, ma anche lasciato).] (sinistra, ma anche lasciato).]
</p> </p>
<p> <p>
Il modo pi&ugrave; semplice per rendere un programma libero &egrave; dichiararlo di dominio Il modo pi&ugrave; semplice per rendere un programma libero &egrave;
pubblico, privo di copyright. [NdT: in Italia questo concetto a dichiararlo di dominio pubblico, privo di copyright. [NdT: in Italia
rigore non esiste, perch&eacute; l'autore non pu&ograve; rinunciare alla paternit&agrave; questo concetto a rigore non esiste, perch&eacute; l'autore non pu&ograve;
dell'opera; effetti simili si possono ottenere con l'uso di una licenza rinunciare alla paternit&agrave; dell'opera; effetti simili si possono
permissiva, come la licenza di X del MIT]. Ci&ograve; permette a chiunque di ottenere con l'uso di una licenza permissiva, come la licenza di X del
condividere il programma e i suoi miglioramenti. Tuttavia permette anche MIT]. Ci&ograve; permette a chiunque di condividere il programma e i suoi
a chi non vuol cooperare di convertire il programma in software miglioramenti. Tuttavia permette anche a chi non vuol cooperare di
proprietario. Costoro possono infatti apportare modifiche, che convertire il programma in software proprietario. Costoro possono infatti
siano significative o meno, e distribuire il risultato come prodotto apportare modifiche, che siano significative o meno, e distribuire il
proprietario. Chi riceve il programma nella forma modificata non ha la risultato come prodotto proprietario. Chi riceve il programma nella forma
libert&agrave; data dall'autore originario; l'intermediario l'avr&agrave; rimossa. modificata non ha la libert&agrave; data dall'autore originario;
l'intermediario l'avr&agrave; rimossa.
</p> </p>
<p> <p>
Nel Progetto GNU, la nostra Nel Progetto GNU, la nostra intenzione &egrave; dare a <em>tutti</em> gli
intenzione &egrave; dare a <em>tutti</em> gli utenti la libert&agrave; di utenti la libert&agrave; di ridistribuire e modificare software GNU. Se
ridistribuire e modificare software GNU. Se l'intermediario potesse l'intermediario potesse rimuoverne la libert&agrave;, potremmo avere molti
rimuoverne la libert&agrave;, potremmo avere molti utenti, ma costoro non utenti, ma costoro non avrebbero libert&agrave;. Cos&igrave;, invece di
avrebbero libert&agrave;. Cos&igrave;, invece di rilasciare il software GNU come rilasciare il software GNU come dominio pubblico, utilizziamo il permesso
dominio pubblico, utilizziamo il permesso d'autore. Il permesso d'autore. Il permesso d'autore (copyleft) significa che chiunque
d'autore (copyleft) significa che chiunque distribuisca il software, con distribuisca il software, con o senza modifiche, deve accompagnarlo con la
o senza modifiche, deve accompagnarlo con la libert&agrave; di ulteriori libert&agrave; di ulteriori copie o modifiche. Il permesso d'autore
copie o modifiche. Il permesso d'autore garantisce che ogni utente sia garantisce che ogni utente sia libero.
libero.
</p> </p>
<p> <p>
Il permesso d'autore costituisce anche un incentivo per altri Il permesso d'autore costituisce anche un incentivo per altri
programmatori ad incrementare il software libero. Alcuni programmi programmatori ad incrementare il software libero. Alcuni programmi liberi
liberi importanti, come il compilatore GNU C++, esistono solo grazie a importanti, come il compilatore GNU C++, esistono solo grazie a questo.
questo.
</p> </p>
<p> <p>
Il permesso d'autore aiuta anche i programmatori che desiderano Il permesso d'autore aiuta anche i programmatori che desiderano
contribuire con miglioramenti al software libero ad ottenerne il contribuire con miglioramenti al software libero ad ottenerne il permesso.
permesso. Questi programmatori spesso lavorano per aziende o universit&agrave; Questi programmatori spesso lavorano per aziende o universit&agrave; che
che farebbero quasi qualunque cosa per avere pi&ugrave; denaro. Un farebbero quasi qualunque cosa per avere pi&ugrave; denaro. Un
programmatore potrebbe voler cedere le sue modifiche alla comunit&agrave;, ma programmatore potrebbe voler cedere le sue modifiche alla comunit&agrave;,
il suo superiore potrebbe volerne fare un prodotto software ma il suo superiore potrebbe volerne fare un prodotto software
proprietario. proprietario.
</p> </p>
@ -196,26 +218,27 @@ decidono di rilasciarla come software libero piuttosto che buttarla via.
<p> <p>
Nel rendere un programma copyleft, per prima cosa mettiamo in chiaro che Nel rendere un programma copyleft, per prima cosa mettiamo in chiaro che
&egrave; soggetto a diritto d'autore; poi aggiungiamo le condizioni di &egrave; soggetto a diritto d'autore; poi aggiungiamo le condizioni di
distribuzione, che sono uno strumento legale per dare a chiunque i distribuzione, che sono uno strumento legale per dare a chiunque i diritti
diritti d'uso, di modifica e ridistribuzione del codice del programma d'uso, di modifica e ridistribuzione del codice del programma
<em>ed ogni programma da esso derivato</em>, ma solo se si lasciano <em>ed ogni programma da esso derivato</em>, ma solo se si lasciano
invariati i termini di distribuzione. Cos&igrave;, il codice e le libert&agrave; invariati i termini di distribuzione. Cos&igrave;, il codice e le
divengono legalmente inseparabili. libert&agrave; divengono legalmente inseparabili.
</p> </p>
<p> <p>
Gli sviluppatori di software proprietario utilizzano il diritto d'autore Gli sviluppatori di software proprietario utilizzano il diritto d'autore
per togliere la libert&agrave; agli utenti. Noi lo utilizziamo per garantire la per togliere la libert&agrave; agli utenti. Noi lo utilizziamo per
loro libert&agrave;. Ecco perch&eacute; invertiamo il termine, trasformando "diritto garantire la loro libert&agrave;. Ecco perch&eacute; invertiamo il
d'autore" in "permesso d'autore" ("copyright" in "copyleft"). termine, trasformando "diritto d'autore" in "permesso d'autore"
("copyright" in "copyleft").
</p> </p>
<p> <p>
Il permesso d'autore &egrave; un concetto generale; ci sono molti modi di Il permesso d'autore &egrave; un concetto generale; ci sono molti modi di
completare i dettagli. Nel Progetto GNU, le specifiche condizioni di completare i dettagli. Nel Progetto GNU, le specifiche condizioni di
distribuzione che utilizziamo sono contenute nella Licenza Pubblica distribuzione che utilizziamo sono contenute nella Licenza Pubblica
Generica GNU, la Licenza Pubblica Generica Attenuata GNU e la Licenza Generica GNU, la Licenza Pubblica Generica Attenuata GNU e la Licenza per
per Documentazione Libera GNU. Documentazione Libera GNU.
</p> </p>
<p> <p>
@ -224,56 +247,58 @@ distribuzione di codice sorgente GNU.
</p> </p>
<p> <p>
La GNU GPL &egrave; progettata perch&eacute; possiate applicarla facilmente ai vostri La GNU GPL &egrave; progettata perch&eacute; possiate applicarla
programmi se siete i titolari dei relativi diritti. Per far questo non facilmente ai vostri programmi se siete i titolari dei relativi diritti.
dovete modificare la GNU GPL ma solo aggiungere nel programma una nota Per far questo non dovete modificare la GNU GPL ma solo aggiungere nel
che vi faccia riferimento. Vi preghiamo di tener presente che se usate programma una nota che vi faccia riferimento. Vi preghiamo di tener
la GNU GPL dovete usare il testo integrale della licenza. E' un tutto presente che se usate la GNU GPL dovete usare il testo integrale della
unico, versioni parziali non sono consentite (lo stesso vale per la LGPL licenza. E' un tutto unico, versioni parziali non sono consentite (lo
e la FDL). stesso vale per la LGPL e la FDL).
</p> </p>
<p> <p>
Usare gli stessi termini di distribuzione per molti programmi rende Usare gli stessi termini di distribuzione per molti programmi rende facile
facile copiare codice tra programmi diversi. Dato che tutti hanno gli copiare codice tra programmi diversi. Dato che tutti hanno gli stessi
stessi termini di distribuzione, non c'&egrave; bisogno di preoccuparsi se i termini di distribuzione, non c'&egrave; bisogno di preoccuparsi se i
termini siano compatibili. La GPL Attenuata include una clausola che termini siano compatibili. La GPL Attenuata include una clausola che
permette di trasformare i termini di distribuzione nella GPL ordinaria, permette di trasformare i termini di distribuzione nella GPL ordinaria, in
in modo che possiate copiare codice in un altro programma coperto dalla modo che possiate copiare codice in un altro programma coperto dalla GPL.
GPL.
</p> </p>
<h3><a href="TOCOtherWorks" <h3>
id="OtherWorks">Licenze per altri tipi di opere</a></h3> <a href="TOCOtherWorks" id="OtherWorks"
>Licenze per altri tipi di opere</a
>
</h3>
<p> <p>
Noi crediamo che il software e la documentazione che si pubblicano Noi crediamo che il software e la documentazione che si pubblicano debbano
debbano essere <a href="Intro">software libero e essere <a href="Intro">software libero e documentazione libera</a>.
documentazione libera</a>. Consigliamo di rendere ugualmente libera Consigliamo di rendere ugualmente libera ogni genere di opera educativa e
ogni genere di opera educativa e di riferimento, utilizzando licenze di di riferimento, utilizzando licenze di documentazione libera come la
documentazione libera come la <a href="FDL">Licenza per <a href="FDL">Licenza per Documentazione Libera GNU</a> (GNU FDL).
Documentazione Libera GNU</a> (GNU FDL).
</p> </p>
<p> <p>
Per saggi o pubblicazioni scientifiche, consigliamo la semplice licenza Per saggi o pubblicazioni scientifiche, consigliamo la semplice licenza di
di "copia letterale" utilizzata ad esempio per questa pagina Web.</p> "copia letterale" utilizzata ad esempio per questa pagina Web.
</p>
<p> <p>
Non prendiamo posizione sull'idea che i lavori artistici o letterari Non prendiamo posizione sull'idea che i lavori artistici o letterari
debbano essere liberi, ma se volete fare in modo che un vostro lavoro debbano essere liberi, ma se volete fare in modo che un vostro lavoro lo
lo sia vi consigliamo la <a href="http://artlibre.org/licence/lalgb.html">Free sia vi consigliamo la
Art License</a> (in inglese).</p> <a href="http://artlibre.org/licence/lalgb.html">Free Art License</a> (in
inglese).
</p>
<p> <p>
Copyright (C) 1996, 1997, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc., Copyright (C) 1996, 1997, 1998, 1999, 2003, 2004, 2005 Free Software
51 Franklin St, Fifth Floor, Boston, MA 02110, USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
<br /> <br />
La copia letterale e la distribuzione di questo articolo nella sua La copia letterale e la distribuzione di questo articolo nella sua
integrit&agrave; sono permesse con qualsiasi mezzo gratuitamente a integrit&agrave; sono permesse con qualsiasi mezzo gratuitamente a
condizione che questa nota sia riprodotta. condizione che questa nota sia riprodotta.
</p> </p>
</body> </body>
</html> </html>

View File

@ -1,31 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html> <html>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>GNU 一般公衆利用許諾契約書 - GNU プロジェクト - フリーソフトウェア財団 (FSF)</title> <title>
GNU 一般公衆利用許諾契約書 - GNU プロジェクト - フリーソフトウェア財団
(FSF)
</title>
</head> </head>
<body> <body>
本訳は、<a href="http://www.opensource.jp/gpl/gpl.ja.html.euc-jp"
>http://www.opensource.jp/gpl/gpl.ja.html.euc-jp</a
>より転載している。
本訳は、<a href="http://www.opensource.jp/gpl/gpl.ja.html.euc-jp">http://www.opensource.jp/gpl/gpl.ja.html.euc-jp</a>より転載している。 <hr />
<hr>
<h2>GNU 一般公衆利用許諾契約書</h2> <h2>GNU 一般公衆利用許諾契約書</h2>
<h3>もくじ</h3> <h3>もくじ</h3>
<ul> <ul>
<li>
<li><a href="#SEC1">GNU 一般公衆利用許諾契約書</a> <a href="#SEC1">GNU 一般公衆利用許諾契約書</a>
<ul> <ul>
<li><a href="#SEC2">はじめに</a></li> <li><a href="#SEC2">はじめに</a></li>
<li><a href="#SEC3">複製、頒布、改変に関する条件と制約</a></li> <li><a href="#SEC3">複製、頒布、改変に関する条件と制約</a></li>
</ul> </ul>
</li>
</ul> </ul>
<hr>
<p> <hr />
<p></p>
<h3><a name="SEC1">GNU 一般公衆利用許諾契約書</a></h3> <h3><a name="SEC1">GNU 一般公衆利用許諾契約書</a></h3>
<p> <p>
バージョン 2、1991年6月<br> バージョン 2、1991年6月<br />
日本語訳、2002年8月28日 日本語訳、2002年8月28日
</p> </p>
@ -35,15 +41,16 @@ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
この利用許諾契約書を、一字一句そのままに複製し頒布することは許可する。 この利用許諾契約書を、一字一句そのままに複製し頒布することは許可する。
しかし変更は認めない。 しかし変更は認めない。
</pre> </pre
>
<blockquote> <blockquote>
This is an unofficial translation of the GNU General Public License This is an unofficial translation of the GNU General Public License into
into Japanese. It was not published by the Free Software Foundation, Japanese. It was not published by the Free Software Foundation, and does
and does not legally state the distribution terms for software that not legally state the distribution terms for software that uses the GNU
uses the GNU GPL--only the original English text of the GNU GPL does GPL--only the original English text of the GNU GPL does that. However, we
that. However, we hope that this translation will help Japanese hope that this translation will help Japanese speakers understand the GNU
speakers understand the GNU GPL better. GPL better.
</blockquote> </blockquote>
<blockquote> <blockquote>
@ -56,12 +63,13 @@ speakers understand the GNU GPL better.
でいます。) でいます。)
</blockquote> </blockquote>
<BLOCKQUOTE> <blockquote>
翻訳は 八田真行&lt;<A 翻訳は 八田真行&lt;<a href="mailto:mhatta@gnu.org">mhatta@gnu.org</a
HREF="mailto:mhatta@gnu.org">mhatta@gnu.org</A>&gt;が行った。原文は<A >&gt;が行った。原文は<a href="http://www.gnu.org/licenses/gpl.html"
HREF="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</A> >http://www.gnu.org/licenses/gpl.html</a
>
である。誤訳の指摘や改善案を歓迎する。 である。誤訳の指摘や改善案を歓迎する。
</BLOCKQUOTE> </blockquote>
<h3><a name="SEC2">はじめに</a></h3> <h3><a name="SEC2">はじめに</a></h3>
@ -71,13 +79,12 @@ HREF="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html
衆利用許諾契約書は、あなたがフリーソフトウェアを共有したり変更したりす 衆利用許諾契約書は、あなたがフリーソフトウェアを共有したり変更したりす
る自由を保証する--すなわち、ソフトウェアがそのユーザすべてにとってフリー る自由を保証する--すなわち、ソフトウェアがそのユーザすべてにとってフリー
であることを保証することを目的としています。この一般公衆利用許諾契約書 であることを保証することを目的としています。この一般公衆利用許諾契約書
はフリーソフトウェア財団のソフトウェアのほとんどに適用されており、また はフリーソフトウェア財団のソフトウェアのほとんどに適用されており、また GNU
GNU GPLを適用すると決めたフリーソフトウェア財団以外の作者によるプログ GPLを適用すると決めたフリーソフトウェア財団以外の作者によるプログ
ラムにも適用されています(いくつかのフリーソフトウェア財団のソフトウェ ラムにも適用されています(いくつかのフリーソフトウェア財団のソフトウェ
アには、GNU GPLではなくGNU ライブラリ一般公衆利用許諾契約書が適用され アには、GNU GPLではなくGNU ライブラリ一般公衆利用許諾契約書が適用され
ています)。あなたもまた、ご自分のプログラムにGNU GPLを適用することが可 ています)。あなたもまた、ご自分のプログラムにGNU GPLを適用することが可
能です。 能です。
</p> </p>
<p> <p>
私たちがフリーソフトウェアと言うとき、それは利用の自由について言及して 私たちがフリーソフトウェアと言うとき、それは利用の自由について言及して
@ -89,7 +96,6 @@ GNU GPLを適用すると決めたフリーソフトウェア財団以外の作
一部を新たなフリーのプログラムで利用できるということ、そして、以上で述 一部を新たなフリーのプログラムで利用できるということ、そして、以上で述
べたようなことができるということがあなたに知らされるということも保証さ べたようなことができるということがあなたに知らされるということも保証さ
れます。 れます。
</p> </p>
<p> <p>
あなたの権利を守るため、私たちは誰かがあなたの有するこれらの権利を否定 あなたの権利を守るため、私たちは誰かがあなたの有するこれらの権利を否定
@ -97,7 +103,6 @@ GNU GPLを適用すると決めたフリーソフトウェア財団以外の作
を加える必要があります。よって、あなたがソフトウェアの複製物を頒布した を加える必要があります。よって、あなたがソフトウェアの複製物を頒布した
りそれを変更したりする場合には、そういった制限のためにあなたにある種の りそれを変更したりする場合には、そういった制限のためにあなたにある種の
責任が発生することになります。 責任が発生することになります。
</p> </p>
<p> <p>
例えば、あなたがフリーなプログラムの複製物を頒布する場合、有料か無料に 例えば、あなたがフリーなプログラムの複製物を頒布する場合、有料か無料に
@ -106,13 +111,11 @@ GNU GPLを適用すると決めたフリーソフトウェア財団以外の作
保証しなければなりません。そして、あなたは彼らに対して以下で述べる条件 保証しなければなりません。そして、あなたは彼らに対して以下で述べる条件
を示し、彼らに自らの持つ権利について知らしめるようにしなければなりませ を示し、彼らに自らの持つ権利について知らしめるようにしなければなりませ
ん。 ん。
</p> </p>
<p> <p>
私たちはあなたの権利を二段階の手順を踏んで保護します。(1) まずソフトウェ 私たちはあなたの権利を二段階の手順を踏んで保護します。(1) まずソフトウェ
アに対して著作権を主張し、そして (2) あなたに対して、ソフトウェアの複 アに対して著作権を主張し、そして (2) あなたに対して、ソフトウェアの複
製や頒布または改変についての法的な許可を与えるこの契約書を提示します。 製や頒布または改変についての法的な許可を与えるこの契約書を提示します。
</p> </p>
<p> <p>
また、各作者や私たちを保護するため、私たちはこのフリーソフトウェアには また、各作者や私たちを保護するため、私たちはこのフリーソフトウェアには
@ -121,7 +124,6 @@ GNU GPLを適用すると決めたフリーソフトウェア財団以外の作
の受領者は彼らが手に入れたソフトウェアがオリジナルのバージョンでは無い の受領者は彼らが手に入れたソフトウェアがオリジナルのバージョンでは無い
こと、そして原作者の名声は他人によって持ち込まれた可能性のある問題によっ こと、そして原作者の名声は他人によって持ち込まれた可能性のある問題によっ
て影響されることがないということを周知させたいと思います。 て影響されることがないということを周知させたいと思います。
</p> </p>
<p> <p>
最後に、ソフトウェア特許がいかなるフリーのプログラムの存在にも不断の脅 最後に、ソフトウェア特許がいかなるフリーのプログラムの存在にも不断の脅
@ -130,28 +132,24 @@ GNU GPLを適用すると決めたフリーソフトウェア財団以外の作
まうという危険を避けたいと思います。こういった事態を予防するため、私た まうという危険を避けたいと思います。こういった事態を予防するため、私た
ちはいかなる特許も誰もが自由に利用できるようライセンスされるか、全くラ ちはいかなる特許も誰もが自由に利用できるようライセンスされるか、全くラ
イセンスされないかのどちらかでなければならないことを明確にしました。 イセンスされないかのどちらかでなければならないことを明確にしました。
</p> </p>
<blockquote> <blockquote>
(訳注: 本契約書で「独占的(proprietary)」とは、ソフトウェアの利用や再頒 (訳注: 本契約書で「独占的(proprietary)」とは、ソフトウェアの利用や再頒
布、改変が禁止されているか、許可を得ることが必要とされているか、あるい 布、改変が禁止されているか、許可を得ることが必要とされているか、あるい
は厳しい制限が課せられていて自由にそうすることが事実上できなくなってい は厳しい制限が課せられていて自由にそうすることが事実上できなくなってい
る状態のことを指す。詳しくは<a href="http://www.gnu.org/philosophy/categories.ja.html#ProprietarySoftware">http://www.gnu.org/philosophy/categories.ja.html#ProprietarySoftware</a> る状態のことを指す。詳しくは<a
href="http://www.gnu.org/philosophy/categories.ja.html#ProprietarySoftware"
>http://www.gnu.org/philosophy/categories.ja.html#ProprietarySoftware</a
>
を参照せよ。) を参照せよ。)
</blockquote> </blockquote>
<p> <p>複製や頒布、改変についての正確な条件と制約を以下で述べていきます。</p>
複製や頒布、改変についての正確な条件と制約を以下で述べていきます。
</p>
<h3><a name="SEC3">複製、頒布、改変に関する条件と制約</a></h3> <h3><a name="SEC3">複製、頒布、改変に関する条件と制約</a></h3>
<p> <p>
<strong>0.</strong> <strong>0.</strong>
この利用許諾契約書は、そのプログラム(またはその他の著作物)をこの一般公 この利用許諾契約書は、そのプログラム(またはその他の著作物)をこの一般公
衆利用許諾契約書の定める条件の下で頒布できる、という告知が著作権者によっ 衆利用許諾契約書の定める条件の下で頒布できる、という告知が著作権者によっ
@ -163,16 +161,16 @@ GNU GPLを適用すると決めたフリーソフトウェア財団以外の作
他の言語に翻訳された形で含む著作物のことである(「改変」という語の本来 他の言語に翻訳された形で含む著作物のことである(「改変」という語の本来
の意味からはずれるが、以下では翻訳も改変の一種と見なす)。それぞれの契 の意味からはずれるが、以下では翻訳も改変の一種と見なす)。それぞれの契
約者は「あなた」と表現される。 約者は「あなた」と表現される。
</p><p> </p>
<p>
複製や頒布、改変以外の活動はこの契約書ではカバーされない。それらはこの 複製や頒布、改変以外の活動はこの契約書ではカバーされない。それらはこの
契約書の対象外である。『プログラム』を実行する行為自体に制限はない。ま 契約書の対象外である。『プログラム』を実行する行為自体に制限はない。ま
た、そのような『プログラム』の出力結果は、その内容が『プログラム』を基 た、そのような『プログラム』の出力結果は、その内容が『プログラム』を基
にした著作物を構成する場合のみこの契約書によって保護される(『プログラ にした著作物を構成する場合のみこの契約書によって保護される(『プログラ
ム』を実行したことによって作成されたということとは無関係である)。この ム』を実行したことによって作成されたということとは無関係である)。この
ような線引きの妥当性は、『プログラム』が何をするのかに依存する。 ような線引きの妥当性は、『プログラム』が何をするのかに依存する。
</p><p> </p>
<p>
<strong>1.</strong> <strong>1.</strong>
それぞれの複製物において適切な著作権表示と保証の否認声明(disclaimer of それぞれの複製物において適切な著作権表示と保証の否認声明(disclaimer of
warranty)を目立つよう適切に掲載し、またこの契約書および一切の保証の不 warranty)を目立つよう適切に掲載し、またこの契約書および一切の保証の不
@ -180,35 +178,39 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
ラム』のいかなる受領者にも『プログラム』と共に頒布する限り、あなたは ラム』のいかなる受領者にも『プログラム』と共に頒布する限り、あなたは
『プログラム』のソースコードの複製物を、あなたが受け取った通りの形で複 『プログラム』のソースコードの複製物を、あなたが受け取った通りの形で複
製または頒布することができる。媒体は問わない。 製または頒布することができる。媒体は問わない。
</p><p> </p>
<p>
あなたは、物理的に複製物を譲渡するという行為に関して手数料を課しても良 あなたは、物理的に複製物を譲渡するという行為に関して手数料を課しても良
いし、希望によっては手数料を取って交換における保護の保証を提供しても良 いし、希望によっては手数料を取って交換における保護の保証を提供しても良
い。 い。
</p><p> </p>
<p>
<strong>2.</strong> <strong>2.</strong>
あなたは自分の『プログラム』の複製物かその一部を改変して『プログラム』 あなたは自分の『プログラム』の複製物かその一部を改変して『プログラム』
を基にした著作物を形成し、そのような改変点や著作物を上記第1節の定める を基にした著作物を形成し、そのような改変点や著作物を上記第1節の定める
条件の下で複製または頒布することができる。ただし、そのためには以下の条 条件の下で複製または頒布することができる。ただし、そのためには以下の条
件すべてを満たしていなければならない: 件すべてを満たしていなければならない:
</p><p> </p>
<p></p>
</p><ul> <ul>
<li>
<li><strong>a)</strong> <strong>a)</strong>
あなたがそれらのファイルを変更したということと変更した日時が良く あなたがそれらのファイルを変更したということと変更した日時が良く
分かるよう、改変されたファイルに告示しなければならない。 分かるよう、改変されたファイルに告示しなければならない。
<p> <p></p>
</p></li><li><strong>b)</strong> </li>
<li>
<strong>b)</strong>
『プログラム』またはその一部を含む著作物、あるいは『プログラム』 『プログラム』またはその一部を含む著作物、あるいは『プログラム』
かその一部から派生した著作物を頒布あるいは発表する場合には、その かその一部から派生した著作物を頒布あるいは発表する場合には、その
全体をこの契約書の条件に従って第三者へ無償で利用許諾しなけれ 全体をこの契約書の条件に従って第三者へ無償で利用許諾しなけれ
ばならない。 ばならない。
<p> <p></p>
</p></li><li><strong>c)</strong> </li>
<li>
<strong>c)</strong>
改変されたプログラムが、通常実行する際に対話的にコマンドを読むよ 改変されたプログラムが、通常実行する際に対話的にコマンドを読むよ
うになっているならば、そのプログラムを最も一般的な方法で対話的に うになっているならば、そのプログラムを最も一般的な方法で対話的に
実行する際、適切な著作権表示、無保証であること(あるいはあなたが保 実行する際、適切な著作権表示、無保証であること(あるいはあなたが保
@ -219,7 +221,8 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
として、『プログラム』そのものは対話的であっても通常そのような告 として、『プログラム』そのものは対話的であっても通常そのような告
知を印刷しない場合には、『プログラム』を基にしたあなたの著作物に 知を印刷しない場合には、『プログラム』を基にしたあなたの著作物に
そのような告知を印刷させる必要はない)。 そのような告知を印刷させる必要はない)。
</li></ul> </li>
</ul>
以上の必要条件は全体としての改変された著作物に適用される。著作物の一部 以上の必要条件は全体としての改変された著作物に適用される。著作物の一部
が『プログラム』から派生したものではないと確認でき、それら自身別の独立 が『プログラム』から派生したものではないと確認でき、それら自身別の独立
@ -231,19 +234,18 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
は『プログラム』丸ごと全体に及び、誰が書いたかは関係なく各部分のすべて は『プログラム』丸ごと全体に及び、誰が書いたかは関係なく各部分のすべて
を保護するからである。 を保護するからである。
<p> <p>
よって、すべてあなたによって書かれた著作物に対し、権利を主張したりあな よって、すべてあなたによって書かれた著作物に対し、権利を主張したりあな
たの権利に異議を申し立てることはこの節の意図するところではない。むしろ、 たの権利に異議を申し立てることはこの節の意図するところではない。むしろ、
その趣旨は『プログラム』を基にした派生物ないし集合著作物の頒布を管理す その趣旨は『プログラム』を基にした派生物ないし集合著作物の頒布を管理す
る権利を行使するということにある。 る権利を行使するということにある。
</p><p> </p>
<p>
また、『プログラム』を基にしていないその他の著作物を『プログラム』(あ また、『プログラム』を基にしていないその他の著作物を『プログラム』(あ
るいは『プログラム』を基にした著作物)と一緒に集めただけのものを一巻の るいは『プログラム』を基にした著作物)と一緒に集めただけのものを一巻の
保管装置ないし頒布媒体に収めても、その他の著作物までこの契約書が保護す 保管装置ないし頒布媒体に収めても、その他の著作物までこの契約書が保護す
る対象になるということにはならない。 る対象になるということにはならない。
</p><p> </p>
<p>
<strong>3.</strong> <strong>3.</strong>
あなたは上記第1節および2節の条件に従い、『プログラム』(あるいは第2節に あなたは上記第1節および2節の条件に従い、『プログラム』(あるいは第2節に
おける派生物)をオブジェクトコードないし実行形式で複製または頒布するこ おける派生物)をオブジェクトコードないし実行形式で複製または頒布するこ
@ -252,29 +254,34 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
<!-- we use this doubled UL to get the sub-sections indented, --> <!-- we use this doubled UL to get the sub-sections indented, -->
<!-- while making the bullets as unobvious as possible. --> <!-- while making the bullets as unobvious as possible. -->
</p><ul> </p>
<ul>
<li><strong>a)</strong> <li>
<strong>a)</strong>
著作物に、『プログラム』に対応した完全かつ機械で読み取り可能なソー 著作物に、『プログラム』に対応した完全かつ機械で読み取り可能なソー
スコードを添付する。ただし、ソースコードは上記第1節および2節の条 スコードを添付する。ただし、ソースコードは上記第1節および2節の条
件に従いソフトウェアの交換で習慣的に使われる媒体で頒布しなければ 件に従いソフトウェアの交換で習慣的に使われる媒体で頒布しなければ
ならない。あるいは、 ならない。あるいは、
<p> <p></p>
</p></li><li><strong>b)</strong> </li>
<li>
<strong>b)</strong>
著作物に、いかなる第三者に対しても、『プログラム』に対応した完全 著作物に、いかなる第三者に対しても、『プログラム』に対応した完全
かつ機械で読み取り可能なソースコードを、頒布に要する物理的コスト かつ機械で読み取り可能なソースコードを、頒布に要する物理的コスト
を上回らない程度の手数料と引き換えに提供する旨述べた少なくとも3年 を上回らない程度の手数料と引き換えに提供する旨述べた少なくとも3年
間は有効な書面になった申し出を添える。ただし、ソースコードは上記 間は有効な書面になった申し出を添える。ただし、ソースコードは上記
第1節および2節の条件に従いソフトウェアの交換で習慣的に使われる媒 第1節および2節の条件に従いソフトウェアの交換で習慣的に使われる媒
体で頒布しなければならない。あるいは、 体で頒布しなければならない。あるいは、
<p> <p></p>
</p></li><li><strong>c)</strong> </li>
<li>
<strong>c)</strong>
対応するソースコード頒布の申し出に際して、あなたが得た情報を一緒 対応するソースコード頒布の申し出に際して、あなたが得た情報を一緒
に引き渡す(この選択肢は、営利を目的としない頒布であって、かつあな に引き渡す(この選択肢は、営利を目的としない頒布であって、かつあな
たが上記小節bで指定されているような申し出と共にオブジェクトコード たが上記小節bで指定されているような申し出と共にオブジェクトコード
あるいは実行形式のプログラムしか入手していない場合に限り許可され あるいは実行形式のプログラムしか入手していない場合に限り許可され る)。
る)。 </li>
</li></ul> </ul>
著作物のソースコードとは、それに対して改変を加える上で好ましいとされる 著作物のソースコードとは、それに対して改変を加える上で好ましいとされる
著作物の形式を意味する。ある実行形式の著作物にとって完全なソースコード 著作物の形式を意味する。ある実行形式の著作物にとって完全なソースコード
@ -286,14 +293,13 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
要なコンポーネント(コンパイラやカーネル等)と通常一緒に(ソースかバイナ 要なコンポーネント(コンパイラやカーネル等)と通常一緒に(ソースかバイナ
リ形式のどちらかで)頒布されるものを含んでいる必要はないとする。 リ形式のどちらかで)頒布されるものを含んでいる必要はないとする。
<p> <p>
実行形式またはオブジェクトコードの頒布が、指定された場所からコピーする 実行形式またはオブジェクトコードの頒布が、指定された場所からコピーする
ためのアクセス手段を提供することで為されるとして、その上でソースコード ためのアクセス手段を提供することで為されるとして、その上でソースコード
も同等のアクセス手段によって同じ場所からコピーできるようになっているな も同等のアクセス手段によって同じ場所からコピーできるようになっているな
らば、第三者がオブジェクトコードと一緒にソースも強制的にコピーさせられ らば、第三者がオブジェクトコードと一緒にソースも強制的にコピーさせられ
るようになっていなくてもソースコード頒布の条件を満たしているものとする。 るようになっていなくてもソースコード頒布の条件を満たしているものとする。
</p><p> </p>
<p>
<strong>4.</strong> <strong>4.</strong>
あなたは『プログラム』を、この契約書において明確に提示された行為を除き あなたは『プログラム』を、この契約書において明確に提示された行為を除き
複製や改変、サブライセンス、あるいは頒布してはならない。他に『プログラ 複製や改変、サブライセンス、あるいは頒布してはならない。他に『プログラ
@ -302,8 +308,8 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
かし、複製物や権利をこの契約書に従ってあなたから得た人々に関しては、そ かし、複製物や権利をこの契約書に従ってあなたから得た人々に関しては、そ
のような人々がこの契約書に完全に従っている限り彼らのライセンスまで終結 のような人々がこの契約書に完全に従っている限り彼らのライセンスまで終結
することはない。 することはない。
</p><p> </p>
<p>
<strong>5.</strong> <strong>5.</strong>
あなたはこの契約書を受諾する必要は無い。というのは、あなたはこれに署名 あなたはこの契約書を受諾する必要は無い。というのは、あなたはこれに署名
していないからである。しかし、この契約書以外にあなたに対して『プログラ していないからである。しかし、この契約書以外にあなたに対して『プログラ
@ -314,8 +320,8 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
にこの契約書を受諾したということ、そして『プログラム』とそれに基づく著 にこの契約書を受諾したということ、そして『プログラム』とそれに基づく著
作物の複製や頒布、改変についてこの契約書が課す制約と条件をすべて受け入 作物の複製や頒布、改変についてこの契約書が課す制約と条件をすべて受け入
れたということを示したものと見なす。 れたということを示したものと見なす。
</p><p> </p>
<p>
<strong>6.</strong> <strong>6.</strong>
あなたが『プログラム』(または『プログラム』を基にした著作物全般)を再頒 あなたが『プログラム』(または『プログラム』を基にした著作物全般)を再頒
布するたびに、その受領者は元々のライセンス許可者から、この契約書で指定 布するたびに、その受領者は元々のライセンス許可者から、この契約書で指定
@ -323,9 +329,8 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
を自動的に得るものとする。あなたは、受領者がここで認められた権利を行使 を自動的に得るものとする。あなたは、受領者がここで認められた権利を行使
することに関してこれ以上他のいかなる制限も課してはならない。あなたには、 することに関してこれ以上他のいかなる制限も課してはならない。あなたには、
第三者がこの契約書に従うことを強制する責任はない。 第三者がこの契約書に従うことを強制する責任はない。
</p>
</p><p> <p>
<strong>7.</strong> <strong>7.</strong>
特許侵害あるいはその他の理由(特許関係に限らない)から、裁判所の判決ある 特許侵害あるいはその他の理由(特許関係に限らない)から、裁判所の判決ある
いは申し立ての結果としてあなたに(裁判所命令や契約などにより)このライセ いは申し立ての結果としてあなたに(裁判所命令や契約などにより)このライセ
@ -337,15 +342,13 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
た人が誰でも『プログラム』を使用料無料で再頒布することを認めていない場 た人が誰でも『プログラム』を使用料無料で再頒布することを認めていない場
合、あなたがその制約とこの契約書を両方とも満たすには『プログラム』 合、あなたがその制約とこの契約書を両方とも満たすには『プログラム』
の頒布を完全に中止するしかないだろう。 の頒布を完全に中止するしかないだろう。
</p>
</p><p> <p>
この節の一部分が特定の状況の下で無効ないし実施不可能な場合でも、節の残 この節の一部分が特定の状況の下で無効ないし実施不可能な場合でも、節の残
りの部分は適用されるよう意図されている。その他の状況では節が全体として りの部分は適用されるよう意図されている。その他の状況では節が全体として
適用されるよう意図されている。 適用されるよう意図されている。
</p>
</p><p> <p>
特許やその他の財産権を侵害したり、そのような権利の主張の効力に異議を唱 特許やその他の財産権を侵害したり、そのような権利の主張の効力に異議を唱
えたりするようあなたを誘惑することがこの節の目的ではない。この節には、 えたりするようあなたを誘惑することがこの節の目的ではない。この節には、
人々によってライセンス慣行として実現されてきた、フリーソフトウェア頒布 人々によってライセンス慣行として実現されてきた、フリーソフトウェア頒布
@ -355,14 +358,12 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
は事実であるが、人がどのようなシステムを通じてソフトウェアを頒布したい は事実であるが、人がどのようなシステムを通じてソフトウェアを頒布したい
と思うかはあくまでも作者/寄与者次第であり、あなたが選択を押しつけるこ と思うかはあくまでも作者/寄与者次第であり、あなたが選択を押しつけるこ
とはできない。 とはできない。
</p>
</p><p> <p>
この節は、この契約書のこの節以外の部分の一帰結になると考えられるケー この節は、この契約書のこの節以外の部分の一帰結になると考えられるケー
スを徹底的に明らかにすることを目的としている。 スを徹底的に明らかにすることを目的としている。
</p>
</p><p> <p>
<strong>8.</strong> <strong>8.</strong>
『プログラム』の頒布や利用が、ある国においては特許または著作権が主張さ 『プログラム』の頒布や利用が、ある国においては特許または著作権が主張さ
れたインターフェースのいずれかによって制限されている場合、『プログラム』 れたインターフェースのいずれかによって制限されている場合、『プログラム』
@ -370,16 +371,15 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
な地理的頒布制限を加え、そこで排除されていない国の中やそれらの国々の間 な地理的頒布制限を加え、そこで排除されていない国の中やそれらの国々の間
でのみ頒布が許可されるようにしても構わない。その場合、そのような制限は でのみ頒布が許可されるようにしても構わない。その場合、そのような制限は
この契約書本文で書かれているのと同様に見なされる。 この契約書本文で書かれているのと同様に見なされる。
</p>
</p><p> <p>
<strong>9.</strong> <strong>9.</strong>
フリーソフトウェア財団は、時によって改訂または新版の一般公衆利用許諾書 フリーソフトウェア財団は、時によって改訂または新版の一般公衆利用許諾書
を発表することができる。そのような新版は現在のバージョンとその精神にお を発表することができる。そのような新版は現在のバージョンとその精神にお
いては似たものになるだろうが、新たな問題や懸念を解決するため細部では異 いては似たものになるだろうが、新たな問題や懸念を解決するため細部では異
なる可能性がある。 なる可能性がある。
</p>
</p><p> <p>
それぞれのバージョンには、見分けが付くようにバージョン番号が振られてい それぞれのバージョンには、見分けが付くようにバージョン番号が振られてい
る。『プログラム』においてそれに適用されるこの契約書のバージョン番号が る。『プログラム』においてそれに適用されるこの契約書のバージョン番号が
指定されていて、更に「それ以降のいかなるバージョン(any later version)」 指定されていて、更に「それ以降のいかなるバージョン(any later version)」
@ -388,10 +388,8 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
の版のどれか一つのどちらかを選ぶことが出来る。『プログラム』でライセン の版のどれか一つのどちらかを選ぶことが出来る。『プログラム』でライセン
スのバージョン番号が指定されていないならば、あなたは今までにフリーソフ スのバージョン番号が指定されていないならば、あなたは今までにフリーソフ
トウェア財団から発行されたバージョンの中から好きに選んで構わない。 トウェア財団から発行されたバージョンの中から好きに選んで構わない。
</p>
</p><p> <p>
<strong>10.</strong> <strong>10.</strong>
もしあなたが『プログラム』の一部を、その頒布条件がこの契約書と異なる他 もしあなたが『プログラム』の一部を、その頒布条件がこの契約書と異なる他
のフリーなプログラムと統合したいならば、作者に連絡して許可を求めよ。フ のフリーなプログラムと統合したいならば、作者に連絡して許可を求めよ。フ
@ -401,11 +399,10 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
ウェアの派生物すべてがフリーな状態に保たれるということと、一般的にソフ ウェアの派生物すべてがフリーな状態に保たれるということと、一般的にソフ
トウェアの共有と再利用を促進するという二つの目標を規準に検討されるであ トウェアの共有と再利用を促進するという二つの目標を規準に検討されるであ
ろう。 ろう。
</p>
</p><p><strong>無保証について</strong></p> <p><strong>無保証について</strong></p>
<p> <p>
<strong>11.</strong> <strong>11.</strong>
<strong> <strong>
『プログラム』は代価無しに利用が許可されるので、適切な法が認める限りに 『プログラム』は代価無しに利用が許可されるので、適切な法が認める限りに
@ -417,9 +414,8 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
『プログラム』に欠陥があると判明した場合、あなたは必要な保守点検や補修、 『プログラム』に欠陥があると判明した場合、あなたは必要な保守点検や補修、
修正に要するコストのすべてを引き受けることになる。 修正に要するコストのすべてを引き受けることになる。
</strong> </strong>
</p>
</p><p> <p>
<strong>12.</strong> <strong>12.</strong>
<strong> <strong>
適切な法か書面での同意によって命ぜられない限り、著作権者、または上記で 適切な法か書面での同意によって命ぜられない限り、著作権者、または上記で
@ -433,4 +429,5 @@ warranty)を目立つよう適切に掲載し、またこの契約書および
</p> </p>
<h3>条件と制約終わり</h3> <h3>条件と制約終わり</h3>
</body></html> </body>
</html>

View File

@ -3,422 +3,455 @@
<title>Licen<EFBFBD>a P&uacute;blica Geral GNU</title> <title>Licen<EFBFBD>a P&uacute;blica Geral GNU</title>
</head> </head>
<body> <body>
<h3>LICEN<EFBFBD>A P<>BLICA GERAL GNU</h3> <h3>LICEN<EFBFBD>A P<>BLICA GERAL GNU</h3>
<p>Vers<EFBFBD>o 2, junho de 1991</p> <p>Vers<EFBFBD>o 2, junho de 1991</p>
<p> <p>
This is an unofficial translation of the GNU General Public License This is an unofficial translation of the GNU General Public License into
into Brazilian Portuguese. It was not published by the Free Software Brazilian Portuguese. It was not published by the Free Software
Foundation, and does not legally state the distribution terms for Foundation, and does not legally state the distribution terms for software
software that uses the GNU GPL -- only the original English text of that uses the GNU GPL -- only the original English text of the GNU GPL
the GNU GPL does that. However, we hope that this translation will does that. However, we hope that this translation will help Brazilian
help Brazilian Portuguese speakers understand the GNU GPL better. Portuguese speakers understand the GNU GPL better.
</p> </p>
<p> <p>
Esta <20> uma tradu<64><75>o n<>o-oficial da Licen<65>a P<>blica Geral GNU ("GPL Esta <20> uma tradu<64><75>o n<>o-oficial da Licen<65>a P<>blica Geral GNU ("GPL GNU")
GNU") para o portugu<67>s do Brasil. Ela n<>o foi publicada pela Free para o portugu<67>s do Brasil. Ela n<>o foi publicada pela Free Software
Software Foundation, e legalmente n<>o afirma os termos de distribui<75><69>o Foundation, e legalmente n<>o afirma os termos de distribui<75><69>o de software
de software que utiliza a GPL GNU -- apenas o texto original da GPL que utiliza a GPL GNU -- apenas o texto original da GPL GNU, em ingl<67>s,
GNU, em ingl<67>s, faz isso. Contudo, esperamos que esta tradu<64><75>o ajude faz isso. Contudo, esperamos que esta tradu<64><75>o ajude aos que utilizam o
aos que utilizam o portugu<67>s do Brasil a entender melhor a GPL GNU. portugu<67>s do Brasil a entender melhor a GPL GNU.
</p> </p>
<p>Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA</p>
<p> <p>
A qualquer pessoa <20> permitido copiar e distribuir c<>pias desse Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
documento de licen<65>a, desde que sem qualquer altera<72><61>o. Cambridge, MA 02139, USA
</p>
<p>
A qualquer pessoa <20> permitido copiar e distribuir c<>pias desse documento
de licen<65>a, desde que sem qualquer altera<72><61>o.
</p> </p>
<h3>Introdu<EFBFBD><EFBFBD>o</h3> <h3>Introdu<EFBFBD><EFBFBD>o</h3>
<p>As licen<65>as de muitos software s<>o desenvolvidas para restringir sua <p>
liberdade de compartilh<6C>-lo e mud<75>-lo. Contr<74>ria a isso, a Licen<65>a As licen<65>as de muitos software s<>o desenvolvidas para restringir sua
P<EFBFBD>blica Geral GNU pretende garantir sua liberdade de compartilhar e liberdade de compartilh<6C>-lo e mud<75>-lo. Contr<74>ria a isso, a Licen<65>a P<>blica
alterar software livres -- garantindo que o software ser<65> livre e Geral GNU pretende garantir sua liberdade de compartilhar e alterar
gratuito para os seus usu<73>rios. Esta Licen<65>a P<>blica Geral aplica-se <20> software livres -- garantindo que o software ser<65> livre e gratuito para os
maioria dos software da Free Software Foundation e a qualquer outro seus usu<73>rios. Esta Licen<65>a P<>blica Geral aplica-se <20> maioria dos software
programa cujo autor decida aplic<69>-la. (Alguns outros software da FSF da Free Software Foundation e a qualquer outro programa cujo autor decida
s<EFBFBD>o cobertos pela Licen<65>a P<>blica Geral de Bibliotecas, no entanto.) aplic<69>-la. (Alguns outros software da FSF s<>o cobertos pela Licen<65>a
Voc<EFBFBD> pode aplic<69>-la tamb<6D>m aos seus programas.</p> P<>blica Geral de Bibliotecas, no entanto.) Voc<6F> pode aplic<69>-la tamb<6D>m aos
seus programas.
<p>Quando nos referimos a software livre, estamos nos referindo a
liberdade e n<>o a pre<72>o. Nossa Licen<65>a P<>blica Geral foi desenvolvida
para garantir que voc<6F> tenha a liberdade de distribuir c<>pias de
software livre (e cobrar por isso, se quiser); que voc<6F> receba o
c<EFBFBD>digo-fonte ou tenha acesso a ele, se quiser; que voc<6F> possa mudar o
software ou utilizar partes dele em novos programas livres e
gratuitos; e que voc<6F> saiba que pode fazer tudo isso.</p>
<p>Para proteger seus direitos, precisamos fazer restri<72><69>es que impe<70>am
a qualquer um negar estes direitos ou solicitar que voc<6F> deles
abdique. Estas restri<72><69>es traduzem-se em certas responsabilidades para
voc<EFBFBD>, se voc<6F> for distribuir c<>pias do software ou modific<69>-lo.</p>
<p>Por exemplo, se voc<6F> distribuir c<>pias de um programa, gratuitamente
ou por alguma quantia, voc<6F> tem que fornecer aos recebedores todos os
direitos que voc<6F> possui. Voc<6F> tem que garantir que eles tamb<6D>m
recebam ou possam obter o c<>digo-fonte. E voc<6F> tem que mostrar-lhes
estes termos para que eles possam conhecer seus direitos.</p>
<p>N<EFBFBD>s protegemos seus direitos em dois passos: (1) com copyright do
software e (2) com a oferta desta licen<65>a, que lhe d<> permiss<73>o legal
para copiar, distribuir e/ou modificar o software.</p>
<p>Al<EFBFBD>m disso, tanto para a prote<74><65>o do autor quanto a nossa,
gostar<EFBFBD>amos de certificar-nos que todos entendam que n<>o h<> qualquer
garantia nestes software livres. Se o software <20> modificado por algu<67>m
mais e passado adiante, queremos que seus recebedores saibam que o que
eles obtiveram n<>o <20> original, de forma que qualquer problema
introduzido por terceiros n<>o interfira na reputa<74><61>o do autor
original.</p>
<p>Finalmente, qualquer programa <20> amea<65>ado constantemente por patentes
de software. Queremos evitar o perigo de que distribuidores de
software livre obtenham patentes individuais, o que tem o efeito de
tornar o programa propriet<65>rio. Para prevenir isso, deixamos claro que
qualquer patente tem que ser licenciada para uso livre e gratuito por
qualquer pessoa, ou ent<6E>o que nem necessite ser licenciada.
</p> </p>
<p>Os termos e condi<64><69>es precisas para c<>pia, distribui<75><69>o e <p>
modifica<EFBFBD><EFBFBD>o se encontram abaixo:</p> Quando nos referimos a software livre, estamos nos referindo a liberdade e
n<>o a pre<72>o. Nossa Licen<65>a P<>blica Geral foi desenvolvida para garantir
<h3>LICEN<EFBFBD>A P<>BLICA GERAL GNU TERMOS E CONDI<44><49>ES PARA C<>PIA, DISTRIBUI<55><49>O E MODIFICA<43><41>O</h3> que voc<6F> tenha a liberdade de distribuir c<>pias de software livre (e
cobrar por isso, se quiser); que voc<6F> receba o c<>digo-fonte ou tenha
acesso a ele, se quiser; que voc<6F> possa mudar o software ou utilizar
partes dele em novos programas livres e gratuitos; e que voc<6F> saiba que
pode fazer tudo isso.
</p>
<p> <p>
<strong>0.</strong>Esta licen<65>a se aplica a qualquer programa ou outro trabalho que Para proteger seus direitos, precisamos fazer restri<72><69>es que impe<70>am a
contenha um aviso colocado pelo detentor dos direitos autorais qualquer um negar estes direitos ou solicitar que voc<6F> deles abdique.
informando que aquele pode ser distribu<62>do sob as condi<64><69>es desta Estas restri<72><69>es traduzem-se em certas responsabilidades para voc<6F>, se
Licen<EFBFBD>a P<>blica Geral. O "Programa" abaixo refere-se a qualquer voc<6F> for distribuir c<>pias do software ou modific<69>-lo.
programa ou trabalho, e "trabalho baseado no Programa" significa tanto </p>
o Programa em si como quaisquer trabalhos derivados, de acordo com a
lei de direitos autorais: isto quer dizer um trabalho que contenha o <p>
Programa ou parte dele, tanto originalmente ou com modifica<63><61>es, e/ou Por exemplo, se voc<6F> distribuir c<>pias de um programa, gratuitamente ou
tradu<EFBFBD><EFBFBD>o para outros idiomas. (Doravante o processo de tradu<64><75>o est<73> por alguma quantia, voc<6F> tem que fornecer aos recebedores todos os
inclu<EFBFBD>do sem limites no termo "modifica<63><61>o".) Cada licenciado <20> direitos que voc<6F> possui. Voc<6F> tem que garantir que eles tamb<6D>m recebam ou
mencionado como "voc<6F>".</p> possam obter o c<>digo-fonte. E voc<6F> tem que mostrar-lhes estes termos para
que eles possam conhecer seus direitos.
</p>
<p>
N<>s protegemos seus direitos em dois passos: (1) com copyright do software
e (2) com a oferta desta licen<65>a, que lhe d<> permiss<73>o legal para copiar,
distribuir e/ou modificar o software.
</p>
<p>
Al<41>m disso, tanto para a prote<74><65>o do autor quanto a nossa, gostar<61>amos de
certificar-nos que todos entendam que n<>o h<> qualquer garantia nestes
software livres. Se o software <20> modificado por algu<67>m mais e passado
adiante, queremos que seus recebedores saibam que o que eles obtiveram n<>o
<20> original, de forma que qualquer problema introduzido por terceiros n<>o
interfira na reputa<74><61>o do autor original.
</p>
<p>
Finalmente, qualquer programa <20> amea<65>ado constantemente por patentes de
software. Queremos evitar o perigo de que distribuidores de software livre
obtenham patentes individuais, o que tem o efeito de tornar o programa
propriet<65>rio. Para prevenir isso, deixamos claro que qualquer patente tem
que ser licenciada para uso livre e gratuito por qualquer pessoa, ou ent<6E>o
que nem necessite ser licenciada.
</p>
<p>
Os termos e condi<64><69>es precisas para c<>pia, distribui<75><69>o e modifica<63><61>o se
encontram abaixo:
</p>
<h3>
LICEN<45>A P<>BLICA GERAL GNU TERMOS E CONDI<44><49>ES PARA C<>PIA, DISTRIBUI<55><49>O E
MODIFICA<43><41>O
</h3>
<p>
<strong>0.</strong>Esta licen<65>a se aplica a qualquer programa ou outro
trabalho que contenha um aviso colocado pelo detentor dos direitos
autorais informando que aquele pode ser distribu<62>do sob as condi<64><69>es desta
Licen<65>a P<>blica Geral. O "Programa" abaixo refere-se a qualquer programa
ou trabalho, e "trabalho baseado no Programa" significa tanto o Programa
em si como quaisquer trabalhos derivados, de acordo com a lei de direitos
autorais: isto quer dizer um trabalho que contenha o Programa ou parte
dele, tanto originalmente ou com modifica<63><61>es, e/ou tradu<64><75>o para outros
idiomas. (Doravante o processo de tradu<64><75>o est<73> inclu<6C>do sem limites no
termo "modifica<63><61>o".) Cada licenciado <20> mencionado como "voc<6F>".
</p>
<p> <p>
Atividades outras que a c<>pia, a distribui<75><69>o e modifica<63><61>o n<>o est<73>o Atividades outras que a c<>pia, a distribui<75><69>o e modifica<63><61>o n<>o est<73>o
cobertas por esta Licen<65>a; elas est<73>o fora de seu escopo. O ato de cobertas por esta Licen<65>a; elas est<73>o fora de seu escopo. O ato de
executar o Programa n<>o <20> restringido e o resultado do Programa <20> executar o Programa n<>o <20> restringido e o resultado do Programa <20> coberto
coberto apenas se seu conte<74>do contenha trabalhos baseados no Programa apenas se seu conte<74>do contenha trabalhos baseados no Programa
(independentemente de terem sido gerados pela execu<63><75>o do (independentemente de terem sido gerados pela execu<63><75>o do Programa). Se
Programa). Se isso <20> verdadeiro depende do que o programa faz.</p> isso <20> verdadeiro depende do que o programa faz.
</p>
<p> <p>
<strong>1.</strong>Voc<EFBFBD> pode copiar e distribuir c<>pias fi<66>is do c<>digo-fonte do <strong>1.</strong>Voc<EFBFBD> pode copiar e distribuir c<>pias fi<66>is do
Programa da mesma forma que voc<6F> o recebeu, usando qualquer meio, c<>digo-fonte do Programa da mesma forma que voc<6F> o recebeu, usando
deste que voc<6F> consp<73>cua e apropriadamente publique em cada c<>pia um qualquer meio, deste que voc<6F> consp<73>cua e apropriadamente publique em cada
aviso de direitos autorais e uma declara<72><61>o de inexist<73>ncia de c<>pia um aviso de direitos autorais e uma declara<72><61>o de inexist<73>ncia de
garantias; mantenha intactas todos os avisos que se referem a esta garantias; mantenha intactas todos os avisos que se referem a esta Licen<65>a
Licen<EFBFBD>a e <20> aus<75>ncia total de garantias; e forne<6E>a a outros e <20> aus<75>ncia total de garantias; e forne<6E>a a outros recebedores do
recebedores do Programa uma c<>pia desta Licen<65>a, junto com o Programa. Programa uma c<>pia desta Licen<65>a, junto com o Programa.
</p> </p>
<p> <p>
Voc<6F> pode cobrar pelo ato f<>sico de transferir uma c<>pia e pode, Voc<6F> pode cobrar pelo ato f<>sico de transferir uma c<>pia e pode,
opcionalmente, oferecer garantia em troca de pagamento. opcionalmente, oferecer garantia em troca de pagamento.
</p> </p>
<p> <p>
<strong>2.</strong> Voc<6F> pode modificar sua c<>pia ou c<>pias do Programa, ou qualquer <strong>2.</strong> Voc<6F> pode modificar sua c<>pia ou c<>pias do Programa,
parte dele, assim gerando um trabalho baseado no Programa, e copiar e ou qualquer parte dele, assim gerando um trabalho baseado no Programa, e
distribuir essas modifica<63><61>es ou trabalhos sob os temos da se<73><65>o 1 copiar e distribuir essas modifica<63><61>es ou trabalhos sob os temos da se<73><65>o
acima, desde que voc<6F> tamb<6D>m se enquadre em todas estas condi<64><69>es:</p> 1 acima, desde que voc<6F> tamb<6D>m se enquadre em todas estas condi<64><69>es:
<dl><dd> </p>
<strong>a)</strong> Voc<6F> tem que fazer com que os arquivos modificados levem avisos <dl>
proeminentes afirmando que voc<6F> alterou os arquivos, incluindo a <dd>
data de qualquer altera<72><61>o. <strong>a)</strong> Voc<6F> tem que fazer com que os arquivos modificados
</dd></dl> levem avisos proeminentes afirmando que voc<6F> alterou os arquivos,
incluindo a data de qualquer altera<72><61>o.
</dd>
</dl>
<dl><dd> <dl>
<strong>b)</strong> Voc<6F> tem que fazer com que quaisquer trabalhos que voc<6F> <dd>
distribua ou publique, e que integralmente ou em partes contenham <strong>b)</strong> Voc<6F> tem que fazer com que quaisquer trabalhos que
ou sejam derivados do Programa ou de suas partes, sejam voc<6F> distribua ou publique, e que integralmente ou em partes contenham
licenciados, integralmente e sem custo algum para quaisquer ou sejam derivados do Programa ou de suas partes, sejam licenciados,
terceiros, sob os termos desta Licen<65>a. integralmente e sem custo algum para quaisquer terceiros, sob os termos
</dd></dl> desta Licen<65>a.
</dd>
</dl>
<dl><dd> <dl>
<strong>c)</strong> Se qualquer programa modificado normalmente l<> comandos <dd>
interativamente quando executados, voc<6F> tem que fazer com que, <strong>c)</strong> Se qualquer programa modificado normalmente l<>
quando iniciado tal uso interativo da forma mais simples, seja comandos interativamente quando executados, voc<6F> tem que fazer com que,
impresso ou mostrado um an<61>ncio de que n<>o h<> qualquer garantia quando iniciado tal uso interativo da forma mais simples, seja impresso
(ou ent<6E>o que voc<6F> fornece a garantia) e que os usu<73>rios podem ou mostrado um an<61>ncio de que n<>o h<> qualquer garantia (ou ent<6E>o que
redistribuir o programa sob estas condi<64><69>es, ainda informando os voc<6F> fornece a garantia) e que os usu<73>rios podem redistribuir o programa
usu<73>rios como consultar uma c<>pia desta Licen<65>a. (Exce<63><65>o: se o sob estas condi<64><69>es, ainda informando os usu<73>rios como consultar uma
Programa em si <20> interativo mas normalmente n<>o imprime estes c<>pia desta Licen<65>a. (Exce<63><65>o: se o Programa em si <20> interativo mas
tipos de an<61>ncios, seu trabalho baseado no Programa n<>o precisa normalmente n<>o imprime estes tipos de an<61>ncios, seu trabalho baseado no
imprimir um an<61>ncio.) Programa n<>o precisa imprimir um an<61>ncio.)
</dd></dl> </dd>
</dl>
<p> <p>
Estas exig<69>ncias aplicam-se ao trabalho modificado como um todo. Se Estas exig<69>ncias aplicam-se ao trabalho modificado como um todo. Se se<73><65>es
se<EFBFBD><EFBFBD>es identific<69>veis de tal trabalho n<>o s<>o derivadas do Programa, e identific<69>veis de tal trabalho n<>o s<>o derivadas do Programa, e podem ser
podem ser razoavelmente consideradas trabalhos independentes e razoavelmente consideradas trabalhos independentes e separados por si s<>,
separados por si s<>, ent<6E>o esta Licen<65>a, e seus termos, n<>o se aplicam ent<6E>o esta Licen<65>a, e seus termos, n<>o se aplicam a estas se<73><65>es quando
a estas se<73><65>es quando voc<6F> distribui-las como trabalhos em voc<6F> distribui-las como trabalhos em separado. Mas quando voc<6F> distribuir
separado. Mas quando voc<6F> distribuir as mesmas se<73><65>es como parte de um as mesmas se<73><65>es como parte de um todo que <20> trabalho baseado no Programa,
todo que <20> trabalho baseado no Programa, a distribui<75><69>o como um todo a distribui<75><69>o como um todo tem que se enquadrar nos termos desta Licen<65>a,
tem que se enquadrar nos termos desta Licen<65>a, cujas permiss<73>es para cujas permiss<73>es para outros licenciados se estendem ao todo, portanto
outros licenciados se estendem ao todo, portanto tamb<6D>m para cada e tamb<6D>m para cada e toda parte independente de quem a escreveu.
toda parte independente de quem a escreveu.
</p> </p>
<p> <p>
Desta forma, esta se<73><65>o n<>o tem a inten<65><6E>o de reclamar direitos os Desta forma, esta se<73><65>o n<>o tem a inten<65><6E>o de reclamar direitos os
contestar seus direitos sobre o trabalho escrito completamente por contestar seus direitos sobre o trabalho escrito completamente por voc<6F>;
voc<EFBFBD>; ao inv<6E>s disso, a inten<65><6E>o <20> a de exercitar o direito de ao inv<6E>s disso, a inten<65><6E>o <20> a de exercitar o direito de controlar a
controlar a distribui<75><69>o de trabalhos, derivados ou coletivos, distribui<75><69>o de trabalhos, derivados ou coletivos, baseados no Programa.
baseados no Programa.
</p> </p>
<p> <p>
Adicionalmente, a mera adi<64><69>o ao Programa de outro trabalho n<>o Adicionalmente, a mera adi<64><69>o ao Programa de outro trabalho n<>o baseado no
baseado no Programa (ou de trabalho baseado no Programa) em um volume Programa (ou de trabalho baseado no Programa) em um volume de
de armazenamento ou meio de distribui<75><69>o n<>o faz o outro trabalho armazenamento ou meio de distribui<75><69>o n<>o faz o outro trabalho parte do
parte do escopo desta Licen<65>a. escopo desta Licen<65>a.
</p> </p>
<p><strong>3.</strong> Voc<6F> pode copiar e distribuir o Programa (ou trabalho baseado <p>
nele, conforme descrito na Se<53><65>o 2) em c<>digo-objeto ou em forma <strong>3.</strong> Voc<6F> pode copiar e distribuir o Programa (ou trabalho
execut<EFBFBD>vel sob os termos das Se<53><65>es 1 e 2 acima, desde que voc<6F> baseado nele, conforme descrito na Se<53><65>o 2) em c<>digo-objeto ou em forma
fa<EFBFBD>a um dos seguintes: execut<75>vel sob os termos das Se<53><65>es 1 e 2 acima, desde que voc<6F> fa<66>a um
dos seguintes:
</p> </p>
<dl><dd> <dl>
<strong>a)</strong>O acompanhe com o c<>digo-fonte completo e em forma acess<73>vel <dd>
por m<>quinas, que tem que ser distribu<62>do sob os termos das Se<53><65>es <strong>a)</strong>O acompanhe com o c<>digo-fonte completo e em forma
1 e 2 acima e em meio normalmente utilizado para o interc<72>mbio de acess<73>vel por m<>quinas, que tem que ser distribu<62>do sob os termos das
Se<53><65>es 1 e 2 acima e em meio normalmente utilizado para o interc<72>mbio de
software; ou, software; ou,
</dd></dl> </dd>
</dl>
<dl><dd> <dl>
<strong>b)</strong> O acompanhe com uma oferta escrita, v<>lida por pelo menos tr<74>s <dd>
anos, de fornecer a qualquer um, com um custo n<>o superior ao <strong>b)</strong> O acompanhe com uma oferta escrita, v<>lida por pelo
custo de distribui<75><69>o f<>sica do material, uma c<>pia do menos tr<74>s anos, de fornecer a qualquer um, com um custo n<>o superior ao
c<>digo-fonte completo e em forma acess<73>vel por m<>quinas, que tem custo de distribui<75><69>o f<>sica do material, uma c<>pia do c<>digo-fonte
que ser distribu<62>do sob os termos das Se<53><65>es 1 e 2 acima e em meio completo e em forma acess<73>vel por m<>quinas, que tem que ser distribu<62>do
normalmente utilizado para o interc<72>mbio de software; ou, sob os termos das Se<53><65>es 1 e 2 acima e em meio normalmente utilizado
</dd></dl> para o interc<72>mbio de software; ou,
</dd>
</dl>
<dl><dd> <dl>
<dd>
<p> <p>
<strong>c)</strong> O acompanhe com a informa<6D><61>o que voc<6F> recebeu em rela<6C><61>o <20> <strong>c)</strong> O acompanhe com a informa<6D><61>o que voc<6F> recebeu em
oferta de distribui<75><69>o do c<>digo-fonte correspondente. (Esta rela<6C><61>o <20> oferta de distribui<75><69>o do c<>digo-fonte correspondente. (Esta
alternativa <20> permitida somente em distribui<75><69>o n<>o comerciais, e alternativa <20> permitida somente em distribui<75><69>o n<>o comerciais, e
apenas se voc<6F> recebeu o programa em forma de c<>digo-objeto ou apenas se voc<6F> recebeu o programa em forma de c<>digo-objeto ou
execut<75>vel, com oferta de acordo com a Subse<73><65>o b acima.) execut<75>vel, com oferta de acordo com a Subse<73><65>o b acima.)
</p> </p>
</dd></dl> </dd>
</dl>
<p> <p>
O c<>digo-fonte de um trabalho corresponde <20> forma de trabalho O c<>digo-fonte de um trabalho corresponde <20> forma de trabalho preferida
preferida para se fazer modifica<63><61>es. Para um trabalho em forma para se fazer modifica<63><61>es. Para um trabalho em forma execut<75>vel, o
execut<EFBFBD>vel, o c<>digo-fonte completo significa todo o c<>digo-fonte de c<>digo-fonte completo significa todo o c<>digo-fonte de todos os m<>dulos
todos os m<>dulos que ele cont<6E>m, mais quaisquer arquivos de defini<6E><69>o que ele cont<6E>m, mais quaisquer arquivos de defini<6E><69>o de "interface", mais
de "interface", mais os "scripts" utilizados para se controlar a os "scripts" utilizados para se controlar a compila<6C><61>o e a instala<6C><61>o do
compila<EFBFBD><EFBFBD>o e a instala<6C><61>o do execut<75>vel. Contudo, como exce<63><65>o execut<75>vel. Contudo, como exce<63><65>o especial, o c<>digo-fonte distribu<62>do n<>o
especial, o c<>digo-fonte distribu<62>do n<>o precisa incluir qualquer precisa incluir qualquer componente normalmente distribu<62>do (tanto em
componente normalmente distribu<62>do (tanto em forma original quanto forma original quanto bin<69>ria) com os maiores componentes (o compilador, o
bin<EFBFBD>ria) com os maiores componentes (o compilador, o "kernel" etc.) do "kernel" etc.) do sistema operacional sob o qual o execut<75>vel funciona, a
sistema operacional sob o qual o execut<75>vel funciona, a menos que o menos que o componente em si acompanhe o execut<75>vel.
componente em si acompanhe o execut<75>vel.
</p> </p>
<p> <p>
Se a distribui<75><69>o do execut<75>vel ou c<>digo-objeto <20> feita atrav<61>s da Se a distribui<75><69>o do execut<75>vel ou c<>digo-objeto <20> feita atrav<61>s da oferta
oferta de acesso a c<>pias de algum lugar, ent<6E>o ofertar o acesso de acesso a c<>pias de algum lugar, ent<6E>o ofertar o acesso equivalente a
equivalente a c<>pia, do mesmo lugar, do c<>digo-fonte equivale <20> c<>pia, do mesmo lugar, do c<>digo-fonte equivale <20> distribui<75><69>o do
distribui<EFBFBD><EFBFBD>o do c<>digo-fonte, mesmo que terceiros n<>o sejam compelidos c<>digo-fonte, mesmo que terceiros n<>o sejam compelidos a copiar o
a copiar o c<>digo-fonte com o c<>digo-objeto. c<>digo-fonte com o c<>digo-objeto.
</p> </p>
<p> <p>
<strong>4.</strong> Voc<6F> n<>o pode copiar, modificar, sub-licenciar ou distribuir o <strong>4.</strong> Voc<6F> n<>o pode copiar, modificar, sub-licenciar ou
Programa, exceto de acordo com as condi<64><69>es expressas nesta distribuir o Programa, exceto de acordo com as condi<64><69>es expressas nesta
Licen<EFBFBD>a. Qualquer outra tentativa de c<>pia, modifica<63><61>o, Licen<65>a. Qualquer outra tentativa de c<>pia, modifica<63><61>o, sub-licenciamento
sub-licenciamento ou distribui<75><69>o do Programa n<>o <20> valida, e ou distribui<75><69>o do Programa n<>o <20> valida, e cancelar<61> automaticamente os
cancelar<EFBFBD> automaticamente os direitos que lhe foram fornecidos por direitos que lhe foram fornecidos por esta Licen<65>a. No entanto, terceiros
esta Licen<65>a. No entanto, terceiros que de voc<6F> receberam c<>pias ou que de voc<6F> receberam c<>pias ou direitos, fornecidos sob os termos desta
direitos, fornecidos sob os termos desta Licen<65>a, n<>o ter<65>o suas Licen<65>a, n<>o ter<65>o suas licen<65>as terminadas, desde que permane<6E>am em total
licen<EFBFBD>as terminadas, desde que permane<6E>am em total concord<72>ncia com concord<72>ncia com ela.
ela.
</p> </p>
<p> <p>
<strong>5.</strong> Voc<6F> n<>o <20> obrigado a aceitar esta Licen<65>a j<> que n<>o a <strong>5.</strong> Voc<6F> n<>o <20> obrigado a aceitar esta Licen<65>a j<> que n<>o
assinou. No entanto, nada mais o dar<61> permiss<73>o para modificar ou a assinou. No entanto, nada mais o dar<61> permiss<73>o para modificar ou
distribuir o Programa ou trabalhos derivados deste. Estas a<><61>es s<>o distribuir o Programa ou trabalhos derivados deste. Estas a<><61>es s<>o
proibidas por lei, caso voc<6F> n<>o aceite esta Licen<65>a. Desta forma, ao proibidas por lei, caso voc<6F> n<>o aceite esta Licen<65>a. Desta forma, ao
modificar ou distribuir o Programa (ou qualquer trabalho derivado do modificar ou distribuir o Programa (ou qualquer trabalho derivado do
Programa), voc<6F> estar<61> indicando sua total aceita<74><61>o desta Licen<65>a Programa), voc<6F> estar<61> indicando sua total aceita<74><61>o desta Licen<65>a para
para faz<61>-los, e todos os seus termos e condi<64><69>es para copiar, faz<61>-los, e todos os seus termos e condi<64><69>es para copiar, distribuir ou
distribuir ou modificar o Programa, ou trabalhos baseados nele. modificar o Programa, ou trabalhos baseados nele.
</p> </p>
<p> <p>
<strong>6.</strong> Cada vez que voc<6F> redistribuir o Programa (ou qualquer trabalho <strong>6.</strong> Cada vez que voc<6F> redistribuir o Programa (ou qualquer
baseado nele), os recebedores adquirir<69>o automaticamente do trabalho baseado nele), os recebedores adquirir<69>o automaticamente do
licenciador original uma licen<65>a para copiar, distribuir ou modificar licenciador original uma licen<65>a para copiar, distribuir ou modificar o
o Programa, sujeitos a estes termos e condi<64><69>es. Voc<6F> n<>o poder<65> impor Programa, sujeitos a estes termos e condi<64><69>es. Voc<6F> n<>o poder<65> impor aos
aos recebedores qualquer outra restri<72><69>o ao exerc<72>cio dos direitos recebedores qualquer outra restri<72><69>o ao exerc<72>cio dos direitos ent<6E>o
ent<EFBFBD>o adquiridos. Voc<6F> n<>o <20> respons<6E>vel em garantir a concord<72>ncia de adquiridos. Voc<6F> n<>o <20> respons<6E>vel em garantir a concord<72>ncia de terceiros
terceiros a esta Licen<65>a. a esta Licen<65>a.
</p> </p>
<p> <p>
<strong>7.</strong> Se, em conseq<65><71>ncia de decis<69>es judiciais ou alega<67><61>es de <strong>7.</strong> Se, em conseq<65><71>ncia de decis<69>es judiciais ou alega<67><61>es
infringimento de patentes ou quaisquer outras raz<61>es (n<>o limitadas a de infringimento de patentes ou quaisquer outras raz<61>es (n<>o limitadas a
assuntos relacionados a patentes), condi<64><69>es forem impostas a voc<6F> assuntos relacionados a patentes), condi<64><69>es forem impostas a voc<6F> (por
(por ordem judicial, acordos ou outras formas) e que contradigam as ordem judicial, acordos ou outras formas) e que contradigam as condi<64><69>es
condi<EFBFBD><EFBFBD>es desta Licen<65>a, elas n<>o o livram das condi<64><69>es desta desta Licen<65>a, elas n<>o o livram das condi<64><69>es desta Licen<65>a. Se voc<6F> n<>o
Licen<EFBFBD>a. Se voc<6F> n<>o puder distribuir de forma a satisfazer puder distribuir de forma a satisfazer simultaneamente suas obriga<67><61>es
simultaneamente suas obriga<67><61>es para com esta Licen<65>a e para com as para com esta Licen<65>a e para com as outras obriga<67><61>es pertinentes, ent<6E>o
outras obriga<67><61>es pertinentes, ent<6E>o como conseq<65><71>ncia voc<6F> n<>o poder<65> como conseq<65><71>ncia voc<6F> n<>o poder<65> distribuir o Programa. Por exemplo, se
distribuir o Programa. Por exemplo, se uma licen<65>a de patente n<>o uma licen<65>a de patente n<>o permitir<69> a redistribui<75><69>o, livre de
permitir<EFBFBD> a redistribui<75><69>o, livre de "royalties", do Programa, por "royalties", do Programa, por todos aqueles que receberem c<>pias direta ou
todos aqueles que receberem c<>pias direta ou indiretamente de voc<6F>, indiretamente de voc<6F>, ent<6E>o a <20>nica forma de voc<6F> satisfazer a ela e a
ent<EFBFBD>o a <20>nica forma de voc<6F> satisfazer a ela e a esta Licen<65>a seria a esta Licen<65>a seria a de desistir completamente de distribuir o Programa.
de desistir completamente de distribuir o Programa.
</p> </p>
<p> <p>
Se qualquer parte desta se<73><65>o for considerada inv<6E>lida ou n<>o Se qualquer parte desta se<73><65>o for considerada inv<6E>lida ou n<>o aplic<69>vel em
aplic<EFBFBD>vel em qualquer circunst<73>ncia particular, o restante da se<73><65>o se qualquer circunst<73>ncia particular, o restante da se<73><65>o se aplica, e a
aplica, e a se<73><65>o como um todo se aplica em outras circunst<73>ncias. se<73><65>o como um todo se aplica em outras circunst<73>ncias.
</p> </p>
<p> <p>
O prop<6F>sito desta se<73><65>o n<>o <20> o de induzi-lo a infringir quaisquer O prop<6F>sito desta se<73><65>o n<>o <20> o de induzi-lo a infringir quaisquer
patentes ou reivindica<63><61>o de direitos de propriedade outros, ou a patentes ou reivindica<63><61>o de direitos de propriedade outros, ou a
contestar a validade de quaisquer dessas reivindica<63><61>es; esta se<73><65>o contestar a validade de quaisquer dessas reivindica<63><61>es; esta se<73><65>o tem
tem como <20>nico prop<6F>sito proteger a integridade dos sistemas de como <20>nico prop<6F>sito proteger a integridade dos sistemas de distribui<75><69>o
distribui<EFBFBD><EFBFBD>o de software livres, o que <20> implementado pela pr<70>tica de de software livres, o que <20> implementado pela pr<70>tica de licen<65>as
licen<EFBFBD>as p<>blicas. V<>rias pessoas t<>m contribu<62>do generosamente e em p<>blicas. V<>rias pessoas t<>m contribu<62>do generosamente e em grande escala
grande escala para os software distribu<62>dos usando este sistema, na para os software distribu<62>dos usando este sistema, na certeza de que sua
certeza de que sua aplica<63><61>o <20> feita de forma consistente; fica a aplica<63><61>o <20> feita de forma consistente; fica a crit<69>rio do autor/doador
crit<EFBFBD>rio do autor/doador decidir se ele ou ela est<73> disposto a decidir se ele ou ela est<73> disposto a distribuir software utilizando outro
distribuir software utilizando outro sistema, e um licenciado n<>o pode sistema, e um licenciado n<>o pode impor qualquer escolha.
impor qualquer escolha.
</p> </p>
<p> <p>
Esta se<73><65>o destina-se a tornar bastante claro o que se acredita ser Esta se<73><65>o destina-se a tornar bastante claro o que se acredita ser
conseq<65><71>ncia do restante desta Licen<65>a. conseq<65><71>ncia do restante desta Licen<65>a.
</p> </p>
<p> <p>
<strong>8.</strong> Se a distribui<75><69>o e/ou uso do Programa s<>o restringidos em certos <strong>8.</strong> Se a distribui<75><69>o e/ou uso do Programa s<>o
pa<EFBFBD>ses por patentes ou direitos autorais, o detentor dos direitos restringidos em certos pa<EFBFBD>ses por patentes ou direitos autorais, o
autorais original, e que colocou o Programa sob esta Licen<65>a, pode detentor dos direitos autorais original, e que colocou o Programa sob esta
incluir uma limita<74><61>o geogr<67>fica de distribui<75><69>o, excluindo aqueles Licen<65>a, pode incluir uma limita<74><61>o geogr<67>fica de distribui<75><69>o, excluindo
pa<EFBFBD>ses de forma a tornar a distribui<75><69>o permitida apenas naqueles ou aqueles pa<EFBFBD>ses de forma a tornar a distribui<75><69>o permitida apenas naqueles
entre aqueles pa<70>ses ent<6E>o n<>o exclu<6C>dos. Nestes casos, esta Licen<65>a ou entre aqueles pa<70>ses ent<6E>o n<>o exclu<6C>dos. Nestes casos, esta Licen<65>a
incorpora a limita<74><61>o como se a mesma constasse escrita nesta Licen<65>a. incorpora a limita<74><61>o como se a mesma constasse escrita nesta Licen<65>a.
</p> </p>
<p> <p>
<strong>9.</strong> A Free Software Foundation pode publicar vers<72>es revisadas e/ou <strong>9.</strong> A Free Software Foundation pode publicar vers<72>es
novas da Licen<65>a P<>blica Geral de tempos em tempos. Estas novas revisadas e/ou novas da Licen<65>a P<>blica Geral de tempos em tempos. Estas
vers<EFBFBD>es ser<65>o similares em esp<73>rito <20> vers<72>o atual, mas podem diferir novas vers<EFBFBD>es ser<65>o similares em esp<73>rito <20> vers<72>o atual, mas podem
em detalhes que resolvem novos problemas ou situa<75><61>es. diferir em detalhes que resolvem novos problemas ou situa<75><61>es.
</p> </p>
<p> <p>
A cada vers<72>o <20> dada um n<>mero distinto. Se o Programa especifica um A cada vers<72>o <20> dada um n<>mero distinto. Se o Programa especifica um
n<>mero de vers<72>o espec<65>fico desta Licen<65>a que se aplica a ele e a n<>mero de vers<72>o espec<65>fico desta Licen<65>a que se aplica a ele e a
"qualquer nova vers<72>o", voc<6F> tem a op<6F><70>o de aceitar os termos e "qualquer nova vers<72>o", voc<6F> tem a op<6F><70>o de aceitar os termos e condi<64><69>es
condi<EFBFBD><EFBFBD>es daquela vers<72>o ou de qualquer outra vers<72>o publicada pela daquela vers<72>o ou de qualquer outra vers<72>o publicada pela Free Software
Free Software Foundation. Se o programa n<>o especifica um n<>mero de Foundation. Se o programa n<>o especifica um n<>mero de vers<72>o desta
vers<EFBFBD>o desta Licen<65>a, voc<6F> pode escolher qualquer vers<72>o j<> publicada Licen<65>a, voc<6F> pode escolher qualquer vers<72>o j<> publicada pela Free
pela Free Software Foundation. Software Foundation.
</p> </p>
<p> <p>
<strong>10.</strong> Se voc<6F> pretende incorporar partes do Programa em outros <strong>10.</strong> Se voc<6F> pretende incorporar partes do Programa em
programas livres cujas condi<64><69>es de distribui<75><69>o s<>o diferentes, outros programas livres cujas condi<64><69>es de distribui<75><69>o s<>o diferentes,
escreva ao autor e solicite permiss<73>o. Para o software que a Free escreva ao autor e solicite permiss<73>o. Para o software que a Free Software
Software Foundation det<65>m direitos autorais, escreva <20> Free Software Foundation det<65>m direitos autorais, escreva <20> Free Software Foundation; <20>s
Foundation; <20>s vezes n<>s permitimos exce<63><65>es a este caso. Nossa vezes n<>s permitimos exce<63><65>es a este caso. Nossa decis<69>o ser<65> guiada pelos
decis<EFBFBD>o ser<65> guiada pelos dois objetivos de preservar a condi<64><69>o de dois objetivos de preservar a condi<64><69>o de liberdade de todas as deriva<76><61>es
liberdade de todas as deriva<76><61>es do nosso software livre, e de do nosso software livre, e de promover o compartilhamento e reutiliza<7A><61>o
promover o compartilhamento e reutiliza<7A><61>o de software em aspectos de software em aspectos gerais.
gerais. </p>
<p><strong>AUS<EFBFBD>NCIA DE GARANTIAS</strong></p>
<p>
<strong>11.</strong> UMA VEZ QUE O PROGRAMA <20> LICENCIADO SEM <20>NUS, N<>O H<>
QUALQUER GARANTIA PARA O PROGRAMA, NA EXTENS<4E>O PERMITIDA PELAS LEIS
APLIC<49>VEIS. EXCETO QUANDO EXPRESSADO DE FORMA ESCRITA, OS DETENTORES DOS
DIREITOS AUTORAIS E/OU TERCEIROS DISPONIBILIZAM O PROGRAMA "NO ESTADO",
SEM QUALQUER TIPO DE GARANTIAS, EXPRESSAS OU IMPL<50>CITAS, INCLUINDO, MAS
N<>O LIMITADO A, AS GARANTIAS IMPL<50>CITAS DE COMERCIALIZA<5A><41>O E AS DE
ADEQUA<55><41>O A QUALQUER PROP<4F>SITO. O RISCO TOTAL COM A QUALIDADE E DESEMPENHO
DO PROGRAMA <20> SEU. SE O PROGRAMA SE MOSTRAR DEFEITUOSO, VOC<4F> ASSUME OS
CUSTOS DE TODAS AS MANUTEN<45><4E>ES, REPAROS E CORRE<52><45>ES.
</p> </p>
<p> <p>
<strong>AUS<EFBFBD>NCIA DE GARANTIAS</strong> <strong>12.</strong> EM NENHUMA OCASI<53>O, A MENOS QUE EXIGIDO PELAS LEIS
</p> APLIC<49>VEIS OU ACORDO ESCRITO, OS DETENTORES DOS DIREITOS AUTORAIS, OU
<p> QUALQUER OUTRA PARTE QUE POSSA MODIFICAR E/OU REDISTRIBUIR O PROGRAMA
<strong>11.</strong> UMA VEZ QUE O PROGRAMA <20> LICENCIADO SEM <20>NUS, N<>O H<> QUALQUER CONFORME PERMITIDO ACIMA, SER<45>O RESPONSABILIZADOS POR VOC<4F> POR DANOS,
GARANTIA PARA O PROGRAMA, NA EXTENS<4E>O PERMITIDA PELAS LEIS INCLUINDO QUALQUER DANO EM GERAL, ESPECIAL, ACIDENTAL OU CONSEQ<45>ENTE,
APLIC<EFBFBD>VEIS. EXCETO QUANDO EXPRESSADO DE FORMA ESCRITA, OS DETENTORES RESULTANTES DO USO OU INCAPACIDADE DE USO DO PROGRAMA (INCLUINDO, MAS N<>O
DOS DIREITOS AUTORAIS E/OU TERCEIROS DISPONIBILIZAM O PROGRAMA "NO LIMITADO A, A PERDA DE DADOS OU DADOS TORNADOS INCORRETOS, OU PERDAS
ESTADO", SEM QUALQUER TIPO DE GARANTIAS, EXPRESSAS OU IMPL<50>CITAS, SOFRIDAS POR VOC<4F> OU POR OUTRAS PARTES, OU FALHAS DO PROGRAMA AO OPERAR
INCLUINDO, MAS N<>O LIMITADO A, AS GARANTIAS IMPL<50>CITAS DE COM QUALQUER OUTRO PROGRAMA), MESMO QUE TAL DETENTOR OU PARTE TENHAM SIDO
COMERCIALIZA<EFBFBD><EFBFBD>O E AS DE ADEQUA<55><41>O A QUALQUER PROP<4F>SITO. O RISCO TOTAL AVISADOS DA POSSIBILIDADE DE TAIS DANOS.
COM A QUALIDADE E DESEMPENHO DO PROGRAMA <20> SEU. SE O PROGRAMA SE
MOSTRAR DEFEITUOSO, VOC<4F> ASSUME OS CUSTOS DE TODAS AS MANUTEN<45><4E>ES,
REPAROS E CORRE<52><45>ES.
</p>
<p>
<strong>12.</strong> EM NENHUMA OCASI<53>O, A MENOS QUE EXIGIDO PELAS LEIS APLIC<49>VEIS OU
ACORDO ESCRITO, OS DETENTORES DOS DIREITOS AUTORAIS, OU QUALQUER OUTRA
PARTE QUE POSSA MODIFICAR E/OU REDISTRIBUIR O PROGRAMA CONFORME
PERMITIDO ACIMA, SER<45>O RESPONSABILIZADOS POR VOC<4F> POR DANOS, INCLUINDO
QUALQUER DANO EM GERAL, ESPECIAL, ACIDENTAL OU CONSEQ<45>ENTE,
RESULTANTES DO USO OU INCAPACIDADE DE USO DO PROGRAMA (INCLUINDO, MAS
N<EFBFBD>O LIMITADO A, A PERDA DE DADOS OU DADOS TORNADOS INCORRETOS, OU
PERDAS SOFRIDAS POR VOC<4F> OU POR OUTRAS PARTES, OU FALHAS DO PROGRAMA
AO OPERAR COM QUALQUER OUTRO PROGRAMA), MESMO QUE TAL DETENTOR OU
PARTE TENHAM SIDO AVISADOS DA POSSIBILIDADE DE TAIS DANOS.
</p> </p>
<h3>FIM DOS TERMOS E CONDI<44><49>ES</h3> <h3>FIM DOS TERMOS E CONDI<44><49>ES</h3>
<h3>Como Aplicar Estes Termos aos Seus Novos Programas</h3> <h3>Como Aplicar Estes Termos aos Seus Novos Programas</h3>
<p>Se voc<6F> desenvolver um novo programa, e quer que ele seja utilizado <p>
Se voc<6F> desenvolver um novo programa, e quer que ele seja utilizado
amplamente pelo p<>blico, a melhor forma de alcan<61>ar este objetivo <20> amplamente pelo p<>blico, a melhor forma de alcan<61>ar este objetivo <20>
torn<EFBFBD>-lo software livre que qualquer um pode redistribuir e alterar, torn<72>-lo software livre que qualquer um pode redistribuir e alterar, sob
sob estes termos. estes termos.
</p> </p>
<p>Para isso, anexe os seguintes avisos ao programa. <20> mais seguro <p>
anex<EFBFBD>-los logo no in<69>cio de cada arquivo-fonte para refor<6F>arem mais Para isso, anexe os seguintes avisos ao programa. <20> mais seguro anex<65>-los
efetivamente a inexist<73>ncia de garantias; e cada arquivo deve possuir logo no in<69>cio de cada arquivo-fonte para refor<6F>arem mais efetivamente a
pelo menos a linha de "copyright" e uma indica<63><61>o de onde o texto inexist<73>ncia de garantias; e cada arquivo deve possuir pelo menos a linha
completo se encontra. de "copyright" e uma indica<63><61>o de onde o texto completo se encontra.
</p> </p>
<p>&lt;uma linha que forne<6E>a o nome do programa e uma id<69>ia do que ele faz.&gt; <p>
Copyright (C) &lt;ano&gt; &lt;nome do autor&gt; &lt;uma linha que forne<6E>a o nome do programa e uma id<69>ia do que ele
faz.&gt; Copyright (C) &lt;ano&gt; &lt;nome do autor&gt;
</p> </p>
<p>Este programa <20> software livre; voc<6F> pode redistribu<62>-lo e/ou <p>
modific<69>-lo sob os termos da Licen<65>a P<>blica Geral GNU, conforme Este programa <20> software livre; voc<6F> pode redistribu<62>-lo e/ou modific<69>-lo
publicada pela Free Software Foundation; tanto a vers<72>o 2 da sob os termos da Licen<65>a P<>blica Geral GNU, conforme publicada pela Free
Licen<65>a como (a seu crit<69>rio) qualquer vers<72>o mais nova. Software Foundation; tanto a vers<72>o 2 da Licen<65>a como (a seu crit<69>rio)
qualquer vers<72>o mais nova.
</p> </p>
<p> Este programa <20> distribu<62>do na expectativa de ser <20>til, mas SEM <p>
QUALQUER GARANTIA; sem mesmo a garantia impl<70>cita de Este programa <20> distribu<62>do na expectativa de ser <20>til, mas SEM QUALQUER
COMERCIALIZA<5A><41>O ou de ADEQUA<55><41>O A QUALQUER PROP<4F>SITO EM GARANTIA; sem mesmo a garantia impl<70>cita de COMERCIALIZA<EFBFBD><EFBFBD>O ou de
PARTICULAR. Consulte a Licen<65>a P<>blica Geral GNU para obter mais ADEQUA<55><41>O A QUALQUER PROP<4F>SITO EM PARTICULAR. Consulte a Licen<65>a P<>blica
detalhes. Geral GNU para obter mais detalhes.
</p> </p>
<p> Voc<6F> deve ter recebido uma c<>pia da Licen<65>a P<>blica Geral GNU <p>
junto com este programa; se n<>o, escreva para a Free Software Voc<6F> deve ter recebido uma c<>pia da Licen<65>a P<>blica Geral GNU junto com
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA este programa; se n<>o, escreva para a Free Software Foundation, Inc., 59
02111-1307, USA. Temple Place, Suite 330, Boston, MA 02111-1307, USA.
</p> </p>
<p>Inclua tamb<6D>m informa<6D><61>es sobre como contact<63>-lo eletronicamente e por carta.</p> <p>
<p>Se o programa <20> interativo, fa<66>a-o mostrar um aviso breve como este, ao iniciar um modo interativo: Inclua tamb<6D>m informa<6D><61>es sobre como contact<63>-lo eletronicamente e por
carta.
</p> </p>
<p>Gnomovision vers<72>o 69, Copyright (C) ano nome do autor <p>
O Gnomovision n<>o possui QUALQUER GARANTIA; para obter mais Se o programa <20> interativo, fa<66>a-o mostrar um aviso breve como este, ao
detalhes digite `show w'. Ele <20> software livre e voc<6F> est<73> iniciar um modo interativo:
convidado a redistribui-lo sob certas condi<64><69>es; digite `show c'
para obter detalhes.
</p> </p>
<p>Os comandos hipot<6F>ticos `show w' e `show c' devem mostrar as partes <p>
Gnomovision vers<72>o 69, Copyright (C) ano nome do autor O Gnomovision n<>o
possui QUALQUER GARANTIA; para obter mais detalhes digite `show w'. Ele <20>
software livre e voc<6F> est<73> convidado a redistribui-lo sob certas
condi<64><69>es; digite `show c' para obter detalhes.
</p>
<p>
Os comandos hipot<6F>ticos `show w' e `show c' devem mostrar as partes
apropriadas da Licen<65>a P<>blica Geral. Claro, os comandos que voc<6F> usar apropriadas da Licen<65>a P<>blica Geral. Claro, os comandos que voc<6F> usar
podem ser ativados de outra forma que `show w' e `show c'; eles podem podem ser ativados de outra forma que `show w' e `show c'; eles podem at<61>
at<EFBFBD> ser cliques do mouse ou itens de um menu -- o que melhor se ser cliques do mouse ou itens de um menu -- o que melhor se adequar ao
adequar ao programa. programa.
</p> </p>
<p>Voc<EFBFBD> tamb<6D>m deve obter do seu empregador (se voc<6F> trabalha como <p>
programador) ou escola, se houver, uma "declara<72><61>o de aus<75>ncia de Voc<6F> tamb<6D>m deve obter do seu empregador (se voc<6F> trabalha como
direitos autorais" sobre o programa, se necess<73>rio. Aqui est<73> um programador) ou escola, se houver, uma "declara<72><61>o de aus<75>ncia de direitos
exemplo; altere os nomes: autorais" sobre o programa, se necess<73>rio. Aqui est<73> um exemplo; altere os
nomes:
</p> </p>
<p>Yoyodyne, Inc., aqui declara a aus<75>ncia de quaisquer direitos <p>
autorais sobre o programa `Gnomovision' (que executa interpreta<74><61>es Yoyodyne, Inc., aqui declara a aus<75>ncia de quaisquer direitos autorais
em compiladores) escrito por James Hacker. sobre o programa `Gnomovision' (que executa interpreta<74><61>es em
compiladores) escrito por James Hacker.
</p> </p>
<p>&lt;assinatura de Ty Coon&gt;, 1o. de abril de 1989 <p>&lt;assinatura de Ty Coon&gt;, 1o. de abril de 1989</p>
<p>Ty Con, Vice-presidente</p>
<p>
Esta Licen<65>a P<>blica Geral n<>o permite incorporar seu programa em
programas propriet<65>rios. Se seu programa <20> uma biblioteca de sub-rotinas,
voc<6F> deve considerar mais <20>til permitir ligar aplica<63><61>es propriet<65>rias com
a biblioteca. Se isto <20> o que voc<6F> deseja, use a Licen<65>a P<>blica Geral de
Bibliotecas GNU, ao inv<6E>s desta Licen<65>a.
</p> </p>
<p>Ty Con, Vice-presidente </body>
</html>
</p>
<p>Esta Licen<65>a P<>blica Geral n<>o permite incorporar seu programa em
programas propriet<65>rios. Se seu programa <20> uma biblioteca de
sub-rotinas, voc<6F> deve considerar mais <20>til permitir ligar aplica<63><61>es
propriet<EFBFBD>rias com a biblioteca. Se isto <20> o que voc<6F> deseja, use a
Licen<EFBFBD>a P<>blica Geral de Bibliotecas GNU, ao inv<6E>s desta Licen<65>a.
</p>
</body></html>

View File

@ -4,24 +4,21 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
$sql = 'SELECT link, name FROM tlink ORDER BY name'; $sql = 'SELECT link, name FROM tlink ORDER BY name';
$result = db_get_all_rows_sql($sql); $result = db_get_all_rows_sql($sql);
if ($result !== false) { if ($result !== false) {
echo '<div class="tit bg4">:: '.__('Links').' ::</div>'; echo '<div class="tit bg4">:: '.__('Links').' ::</div>';
echo '<div class="menu"><ul>'; echo '<div class="menu"><ul>';
foreach ($result as $link) { foreach ($result as $link) {
echo '<li class="links"><a href="'.$link["link"].'" target="_blank">'.$link["name"].'</a></li>'; echo '<li class="links"><a href="'.$link['link'].'" target="_blank">'.$link['name'].'</a></li>';
} }
echo '</ul></div>'; echo '</ul></div>';
} }
?>

View File

@ -4,11 +4,9 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ -25,55 +23,78 @@ if (is_ajax()) {
// Updates config['skip_login_help_dialog'] in order to don't show login help message // Updates config['skip_login_help_dialog'] in order to don't show login help message
if ($skip_login_help) { if ($skip_login_help) {
if (isset ($config['skip_login_help_dialog'])) if (isset($config['skip_login_help_dialog'])) {
$result_config = db_process_sql_update('tconfig', array("value" => 1), array("token" => "skip_login_help_dialog")); $result_config = db_process_sql_update('tconfig', ['value' => 1], ['token' => 'skip_login_help_dialog']);
else } else {
$result_config = db_process_sql_insert ('tconfig', array ("value" => 1, "token" => "skip_login_help_dialog")); $result_config = db_process_sql_insert('tconfig', ['value' => 1, 'token' => 'skip_login_help_dialog']);
}
} }
return; return;
} }
// Prints help dialog information // Prints help dialog information
echo '<div id="login_help_dialog" title="' . echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name()).'" style="">';
__('Welcome to %s', get_product_name()) . '" style="">';
echo '<div style="font-size: 10pt; margin: 20px;">'; echo '<div style="font-size: 10pt; margin: 20px;">';
echo __("If this is your first time using %s, we suggest a few links that'll help you learn more about the software. Monitoring can be overwhelming, but take your time to learn how to harness the power of %s!", echo __(
get_product_name(), get_product_name()); "If this is your first time using %s, we suggest a few links that'll help you learn more about the software. Monitoring can be overwhelming, but take your time to learn how to harness the power of %s!",
get_product_name(),
get_product_name()
);
echo '</div>'; echo '</div>';
echo '<div style="">'; echo '<div style="">';
echo '<table cellspacing=0 cellpadding=0 style="border:1px solid #FFF; width:100%; height: 100%">'; echo '<table cellspacing=0 cellpadding=0 style="border:1px solid #FFF; width:100%; height: 100%">';
echo '<tr>'; echo '<tr>';
echo '<td style="border:1px solid #FFF; text-align:center;">'; echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="' . ui_get_full_url(false) . 'general/pandora_help.php?id=main_help" target="_blank" style="text-decoration:none;">' . echo '<a href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank" style="text-decoration:none;">'.html_print_image(
html_print_image('images/online_help.png', true, 'images/online_help.png',
array("alt" => __('Online help'), "border" => 0)) . '</a>'; true,
[
'alt' => __('Online help'),
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />'; echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;" href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank">'.__('Online help').'</a>'; echo '<a style="font-size: 9pt;" href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank">'.__('Online help').'</a>';
echo '</td>'; echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">'; echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="http://pandorafms.com/" target="_blank" style="text-decoration:none;">' . echo '<a href="http://pandorafms.com/" target="_blank" style="text-decoration:none;">'.html_print_image(
html_print_image('images/enterprise_version.png', true, 'images/enterprise_version.png',
array("alt" => __('Enterprise version'), "border" => 0)) . '</a>'; true,
[
'alt' => __('Enterprise version'),
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />'; echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;" href="http://pandorafms.com/" target="_blank">'.__('Enterprise version').'</a>'; echo '<a style="font-size: 9pt;" href="http://pandorafms.com/" target="_blank">'.__('Enterprise version').'</a>';
echo '</td>'; echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">'; echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="https://pandorafms.com/forums" target="_blank" style="text-decoration:none;">' . echo '<a href="https://pandorafms.com/forums" target="_blank" style="text-decoration:none;">'.html_print_image(
html_print_image('images/support.png', true, 'images/support.png',
array("alt" => __('Support'), "border" => 0)) . '</a>'; true,
[
'alt' => __('Support'),
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />'; echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;" href="https://pandorafms.com/forums" target="_blank">'.__('Support').' / '.__('Forums').'</a>'; echo '<a style="font-size: 9pt;" href="https://pandorafms.com/forums" target="_blank">'.__('Support').' / '.__('Forums').'</a>';
echo '</td>'; echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">'; echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="' . $config['custom_docs_url'] . '" target="_blank" style="text-decoration:none;">' . echo '<a href="'.$config['custom_docs_url'].'" target="_blank" style="text-decoration:none;">'.html_print_image(
html_print_image('images/documentation.png', true, 'images/documentation.png',
array("alt" => __('Documentation'), "border" => 0)) . '</a>'; true,
[
'alt' => __('Documentation'),
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />'; echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;" href="'.$config['custom_docs_url'].'" target="_blank">'.__('Documentation').'</span></a>'; echo '<a style="font-size: 9pt;" href="'.$config['custom_docs_url'].'" target="_blank">'.__('Documentation').'</span></a>';
echo '</td>'; echo '</td>';
@ -87,7 +108,7 @@ echo '<div id="login_help_dialog" title="' .
echo '&nbsp;<span style="font-size: 12px;">'.__("Click here to don't show again this message").'</span>'; echo '&nbsp;<span style="font-size: 12px;">'.__("Click here to don't show again this message").'</span>';
echo '</div>'; echo '</div>';
echo '<div style="float: right; width: 20%;">'; echo '<div style="float: right; width: 20%;">';
html_print_submit_button("Ok", 'hide-login-help', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"'); html_print_submit_button('Ok', 'hide-login-help', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';

View File

@ -4,11 +4,9 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ -20,30 +18,73 @@
global $config; global $config;
function display_register ($data) {
if ($data['instance_registered'] == 1) return false; function display_register($data)
if ($data['force_register'] == 1) return true; {
if ($data['force_register'] == 0) return false; if ($data['instance_registered'] == 1) {
if ($data['identification_reminder'] == 0) return false;
if (!isset ($data['identification_reminder_timestamp'])) return true;
if ($data['identification_reminder_timestamp'] < time()) return true;
return false; return false;
} }
function display_newsletter ($data) { if ($data['force_register'] == 1) {
if ($data['newsletter_subscribed'] == 1) return false; return true;
if ($data['force_newsletter'] == 1) return true; }
if ($data['force_newsletter'] == 0) return false;
if ($data['newsletter_reminder'] === 0) return false; if ($data['force_register'] == 0) {
if (!isset ($data['newsletter_reminder_timestamp'])) return true;
if (!is_numeric ($data['newsletter_reminder_timestamp'])) return true;
if ($data['newsletter_reminder_timestamp'] < time()) return true;
return false; return false;
} }
if ($data['identification_reminder'] == 0) {
return false;
}
if (!isset($data['identification_reminder_timestamp'])) {
return true;
}
if ($data['identification_reminder_timestamp'] < time()) {
return true;
}
return false;
}
function display_newsletter($data)
{
if ($data['newsletter_subscribed'] == 1) {
return false;
}
if ($data['force_newsletter'] == 1) {
return true;
}
if ($data['force_newsletter'] == 0) {
return false;
}
if ($data['newsletter_reminder'] === 0) {
return false;
}
if (!isset($data['newsletter_reminder_timestamp'])) {
return true;
}
if (!is_numeric($data['newsletter_reminder_timestamp'])) {
return true;
}
if ($data['newsletter_reminder_timestamp'] < time()) {
return true;
}
return false;
}
if (is_ajax()) { if (is_ajax()) {
include_once $config['homedir'].'/include/functions_update_manager.php';
include_once($config['homedir'] . "/include/functions_update_manager.php");
$open_wizard = get_parameter('open_wizard', 0); $open_wizard = get_parameter('open_wizard', 0);
$not_return = get_parameter('not_return', 0); $not_return = get_parameter('not_return', 0);
@ -54,15 +95,16 @@ if (is_ajax()) {
} }
if ($open_wizard) { if ($open_wizard) {
$register_pandora = get_parameter('register_pandora', 0); $register_pandora = get_parameter('register_pandora', 0);
$newsletter = get_parameter('newsletter', 0); $newsletter = get_parameter('newsletter', 0);
$forced = get_parameter('forced', 0); $forced = get_parameter('forced', 0);
$future_8_days = time() + 8 * SECONDS_1DAY; $future_8_days = (time() + 8 * SECONDS_1DAY);
$ui_feedback = array('status' => true, 'message' => ''); $ui_feedback = [
'status' => true,
'message' => '',
];
if ($register_pandora) { if ($register_pandora) {
// Pandora register update // Pandora register update
$um_message = update_manager_register_instance(); $um_message = update_manager_register_instance();
$ui_feedback['message'] .= $um_message['message'].'<br><br>'; $ui_feedback['message'] .= $um_message['message'].'<br><br>';
@ -77,19 +119,18 @@ if (is_ajax()) {
} }
if ($newsletter) { if ($newsletter) {
// Pandora newsletter update // Pandora newsletter update
$email = get_parameter('email', ''); $email = get_parameter('email', '');
$um_message = update_manager_insert_newsletter($email); $um_message = update_manager_insert_newsletter($email);
$ui_feedback['message'] .= $um_message['message']; $ui_feedback['message'] .= $um_message['message'];
if ($um_message['success']) { if ($um_message['success']) {
db_process_sql_update ('tusuario', array ('middlename' => 1), array('id_user' => $config['id_user'])); db_process_sql_update('tusuario', ['middlename' => 1], ['id_user' => $config['id_user']]);
$ui_feedback['status'] = true && $ui_feedback['status']; $ui_feedback['status'] = true && $ui_feedback['status'];
} else { } else {
$ui_feedback['status'] = false; $ui_feedback['status'] = false;
} }
} else if (!$forced) { } else if (!$forced) {
db_process_sql_update ('tusuario', array ('lastname' => $future_8_days), array('id_user' => $config['id_user'])); db_process_sql_update('tusuario', ['lastname' => $future_8_days], ['id_user' => $config['id_user']]);
} }
// Form answer JSON // Form answer JSON
@ -103,11 +144,16 @@ if (is_ajax()) {
} }
// Check if user is admin // Check if user is admin
if (!license_free()) return; if (!license_free()) {
if (!users_is_admin ($config['id_user'])) return; return;
}
if (!users_is_admin($config['id_user'])) {
return;
}
// Get data to display properly the wizard // Get data to display properly the wizard
$wizard_data = array (); $wizard_data = [];
$wizard_data['newsletter_subscribed'] = db_get_value('middlename', 'tusuario', 'id_user', $config['id_user']); $wizard_data['newsletter_subscribed'] = db_get_value('middlename', 'tusuario', 'id_user', $config['id_user']);
// force_* = 1 -> force show // force_* = 1 -> force show
@ -128,63 +174,66 @@ $display_register = display_register ($wizard_data);
$display_forced = ($wizard_data['force_newsletter'] != -1) || ($wizard_data['force_register'] != -1); $display_forced = ($wizard_data['force_newsletter'] != -1) || ($wizard_data['force_register'] != -1);
// Return if it is fully completed // Return if it is fully completed
if ((!$display_register) && (!$display_newsletter)) return false; if ((!$display_register) && (!$display_newsletter)) {
return false;
}
$return_button = get_parameter('return_button', 0) == 1; $return_button = get_parameter('return_button', 0) == 1;
$email = db_get_value('email', 'tusuario', 'id_user', $config['id_user']); $email = db_get_value('email', 'tusuario', 'id_user', $config['id_user']);
// Avoid to show default email // Avoid to show default email
if ($email == 'admin@example.com') $email = ''; if ($email == 'admin@example.com') {
$email = '';
}
// Prints accept register license // Prints accept register license
echo '<div id="login_accept_register" title="' . echo '<div id="login_accept_register" title="'.__('The %s community wizard', get_product_name()).'" style="">';
__('The %s community wizard', get_product_name()) . '" style="">';
echo '<div style="margin: 5px 0 10px; float: left; padding-left: 15px;">'; echo '<div style="margin: 5px 0 10px; float: left; padding-left: 15px;">';
echo html_print_image('images/pandora_circle_big.png', true); echo html_print_image('images/pandora_circle_big.png', true);
echo '</div>'; echo '</div>';
echo '<div style="font-size: 12pt; margin: 5px 20px; float: left; padding-top: 23px;">'; echo '<div style="font-size: 12pt; margin: 5px 20px; float: left; padding-top: 23px;">';
echo __('Stay up to date with the %s community', get_product_name()) . "."; echo __('Stay up to date with the %s community', get_product_name()).'.';
echo '</div>'; echo '</div>';
echo '<div id="license_newsletter">'; echo '<div id="license_newsletter">';
echo '<p>' . __("When you subscribe to the %s Update Manager service, you accept that we register your %s instance as an identifier on the database owned by Artica TS. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the Update Manager options.", get_product_name(), get_product_name(), get_product_name()) . '</p>'; echo '<p>'.__('When you subscribe to the %s Update Manager service, you accept that we register your %s instance as an identifier on the database owned by Artica TS. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the Update Manager options.', get_product_name(), get_product_name(), get_product_name()).'</p>';
echo '<p>' . __("In the same fashion, when subscribed to the newsletter you accept that your email will pass on to a database property of Artica TS. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the newsletter subscription options.", get_product_name()) . '</p>'; echo '<p>'.__('In the same fashion, when subscribed to the newsletter you accept that your email will pass on to a database property of Artica TS. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the newsletter subscription options.', get_product_name()).'</p>';
echo '</div>'; echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; padding-top:10px; position:relative; border: 1px solid #FFF;">'; echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; padding-top:10px; position:relative; border: 1px solid #FFF;">';
echo '<div style="float: right;">'; echo '<div style="float: right;">';
html_print_submit_button(__("Finish"), 'finish_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"'); html_print_submit_button(__('Finish'), 'finish_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '</div>'; echo '</div>';
$display_status_return = $return_button ? 'block' : 'none'; $display_status_return = $return_button ? 'block' : 'none';
echo '<div style="float: right; width: 20%; display: '.$display_status_return.';">'; echo '<div style="float: right; width: 20%; display: '.$display_status_return.';">';
html_print_submit_button(__("Return"), 'return_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd" style="width:100px;"'); html_print_submit_button(__('Return'), 'return_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd" style="width:100px;"');
echo '</div>'; echo '</div>';
echo '<div style="float: left; margin-left: 0px; width: 50%; text-align: left;">'; echo '<div style="float: left; margin-left: 0px; width: 50%; text-align: left;">';
html_print_checkbox('register', 1, false, false, false, 'cursor: \'pointer\''); html_print_checkbox('register', 1, false, false, false, 'cursor: \'pointer\'');
echo '&nbsp;<span style="font-size: 12px;" id="label-register">'.__('Join the %s community!', get_product_name()).'!</span><br>'; echo '&nbsp;<span style="font-size: 12px;" id="label-register">'.__('Join the %s community!', get_product_name()).'!</span><br>';
html_print_checkbox('newsletter', 1, false, false, false, 'cursor: \'pointer\''); html_print_checkbox('newsletter', 1, false, false, false, 'cursor: \'pointer\'');
echo '&nbsp;<span style="font-size: 12px;" id="label-newsletter">' .__("Subscribe to our newsletter") . '</span>'; echo '&nbsp;<span style="font-size: 12px;" id="label-newsletter">'.__('Subscribe to our newsletter').'</span>';
echo "<br>"; echo '<br>';
echo '<div id="email_container">'; echo '<div id="email_container">';
echo '&nbsp;<span id="label-email-newsletter"style="font-size: 12px; display: none">' .__("Email") . ': </span>'; echo '&nbsp;<span id="label-email-newsletter"style="font-size: 12px; display: none">'.__('Email').': </span>';
html_print_input_text_extended ('email-newsletter', $email, 'text-email-newsletter', '', 30, 255, false, '', array ("style" => "display:none; width: 200px;")); echo '&nbsp;<span id="label-email-newsletter"style="font-size: 12px; display: none">' .__("Email") . ': </span>'; html_print_input_text_extended('email-newsletter', $email, 'text-email-newsletter', '', 30, 255, false, '', ['style' => 'display:none; width: 200px;']);
echo '&nbsp;<span id="required-email-newsletter">*'.__("Required") .' </span>'; echo '&nbsp;<span id="label-email-newsletter"style="font-size: 12px; display: none">'.__('Email').': </span>';
echo '&nbsp;<span id="required-email-newsletter">*'.__('Required').' </span>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
// Print yes or not dialog // Print yes or not dialog
echo '<div id="login_registration_yesno" title="' . echo '<div id="login_registration_yesno" title="'.__('%s instance identification wizard', get_product_name()).'" style="">';
__("%s instance identification wizard", get_product_name()) . '" style="">';
echo '<div style="font-size: 12pt; margin: 20px;">'; echo '<div style="font-size: 12pt; margin: 20px;">';
echo __("Do you want to continue without any registration") . "?"; echo __('Do you want to continue without any registration').'?';
echo '</div>'; echo '</div>';
echo '<div style="float: left; padding-left: 15px; padding-top: 20px;">'; echo '<div style="float: left; padding-left: 15px; padding-top: 20px;">';
html_print_submit_button(__("No"), 'no_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub cancel" style="width:100px;"'); html_print_submit_button(__('No'), 'no_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub cancel" style="width:100px;"');
echo '</div>'; echo '</div>';
echo '<div style="float: right; padding-right: 15px; padding-top: 20px;">'; echo '<div style="float: right; padding-right: 15px; padding-top: 20px;">';
html_print_submit_button(__("Yes"), 'yes_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd" style="width:100px;"'); html_print_submit_button(__('Yes'), 'yes_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd" style="width:100px;"');
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';

View File

@ -4,31 +4,28 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
if (isset($config['homedir'])) {
if (isset($config["homedir"])) { $homedir = $config['homedir'].'/';
$homedir = $config["homedir"] . '/'; } else {
}
else {
$homedir = ''; $homedir = '';
} }
include_once($homedir . 'include/functions_ui.php'); ui_require_css_file('login');
include_once($homedir . 'include/functions.php');
include_once(__DIR__ . '/../include/functions_html.php'); require_once $homedir.'include/functions_ui.php';
require_once $homedir.'include/functions.php';
require_once __DIR__.'/../include/functions_html.php';
if ($config['visual_animation']) { if ($config['visual_animation']) {
echo echo '<style>
'<style>
@keyframes login_move { @keyframes login_move {
from {margin-left: 10%;margin-right: 10%;opacity:0.1} from {margin-left: 10%;margin-right: 10%;opacity:0.1}
to {margin-left: 5%;margin-right: 5%;opacity:1} to {margin-left: 5%;margin-right: 5%;opacity:1}
@ -52,6 +49,7 @@ switch ($login_screen) {
$logo_link = 'http://www.pandorafms.com'; $logo_link = 'http://www.pandorafms.com';
$logo_title = __('Go to %s Website', get_product_name()); $logo_title = __('Go to %s Website', get_product_name());
break; break;
case 'logout': case 'logout':
case 'double_auth': case 'double_auth':
case 'error_install': case 'error_install':
@ -64,6 +62,7 @@ switch ($login_screen) {
$logo_link = 'index.php'; $logo_link = 'index.php';
$logo_title = __('Go to Login'); $logo_title = __('Go to Login');
break; break;
default: default:
error_reporting(0); error_reporting(0);
$error_info = ui_get_error($login_screen); $error_info = ui_get_error($login_screen);
@ -81,12 +80,14 @@ if (!empty ($page) && !empty ($sec)) {
$url .= '&amp;'.safe_url_extraclean($key).'='.safe_url_extraclean($value); $url .= '&amp;'.safe_url_extraclean($key).'='.safe_url_extraclean($value);
} }
} }
$login_body_style = ''; $login_body_style = '';
// Overrides the default background with the defined by the user // Overrides the default background with the defined by the user
if (!empty($config['login_background'])) { if (!empty($config['login_background'])) {
$background_url = "images/backgrounds/" . $config['login_background']; $background_url = 'images/backgrounds/'.$config['login_background'];
$login_body_style = "style=\"background-image: url('$background_url');\""; $login_body_style = "style=\"background-image: url('$background_url');\"";
} }
// Get the custom icons // Get the custom icons
$docs_logo = ui_get_docs_logo(); $docs_logo = ui_get_docs_logo();
$support_logo = ui_get_support_logo(); $support_logo = ui_get_support_logo();
@ -94,32 +95,34 @@ echo '<div id="login_body" ' . $login_body_style . '>';
echo '<div id="header_login">'; echo '<div id="header_login">';
echo '<div id="icon_custom_pandora">'; echo '<div id="icon_custom_pandora">';
if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) { if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (isset($config['custom_logo'])) { if (isset($config['custom_logo'])) {
echo '<img src="enterprise/images/custom_logo/'.$config['custom_logo'].'" alt="monitoring_console">'; echo '<img src="enterprise/images/custom_logo/'.$config['custom_logo'].'" alt="monitoring_console">';
} } else {
else{
echo '<img src="images/custom_logo/pandora_logo_head_4.png" alt="monitoring_console">'; echo '<img src="images/custom_logo/pandora_logo_head_4.png" alt="monitoring_console">';
} }
} } else {
else{
echo '<img src="images/custom_logo/pandora_logo_head_3.png" alt="monitoring_console">'; echo '<img src="images/custom_logo/pandora_logo_head_3.png" alt="monitoring_console">';
} }
echo '</div>'; echo '</div>';
echo '<div id="list_icon_docs_support"><ul style="line-height: 36px;">'; echo '<div id="list_icon_docs_support"><ul style="line-height: 36px;">';
if ($docs_logo !== false) { if ($docs_logo !== false) {
echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>'; echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
} }
echo '<li><a style="color: white; font-size:inherit;" href="'.$config['custom_docs_url'].'" target="_blank">'.__('Docs').'</li>'; echo '<li><a style="color: white; font-size:inherit;" href="'.$config['custom_docs_url'].'" target="_blank">'.__('Docs').'</li>';
if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) { if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($support_logo !== false) { if ($support_logo !== false) {
echo '<li id="li_margin_left"><a href="'.$config['custom_support_url'].'" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>'; echo '<li id="li_margin_left"><a href="'.$config['custom_support_url'].'" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
} }
echo '<li><a style="color: white; font-size:inherit;" href="'.$config['custom_support_url'].'" target="_blank">'.__('Support').'</li>'; echo '<li><a style="color: white; font-size:inherit;" href="'.$config['custom_support_url'].'" target="_blank">'.__('Support').'</li>';
} else { } else {
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>'; echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
echo '<li>'.__('Support').'</li>'; echo '<li>'.__('Support').'</li>';
} }
echo '</ul></div>'; echo '</ul></div>';
@ -130,31 +133,27 @@ echo '<div class="login_page">';
echo '<form method="post" action="'.ui_get_full_url('index.php'.$url).'" ><div class="login_logo_icon">'; echo '<form method="post" action="'.ui_get_full_url('index.php'.$url).'" ><div class="login_logo_icon">';
echo '<a href="'.$logo_link.'">'; echo '<a href="'.$logo_link.'">';
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
if (!isset ($config["custom_logo_login"])){ if (!isset($config['custom_logo_login'])) {
html_print_image ("images/custom_logo_login/login_logo.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true); html_print_image('images/custom_logo_login/login_logo.png', false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else {
html_print_image('images/custom_logo_login/'.$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} }
else{ } else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
html_print_image ("images/custom_logo_login/".$config['custom_logo_login'], false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true); if (!isset($config['custom_logo_login'])) {
html_print_image('enterprise/images/custom_logo_login/login_logo_v7.png', false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else {
html_print_image('enterprise/images/custom_logo_login/'.$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} }
} else {
if (!isset($config['custom_logo_login']) || $config['custom_logo_login'] == 0) {
html_print_image('images/custom_logo_login/pandora_logo.png', false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else {
html_print_image('images/custom_logo_login/'.$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} }
else if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) {
if (!isset ($config["custom_logo_login"])){
html_print_image ("enterprise/images/custom_logo_login/login_logo_v7.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
}
else{
html_print_image ("enterprise/images/custom_logo_login/".$config['custom_logo_login'], false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
}
}
else {
if (!isset ($config["custom_logo_login"]) || $config["custom_logo_login"] == 0){
html_print_image ("images/custom_logo_login/pandora_logo.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
}
else{
html_print_image ("images/custom_logo_login/".$config['custom_logo_login'], false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
}
echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>"; echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";
} }
echo '</a></div>'; echo '</a></div>';
switch ($login_screen) { switch ($login_screen) {
@ -165,25 +164,46 @@ echo '<div class="login_page">';
html_print_input_hidden(io_safe_input($key), $value); html_print_input_hidden(io_safe_input($key), $value);
} }
} }
if ($config['auth'] == 'saml') { if ($config['auth'] == 'saml') {
echo '<div id="log_nick" class="login_nick" style="display: none;">'; echo '<div id="log_nick" class="login_nick" style="display: none;">';
echo '<div>'; echo '<div>';
html_print_image ("/images/usuario_login.png", false); html_print_image('/images/usuario_login.png', false);
echo '</div>'; echo '</div>';
html_print_input_text_extended ("nick", '', "nick", '', '', '' , false, html_print_input_text_extended(
'', 'placeholder="'.__('User').'"'); 'nick',
'',
'nick',
'',
'',
'',
false,
'',
'placeholder="'.__('User').'"'
);
echo '</div>'; echo '</div>';
echo '<div id="log_pass" class="login_pass" style="display: none;">'; echo '<div id="log_pass" class="login_pass" style="display: none;">';
echo '<div>'; echo '<div>';
html_print_image ("/images/candado_login.png", false); html_print_image('/images/candado_login.png', false);
echo '</div>'; echo '</div>';
html_print_input_text_extended ("pass", '', "pass", '', '', '' ,false, html_print_input_text_extended(
'', 'placeholder="'.__('Password').'"', false, true); 'pass',
'',
'pass',
'',
'',
'',
false,
'',
'placeholder="'.__('Password').'"',
false,
true
);
echo '</div>'; echo '</div>';
echo '<div id="log_button" class="login_button" style="display: none; margin-bottom: 20px;">'; echo '<div id="log_button" class="login_button" style="display: none; margin-bottom: 20px;">';
html_print_submit_button(__("Login as admin"), "login_button", false, 'class="sub next_login"'); html_print_submit_button(__('Login as admin'), 'login_button', false, 'class="sub next_login"');
echo '</div>'; echo '</div>';
echo '<div class="login_button" id="remove_button" style="margin-bottom: 20px;">'; echo '<div class="login_button" id="remove_button" style="margin-bottom: 20px;">';
@ -191,52 +211,73 @@ echo '<div class="login_page">';
echo '</div>'; echo '</div>';
echo '<div class="login_button">'; echo '<div class="login_button">';
html_print_submit_button(__("Login with SAML"), "login_button_saml", false, ''); html_print_submit_button(__('Login with SAML'), 'login_button_saml', false, '');
echo '</div>'; echo '</div>';
} } else {
else {
echo '<div class="login_nick">'; echo '<div class="login_nick">';
echo '<div>'; echo '<div>';
html_print_image ("/images/usuario_login.png", false); html_print_image('/images/usuario_login.png', false);
echo '</div>'; echo '</div>';
html_print_input_text_extended ("nick", '', "nick", '', '', '' , false, html_print_input_text_extended(
'', 'autocomplete="off" placeholder="'.__('User').'"'); 'nick',
'',
'nick',
'',
'',
'',
false,
'',
'autocomplete="off" placeholder="'.__('User').'"'
);
echo '</div>'; echo '</div>';
echo '<div class="login_pass">'; echo '<div class="login_pass">';
echo '<div>'; echo '<div>';
html_print_image ("/images/candado_login.png", false); html_print_image('/images/candado_login.png', false);
echo '</div>'; echo '</div>';
html_print_input_text_extended ("pass", '', "pass", '', '', '' ,false, html_print_input_text_extended(
'', 'autocomplete="off" placeholder="'.__('Password').'"', false, true); 'pass',
'',
'pass',
'',
'',
'',
false,
'',
'autocomplete="off" placeholder="'.__('Password').'"',
false,
true
);
echo '</div>'; echo '</div>';
echo '<div class="login_button">'; echo '<div class="login_button">';
html_print_submit_button(__("Login"), "login_button", false, 'class="sub next_login"'); html_print_submit_button(__('Login'), 'login_button', false, 'class="sub next_login"');
echo '</div>'; echo '</div>';
} }
break; break;
case 'double_auth': case 'double_auth':
if (!empty($page) && !empty($sec)) { if (!empty($page) && !empty($sec)) {
foreach ($_POST as $key => $value) { foreach ($_POST as $key => $value) {
html_print_input_hidden(io_safe_input($key), $value); html_print_input_hidden(io_safe_input($key), $value);
} }
} }
echo '<div class="login_nick">'; echo '<div class="login_nick">';
echo '<div>'; echo '<div>';
html_print_image ("/images/icono_autenticacion.png", false); html_print_image('/images/icono_autenticacion.png', false);
echo '</div>'; echo '</div>';
html_print_input_text_extended ("auth_code", '', "auth_code", '', '', '' , false, '', 'class="login login_password" placeholder="'.__('Authentication code').'"', false, true); html_print_input_text_extended('auth_code', '', 'auth_code', '', '', '', false, '', 'class="login login_password" placeholder="'.__('Authentication code').'"', false, true);
echo '</div>'; echo '</div>';
echo '<div class="login_button">'; echo '<div class="login_button">';
html_print_submit_button(__("Check code") . '&nbsp;&nbsp;>', "login_button", false, 'class="sub next_login"'); html_print_submit_button(__('Check code').'&nbsp;&nbsp;>', 'login_button', false, 'class="sub next_login"');
echo '</div>'; echo '</div>';
break; break;
default: default:
if (isset($error_info)) { if (isset($error_info)) {
echo '<h1 id="log_title">'.$error_info['title'].'</h1>'; echo '<h1 id="log_title">'.$error_info['title'].'</h1>';
echo '<div id="error_buttons">'; echo '<div id="error_buttons">';
echo '<a href="index.php">' . html_print_image($config['homeurl'] . '/images/refresh_white.png', true, array('title' => __('Refresh')), false, true) . '</a>'; echo '<a href="index.php">'.html_print_image($config['homeurl'].'/images/refresh_white.png', true, ['title' => __('Refresh')], false, true).'</a>';
echo '<a href="javascript: modal_alert_critical()">' . html_print_image($config['homeurl'] . '/images/help_white.png', true, array('title' => __('View details')), false, true) . '</a>'; echo '<a href="javascript: modal_alert_critical()">'.html_print_image($config['homeurl'].'/images/help_white.png', true, ['title' => __('View details')], false, true).'</a>';
echo '</div>'; echo '</div>';
echo '<div id="log_msg">'; echo '<div id="log_msg">';
echo $error_info['message']; echo $error_info['message'];
@ -246,7 +287,7 @@ echo '<div class="login_page">';
} }
if ($config['enterprise_installed']) { if ($config['enterprise_installed']) {
if ($config["reset_pass_option"]) { if ($config['reset_pass_option']) {
$reset_pass_link = 'reset_pass.php'; $reset_pass_link = 'reset_pass.php';
// Reset password link // Reset password link
echo '<div style="width:70%; height:40px; margin-right:auto; margin-left:auto; margin-top:20px; text-align:center;">'; echo '<div style="width:70%; height:40px; margin-right:auto; margin-left:auto; margin-top:20px; text-align:center;">';
@ -260,44 +301,41 @@ echo '<div class="login_page">';
echo '<div class="login_data">'; echo '<div class="login_data">';
echo '<div class ="text_banner_login">'; echo '<div class ="text_banner_login">';
echo '<div><span class="span1 pandora_upper">'; echo '<div><span class="span1 pandora_upper">';
if(file_exists (ENTERPRISE_DIR . "/load_enterprise.php")){ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title1_login']) { if ($config['custom_title1_login']) {
echo io_safe_output($config['custom_title1_login']); echo io_safe_output($config['custom_title1_login']);
} } else {
else{
echo __('WELCOME TO %s', get_product_name()); echo __('WELCOME TO %s', get_product_name());
} }
} } else {
else{
echo __('WELCOME TO %s', get_product_name()); echo __('WELCOME TO %s', get_product_name());
} }
echo '</span></div>'; echo '</span></div>';
echo '<div><span class="span2">'; echo '<div><span class="span2">';
if(file_exists (ENTERPRISE_DIR . "/load_enterprise.php")){ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title2_login']) { if ($config['custom_title2_login']) {
echo io_safe_output($config['custom_title2_login']); echo io_safe_output($config['custom_title2_login']);
} } else {
else{
echo __('NEXT GENERATION'); echo __('NEXT GENERATION');
} }
} } else {
else{
echo __('NEXT GENERATION'); echo __('NEXT GENERATION');
} }
echo '</span></div>'; echo '</span></div>';
echo '</div>'; echo '</div>';
echo '<div class ="img_banner_login">'; echo '<div class ="img_banner_login">';
if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) { if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (isset($config['custom_splash_login'])) { if (isset($config['custom_splash_login'])) {
html_print_image ("enterprise/images/custom_splash_login/".$config['custom_splash_login'], false, array ( "alt" => "splash", "border" => 0, "title" => $splash_title), false, true); html_print_image('enterprise/images/custom_splash_login/'.$config['custom_splash_login'], false, [ 'alt' => 'splash', 'border' => 0, 'title' => $splash_title], false, true);
} else {
html_print_image('enterprise/images/custom_splash_login/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0, 'title' => $splash_title], false, true);
} }
else{ } else {
html_print_image ("enterprise/images/custom_splash_login/splash_image_default.png", false, array ("alt" => "logo", "border" => 0, "title" => $splash_title), false, true); html_print_image('images/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0, 'title' => $splash_title], false, true);
}
}
else{
html_print_image ("images/splash_image_default.png", false, array ("alt" => "logo", "border" => 0, "title" => $splash_title), false, true);
} }
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
@ -308,7 +346,7 @@ if (!isset($process_error_message) && isset($mail)) {
echo '<div id="reset_correct" title="'.__('Password reset').'">'; echo '<div id="reset_correct" title="'.__('Password reset').'">';
echo '<div class="content_alert">'; echo '<div class="content_alert">';
echo '<div class="icon_message_alert">'; echo '<div class="icon_message_alert">';
echo html_print_image('images/icono_logo_pandora.png', true, array("alt" => __('Password reset'), "border" => 0)); echo html_print_image('images/icono_logo_pandora.png', true, ['alt' => __('Password reset'), 'border' => 0]);
echo '</div>'; echo '</div>';
echo '<div class="content_message_alert">'; echo '<div class="content_message_alert">';
echo '<div class="text_message_alert">'; echo '<div class="text_message_alert">';
@ -316,17 +354,16 @@ if (!isset($process_error_message) && isset($mail)) {
echo '<p>'.__('An email has been sent to your email address').'</p>'; echo '<p>'.__('An email has been sent to your email address').'</p>';
echo '</div>'; echo '</div>';
echo '<div class="button_message_alert">'; echo '<div class="button_message_alert">';
html_print_submit_button("Ok", 'reset_correct_button', false); html_print_submit_button('Ok', 'reset_correct_button', false);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
} } else if (isset($process_error_message)) {
else if (isset($process_error_message)) {
echo '<div id="reset_correct" title="'.__('Password reset').'">'; echo '<div id="reset_correct" title="'.__('Password reset').'">';
echo '<div class="content_alert">'; echo '<div class="content_alert">';
echo '<div class="icon_message_alert">'; echo '<div class="icon_message_alert">';
echo html_print_image('images/icono_stop.png', true, array("alt" => __('Password reset'), "border" => 0)); echo html_print_image('images/icono_stop.png', true, ['alt' => __('Password reset'), 'border' => 0]);
echo '</div>'; echo '</div>';
echo '<div class="content_message_alert">'; echo '<div class="content_message_alert">';
echo '<div class="text_message_alert">'; echo '<div class="text_message_alert">';
@ -334,7 +371,7 @@ else if (isset($process_error_message)) {
echo '<p>'.$process_error_message.'</p>'; echo '<p>'.$process_error_message.'</p>';
echo '</div>'; echo '</div>';
echo '<div class="button_message_alert">'; echo '<div class="button_message_alert">';
html_print_submit_button("Ok", 'reset_correct_button', false); html_print_submit_button('Ok', 'reset_correct_button', false);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
@ -346,7 +383,7 @@ if (isset($correct_reset_pass_process)) {
echo '<div id="final_process_correct" title="'.__('Password reset').'">'; echo '<div id="final_process_correct" title="'.__('Password reset').'">';
echo '<div class="content_alert">'; echo '<div class="content_alert">';
echo '<div class="icon_message_alert">'; echo '<div class="icon_message_alert">';
echo html_print_image('images/icono_logo_pandora.png', true, array("alt" => __('Password reset'), "border" => 0)); echo html_print_image('images/icono_logo_pandora.png', true, ['alt' => __('Password reset'), 'border' => 0]);
echo '</div>'; echo '</div>';
echo '<div class="content_message_alert">'; echo '<div class="content_message_alert">';
echo '<div class="text_message_alert">'; echo '<div class="text_message_alert">';
@ -354,7 +391,7 @@ if (isset($correct_reset_pass_process)) {
echo '<p>'.$correct_reset_pass_process.'</p>'; echo '<p>'.$correct_reset_pass_process.'</p>';
echo '</div>'; echo '</div>';
echo '<div class="button_message_alert">'; echo '<div class="button_message_alert">';
html_print_submit_button("Ok", 'final_process_correct_button', false); html_print_submit_button('Ok', 'final_process_correct_button', false);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
@ -365,15 +402,15 @@ if (isset ($login_failed)) {
echo '<div id="login_failed" title="'.__('Login failed').'">'; echo '<div id="login_failed" title="'.__('Login failed').'">';
echo '<div class="content_alert">'; echo '<div class="content_alert">';
echo '<div class="icon_message_alert">'; echo '<div class="icon_message_alert">';
echo html_print_image('images/icono_stop.png', true, array("alt" => __('Login failed'), "border" => 0)); echo html_print_image('images/icono_stop.png', true, ['alt' => __('Login failed'), 'border' => 0]);
echo '</div>'; echo '</div>';
echo '<div class="content_message_alert">'; echo '<div class="content_message_alert">';
echo '<div class="text_message_alert">'; echo '<div class="text_message_alert">';
echo '<h1>'.__('ERROR').'</h1>'; echo '<h1>'.__('ERROR').'</h1>';
echo '<p>' . $config["auth_error"] . '</p>'; echo '<p>'.$config['auth_error'].'</p>';
echo '</div>'; echo '</div>';
echo '<div class="button_message_alert">'; echo '<div class="button_message_alert">';
html_print_submit_button("Ok", 'hide-login-error', false); html_print_submit_button('Ok', 'hide-login-error', false);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
@ -384,7 +421,7 @@ if ($login_screen == 'logout'){
echo '<div id="login_logout" title="'.__('Logged out').'">'; echo '<div id="login_logout" title="'.__('Logged out').'">';
echo '<div class="content_alert">'; echo '<div class="content_alert">';
echo '<div class="icon_message_alert">'; echo '<div class="icon_message_alert">';
echo html_print_image('images/icono_logo_pandora.png', true, array("alt" => __('Logged out'), "border" => 0)); echo html_print_image('images/icono_logo_pandora.png', true, ['alt' => __('Logged out'), 'border' => 0]);
echo '</div>'; echo '</div>';
echo '<div class="content_message_alert">'; echo '<div class="content_message_alert">';
echo '<div class="text_message_alert">'; echo '<div class="text_message_alert">';
@ -392,7 +429,7 @@ if ($login_screen == 'logout'){
echo '<p>'.__('Your session has ended. Please close your browser window to close this %s session.', get_product_name()).'</p>'; echo '<p>'.__('Your session has ended. Please close your browser window to close this %s session.', get_product_name()).'</p>';
echo '</div>'; echo '</div>';
echo '<div class="button_message_alert">'; echo '<div class="button_message_alert">';
html_print_submit_button("Ok", 'hide-login-logout', false); html_print_submit_button('Ok', 'hide-login-logout', false);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
@ -403,9 +440,11 @@ switch ($login_screen) {
case 'error_authconfig': case 'error_authconfig':
case 'error_dbconfig': case 'error_dbconfig':
$title = __('Problem with %s database', get_product_name()); $title = __('Problem with %s database', get_product_name());
$message = __('Cannot connect to the database, please check your database setup in the <b>include/config.php</b> file.<i><br/><br/> $message = __(
'Cannot connect to the database, please check your database setup in the <b>include/config.php</b> file.<i><br/><br/>
Probably your database, hostname, user or password values are incorrect or Probably your database, hostname, user or password values are incorrect or
the database server is not running.').'<br /><br />'; the database server is not running.'
).'<br /><br />';
$message .= '<span class="red">'; $message .= '<span class="red">';
$message .= '<b>'.__('DB ERROR').':</b><br>'; $message .= '<b>'.__('DB ERROR').':</b><br>';
$message .= db_get_last_error(); $message .= db_get_last_error();
@ -416,59 +455,75 @@ switch ($login_screen) {
$message .= __('If you have modified the auth system, the origin of this problem could be that %s cannot override the authorization variables from the config database. Please remove them from your database by executing:<br><pre>DELETE FROM tconfig WHERE token = "auth";</pre>', get_product_name()); $message .= __('If you have modified the auth system, the origin of this problem could be that %s cannot override the authorization variables from the config database. Please remove them from your database by executing:<br><pre>DELETE FROM tconfig WHERE token = "auth";</pre>', get_product_name());
} }
break; break;
case 'error_emptyconfig': case 'error_emptyconfig':
$title = __('Empty configuration table'); $title = __('Empty configuration table');
$message = __('Cannot load configuration variables from database. Please check your database setup in the $message = __(
'Cannot load configuration variables from database. Please check your database setup in the
<b>include/config.php</b> file.<i><br><br> <b>include/config.php</b> file.<i><br><br>
Most likely your database schema has been created but there are is no data in it, you have a problem with the database access credentials or your schema is out of date. Most likely your database schema has been created but there are is no data in it, you have a problem with the database access credentials or your schema is out of date.
<br><br>%s Console cannot find <i>include/config.php</i> or this file has invalid <br><br>%s Console cannot find <i>include/config.php</i> or this file has invalid
permissions and HTTP server cannot read it. Please read documentation to fix this problem.</i>', permissions and HTTP server cannot read it. Please read documentation to fix this problem.</i>',
get_product_name()).'<br /><br />'; get_product_name()
).'<br /><br />';
break; break;
case 'error_noconfig': case 'error_noconfig':
$title = __('No configuration file found'); $title = __('No configuration file found');
$message = __('%s Console cannot find <i>include/config.php</i> or this file has invalid $message = __(
permissions and HTTP server cannot read it. Please read documentation to fix this problem.', get_product_name()).'<br /><br />'; '%s Console cannot find <i>include/config.php</i> or this file has invalid
permissions and HTTP server cannot read it. Please read documentation to fix this problem.',
get_product_name()
).'<br /><br />';
if (file_exists('install.php')) { if (file_exists('install.php')) {
$link_start = '<a href="install.php">'; $link_start = '<a href="install.php">';
$link_end = '</a>'; $link_end = '</a>';
} } else {
else {
$link_start = ''; $link_start = '';
$link_end = ''; $link_end = '';
} }
$message .= sprintf(__('You may try to run the %s<b>installation wizard</b>%s to create one.'), $link_start, $link_end); $message .= sprintf(__('You may try to run the %s<b>installation wizard</b>%s to create one.'), $link_start, $link_end);
break; break;
case 'error_install': case 'error_install':
$title = __('Installer active'); $title = __('Installer active');
$message = __('For security reasons, normal operation is not possible until you delete installer file. $message = __(
Please delete the <i>./install.php</i> file before running %s Console.', get_product_name()); 'For security reasons, normal operation is not possible until you delete installer file.
Please delete the <i>./install.php</i> file before running %s Console.',
get_product_name()
);
break; break;
case 'error_perms': case 'error_perms':
$title = __('Bad permission for include/config.php'); $title = __('Bad permission for include/config.php');
$message = __('For security reasons, <i>config.php</i> must have restrictive permissions, and "other" users $message = __(
'For security reasons, <i>config.php</i> must have restrictive permissions, and "other" users
should not read it or write to it. It should be written only for owner should not read it or write to it. It should be written only for owner
(usually www-data or http daemon user), normal operation is not possible until you change (usually www-data or http daemon user), normal operation is not possible until you change
permissions for <i>include/config.php</i> file. Please do it, it is for your security.'); permissions for <i>include/config.php</i> file. Please do it, it is for your security.'
);
break; break;
case 'homedir_bad_defined': case 'homedir_bad_defined':
$title = __('Bad defined homedir'); $title = __('Bad defined homedir');
$message = __('In the config.php file in the variable $config["homedir"] = add the correct path'); $message = __('In the config.php file in the variable $config["homedir"] = add the correct path');
break; break;
case 'homeurl_bad_defined': case 'homeurl_bad_defined':
$title = __('Bad defined homeurl or homeurl_static'); $title = __('Bad defined homeurl or homeurl_static');
$message = __('In the config.php file in the variable $config["homeurl"] or $config["homeurl_static"] = add the correct path'); $message = __('In the config.php file in the variable $config["homeurl"] or $config["homeurl_static"] = add the correct path');
break; break;
} }
if($login_screen == 'error_authconfig' || $login_screen == 'error_emptyconfig' || $login_screen == 'error_install' || if ($login_screen == 'error_authconfig' || $login_screen == 'error_emptyconfig' || $login_screen == 'error_install'
$login_screen == 'error_dbconfig' || $login_screen == 'error_noconfig' || $login_screen == 'error_perms' || || $login_screen == 'error_dbconfig' || $login_screen == 'error_noconfig' || $login_screen == 'error_perms'
$login_screen == 'homedir_bad_defined' || $login_screen == 'homeurl_bad_defined'){ || $login_screen == 'homedir_bad_defined' || $login_screen == 'homeurl_bad_defined'
) {
echo '<div id="modal_alert" title="'.__('Login failed').'">'; echo '<div id="modal_alert" title="'.__('Login failed').'">';
echo '<div class="content_alert">'; echo '<div class="content_alert">';
echo '<div class="icon_message_alert">'; echo '<div class="icon_message_alert">';
echo html_print_image('images/icono_stop.png', true, array("alt" => __('Login failed'), "border" => 0)); echo html_print_image('images/icono_stop.png', true, ['alt' => __('Login failed'), 'border' => 0]);
echo '</div>'; echo '</div>';
echo '<div class="content_message_alert">'; echo '<div class="content_message_alert">';
echo '<div class="text_message_alert">'; echo '<div class="text_message_alert">';
@ -476,7 +531,7 @@ if($login_screen == 'error_authconfig' || $login_screen == 'error_emptyconfig' |
echo '<p> '.$message.'</h1>'; echo '<p> '.$message.'</h1>';
echo '</div>'; echo '</div>';
echo '<div class="button_message_alert">'; echo '<div class="button_message_alert">';
html_print_submit_button("Ok", 'hide-login-error', false); html_print_submit_button('Ok', 'hide-login-error', false);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
@ -484,16 +539,15 @@ if($login_screen == 'error_authconfig' || $login_screen == 'error_emptyconfig' |
} }
ui_require_css_file('dialog'); ui_require_css_file('dialog');
ui_require_css_file ('jquery-ui.min'); ui_require_css_file('jquery-ui.min', 'include/styles/js/');
ui_require_jquery_file('jquery-ui.min'); ui_require_jquery_file('jquery-ui.min');
?> ?>
<?php <?php
// Hidden div to forced title // Hidden div to forced title
html_print_div(array('id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true)); html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]);
// html_print_div(array('id' => 'modal_alert', 'hidden' => true)); // html_print_div(array('id' => 'modal_alert', 'hidden' => true));
?> ?>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
function show_normal_menu() { function show_normal_menu() {
@ -506,8 +560,7 @@ html_print_div(array('id' => 'forced_title_layer', 'class' => 'forced_title_laye
document.getElementById('log_pass').className = 'login_pass'; document.getElementById('log_pass').className = 'login_pass';
} }
<?php switch ("<?php echo $login_screen; ?>") {
switch($login_screen) {
case 'error_authconfig': case 'error_authconfig':
case 'error_dbconfig': case 'error_dbconfig':
case 'error_emptyconfig': case 'error_emptyconfig':
@ -516,8 +569,6 @@ html_print_div(array('id' => 'forced_title_layer', 'class' => 'forced_title_laye
case 'error_perms': case 'error_perms':
case 'homedir_bad_defined': case 'homedir_bad_defined':
case 'homeurl_bad_defined': case 'homeurl_bad_defined':
?>
// Auto popup // Auto popup
$(document).ready (function () { $(document).ready (function () {
$(function() { $(function() {
@ -540,10 +591,9 @@ html_print_div(array('id' => 'forced_title_layer', 'class' => 'forced_title_laye
}); });
}); });
<?php
break; break;
case 'logout': case 'logout':
?>
$(document).ready (function () { $(document).ready (function () {
$(function() { $(function() {
$("#login_logout").dialog({ $("#login_logout").dialog({
@ -564,11 +614,9 @@ html_print_div(array('id' => 'forced_title_layer', 'class' => 'forced_title_laye
$("#login_logout").dialog('close'); $("#login_logout").dialog('close');
}); });
}); });
<?php
break; break;
default: default:
?>
$(document).ready (function () { $(document).ready (function () {
// IE9- modal warning window // IE9- modal warning window
$(function() { $(function() {
@ -610,10 +658,8 @@ html_print_div(array('id' => 'forced_title_layer', 'class' => 'forced_title_laye
}); });
$('#nick').focus(); $('#nick').focus();
break;
<?php
} }
?>
$(document).ready (function () { $(document).ready (function () {
$(function() { $(function() {

View File

@ -4,11 +4,9 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ -21,7 +19,6 @@
global $config; global $config;
if (is_ajax()) { if (is_ajax()) {
$save_identification = get_parameter('save_required_wizard', 0); $save_identification = get_parameter('save_required_wizard', 0);
$change_language = get_parameter('change_language', 0); $change_language = get_parameter('change_language', 0);
$cancel_wizard = get_parameter('cancel_wizard', 0); $cancel_wizard = get_parameter('cancel_wizard', 0);
@ -32,17 +29,33 @@ if (is_ajax()) {
$timezone = get_parameter('timezone', false); $timezone = get_parameter('timezone', false);
$language = get_parameter('language', false); $language = get_parameter('language', false);
if ($email !== false) config_update_value ('language', $language); if ($email !== false) {
if ($timezone !== false) config_update_value ('timezone', $timezone); config_update_value('language', $language);
if ($email !== false) db_process_sql_update ('tusuario', }
array ('email' => $email), array('id_user' => $config['id_user']));
if ($timezone !== false) {
config_update_value('timezone', $timezone);
}
if ($email !== false) {
db_process_sql_update(
'tusuario',
['email' => $email],
['id_user' => $config['id_user']]
);
}
// Update the alert action Mail to XXX/Administrator if it is set to default // Update the alert action Mail to XXX/Administrator if it is set to default
$mail_check = 'yourmail@domain.es'; $mail_check = 'yourmail@domain.es';
$mail_alert = alerts_get_alert_action_field1(1); $mail_alert = alerts_get_alert_action_field1(1);
if ($mail_check === $mail_alert && $email !== false) { if ($mail_check === $mail_alert && $email !== false) {
alerts_update_alert_action (1, array('field1' => $email, alerts_update_alert_action(
'field1_recovery' => $email)); 1,
[
'field1' => $email,
'field1_recovery' => $email,
]
);
} }
config_update_value('initial_wizard', 1); config_update_value('initial_wizard', 1);
@ -62,11 +75,12 @@ if (is_ajax()) {
$email = db_get_value('email', 'tusuario', 'id_user', $config['id_user']); $email = db_get_value('email', 'tusuario', 'id_user', $config['id_user']);
// Avoid to show default email // Avoid to show default email
if ($email == 'admin@example.com') $email = ''; if ($email == 'admin@example.com') {
$email = '';
}
// Prints first step pandora registration // Prints first step pandora registration
echo '<div id="login_id_dialog" title="' . echo '<div id="login_id_dialog" title="'.__('%s instance identification wizard', get_product_name()).'" style="display: none;">';
__('%s instance identification wizard', get_product_name()) . '" style="display: none;">';
echo '<div style="font-size: 10pt; margin: 20px;">'; echo '<div style="font-size: 10pt; margin: 20px;">';
echo __('Please fill the following information in order to configure your %s instance successfully', get_product_name()).'.'; echo __('Please fill the following information in order to configure your %s instance successfully', get_product_name()).'.';
@ -76,8 +90,8 @@ echo '<div id="login_id_dialog" title="' .
$table = new StdClass(); $table = new StdClass();
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->width = '100%'; $table->width = '100%';
$table->data = array (); $table->data = [];
$table->size = array(); $table->size = [];
$table->size[0] = '40%'; $table->size[0] = '40%';
$table->style[0] = 'font-weight:bold'; $table->style[0] = 'font-weight:bold';
$table->size[1] = '60%'; $table->size[1] = '60%';
@ -86,16 +100,33 @@ echo '<div id="login_id_dialog" title="' .
$table->data[0][0] = __('Language code'); $table->data[0][0] = __('Language code');
$table->data[0][1] = html_print_select_from_sql( $table->data[0][1] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage', 'SELECT id_language, name FROM tlanguage',
'language', $config['language'] , '', '', '', true); 'language',
$config['language'],
'',
'',
'',
true
);
$zone_name = array('Africa' => __('Africa'), 'America' => __('America'), 'Antarctica' => __('Antarctica'), 'Arctic' => __('Arctic'), 'Asia' => __('Asia'), 'Atlantic' => __('Atlantic'), 'Australia' => __('Australia'), 'Europe' => __('Europe'), 'Indian' => __('Indian'), 'Pacific' => __('Pacific'), 'UTC' => __('UTC')); $zone_name = [
'Africa' => __('Africa'),
'America' => __('America'),
'Antarctica' => __('Antarctica'),
'Arctic' => __('Arctic'),
'Asia' => __('Asia'),
'Atlantic' => __('Atlantic'),
'Australia' => __('Australia'),
'Europe' => __('Europe'),
'Indian' => __('Indian'),
'Pacific' => __('Pacific'),
'UTC' => __('UTC'),
];
if ($zone_selected == "") { if ($zone_selected == '') {
if ($config["timezone"] != "") { if ($config['timezone'] != '') {
$zone_array = explode("/", $config["timezone"]); $zone_array = explode('/', $config['timezone']);
$zone_selected = $zone_array[0]; $zone_selected = $zone_array[0];
} } else {
else {
$zone_selected = 'Europe'; $zone_selected = 'Europe';
} }
} }
@ -109,9 +140,11 @@ echo '<div id="login_id_dialog" title="' .
} }
$table->data[2][0] = __('Timezone setup').' '.ui_print_help_tip( $table->data[2][0] = __('Timezone setup').' '.ui_print_help_tip(
__('Must have the same time zone as the system or database to avoid mismatches of time.'), true); __('Must have the same time zone as the system or database to avoid mismatches of time.'),
true
);
$table->data[2][1] = html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone()', '', '', true); $table->data[2][1] = html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone()', '', '', true);
$table->data[2][1] .= "&nbsp;&nbsp;". html_print_select($timezone_n, 'timezone', $config["timezone"], '', '', '', true); $table->data[2][1] .= '&nbsp;&nbsp;'.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true);
$table->data[4][0] = __('E-mail for receiving alerts'); $table->data[4][0] = __('E-mail for receiving alerts');
$table->data[4][1] = html_print_input_text('email', $email, '', 50, 255, true); $table->data[4][1] = html_print_input_text('email', $email, '', 50, 255, true);
@ -121,13 +154,13 @@ echo '<div id="login_id_dialog" title="' .
echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; right: 10px; border: 1px solid #FFF; width: 570px">'; echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; right: 10px; border: 1px solid #FFF; width: 570px">';
echo '<div style="float: right; width: 20%;">'; echo '<div style="float: right; width: 20%;">';
html_print_submit_button(__("Register"), 'id_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"'); html_print_submit_button(__('Register'), 'id_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '</div>'; echo '</div>';
echo '<div style="float: right; width: 20%;">'; echo '<div style="float: right; width: 20%;">';
html_print_button(__("Cancel"), 'cancel', false, '', 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"'); html_print_button(__('Cancel'), 'cancel', false, '', 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '</div>'; echo '</div>';
echo '<div id="all-required" style="float: right; margin-right: 30px; display: none; color: red;">'; echo '<div id="all-required" style="float: right; margin-right: 30px; display: none; color: red;">';
echo __("All fields required"); echo __('All fields required');
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';

View File

@ -4,16 +4,13 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
$login_screen = 'logout'; $login_screen = 'logout';
require('login_page.php'); require 'login_page.php';

View File

@ -4,16 +4,13 @@
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
?> ?>
<div class='databox' id='login'> <div class='databox' id='login'>

Some files were not shown because too many files have changed in this diff Show More