Merge remote-tracking branch 'origin/develop' into features/oracle

This commit is contained in:
Alejandro Gallardo Escobar 2015-06-18 20:02:01 +02:00
commit 3b037caf32
222 changed files with 3634 additions and 3474 deletions

View File

@ -0,0 +1,49 @@
%define name wmic
%define version 4.0.0tp4.rbn
Summary: Linux WMI client to do WMI querys using DCOM http://samba.org
Name: %{name}
Version: %{version}
Release: 1
License: GPL2
Group: System/Management
Packager: Robert B. Nelson <robertn@the-nelsons.org>
Source: http://www.openvas.org/download/wmi/wmi-1.3.14.tar.bz2
Patch1: http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch
Patch2: http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch2
Patch3: http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch3v2
Patch4: http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch4
Patch5: http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch5
BuildRoot: %{_tmppath}/%{name}-%{version}-build
AutoReq: 1
Provides: %{name}-%{version}
%description
Linux WMI client to do WMI querys. More information at SAMBA4 project at http://www.samba.org/
%prep
rm -rf $RPM_BUILD_ROOT
%setup -n wmi-1.3.14
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
cd Samba/source
./autogen.sh
./configure --without-readline --enable-debug
make "CPP=gcc -E -ffreestanding" proto bin/wmic
%install
mkdir -p $RPM_BUILD_ROOT/usr/bin/
install Samba/source/bin/wmic $RPM_BUILD_ROOT%{_bindir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%{_bindir}/wmic

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 6.0dev-150602
Version: 6.0dev-150618
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -68,40 +68,43 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local
transfer_mode tentacle
# timeout in seconds for file transfer programs execution (30 by default)
#transfer_timeout 30
# Server password (Tentacle or FTP). Leave empty for no password (default).
# server_pwd mypassword
#server_pwd mypassword
# Set to yes/no to enable/disable OpenSSL support for Tentacle (disabled by default).
# server_ssl no
#server_ssl no
# Extra options for the Tentacle client (for example, server_opts "-v -r 5").
# server_opts
#server_opts
# delayed_startup defines number of seconds before start execution
# for first time when startup Pandora FMS Agent
# delayed_startup 10
#delayed_startup 10
# Pandora nice defines priority of execution. Less priority means more intensive execution
# A recommended value is 10. 0 priority means no Pandora CPU protection enabled (default)
# pandora_nice 0
#pandora_nice 0
# Cron mode replace Pandora FMS own task schedule each XX interval seconds by the use
# of old style cron. You should add to crontab Pandora FMS agent script to use this mode.
# This is disabled by default, and is not recommended. Use Pandora FMS internal scheduler
# is much more safe.
# cron_mode
#cron_mode
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
# remote_config 1
#remote_config 1
# If set to 1 start Drone Agent's Proxy Mode
# proxy_mode 1
#proxy_mode 1
# Max number of simmultaneus connection for proxy (by default 10)
# proxy_max_connection 10
#proxy_max_connection 10
# Proxy timeout (by default 1s)
# proxy_timeout 1
#proxy_timeout 1
# Number of threads to execute modules in parallel
#agent_threads 1
@ -109,20 +112,21 @@ transfer_mode tentacle
# User the agent will run as
#pandora_user root
# Secondary server configuration
# ==============================
#Secondary server configuration
#==============================
# If secondary_mode is set to on_error, data files are copied to the secondary
# server only if the primary server fails. If set to always, data files are
# always copied to the secondary server.
# secondary_mode on_error
# secondary_server_ip localhost
# secondary_server_path /var/spool/pandora/data_in
# secondary_server_port 41121
# secondary_transfer_mode tentacle
# secondary_server_pwd mypassword
# secondary_server_ssl no
# secondary_server_opts
#secondary_mode on_error
#secondary_server_ip localhost
#secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121
#secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword
#secondary_server_ssl no
#secondary_server_opts
# Module Definition
# =================

View File

@ -94,6 +94,9 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local
transfer_mode tentacle
# timeout in seconds for file transfer programs execution (30 by default)
#transfer_timeout 30
# Server password (Tentacle or FTP). Leave empty for no password (default).
#server_pwd mypassword
@ -154,6 +157,7 @@ temporal_min_size 1024
#secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121
#secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword
#secondary_server_ssl no
#secondary_server_opts

View File

@ -64,40 +64,43 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local
transfer_mode tentacle
# timeout in seconds for file transfer programs execution (30 by default)
#transfer_timeout 30
# Server password (Tentacle or FTP). Leave empty for no password (default).
# server_pwd mypassword
#server_pwd mypassword
# Set to yes/no to enable/disable OpenSSL support for Tentacle (disabled by default).
# server_ssl no
#server_ssl no
# Extra options for the Tentacle client (for example, server_opts "-v -r 5").
# server_opts
#server_opts
# delayed_startup defines number of seconds before start execution
# for first time when startup Pandora FMS Agent
# delayed_startup 10
#delayed_startup 10
# Pandora nice defines priority of execution. Less priority means more intensive execution
# A recommended value is 10. 0 priority means no Pandora CPU protection enabled (default)
# pandora_nice 0
#pandora_nice 0
# Cron mode replace Pandora FMS own task schedule each XX interval seconds by the use
# of old style cron. You should add to crontab Pandora FMS agent script to use this mode.
# This is disabled by default, and is not recommended. Use Pandora FMS internal scheduler
# is much more safe.
# cron_mode
#cron_mode
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
# remote_config 1
#remote_config 1
# If set to 1 start Drone Agent's Proxy Mode
# proxy_mode 1
#proxy_mode 1
# Max number of simmultaneus connection for proxy (by default 10)
# proxy_max_connection 10
#proxy_max_connection 10
# Proxy timeout (by default 1s)
# proxy_timeout 1
#proxy_timeout 1
# Number of threads to execute modules in parallel
#agent_threads 1
@ -111,14 +114,15 @@ transfer_mode tentacle
# If secondary_mode is set to on_error, data files are copied to the secondary
# server only if the primary server fails. If set to always, data files are
# always copied to the secondary server.
# secondary_mode on_error
# secondary_server_ip localhost
# secondary_server_path /var/spool/pandora/data_in
# secondary_server_port 41121
# secondary_transfer_mode tentacle
# secondary_server_pwd mypassword
# secondary_server_ssl no
# secondary_server_opts
#secondary_mode on_error
#secondary_server_ip localhost
#secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121
#secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword
#secondary_server_ssl no
#secondary_server_opts
# Module Definition
# =================

View File

@ -58,40 +58,43 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local
transfer_mode tentacle
# timeout in seconds for file transfer programs execution (30 by default)
#transfer_timeout 30
# Server password (Tentacle or FTP). Leave empty for no password (default).
# server_pwd mypassword
#server_pwd mypassword
# Set to yes/no to enable/disable OpenSSL support for Tentacle (disabled by default).
# server_ssl no
#server_ssl no
# Extra options for the Tentacle client (for example, server_opts "-v -r 5").
# server_opts
#server_opts
# delayed_startup defines number of seconds before start execution
# for first time when startup Pandora FMS Agent
# delayed_startup 10
#delayed_startup 10
# Pandora nice defines priority of execution. Less priority means more intensive execution
# A recommended value is 10. 0 priority means no Pandora CPU protection enabled (default)
# pandora_nice 0
#pandora_nice 0
# Cron mode replace Pandora FMS own task schedule each XX interval seconds by the use
# of old style cron. You should add to crontab Pandora FMS agent script to use this mode.
# This is disabled by default, and is not recommended. Use Pandora FMS internal scheduler
# is much more safe.
# cron_mode
#cron_mode
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
# remote_config 1
#remote_config 1
# If set to 1 start Drone Agent's Proxy Mode
# proxy_mode 1
#proxy_mode 1
# Max number of simmultaneus connection for proxy (by default 10)
# proxy_max_connection 10
#proxy_max_connection 10
# Proxy timeout (by default 1s)
# proxy_timeout 1
#proxy_timeout 1
# User the agent will run as
#pandora_user root
@ -102,14 +105,15 @@ transfer_mode tentacle
# If secondary_mode is set to on_error, data files are copied to the secondary
# server only if the primary server fails. If set to always, data files are
# always copied to the secondary server.
# secondary_mode on_error
# secondary_server_ip localhost
# secondary_server_path /var/spool/pandora/data_in
# secondary_server_port 41121
# secondary_transfer_mode tentacle
# secondary_server_pwd mypassword
# secondary_server_ssl no
# secondary_server_opts
#secondary_mode on_error
#secondary_server_ip localhost
#secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121
#secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword
#secondary_server_ssl no
#secondary_server_opts
# Module Definition
# =================

View File

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '6.0dev';
use constant AGENT_BUILD => '150602';
use constant AGENT_BUILD => '150618';
# Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => {
@ -510,6 +510,9 @@ sub parse_conf_modules($) {
# Make the module run the first time
$module->{'counter'} = $module->{'intensive_interval'};
# Replace macros
replace_macros ($module);
push (@Modules, {%{$module}});
} else {
$module->{'func'} = \&module_plugin;
@ -601,15 +604,19 @@ sub write_broker_conf($){
my ($broker_agent) = @_;
my $content = '';
# I don't think the following should be copied either: proxy_*
my %ignored_tokens = (
'broker_agent' => 1, 'agent_name_cmd' => 1, 'udp_server' => 1, 'cron_mode' => 1
);
open (CONF_FILE, "$ConfDir/$ConfFile") or error ("Could not open file '$ConfDir/$ConfFile': $!.");
open (BROKER_FILE, ">$ConfDir/${broker_agent}.conf") or error ("Could not write configuration file: $!");
while (my $line = <CONF_FILE>){
while (my $line = <CONF_FILE>) {
# Skip broker definitions
if ($line =~ m/^\s*broker_agent/) {
next;
}
my ( $token ) = $line =~ m/^\s*(\S+)(\s.*)?$/;
# Skip tokens which should not be copied to broker configuration
next if defined $ignored_tokens{$token};
# Change the agent name
if ($line =~ m/^\s*#*\s*agent_name\s+/) {
@ -647,19 +654,6 @@ sub read_config (;$) {
# Replace CRLF with LF
$line =~ s/\r\n/\n/g;
# Store the custom fields
if (($line =~ m/^(custom_field\d+_name)\s+(.*)/) or ($line =~ m/^(custom_field\d+_value)\s+(.*)/)) {
$Customfields{$1} = $2;
next;
}
# Save global macros
if ($line =~ m/^macro(\S+)\s+(.*)/) {
$Macros{$1} = $2;
next;
}
# Token search
if (defined ($token)) {
if ($line =~ /^\s*(\S+)\s+(.*)$/ && $1 eq $token) {
@ -675,6 +669,20 @@ sub read_config (;$) {
}
next;
}
# Store the custom fields
if (($line =~ m/^(custom_field\d+_name)\s+(.*)/) or ($line =~ m/^(custom_field\d+_value)\s+(.*)/)) {
$Customfields{$1} = $2;
next;
}
# Save global macros
if ($line =~ m/^macro(\S+)\s+(.*)/) {
$Macros{$1} = $2;
next;
}
next if ($line =~ /^module\s*\w*/);
#Configuration token
@ -872,7 +880,7 @@ sub send_buffered_xml_files () {
while (my $xml_file = readdir(TEMPORAL)) {
# Skip non data files and symlinks
next if ($xml_file !~ m/\.data$/ || -l "$Conf{'temporal'}/$xml_file");
next if ($xml_file !~ m/^$Conf{'agent_name'}\.[0-9]+\.data$/ || -l "$Conf{'temporal'}/$xml_file");
my $rc = send_file ("$Conf{'temporal'}/$xml_file", 1);
unlink ("$Conf{'temporal'}/$xml_file") if ($rc == 0);

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 6.0dev
%define release 150602
%define release 150618
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
@ -51,11 +51,6 @@ cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_R
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
# Checking old config file (if exists)
if [ -f /etc/pandora/pandora_agent.conf ] ; then
mv /etc/pandora/pandora_agent.conf /etc/pandora/pandora_agent.conf.backup
fi
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 6.0dev
%define release 150602
%define release 150618
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
@ -51,16 +51,11 @@ cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_R
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
# Checking old config file (if exists)
if [ -f /etc/pandora/pandora_agent.conf ] ; then
mv /etc/pandora/pandora_agent.conf /etc/pandora/pandora_agent.conf.backup
fi
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then
rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec
fi
#if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then
# rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec
#fi
%clean
rm -Rf $RPM_BUILD_ROOT

View File

@ -62,6 +62,9 @@ interval 300
transfer_mode tentacle
server_port 41121
# timeout in seconds for file transfer programs execution (30 by default)
#transfer_timeout 30
# In case of using FTP or tentacle with password. User is always "pandora"
#server_pwd pandora
@ -98,6 +101,7 @@ xml_buffer 1
#secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121
#secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword
#secondary_server_ssl no
#secondary_server_opts

View File

@ -107,7 +107,7 @@ read_func(void *ptr, size_t size, size_t nmemb, FILE *stream)
*/
int
Pandora_Ftp_Client::ftpFileFilename (const string remote_filename,
const string filepath)
const string filepath, int timeout)
{
FILE *fd;
string operation1;
@ -155,8 +155,8 @@ Pandora_Ftp_Client::ftpFileFilename (const string remote_filename,
curl_easy_setopt (this->curl, CURLOPT_UPLOAD, 1) ;
curl_easy_setopt (this->curl, CURLOPT_URL, url.c_str ());
curl_easy_setopt (this->curl, CURLOPT_POSTQUOTE, headerlist);
curl_easy_setopt (this->curl, CURLOPT_TIMEOUT, 240);
curl_easy_setopt (this->curl, CURLOPT_FTP_RESPONSE_TIMEOUT, 60);
curl_easy_setopt (this->curl, CURLOPT_TIMEOUT, timeout * 4);
curl_easy_setopt (this->curl, CURLOPT_FTP_RESPONSE_TIMEOUT, timeout);
curl_easy_setopt (this->curl, CURLOPT_READFUNCTION, read_func);
curl_easy_setopt (this->curl, CURLOPT_READDATA, fd);
curl_easy_setopt (curl, CURLOPT_INFILESIZE_LARGE,

View File

@ -72,7 +72,7 @@ namespace FTP {
void disconnect ();
int ftpFileFilename (const string remote_filename,
const string filepath);
const string filepath, int timeout);
string getError ();
};

View File

@ -79,10 +79,16 @@ Pandora_FTP_Test::test () {
char *err;
DIR *dir;
FILE *conf_fh = NULL;
int timeout;
remote_host = this->conf->getValue ("server_ip");
cout << "Connecting with " << remote_host << "..." << endl;
password = this->conf->getValue ("server_pwd");
timeout = atoi (conf->getValue ("transfer_timeout").c_str ());
if (timeout == 0) {
timeout = 30;
}
if (password == "") {
cout << "FTP password not found in configuration file." << endl;
cout << "Check that server_pwd variable is set." << endl;
@ -136,7 +142,7 @@ Pandora_FTP_Test::test () {
try {
ftp_client->ftpFileFilename (remote_filepath + tmp_filename,
tmp_filepath);
tmp_filepath, timeout);
} catch (FTP::Unknown_Host e) {
cout << "Failed when copying to " << remote_host << " (" <<
ftp_client->getError () << ")" << endl;

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{150602}
{150618}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("6.0dev(Build 150602)")
#define PANDORA_VERSION ("6.0dev(Build 150618)")
string pandora_path;
string pandora_dir;

View File

@ -687,14 +687,14 @@ Pandora_Windows_Service::copyTentacleDataFile (string host,
string port,
string ssl,
string pass,
string opts)
string opts,
int timeout)
{
DWORD rc;
string var, filepath;
string tentacle_cmd, working_dir;
PROCESS_INFORMATION pi;
STARTUPINFO si;
int tentacle_timeout = 0;
var = conf->getValue ("temporal");
if (var[var.length () - 1] != '\\') {
@ -740,24 +740,25 @@ Pandora_Windows_Service::copyTentacleDataFile (string host,
CloseHandle (pi.hThread);
/* Timeout */
tentacle_timeout = atoi (conf->getValue ("tentacle_timeout").c_str ());
if (tentacle_timeout <= 0) {
tentacle_timeout = INFINITE;
} else {
/* Convert to milliseconds */
tentacle_timeout *= 1000;
}
if (timeout <= 0) {
timeout = 30;
}
/* Convert to milliseconds */
timeout *= 1000;
if (WaitForSingleObject(pi.hProcess, tentacle_timeout) == WAIT_TIMEOUT) {
if (WaitForSingleObject(pi.hProcess, timeout) == WAIT_TIMEOUT) {
TerminateProcess(pi.hProcess, STILL_ACTIVE);
CloseHandle (pi.hProcess);
pandoraLog ("Pandora Agent: Failed when copying to %s (tentacle timeout)", host.c_str ());
return -1;
}
/* Get the return code of the tentacle client*/
GetExitCodeProcess (pi.hProcess, &rc);
GetExitCodeProcess (pi.hProcess, &rc);
if (rc != 0) {
CloseHandle (pi.hProcess);
pandoraLog ("Pandora Agent: Failed when copying to %s",
host.c_str ());
return -1;
}
@ -770,6 +771,8 @@ Pandora_Windows_Service::copyScpDataFile (string host,
string remote_path,
string filename)
{
/* TODO: timeout implementation */
int rc = 0;
SSH::Pandora_Ssh_Client ssh_client;
string tmp_dir, filepath,port_str;
@ -830,7 +833,8 @@ int
Pandora_Windows_Service::copyFtpDataFile (string host,
string remote_path,
string filename,
string password)
string password,
int timeout)
{
int rc = 0;
FTP::Pandora_Ftp_Client ftp_client;
@ -856,7 +860,7 @@ Pandora_Windows_Service::copyFtpDataFile (string host,
password);
rc = ftp_client.ftpFileFilename (remote_path + filename,
filepath);
filepath, timeout);
if (rc == UNKNOWN_HOST) {
pandoraLog ("Pandora Agent: Failed when copying to %s (%s)",
host.c_str (), ftp_client.getError ().c_str ());
@ -882,13 +886,18 @@ Pandora_Windows_Service::copyFtpDataFile (string host,
int
Pandora_Windows_Service::copyDataFile (string filename)
{
int rc = 0;
int rc = 0, timeout;
unsigned char copy_to_secondary = 0;
string mode, host, remote_path;
mode = conf->getValue ("transfer_mode");
host = conf->getValue ("server_ip");
remote_path = conf->getValue ("server_path");
timeout = atoi (conf->getValue ("transfer_timeout").c_str ());
if (timeout == 0) {
timeout = 30;
}
// Fix remote path
if (mode != "local" && remote_path[remote_path.length () - 1] != '/') {
remote_path += "/";
@ -897,11 +906,11 @@ Pandora_Windows_Service::copyDataFile (string filename)
}
if (mode == "ftp") {
rc = copyFtpDataFile (host, remote_path, filename, conf->getValue ("server_pwd"));
rc = copyFtpDataFile (host, remote_path, filename, conf->getValue ("server_pwd"), timeout);
} else if (mode == "tentacle" || mode == "") {
rc = copyTentacleDataFile (host, filename, conf->getValue ("server_port"),
conf->getValue ("server_ssl"), conf->getValue ("server_pwd"),
conf->getValue ("server_opts"));
conf->getValue ("server_opts"), timeout);
} else if (mode == "ssh") {
rc =copyScpDataFile (host, remote_path, filename);
} else if (mode == "local") {
@ -932,6 +941,10 @@ Pandora_Windows_Service::copyDataFile (string filename)
mode = conf->getValue ("secondary_transfer_mode");
host = conf->getValue ("secondary_server_ip");
remote_path = conf->getValue ("secondary_server_path");
timeout = atoi (conf->getValue ("secondary_transfer_timeout").c_str ());
if (timeout == 0) {
timeout = 30;
}
// Fix remote path
if (mode != "local" && remote_path[remote_path.length () - 1] != '/') {
@ -942,11 +955,11 @@ Pandora_Windows_Service::copyDataFile (string filename)
// Send the file to the secondary server
if (mode == "ftp") {
rc = copyFtpDataFile (host, remote_path, filename, conf->getValue ("secondary_server_pwd"));
rc = copyFtpDataFile (host, remote_path, filename, conf->getValue ("secondary_server_pwd"), timeout);
} else if (mode == "tentacle" || mode == "") {
rc = copyTentacleDataFile (host, filename, conf->getValue ("secondary_server_port"),
conf->getValue ("secondary_server_ssl"), conf->getValue ("secondary_server_pwd"),
conf->getValue ("secondary_server_opts"));
conf->getValue ("secondary_server_opts"), timeout);
} else if (mode == "ssh") {
rc = copyScpDataFile (host, remote_path, filename);
} else {
@ -965,11 +978,14 @@ Pandora_Windows_Service::copyDataFile (string filename)
void
Pandora_Windows_Service::recvTentacleDataFile (string host,
string filename)
string filename,
int timeout)
{
int rc;
DWORD rc;
string var;
string tentacle_cmd;
PROCESS_INFORMATION pi;
STARTUPINFO si;
/* Change directory to "temporal" */
var = conf->getValue ("temporal");
@ -1008,42 +1024,58 @@ Pandora_Windows_Service::recvTentacleDataFile (string host,
filename.c_str (), host.c_str ());
pandoraDebug ("Command %s", tentacle_cmd.c_str());
rc = system (tentacle_cmd.c_str());
switch (rc) {
/* system() error */
case -1:
pandoraLog ("Unable to receive file %s", filename.c_str ());
throw Pandora_Exception ();
/* tentacle_client.exe returned OK */
case 0:
break;
/* tentacle_client.exe error */
default:
pandoraDebug ("Tentacle client was unable to receive file %s",
filename.c_str ());
throw Pandora_Exception ();
ZeroMemory (&si, sizeof (si));
ZeroMemory (&pi, sizeof (pi));
if (CreateProcess (NULL , (CHAR *)tentacle_cmd.c_str (), NULL, NULL, FALSE,
CREATE_NO_WINDOW, NULL, NULL, &si, &pi) == 0) {
return;
}
/* close thread handle, because it won't be used */
CloseHandle (pi.hThread);
/* Timeout */
if (timeout <= 0) {
timeout = 30;
}
/* Convert to milliseconds */
timeout *= 1000;
if (WaitForSingleObject(pi.hProcess, timeout) == WAIT_TIMEOUT) {
TerminateProcess(pi.hProcess, STILL_ACTIVE);
CloseHandle (pi.hProcess);
pandoraLog ("Unable to receive file %s (tentacle timeout)", filename.c_str ());
return;
}
/* Get the return code of the tentacle client*/
GetExitCodeProcess (pi.hProcess, &rc);
if (rc != 0) {
CloseHandle (pi.hProcess);
pandoraLog ("Unable to receive file %s", filename.c_str ());
return;
}
CloseHandle (pi.hProcess);
return;
}
void
Pandora_Windows_Service::recvDataFile (string filename) {
string mode, host, remote_path;
int timeout;
mode = conf->getValue ("transfer_mode");
host = conf->getValue ("server_ip");
remote_path = conf->getValue ("server_path");
timeout = atoi (conf->getValue ("transfer_timeout").c_str ());
if (remote_path[remote_path.length () - 1] != '/') {
remote_path += "/";
}
try {
if (mode == "tentacle") {
recvTentacleDataFile (host, filename);
recvTentacleDataFile (host, filename, timeout);
} else {
pandoraLog ("Transfer mode %s does not support file retrieval.", mode.c_str () );
throw Pandora_Exception ();

View File

@ -61,19 +61,22 @@ namespace Pandora {
string port,
string ssl,
string pass,
string opts);
string opts,
int timeout);
int copyScpDataFile (string host,
string remote_path,
string filename);
int copyFtpDataFile (string host,
string remote_path,
string filename,
string password);
string password,
int timeout);
int copyLocalDataFile (string remote_path,
string filename);
void recvDataFile (string filename);
void recvTentacleDataFile (string host,
string filename);
string filename,
int timeout);
int unzipCollection(string zip_path, string dest_dir);
void checkCollections ();

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(6.0dev(Build 150602))"
VALUE "ProductVersion", "(6.0dev(Build 150618))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -116,11 +116,8 @@ Pandora_Wmi::isServiceRunning (string service_name) {
if (str_state == "Running") {
retval = 1;
}
else if (str_state == "Stopped") {
retval = 0;
}
else {
retval = -1;
retval = 0;
}
dhFreeString (state);

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 6.0dev-150602
Version: 6.0dev-150618
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="6.0dev-150602"
pandora_version="6.0dev-150618"
package_pear=0
package_pandora=1

View File

@ -140,15 +140,17 @@ function mainAgentsModules() {
$filter_module_group['id_module_group'] = $modulegroup;
}
$count = 0;
foreach ($agents as $agent){
$module = agents_get_modules($agent, false, $filter_module_group, true, false);
if ($module == false){
foreach ($agents as $agent) {
$module = agents_get_modules($agent, false,
$filter_module_group, true, false);
if ($module == false) {
unset($agents[$count]);
}
$count++;
}
$total_pagination = count($agents);
$all_modules = agents_get_modules($agents, false, $filter_module_group, true, false);
$all_modules = agents_get_modules($agents, false,
$filter_module_group, true, false);
$modules_by_name = array();
$name = '';

View File

@ -86,7 +86,7 @@ function main_net_tools () {
$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);
foreach ($list_address as $address){
foreach ($list_address as $address) {
$ids []= join(",",$address);
}
$ids_address = implode(",",$ids);
@ -98,13 +98,13 @@ function main_net_tools () {
}
echo "
<script type='text/javascript'>
function mostrarColumns(ValueSelect){
function mostrarColumns(ValueSelect) {
value = ValueSelect.value;
if ( value==3 ) {
if (value == 3) {
$('netToolTable').css('width','100%');
$('#snmpcolumn').show();
}
else{
else {
$('netToolTable').css('width','100%');
$('#snmpcolumn').hide();
}
@ -116,7 +116,8 @@ function main_net_tools () {
echo "<table class='databox filters' width=100% id=netToolTable>";
echo "<tr><td>";
echo __("Operation");
ui_print_help_tip(__('You can set the command path in the menu Administration -&gt; Extensions -&gt; Config Network Tools'));
ui_print_help_tip(
__('You can set the command path in the menu Administration -&gt; Extensions -&gt; Config Network Tools'));
echo "</td><td>";
echo "<select name='operation' onChange='mostrarColumns(this);'>";
echo "<option value='1'>" . __("Traceroute");
@ -130,10 +131,11 @@ function main_net_tools () {
echo __("IP address");
echo "</td><td>";
echo "<select name='select_ips'>";
foreach($ips as $ip){
if ($ip['ip'] == $principal_ip){
foreach ($ips as $ip) {
if ($ip['ip'] == $principal_ip) {
echo "<option value='". $ip['ip'] ."' selected = 'selected'>" . $ip['ip'];
}else{
}
else {
echo "<option value='". $ip['ip'] ."'>" . $ip['ip'];
}
}
@ -172,7 +174,7 @@ function main_net_tools () {
ui_print_error_message(__('Ping executable does not exist.'));
}
else {
echo "<h3>".__("Ping to "). $ip. "</h3>";
echo "<h3>" . __("Ping to %s", $ip) . "</h3>";
echo "<pre>";
echo system ("$ping -c 5 $ip");
echo "</pre>";

View File

@ -76,11 +76,15 @@ function pluginreg_extension_main () {
$file_exec_path = $exec_path;
if (isset($ini_array["plugin_definition"]["execution_command"]) && ($ini_array["plugin_definition"]["execution_command"] != "")){
if (isset($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"];
}
if (isset($ini_array["plugin_definition"]["execution_postcommand"]) && ($ini_array["plugin_definition"]["execution_postcommand"] != "")){
if (isset($ini_array["plugin_definition"]["execution_postcommand"])
&& ($ini_array["plugin_definition"]["execution_postcommand"] != "")) {
$exec_path = $exec_path . " " .$ini_array["plugin_definition"]["execution_postcommand"];
}

View File

@ -88,7 +88,7 @@ if (empty($data)) {
}
echo '{
"label": "' . $graph_title . '",
"data": [["' . time() . '", ' . $data . ']]
"label": "' . $graph_title . '",
"data": [["' . time() . '", ' . $data . ']]
}';
?>

View File

@ -27,10 +27,10 @@ function render_info_data ($query, $label) {
render_row ($info, $label);
}
function render_row ($data, $label){
function render_row ($data, $label) {
global $console_mode;
if ($console_mode == 1){
if ($console_mode == 1) {
echo $label;
echo "|";
echo $data;

View File

@ -136,6 +136,13 @@ UPDATE `trecon_script` SET
`macros` = '{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.:&#x20;192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional&#x20;parameters\",\"help\":\"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.\",\"value\":\"\",\"hide\":\"\"}}'
WHERE `id_recon_script` = 2 AND `name` = 'IPMI&#x20;Recon';
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
UPDATE tnetwork_component SET snmp_oid ='SELECT&#x20;DNSHostName&#x20;FROM&#x20;Win32_ComputerSystem' WHERE id_nc = 204 AND name = 'Hostname';
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=207;
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=219;
-- -----------------------------------------------------
-- Table `tgis_map_has_tgis_map_con` (tgis_map_has_tgis_map_connection)

View File

@ -109,3 +109,11 @@ UPDATE trecon_script SET
description = 'Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident_flag&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0',
macros = '{"1":{"macro":"_field1_","desc":"Network","help":"i.e.:&#x20;192.168.100.0/24","value":"","hide":""},"2":{"macro":"_field2_","desc":"Username","help":"","value":"","hide":""},"3":{"macro":"_field3_","desc":"Password","help":"","value":"","hide":"1"},"4":{"macro":"_field4_","desc":"Additional&#x20;parameters","help":"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.","value":"","hide":""}}'
WHERE id_recon_script = 2 AND name = 'IPMI&#x20;Recon';
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
UPDATE tnetwork_component SET snmp_oid ='SELECT&#x20;DNSHostName&#x20;FROM&#x20;Win32_ComputerSystem' WHERE id_nc = 204 AND name = 'Hostname';
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=207;
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=219;

View File

@ -107,3 +107,11 @@ UPDATE "trecon_script"SET
"description" = 'Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident_flag&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0',
"macros" = '{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.:&#x20;192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional&#x20;parameters\",\"help\":\"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.\",\"value\":\"\",\"hide\":\"\"}}'
WHERE "id_recon_script" = 2 AND "name" = 'IPMI&#x20;Recon';
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
UPDATE tnetwork_component SET snmp_oid ='SELECT&#x20;DNSHostName&#x20;FROM&#x20;Win32_ComputerSystem' WHERE id_nc = 204 AND name = 'Hostname';
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=207;
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=219;

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=gagente&sec2=enterprise/godmode/agentes/collections&action=new">Crear una nueva colección</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=gagente&sec2=enterprise/godmode/agentes/collections&action=new">Crear una nueva colección</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field">Crear un nuevo campo</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field">Crear un nuevo campo</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="?sec=gservers&sec2=godmode/reporting/visual_console_builder">Crear un mapa de consola</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="?sec=gservers&sec2=godmode/reporting/visual_console_builder">Crear un mapa de consola</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=network&amp;sec2=operation/agentes/networkmap&add_networkmap=1&tab=groups">Crear un mapa de red de grupo</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=network&amp;sec2=operation/agentes/networkmap&add_networkmap=1&tab=groups">Crear un mapa de red de grupo</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,23 +5,23 @@ ui_require_css_file ('firts_task');
?>
<div class="new_task">
<div>
<div class="title_task"> <?php echo __('There are no recon task defined yet'); ?> </div>
</div>
<div>
<div class="image_task">
<?php echo html_print_image('images/icono_grande_reconserver.png', true, array("alt" => __('Recon server')));?>
</div>
<div class="text_task">
<div>
<div class="title_task"> <?php echo __('There are no recon task defined yet'); ?> </div>
</div>
<div>
<div class="image_task">
<?php echo html_print_image('images/icono_grande_reconserver.png', true, array("alt" => __('Recon server')));?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Recon Task'); ?></h3>
<p id="description_task"> <?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
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>
type. You can define your own customized recon script.'); ?></p>
<p id="description_task"> <?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
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>
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">
<button class="button_task" > <?php echo __('Create Recon Task'); ?></button>
</form>
</div>
</div>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="?sec=estado&sec2=enterprise/godmode/services/services.service&action=new_service">Crear un nuevo servicio</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="?sec=estado&sec2=enterprise/godmode/services/services.service&action=new_service">Crear un nuevo servicio</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter=-1">Crear un nuevo filtro snmp</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter=-1">Crear un nuevo filtro snmp</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=$sec&sec2=godmode/tag/edit_tag&action=new">Crear un nuevo tag</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=$sec&sec2=godmode/tag/edit_tag&action=new">Crear un nuevo tag</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -213,10 +213,12 @@ config_check();
$autorefresh_additional .= '</span>';
unset ($values);
$autorefresh_link_open_img = '<a class="white autorefresh" href="' . ui_get_url_refresh ($ignored_params) . '">';
$autorefresh_link_open_img =
'<a class="white autorefresh" href="' . ui_get_url_refresh ($ignored_params) . '">';
if ($_GET['refr']) {
$autorefresh_link_open_txt = '<a class="white autorefresh autorefresh_txt" href="' . ui_get_url_refresh ($ignored_params) . '">';
$autorefresh_link_open_txt =
'<a class="white autorefresh autorefresh_txt" href="' . ui_get_url_refresh ($ignored_params) . '">';
}
else {
$autorefresh_link_open_txt = '<a>';
@ -249,10 +251,18 @@ config_check();
$maintenance_title = __("System alerts detected - Please fix as soon as possible");
$maintenance_class = $maintenance_id = 'show_systemalert_dialog white';
$maintenance_link_open_txt = '<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_close = '</a>';
$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;
$maintenance_link_open_txt =
'<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_close = '</a>';
$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 {
$maintenance_img = html_print_image ("images/header_ready.png", true, array ("title" => __('There are not warnings'), "id" => "yougotalert", "class" => "bot"));

View File

@ -67,7 +67,8 @@ echo '<div class="databox_login" id="login">';
echo '<div id="login_inner">';
echo '<div id="login_in">';
echo '<div class="version_login"><div style="padding-top: 2px; color: #FFF;">' . $pandora_version . '</div></div>';
echo '<div class="version_login">
<div style="padding-top: 2px; color: #FFF;">' . $pandora_version . '</div></div>';
echo '<form method="post" action="' . ui_get_full_url('index.php'.$url) . '" >';
//TODO: Put branding in variables (external file) or database

View File

@ -205,7 +205,7 @@ $(document).ready( function() {
show_menu();
openTime = new Date().getTime();
}
}).mouseleave(function(){
}).mouseleave(function() {
handsIn = 0;
setTimeout(function() {
openedTime = new Date().getTime() - openTime;
@ -225,7 +225,7 @@ $(document).ready( function() {
$('#menu').css('width', '145px');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}).mouseleave(function(){
}).mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
@ -238,7 +238,7 @@ $(document).ready( function() {
}, 1500);
});
}
else{
else {
$('div#title_menu').hide();
}
});
@ -251,7 +251,7 @@ $(document).ready( function() {
handsIn = 0;
handsIn2 = 0;
$('.menu_icon').mouseenter(function(){
$('.menu_icon').mouseenter(function() {
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
@ -261,7 +261,7 @@ $(document).ready( function() {
if( typeof(table_noHover) != 'undefined')
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide();
}).mouseleave(function(){
}).mouseleave(function() {
//$('div#menu').css('overflow', 'hidden');
table_noHover = $(this);
handsIn = 0;
@ -275,7 +275,7 @@ $(document).ready( function() {
});
- $('.has_submenu').mouseenter(function(){
- $('.has_submenu').mouseenter(function() {
table_hover2 = $(this);
handsIn2 = 1;
openTime2 = new Date().getTime();
@ -283,7 +283,7 @@ $(document).ready( function() {
if( typeof(table_noHover2) != 'undefined')
if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id )
$("ul#sub"+table_noHover2[0].id).hide();
}).mouseleave(function(){
}).mouseleave(function() {
table_noHover2 = table_hover2;
handsIn2 = 0;
setTimeout(function() {
@ -295,8 +295,8 @@ $(document).ready( function() {
}, 3500);
});
$(document).ready(function(){
$('#container').click(function(){
$(document).ready(function() {
$('#container').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
@ -308,7 +308,7 @@ $(document).ready( function() {
$('div#title_menu').hide();
});
$('div.menu>ul>li>ul>li>a').click(function(){
$('div.menu>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
@ -319,7 +319,7 @@ $(document).ready( function() {
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
$('div.menu>ul>li>ul>li>ul>li>a').click(function(){
$('div.menu>ul>li>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();

View File

@ -63,13 +63,13 @@ if (is_ajax()) {
}
// Get critical events (realtime update)
if ($get_alerts_fired){
if ($get_alerts_fired) {
echo sc_get_alerts_fired();
return;
}
// Get critical events (realtime update)
if ($get_critical_events){
if ($get_critical_events) {
echo sc_get_critical_events();
return;
}
@ -107,7 +107,7 @@ function sc_get_critical_events () {
$shortcut_events_update = array();
$critical_events_update = 0;
foreach($shortcut_events_update as $event_update){
foreach ($shortcut_events_update as $event_update) {
if ($event_update['criticity'] == 4 and $event_update['estado'] == 0) {
$critical_events_update++;
}

View File

@ -164,7 +164,7 @@ switch ($config["dbtype"]) {
$result = db_get_all_rows_sql ($sql);
// Delete rnum row generated by oracle_recode_query() function
if (($config["dbtype"] == 'oracle') && ($result !== false)){
if (($config["dbtype"] == 'oracle') && ($result !== false)) {
for ($i=0; $i < count($result); $i++) {
unset($result[$i]['rnum']);
}

View File

@ -66,7 +66,7 @@ if (is_ajax ()) {
$oid_snmp = array();
$out = false;
foreach ($idSNMP as $id) {
foreach ($snmp[$id] as $key => $value){
foreach ($snmp[$id] as $key => $value) {
// Check if it has "ifXXXX" syntax and skip it
if (! preg_match ( "/if/", $key)) {
@ -246,7 +246,7 @@ $table->data[3][1] = html_print_select_groups(false, "AR", false, 'grupo', $grup
$table->data[4][0] = __('Interval');
$table->data[4][1] = html_print_extended_select_for_time ('intervalo', $intervalo, '', '', '0', 10, true);
if($intervalo<300){
if ($intervalo < SECONDS_5MINUTES) {
$table->data[4][1] .= clippy_context_help("interval_agent_min");
}
$table->data[5][0] = __('OS');

View File

@ -1052,11 +1052,14 @@ $(document).ready (function () {
});
$("#submit-create_modules_btn").click(function () {
if($("#module option").length == 0 || ($("#module option").length == 1 && $("#module option").eq(0).val() == 0)) {
if ($("#module option").length == 0
|| ($("#module option").length == 1
&& $("#module option").eq(0).val() == 0)) {
alert('<?php echo __('Modules list is empty'); ?>');
return false;
}
$('#module option').map(function(){
$('#module option').map(function() {
$(this).attr('selected','selected');
});
});

View File

@ -355,7 +355,9 @@ if ($wmiexplore && !$fail) {
$table->data[2][1] .= '<div class="wizard_mode_form wizard_mode_disks wizard_mode_disks_arrow clickable">' . html_print_image('images/darrowright.png', true, array('title' => __('Add to modules list'))) . '</div>';
$table->data[2][1] .= '<br><br><div class="wizard_mode_delete_arrow clickable">' . html_print_image('images/cross.png', true, array('title' => __('Remove from modules list'))) . '</div>';
$table->data[2][1] .= '<br><br><div class="wizard_mode_delete_arrow clickable">' .
html_print_image('images/cross.png', true, array('title' => __('Remove from modules list'))) .
'</div>';
$table->cellstyle[2][1] = 'vertical-align: middle; text-align: center;';
$table->data[2][2] = html_print_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:300px; height: 100%;');
@ -490,7 +492,7 @@ $(document).ready (function () {
alert('<?php echo __('Modules list is empty'); ?>');
return false;
}
$('#module option').map(function(){
$('#module option').map(function() {
$(this).attr('selected','selected');
});
});

View File

@ -205,10 +205,11 @@ if ($create_agent) {
// Create custom fields for this agent
foreach ($field_values as $key => $value) {
db_process_sql_insert ('tagent_custom_data',
array('id_field' => $key,'id_agent' => $id_agente, 'description' => $value));
array('id_field' => $key, 'id_agent' => $id_agente,
'description' => $value));
}
// Create address for this agent in taddress
if ( $direccion_agente != ''){
if ( $direccion_agente != '') {
agents_add_address ($id_agente, $direccion_agente);
}

View File

@ -40,14 +40,15 @@ $display_on_front = (int) get_parameter ('display_on_front', 0);
/* Create field */
if ($create_field) {
/*Check if name field is empty*/
if ($name == ""){
if ($name == "") {
ui_print_error_message(__('The name must not be empty'));
}
else if ($name == db_get_value ('name', 'tagent_custom_fields', 'name', $name)) {
ui_print_error_message(__('The name must be unique'));
}
else {
$result = db_process_sql_insert('tagent_custom_fields', array('name' => $name, 'display_on_front' => $display_on_front));
$result = db_process_sql_insert('tagent_custom_fields',
array('name' => $name, 'display_on_front' => $display_on_front));
ui_print_success_message(__('Field successfully created'));
}
}
@ -74,7 +75,8 @@ if ($update_field) {
/* Delete field */
if ($delete_field) {
$result = db_process_sql_delete('tagent_custom_fields', array('id_field' => $id_field));
$result = db_process_sql_delete('tagent_custom_fields',
array('id_field' => $id_field));
if (!$result)
ui_print_error_message(__('There was a problem deleting field'));

View File

@ -143,10 +143,10 @@ html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group,
echo "<td>";
echo __('Show Agents') . '&nbsp;';
$fields = array(
2 => __('Everyone'),
1 => __('Only disabled'),
0 => __('Only enabled'),
);
2 => __('Everyone'),
1 => __('Only disabled'),
0 => __('Only enabled'),
);
html_print_select($fields,"disabled",$disabled,'this.form.submit()');
echo "</td>";
@ -251,12 +251,12 @@ if ($search != "") {
LIKE '%$search%' OR direccion LIKE '%$search%') ";
}
if ($disabled==1)
if ($disabled == 1)
{
$search_sql = " AND disabled = ". $disabled . $search_sql;
}
else{
if ($disabled==0){
else {
if ($disabled == 0) {
$search_sql = " AND disabled = 0" . $search_sql;
}
}

View File

@ -403,7 +403,8 @@ $table_advanced->colspan[4][4] = 3;
$table_advanced->data[5][0] = __('FF interval') . ' ' . ui_print_help_icon ('ff_interval', true);
$table_advanced->data[5][1] = html_print_input_text ('module_ff_interval', $ff_interval,
'', 5, 10, true, $disabledBecauseInPolicy).ui_print_help_tip (__('Module execution flip flop time interval (in secs).'), true);
'', 5, 10, true, $disabledBecauseInPolicy) .
ui_print_help_tip (__('Module execution flip flop time interval (in secs).'), true);
$table_advanced->colspan[5][1] = 2;
$table_advanced->data[5][3] = __('FF timeout') . ' ' . ui_print_help_icon ('ff_timeout', true);
@ -544,7 +545,8 @@ $table_advanced->colspan[12][4] = 3;
if (check_acl ($config['id_user'], 0, "PM")) {
$table_advanced->data[13][0] = __('Category');
$table_advanced->data[13][1] = html_print_select(categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true);
$table_advanced->data[13][1] = html_print_select(
categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true);
$table_advanced->colspan[13][1] = 6;
}
else {
@ -725,13 +727,13 @@ $(document).ready (function () {
});
$("#submit-updbutton").click(function () {
$('#id_tag_selected option').map(function(){
$('#id_tag_selected option').map(function() {
$(this).attr('selected','selected');
});
});
$("#submit-crtbutton").click(function () {
$('#id_tag_selected option').map(function(){
$('#id_tag_selected option').map(function() {
$(this).attr('selected','selected');
});
});
@ -770,7 +772,7 @@ $(document).ready (function () {
$("#id_module_type").trigger('change');
// Prevent the form submission when the user hits the enter button from the relationship autocomplete inputs
$("#text-autocomplete_agent_name").keydown(function(event){
$("#text-autocomplete_agent_name").keydown(function(event) {
if(event.keyCode == 13) { // key code 13 is the enter button
event.preventDefault();
}
@ -839,7 +841,7 @@ function change_modules_autocomplete_input () {
if (data) {
module_autocomplete.html(data);
// Prevent the form submission when the user hits the enter button from the relationship autocomplete inputs
$("#text-autocomplete_module_name").keydown(function(event){
$("#text-autocomplete_module_name").keydown(function(event) {
if(event.keyCode == 13) { // key code 13 is the enter button
event.preventDefault();
}

View File

@ -544,10 +544,13 @@ else {
'&delete_downtime=1&id_downtime=' . $downtime['id'] . '&' . $filter_params_str . '">' .
html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete')));
}
elseif ($downtime["executed"] == 1 && $downtime['type_execution'] == 'once'){
elseif ($downtime["executed"] == 1
&& $downtime['type_execution'] == 'once') {
$data[8] = '<a href="index.php?sec=estado&amp;sec2=godmode/agentes/planned_downtime.editor&amp;' .
'edit_downtime=1&amp;id_downtime='.$downtime['id'].'">' .
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>';
'edit_downtime=1&amp;id_downtime=' . $downtime['id'] . '">' .
html_print_image("images/config.png", true,
array("border" => '0', "alt" => __('Update'))) . '</a>';
$data[9]= "N/A";
}
else {

View File

@ -73,9 +73,9 @@ if ($copy_action) {
$al_action = alerts_get_alert_action ($id);
if ($al_action !== false){
if ($al_action !== false) {
// If user tries to copy an action with group=ALL
if ($al_action['id_group'] == 0){
if ($al_action['id_group'] == 0) {
// then must have "PM" access privileges
if (! check_acl ($config['id_user'], 0, "PM")) {
db_pandora_audit("ACL Violation",

View File

@ -142,7 +142,8 @@ if ( defined("METACONSOLE") ) {
$form_filter .= "</td>";
$form_filter .= "</tr>";
$form_filter .= "</table>";
}else{
}
else {
$form_filter .= "</table>";
$form_filter .= "<div style='text-align:right; height:100%;'>";
$form_filter .= html_print_submit_button (__('Update'), '', false, 'class="sub upd"', true);
@ -497,7 +498,7 @@ foreach ($simple_alerts as $alert) {
else
$data[2] .= __('On').' '.$action['fires_min'];
}
else if ($action['fires_min'] < $action['fires_max']){
else if ($action['fires_min'] < $action['fires_max']) {
if ($action['fires_min'] == 0)
$data[2] .= __('Until').' '.$action['fires_max'];
else
@ -698,7 +699,7 @@ if (isset($dont_display_alert_create_bttn))
if ($dont_display_alert_create_bttn)
$display_create = false;
if ($display_create && check_acl ($config['id_user'], 0, "LW")){
if ($display_create && check_acl ($config['id_user'], 0, "LW")) {
echo '<div class="action-buttons" style="width: ' . $table->width . '">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">';
html_print_submit_button (__('Create'), 'crtbtn', false, 'class="sub next"');

View File

@ -124,7 +124,8 @@ if ($delete_alert) {
$id_agent_module = $temp["id_agent_module"];
$alert_template_name = db_get_value ("name", "talert_templates","id", $id_alert_template);
$module_name = db_get_value ("nombre", "tagente_modulo","id_agente_modulo", $id_agent_module);
$agent_name = agents_get_name (db_get_value ("id_agente", "tagente_modulo","id_agente_modulo", $id_agent_module));
$agent_name = agents_get_name(
db_get_value("id_agente", "tagente_modulo","id_agente_modulo", $id_agent_module));
$result = alerts_delete_alert_agent_module ($id_alert_agent_module);

View File

@ -231,7 +231,7 @@ $search_string = (string) get_parameter ('search_string');
$search_type = (string) get_parameter ('search_type');
$table->width = '98%';
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->width = '96%';
$table->class = 'databox_filters';
$table->cellspacing = 0;
@ -242,7 +242,7 @@ $table->data = array ();
$table->head = array ();
$table->style = array ();
if (!defined("METACONSOLE")){
if (!defined("METACONSOLE")) {
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
}
@ -258,13 +258,13 @@ $table->data[0][4] .= html_print_submit_button (__('Search'), 'search', false,
'class="sub search"', true);
$table->data[0][4] .= '</div>';
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$filter = '<form class="filters_form" method="post" action="' . $url . '">';
$filter .= html_print_table ($table,true);
$filter .= '</form>';
ui_toggle($filter, __("Show Options"));
}
else{
else {
echo '<form method="post" action="' . $url . '">';
html_print_table ($table);
echo '</form>';

View File

@ -431,13 +431,18 @@ $table->style[1] = 'width: 30%;';
$table->style[2] = 'width: 30%;';
$table->style[3] = 'font-weight: bold; width: 30%;';
$table->title = __('Firing fields') . ui_print_help_tip(__('Fields passed to the command executed by this action when the alert is fired'), true);
$table->title = __('Firing fields') .
ui_print_help_tip(__('Fields passed to the command executed by this action when the alert is fired'), true);
$table->head[0] = __('Field') . ui_print_help_tip(__('Fields configured on the command associated to the action'), true);
$table->head[1] = __('Template fields') . ui_print_help_tip(__('Triggering fields configured in template'), true);
$table->head[2] = __('Action fields') . ui_print_help_tip(__('Triggering fields configured in action'), true);
$table->head[0] = __('Field') .
ui_print_help_tip(__('Fields configured on the command associated to the action'), true);
$table->head[1] = __('Template fields') .
ui_print_help_tip(__('Triggering fields configured in template'), true);
$table->head[2] = __('Action fields') .
ui_print_help_tip(__('Triggering fields configured in action'), true);
$table->head[3] = __('Executed on firing') . ui_print_help_tip(__('Fields used on execution when the alert is fired'), true);
$table->head[3] = __('Executed on firing') .
ui_print_help_tip(__('Fields used on execution when the alert is fired'), true);
$firing_fields = array();

View File

@ -302,13 +302,17 @@ $(document).ready (function () {
// Replace the old column with the new
$table_macros_field.replaceWith(field_row);
if (old_value != '' || old_recovery_value != ''){
if (old_value != '' || old_recovery_value != '') {
$("[name=field" + i + "_value]").val(old_value);
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
}
else {
$("[name=field" + i + "_value]").val($("[name=field" + i + "_value]").val());
$("[name=field" + i + "_recovery_value]").val($("[name=field" + i + "_recovery_value]").val());
$("[name=field" + i + "_value]")
.val($("[name=field" + i + "_value]")
.val());
$("[name=field" + i + "_recovery_value]")
.val($("[name=field" + i + "_recovery_value]")
.val());
}
// Add help hint only in first field
if (i == 1) {

View File

@ -119,7 +119,7 @@ if (!empty($fields_values)) {
}
$table->width = '98%';
if (defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
if ($id) {
@ -133,7 +133,7 @@ if (defined('METACONSOLE')){
$table->headstyle[0] = 'text-align: center';
}
$table->style = array ();
if (!defined('METACONSOLE')){
if (!defined('METACONSOLE')) {
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
}

View File

@ -538,16 +538,18 @@ if ($step == 2) {
$table->data[4][0] = __('Default action');
$usr_groups = implode(',', array_keys(users_get_groups($config['id_user'], 'LM', true)));
switch ($config['dbtype']){
switch ($config['dbtype']) {
case "mysql":
case "postgresql":
$sql_query = sprintf('SELECT id, name
$sql_query = sprintf('
SELECT id, name
FROM talert_actions
WHERE id_group IN (%s)
ORDER BY name', $usr_groups);
break;
case "oracle":
$sql_query = sprintf('SELECT id,
$sql_query = sprintf('
SELECT id,
dbms_lob.substr(name,4000,1) AS nombre
FROM talert_actions
WHERE id_group IN (%s)
@ -557,7 +559,8 @@ if ($step == 2) {
$table->data[4][1] = html_print_select_from_sql ($sql_query,
'default_action', $default_action, '', __('None'), 0,
true, false, false) .
ui_print_help_tip (__('In case you fill any Field 1, Field 2 or Field 3 above, those will replace the corresponding fields of this associated "Default action".'), true);
ui_print_help_tip (
__('In case you fill any Field 1, Field 2 or Field 3 above, those will replace the corresponding fields of this associated "Default action".'), true);
$table->data[5][0] = __('Condition type');
$table->data[5][1] = html_print_select (alerts_get_alert_templates_types (), 'type',

View File

@ -89,13 +89,14 @@ $result = false;
$result = categories_get_all_categories ();
// Form to add new categories or search categories
if(!defined('METACONSOLE')){
if (!defined('METACONSOLE')) {
echo "<table border=0 cellpadding=4 cellspacing=4 class='databox' width=98%>";
echo "<tr>";
echo "<td align=right>";
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/category/edit_category&action=new&pure='.(int)$config['pure'].'">';
html_print_input_hidden ("create_category", "1", true);
html_print_submit_button (__('Create category'), 'create_button', false, 'class="sub next"');
html_print_submit_button (__('Create category'),
'create_button', false, 'class="sub next"');
echo "</form>";
echo "</td>";
echo "</tr>";
@ -133,12 +134,12 @@ if (!empty($result)) {
$data = array ();
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$data[0] = "<a href='index.php?sec=advanced&sec2=godmode/category/edit_category&action=update&id_category=" . $category["id"] . "&pure=" . (int)$config['pure'] . "'>" . $category["name"] . "</a>";
$data[1] = "<a href='index.php?sec=advanced&sec2=godmode/category/edit_category&action=update&id_category=".$category["id"] . "&pure=" . (int)$config['pure'] . "'>" . html_print_image("images/config.png", true, array("title" => "Edit")) . "</a>&nbsp;&nbsp;";
$data[1] .= '<a href="index.php?sec=advanced&sec2=godmode/category/category&delete_category='.$category["id"] . '&pure='.(int)$config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">' . html_print_image("images/cross.png", true, array("title" => "Delete")) . '</a>';
}
else{
else {
$data[0] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=" . $category["id"] . "&pure=" . (int)$config['pure'] . "'>" . $category["name"] . "</a>";
$data[1] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=".$category["id"] . "&pure=" . (int)$config['pure'] . "'>" . html_print_image("images/config.png", true, array("title" => "Edit")) . "</a>&nbsp;&nbsp;";
$data[1] .= '<a href="index.php?sec=gmodules&sec2=godmode/category/category&delete_category='.$category["id"] . '&pure='.(int)$config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">' . html_print_image("images/cross.png", true, array("title" => "Delete")) . '</a>';
@ -148,7 +149,7 @@ if (!empty($result)) {
html_print_table ($table);
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
echo "<table border=0 cellpadding=0 cellspacing=0 class='' width=100%>";
echo "<tr>";
echo "<td align=right>";

View File

@ -42,7 +42,7 @@ if(defined('METACONSOLE')) {
'text' => '<a href="index.php?sec=advanced&sec2=godmode/category/category&tab=list&pure='.(int)$config['pure'].'">' .
html_print_image ("images/list.png", true, array ("title" => __('List categories'))) .'</a>'));
}
else{
else {
$buttons = array(
'list' => array(
'active' => false,
@ -131,7 +131,7 @@ if(!defined('METACONSOLE'))
echo "<table border=0 cellpadding=4 cellspacing=4 class=databox width=100%>";
else
echo "<table border=0 cellpadding=4 cellspacing=4 class='databox data' width=100%>";
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
if ($action == "update") {
echo "<thead>
<tr>
@ -165,14 +165,15 @@ else
html_print_input_text ('name_category', $name_category);
echo "</td>";
echo "</tr>";
if(!defined('METACONSOLE')){
if (!defined('METACONSOLE')) {
echo "<tr>";
if ($action == "update") {
echo "<td align=center>";
html_print_input_hidden ('update_category', 1);
echo "</td>";
echo "<td align=right>";
html_print_submit_button (__('Update'), 'update_button', false, 'class="sub next"');
html_print_submit_button (__('Update'), 'update_button',
false, 'class="sub next"');
echo "</td>";
}
if ($action == "new") {
@ -186,17 +187,19 @@ else
echo "</tr>";
}
echo "</table>";
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
echo "<table border=0 cellpadding=0 cellspacing=0 class='' width=100%>";
echo "<tr>";
echo "<td align=right>";
if ($action == "update") {
html_print_input_hidden ('update_category', 1);
html_print_submit_button (__('Update'), 'update_button', false, 'class="sub next"');
html_print_submit_button (__('Update'), 'update_button', false,
'class="sub next"');
}
if ($action == "new") {
html_print_input_hidden ('create_category', 1);
html_print_submit_button (__('Create'), 'create_button', false, 'class="sub next"');
html_print_submit_button (__('Create'), 'create_button', false,
'class="sub next"');
}
echo "</td>";
echo "</tr>";

View File

@ -61,7 +61,7 @@ $time["3month"] = $time["all"] - SECONDS_3MONTHS;
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
if (isset($_POST["purgedb"])){ # Fixed 2005-1-13, nil
if (isset($_POST["purgedb"])) { # Fixed 2005-1-13, nil
$from_date = get_parameter_post("date_purge");
$deleted = db_process_sql_delete('tsesion', array('utimestamp' => '< ' . $from_date));

View File

@ -18,7 +18,8 @@ global $config;
check_login ();
ui_print_page_header (__('Database maintenance').' &raquo; '.__('Event database cleanup'), "images/gm_db.png", false, "", true);
ui_print_page_header (__('Database maintenance').' &raquo; ' .
__('Event database cleanup'), "images/gm_db.png", false, "", true);
if (! check_acl ($config['id_user'], 0, "DM")) {
db_pandora_audit("ACL Violation", "Trying to access Database Management Event");
@ -29,10 +30,11 @@ if (! check_acl ($config['id_user'], 0, "DM")) {
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
if (isset ($_POST["date_purge"])){
if (isset ($_POST["date_purge"])) {
$from_date = (int) get_parameter_post ("date_purge");
$deleted = db_process_sql_delete('tevento', array('utimestamp' => '< ' . $from_date));
$deleted = db_process_sql_delete('tevento',
array('utimestamp' => '< ' . $from_date));
if ($deleted !== false) {
ui_print_success_message(__('Successfully deleted old events'));
@ -43,7 +45,11 @@ if (isset ($_POST["date_purge"])){
}
# End of get parameters block
$row = db_get_row_sql ("SELECT COUNT(*) AS total, MIN(timestamp) AS first_date, MAX(timestamp) AS latest_date FROM tevento");
$row = db_get_row_sql ("
SELECT COUNT(*) AS total,
MIN(timestamp) AS first_date,
MAX(timestamp) AS latest_date
FROM tevento");
$table->data = array ();
$table->cellpadding = 4;

View File

@ -178,12 +178,19 @@ foreach ($fields_available as $key=>$available) {
$table->data[0][0] = '<b>' . __('Fields available').'</b>';
$table->data[1][0] = html_print_select ($fields_available, 'fields_available[]', true, '', '', '', true, true, false, '', false, 'width: 200px');
$table->data[1][1] = '<a href="javascript:">'.html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add fields to select'))).'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'. html_print_image('images/darrowleft.png', true, array('id' => 'left', 'title' => __('Delete fields to select'))).'</a>';
$table->data[1][1] = '<a href="javascript:">' .
html_print_image('images/darrowright.png', true,
array('id' => 'right', 'title' => __('Add fields to select'))) .
'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">' .
html_print_image('images/darrowleft.png', true,
array('id' => 'left', 'title' => __('Delete fields to select'))) .
'</a>';
$table->data[0][1] = '';
$table->data[0][2] = '<b>' . __('Fields selected') . '</b>';
$table->data[1][2] = html_print_select($result_selected, 'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 200px');
$table->data[1][2] = html_print_select($result_selected,
'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 200px');
echo '<form id="custom_events" method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=fields&amp;pure='.$config['pure'].'">';
html_print_table($table);
@ -212,7 +219,7 @@ $(document).ready (function () {
$("#left").click (function () {
jQuery.each($("select[name='fields_selected[]'] option:selected"), function (key, value) {
field_name = $(value).html();
if (field_name != <?php echo "'".__('None')."'"; ?>){
if (field_name != <?php echo "'".__('None')."'"; ?>) {
id_field = $(value).attr('value');
$("select[name='fields_available[]']").append($("<option></option>").val(id_field).html('<i>' + field_name + '</i>'));
$("#fields_selected").find("option[value='" + id_field + "']").remove();

View File

@ -317,7 +317,7 @@ if (defined("METACONSOLE")) {
$table->data[13][1] .= html_print_input_hidden('tag_without',
$tag_without_base64, true);
}
else{
else {
$table->colspan[13][0] = '2';
$table->data[13][0] = '<b>' . __('Events with following tags') . '</b>';

View File

@ -28,7 +28,7 @@ if (! check_acl ($config["id_user"], 0, "EW")) {
$delete = (bool) get_parameter ('delete', 0);
$multiple_delete = (bool)get_parameter('multiple_delete', 0);
if ($delete){
if ($delete) {
$id = (int) get_parameter('id');

View File

@ -85,7 +85,7 @@ $table->data = array();
$defaultMapId = null;
if ($maps){
if ($maps) {
$own_info = get_user_info($config['id_user']);
foreach ($maps as $map) {
if (!check_acl ($config["id_user"], $map["group_id"], "IW")) {

View File

@ -98,7 +98,7 @@ else {
$table->width = '98%';
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->width = '100%';
$table->class = 'databox data';
if ($id_group)

View File

@ -323,11 +323,12 @@ foreach ($all_parents as $parent) {
$groups_count = count($groups);
if (check_acl($config['id_user'], 0, "PM")) {
if (!defined("METACONSOLE")){
if (!defined("METACONSOLE")) {
echo '<br />';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/groups/configure_group&pure='.$pure.'">';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button (__('Create group'), 'crt', false, 'class="sub next"');
html_print_submit_button(__('Create group'), 'crt', false,
'class="sub next"');
echo '</div>';
echo '</form>';
}

View File

@ -306,7 +306,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["enterprise"] = $extension['enterprise'];
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
}
else{
else {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon'];
@ -316,7 +316,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
}
}
else{
else {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon'];

View File

@ -45,7 +45,7 @@ else {
}
$table->width = '98%';
if (defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
if ($id) {

View File

@ -442,12 +442,12 @@ $search_id_group = (int) get_parameter ('search_id_group');
$search_string = (string) get_parameter ('search_string');
$table->width = '98%';
if(defined("METACONSOLE")){
if(defined("METACONSOLE")) {
$table->width = '50%';
$table->class = 'databox_filters';
}
$table->style = array ();
if (!defined('METACONSOLE')){
if (!defined('METACONSOLE')) {
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
}
@ -501,14 +501,14 @@ $table->data[0][4] .= html_print_submit_button (__('Search'), 'search', false,
'class="sub search"', true);
$table->data[0][4] .= '</div>';
if(defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$filter = '<form class="filters_form" method="post" action="'.$url.'">';
$filter .= html_print_table ($table,true);
$filter .= '</form>';
ui_toggle($filter, __("Show Options"));
}
else{
echo '<form method="post" action="'.$url.'">';
else {
echo '<form method="post" action="' . $url . '">';
html_print_table ($table);
echo '</form>';
}
@ -517,7 +517,10 @@ $filter = array ();
if ($search_id_group)
$filter['id_group'] = $search_id_group;
if ($search_string != '')
$filter[] = '(name LIKE "%'.$search_string.'%" OR description LIKE "%'.$search_string.'%" OR tcp_send LIKE "%'.$search_string.'%" OR tcp_rcv LIKE "%'.$search_string.'%")';
$filter[] = '(name LIKE "%' . $search_string . '%" ' .
'OR description LIKE "%'. $search_string . '%" ' .
'OR tcp_send LIKE "%' . $search_string . '%" ' .
'OR tcp_rcv LIKE "%' . $search_string . '%")';
$total_components = network_components_get_network_components (false, $filter, 'COUNT(*) AS total');
$total_components = $total_components[0]['total'];

View File

@ -233,7 +233,7 @@ else {
echo '<form name="component" method="post">';
/* $table came from manage_network_components_form_common.php */
if (defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
if ($id) {

View File

@ -267,10 +267,18 @@ if ($id_np > 0) {
$group_filter .= '</div></form>';
if ($ncgroup > 0) {
$sql = sprintf ("SELECT id_nc, name, id_group FROM tnetwork_component WHERE id_group = %d AND name LIKE '%".$ncfilter."%' ORDER BY name", $ncgroup);
$sql = sprintf ("
SELECT id_nc, name, id_group
FROM tnetwork_component
WHERE id_group = %d AND name LIKE '%" . $ncfilter . "%'
ORDER BY name", $ncgroup);
}
else {
$sql = "SELECT id_nc, name, id_group FROM tnetwork_component WHERE name LIKE '%".$ncfilter."%' ORDER BY name";
$sql = "
SELECT id_nc, name, id_group
FROM tnetwork_component
WHERE name LIKE '%" . $ncfilter . "%'
ORDER BY name";
}
$result = db_get_all_rows_sql ($sql);

View File

@ -112,7 +112,7 @@ if ($filters === false)
$filters = array ();
$table->width = '90%';
if (defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '100%';
}
$table->head = array ();

View File

@ -173,7 +173,7 @@ $table->border = 0;
$table->cellspacing = 3;
$table->cellpadding = 5;
$table->class = "databox_color";
if (defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
if($id)
@ -183,7 +183,7 @@ if (defined('METACONSOLE')){
$table->head_colspan[0] = 5;
$table->headstyle[0] = 'text-align: center';
}
else{
else {
$table->style[0] = 'vertical-align: top;';
}

View File

@ -195,14 +195,14 @@ $last_item = $item_max['id_rc'];
foreach ($reports_item as $item) {
$data = array ();
if (($item['id_rc'] == $first_item) && ($item['id_rc'] == $last_item)){
if (($item['id_rc'] == $first_item) && ($item['id_rc'] == $last_item)) {
$data[0] = '<span style="display: block; float: left; width: 16px;">&nbsp;</span>';
}
else if (($item['id_rc'] == $first_item) && ($item['id_rc'] != $last_item)){
else if (($item['id_rc'] == $first_item) && ($item['id_rc'] != $last_item)) {
$data[0] = '<span style="display: block; float: left; width: 16px;">&nbsp;</span>';
$data[0] .= '<a href="' . $config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>';
}
else if (($item['id_rc'] == $last_item) && ($item['id_rc'] != $first_item)){
else if (($item['id_rc'] == $last_item) && ($item['id_rc'] != $first_item)) {
$data[0] = '<a href="' . $config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>';
}
else {

View File

@ -73,7 +73,7 @@ if ($editGraph) {
}
// Modules table
if(count($module_array) > 0){
if (count($module_array) > 0) {
echo "<table width='98%' cellpadding=4 cellpadding=4 class='databox'>";
echo "<tr>
<th>".__('Agent')."</th>
@ -81,9 +81,9 @@ if(count($module_array) > 0){
<th>".__('Weight')."</th>
<th>".__('Delete')."</th>";
$color = 0;
for ($a = 0; $a < count($module_array); $a++){
for ($a = 0; $a < count($module_array); $a++) {
// Calculate table line color
if ($color == 1){
if ($color == 1) {
$tdcolor = "datos";
$color = 0;
}

View File

@ -41,9 +41,9 @@ if (is_ajax ()) {
}
return;
}
}
return;
return;
}
check_login ();

View File

@ -39,9 +39,9 @@ if (is_ajax ()) {
}
return;
}
}
return;
return;
}
check_login ();

View File

@ -38,7 +38,7 @@ $buttons['graph_list'] = array('active' => true,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs">' .
html_print_image("images/list.png", true, array ("title" => __('Graph list'))) .'</a>');
if ($enterpriseEnable){
if ($enterpriseEnable) {
$buttons = reporting_enterprise_add_template_graph_tabs($buttons);
}

View File

@ -189,7 +189,7 @@ switch ($action) {
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
$period = $item['period'];
// 'top_n_value' field will be reused for projection report
if ($type == 'projection_graph'){
if ($type == 'projection_graph') {
$projection_period = $item['top_n_value'];
$period_pg = $item['period'];
}
@ -545,16 +545,16 @@ else
?>
<table style="" class="<?php echo $class;?>" id="" border="0" cellpadding="4" cellspacing="4" width="100%">
<?php
if (defined("METACONSOLE")){
echo "<thead>
<tr>
<th align=center colspan=5>
" . __('Item Editor') . "
</th>
</tr>
</thead>";
}
?>
if (defined("METACONSOLE")) {
echo "<thead>
<tr>
<th align=center colspan=5>
" . __('Item Editor') . "
</th>
</tr>
</thead>";
}
?>
<tbody>
<tr id="row_type" style="" class="datos">
<td style="vertical-align: top; width: 220px;"><?php echo __('Type'); ?></td>
@ -962,8 +962,10 @@ else
$metaconsole_connections = array();
}
$result_servers = array();
foreach ($metaconsole_connections as $metaconsole_element){
$connection_data = enterprise_hook('metaconsole_get_connection', array($metaconsole_element));
foreach ($metaconsole_connections as $metaconsole_element) {
$connection_data = enterprise_hook(
'metaconsole_get_connection',
array($metaconsole_element));
$result_servers[$connection_data['server_name']] = $connection_data['server_name'];
}
// Print select combo with metaconsole servers
@ -1710,7 +1712,7 @@ function edit_custom_graph() {
var id_element_graph;
var id_server;
if (id_graph.indexOf("|") != -1){
if (id_graph.indexOf("|") != -1) {
agent_server_temp = id_graph.split('|');
id_element_graph = agent_server_temp[0];
id_server = agent_server_temp[1];

View File

@ -279,7 +279,7 @@ $table->style[0] = 'text-align: right;';
if ($items) {
$table->width = '98%';
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->width = '100%';
$table->class = "databox data";
}
@ -448,7 +448,7 @@ foreach ($items as $item) {
metaconsole_restore_db();
}
}
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
if ($items != false) {
ui_pagination ($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . $urlFilter);
html_print_table($table);
@ -491,13 +491,13 @@ $table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->class = "databox data";
$table->head[0] = __("Sort items");
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
}
else{
else {
$table->data[0][0] = "<b>". __("Sort items") . "</b>";
}
$table->data[1][0] = __('Sort selected items from position: ');
@ -522,13 +522,13 @@ $table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->class = "databox data";
$table->head[0] = __("Delete items");
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
}
else{
else {
$table->data[0][0] = "<b>". __("Delete items") . "</b>";
}
$table->data[1][0] = __('Delete selected items from position: ');
@ -594,6 +594,11 @@ function added_ids_sorted_items_to_hidden_input() {
function only_numbers(name) {
var value = $("input[name='" + name + "']").val();
if (value == "") {
// Do none it is a empty field.
return;
}
value = parseInt(value);
if (isNaN(value)) {

View File

@ -47,7 +47,7 @@ $table->id = 'add_alert_table';
$table->class = 'databox';
$table->head = array ();
if(defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->width = '100%';
$table->class = 'databox data';
$table->head[0] = __('Main data');

View File

@ -374,7 +374,7 @@ switch ($action) {
$table_aux->class = 'databox filters';
$table_aux->cellpadding = 0;
$table_aux->cellspacing = 0;
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table_aux->class = 'databox_filters';
$table_aux->width = '96%';
$table_aux->cellpadding = 0;
@ -390,14 +390,14 @@ switch ($action) {
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true);
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$filter = "<form class ='filters_form' action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&id_group=$id_group&pure=$pure'
method='post'>";
$filter .= html_print_table($table_aux,true);
$filter .= "</form>";
ui_toggle($filter, __("Show Option"));
}
else{
else {
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&id_group=$id_group&pure=$pure'
method='post'>";
html_print_table($table_aux);
@ -471,7 +471,7 @@ switch ($action) {
$table->class = 'databox data';
$table->cellpadding = 0;
$table->cellspacing = 0;
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->class = 'databox';
$table->width = '100%';
}
@ -656,7 +656,7 @@ switch ($action) {
}
html_print_table ($table);
}
else{
else {
ui_print_info_message ( array ( 'no_close' => true, 'message' => __('No data found.') ) );
}
if (check_acl ($config['id_user'], 0, "RW")) {
@ -853,7 +853,7 @@ switch ($action) {
$interval_max = get_parameter('max_interval');
$interval_min = get_parameter('min_interval');
// Checks intervals fields
if (preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_max) and preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_min)){
if (preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_max) and preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_min)) {
$good_format = true;
}
$intervals = get_parameter('max_interval') . ';' . get_parameter('min_interval');
@ -1115,7 +1115,7 @@ switch ($action) {
$interval_max = get_parameter('max_interval');
$interval_min = get_parameter('min_interval');
// Checks intervals fields
if (preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_max) and preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_min)){
if (preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_max) and preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_min)) {
$good_format = true;
}
$intervals = get_parameter('max_interval') . ';' . get_parameter('min_interval');

View File

@ -263,12 +263,12 @@ if (($create != "") OR ($view != "")) {
$table->colspan['plugin_desc'][1] = 3;
$table->data['plugin_desc'] = $data;
if (!defined("METACONSOLE")){
if (!defined("METACONSOLE")) {
echo '<br>';
echo '<table class="databox" style="margin: 0 auto; width: 98%;"><tr><td>';
}
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->width = '100%';
$table->class = 'databox data';
$table->head[0] = __('General');
@ -276,8 +276,9 @@ if (($create != "") OR ($view != "")) {
$table->headstyle[0] = 'text-align: center';
echo '<br>';
html_print_table($table);
}else{
echo '<fieldset style="width:96%"><legend>'.__('General').'</legend>';
}
else {
echo '<fieldset style="width:96%"><legend>' . __('General') . '</legend>';
html_print_table($table);
echo '</fieldset>';
}
@ -330,7 +331,7 @@ if (($create != "") OR ($view != "")) {
$data[1] = '<div id="command_preview" style="font-style:italic"></div>';
$table->data['plugin_preview'] = $data;
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->width = '100%';
$table->class = 'databox data';
$table->head[0] = __('Command');
@ -338,8 +339,9 @@ if (($create != "") OR ($view != "")) {
$table->headstyle[0] = 'text-align: center';
echo '<br>';
html_print_table($table);
}else{
echo '<fieldset style="width:96%"><legend>'.__('Command').'</legend>';
}
else {
echo '<fieldset style="width:96%"><legend>' . __('Command') . '</legend>';
html_print_table($table);
echo '</fieldset>';
}
@ -449,7 +451,7 @@ if (($create != "") OR ($view != "")) {
$table->data['plugin_action'] = $datam;
}
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->width = '100%';
$table->class = 'databox data';
$table->head[0] = __('Parameters macros');
@ -457,8 +459,10 @@ if (($create != "") OR ($view != "")) {
$table->headstyle[0] = 'text-align: center';
echo '<br>';
html_print_table($table);
}else{
echo '<fieldset style="width:96%"><legend>'.__('Parameters macros').ui_print_help_icon ('macros', true).'</legend>';
}
else {
echo '<fieldset style="width:96%">' .
'<legend>' . __('Parameters macros') .ui_print_help_icon ('macros', true) . '</legend>';
html_print_table($table);
echo '</fieldset>';
}
@ -556,7 +560,8 @@ else {
$result = false;
if ($values['name'] != '' && $values['execute'] != '')
$result = db_process_sql_update('tplugin', $values, array('id' => $plugin_id));
$result = db_process_sql_update('tplugin', $values,
array('id' => $plugin_id));
if (! $result) {
ui_print_error_message(__('Problem updating plugin'));

View File

@ -61,13 +61,13 @@ if ($create != "") {
$form_name = "";
$form_description = "";
$form_script = "";
$macros = "";
$macros = "";
}
// SHOW THE FORM
// =================================================================
if (($create != "") OR ($view != "")){
if (($create != "") OR ($view != "")) {
if ($create != "")
ui_print_page_header (__('Recon script creation'), "images/gm_servers.png", false, "reconscript_definition", true);
@ -215,7 +215,7 @@ if (($create != "") OR ($view != "")){
echo '<table width=98%>';
echo '<tr><td align="right">';
if ($create != ""){
if ($create != "") {
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('Create')."'>";
}
else {
@ -332,7 +332,7 @@ else {
else {
ui_print_success_message(__('reconscript deleted successfully'));
}
if ($reconscript_id != 0){
if ($reconscript_id != 0) {
$result = db_process_sql_delete('trecon_task',
array('id_recon_script' => $reconscript_id));
}

View File

@ -90,8 +90,8 @@ foreach ($servers as $server) {
}
// Type
$data[2] = '<span style="white-space:nowrap;">'.$server["img"];
if ($server["master"] == 1){
$data[2] = '<span style="white-space:nowrap;">' . $server["img"];
if ($server["master"] == 1) {
$data[2] .= ui_print_help_tip (__("This is a master server"), true);
}
//$data[2] .= '</span> <span style="font-size:8px;"> v' .. '</span>';
@ -117,7 +117,7 @@ foreach ($servers as $server) {
}
$data[6] = $server['threads'].' : '.$server['queued_modules'];
if ($server['queued_modules'] > 200){
if ($server['queued_modules'] > 200) {
$data[6] .= clippy_context_help("server_queued_modules");
}
$data[7] = ui_print_timestamp ($server['keepalive'], true);
@ -169,7 +169,7 @@ if ($tiny) {
if ($tiny) {
ui_toggle(html_print_table ($table,true), __('Tactical server information'));
}
else{
else {
html_print_table ($table);
}
?>

View File

@ -79,7 +79,9 @@ if ($mapsConnections !== false) {
ui_print_group_icon ($mapsConnection['group_id'], true),
'<a href="index.php?sec=gsetup&sec2=godmode/setup/gis&amp;id_connection_map=' .
$mapsConnection['id_tmap_connection'].'&amp;action=delete_connection"
onClick="javascript: if (!confirm(\'' . __('Do you wan delete this connection?') . '\')) return false;">' . html_print_image ("images/cross.png", true).'</a>');
onClick="javascript: if (!confirm(\'' .
__('Do you wan delete this connection?') . '\')) return false;">' .
html_print_image ("images/cross.png", true).'</a>');
}
}

View File

@ -136,9 +136,9 @@ else { // Main list view for Links editor
echo "<th width='180px'>".__('Link name')."</th>";
echo "<th width='80px'>".__('Delete')."</th>";
$color=1;
$color = 1;
foreach ($rows as $row) {
if ($color == 1){
if ($color == 1) {
$tdcolor = "datos";
$color = 0;
}

View File

@ -27,12 +27,12 @@ if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_us
enterprise_include_once ('godmode/setup/setup.php');
/*
NOTICE FOR DEVELOPERS:
NOTICE FOR DEVELOPERS:
Update operation is done in config_process.php
This is done in that way so the user can see the changes inmediatly.
If you added a new token, please check config_update_config() in functions_config.php
to add it there.
Update operation is done in config_process.php
This is done in that way so the user can see the changes inmediatly.
If you added a new token, please check config_update_config() in functions_config.php
to add it there.
*/
$table = new StdClass();

View File

@ -54,12 +54,12 @@ enterprise_include_once ('include/functions_setup.php');
enterprise_include_once ('godmode/setup/setup.php');
/*
NOTICE FOR DEVELOPERS:
NOTICE FOR DEVELOPERS:
Update operation is done in config_process.php
This is done in that way so the user can see the changes inmediatly.
If you added a new token, please check config_update_config() in functions_config.php
to add it there.
Update operation is done in config_process.php
This is done in that way so the user can see the changes inmediatly.
If you added a new token, please check config_update_config() in functions_config.php
to add it there.
*/
// Gets section to jump to another section

View File

@ -98,7 +98,11 @@ $table->data[18][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('i
if ($config["integria_enabled"]) {
require_once('include/functions_incidents.php');
$invent = incidents_call_api($config['integria_url']."/include/api.php?user=".$config['id_user']."&pass=".io_output_password($config['integria_api_password'])."&op=get_inventories");
$invent = incidents_call_api(
$config['integria_url'] . "/include/api.php?" .
"user=" . $config['id_user'] . "&" .
"pass=" . io_output_password($config['integria_api_password']) ."&" .
"op=get_inventories");
$bad_input = false;
// Wrong connection to api, bad password
if (empty($invent)) {
@ -132,14 +136,17 @@ if ($config["integria_enabled"]) {
}
}
$table->data[20][0] = __('Integria URL') . ui_print_help_icon ("integria_url", true);
$table->data[20][1] = html_print_input_text ('integria_url', $config["integria_url"], '', 25, 255, true);
$table->data[20][1] = html_print_input_text('integria_url',
$config["integria_url"], '', 25, 255, true);
// If something goes wrong
if ($bad_input){
$table->data[20][1] .= html_print_image('images/error.png', true, array('title' => __('URL and/or Integria password are incorrect')));
if ($bad_input) {
$table->data[20][1] .= html_print_image('images/error.png',
true, array('title' => __('URL and/or Integria password are incorrect')));
}
$table->data[21][0] = __('Integria API password');
$table->data[21][1] = html_print_input_text ('integria_api_password', io_output_password($config["integria_api_password"]), '', 25, 25, true);
$table->data[21][1] = html_print_input_text('integria_api_password',
io_output_password($config["integria_api_password"]), '', 25, 25, true);
if (!$bad_input) {
foreach ($invent as $inv) {
@ -190,8 +197,11 @@ foreach ($timezones as $timezone) {
}
}
$table->data[23][0] = __('Timezone setup'). ' ' . ui_print_help_tip (__('Must have the same time zone as the system or database to avoid mismatches of time.'), true);
$table->data[23][1] = html_print_input_text_extended ('timezone_text', $config["timezone"], 'text-timezone_text', '', 25, 25, false, '', 'readonly', true);
$table->data[23][0] = __('Timezone setup'). ' ' . ui_print_help_tip(
__('Must have the same time zone as the system or database to avoid mismatches of time.'), true);
$table->data[23][1] = html_print_input_text_extended(
'timezone_text', $config["timezone"], 'text-timezone_text', '', 25,
25, false, '', 'readonly', true);
$table->data[23][1] .= '<a id="change_timezone">'.html_print_image ('images/pencil.png', true, array ('title' => __('Change timezone'))).'</a>';
$table->data[23][1] .= "&nbsp;&nbsp;". html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true);
$table->data[23][1] .= "&nbsp;&nbsp;". html_print_select($timezone_n, 'timezone', $config["timezone"], '', '', '', true);
@ -310,14 +320,14 @@ function show_timezone () {
url: "ajax.php",
data: "page=<?php echo $_GET['sec2']; ?>&select_timezone=1&zone=" + zone,
dataType: "json",
success: function(data){
$("#timezone").empty();
jQuery.each (data, function (id, value) {
timezone = value;
$("select[name='timezone']").append($("<option>").val(timezone).html(timezone));
});
}
});
success: function(data) {
$("#timezone").empty();
jQuery.each (data, function (id, value) {
timezone = value;
$("select[name='timezone']").append($("<option>").val(timezone).html(timezone));
});
}
});
}
$(document).ready (function () {

817
pandora_console/godmode/setup/setup_visuals.php Normal file → Executable file
View File

@ -34,12 +34,12 @@ require_once("include/functions_post_process.php");
enterprise_include ('godmode/setup/setup_visuals.php');
/*
NOTICE FOR DEVELOPERS:
NOTICE FOR DEVELOPERS:
Update operation is done in config_process.php
This is done in that way so the user can see the changes inmediatly.
If you added a new token, please check config_update_config() in functions_config.php
to add it there.
Update operation is done in config_process.php
This is done in that way so the user can see the changes inmediatly.
If you added a new token, please check config_update_config() in functions_config.php
to add it there.
*/
require_once ('include/functions_themes.php');
@ -51,13 +51,439 @@ $table->data = array ();
$row = 0;
$table->data[$row][0] = __('Date format string') . ui_print_help_icon("date_format", true);
$table->data[$row][1] = '<em>'.__('Example').'</em> '.date ($config["date_format"]);
$table->data[$row][1] .= html_print_input_text ('date_format', $config["date_format"], '', 30, 100, true);
//----------------------------------------------------------------------
// BEHAVIOUR CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('Behaviour configuration') . '<hr>';
$row++;
$table->data[$row][0] = __('Block size for pagination');
$table->data[$row][1] = html_print_input_text ('block_size', $config["global_block_size"], '', 5, 5, true);
$row++;
$values = array ();
$values[5] = human_time_description_raw (5);
$values[30] = human_time_description_raw (30);
$values[SECONDS_1MINUTE] = human_time_description_raw(SECONDS_1MINUTE);
$values[SECONDS_2MINUTES] = human_time_description_raw(SECONDS_2MINUTES);
$values[SECONDS_5MINUTES] = human_time_description_raw(SECONDS_5MINUTES);
$values[SECONDS_10MINUTES] = human_time_description_raw(SECONDS_10MINUTES);
$values[SECONDS_30MINUTES] = human_time_description_raw(SECONDS_30MINUTES);
$table->data[$row][0] = __('Default interval for refresh on Visual Console') . ui_print_help_tip(__('This interval will affect to Visual Console pages'), true);
$table->data[$row][1] = html_print_select ($values, 'vc_refr', $config["vc_refr"], '', 'N/A', 0, true, false, false);
$row++;
$table->data[$row][0] = __('Paginated module view');
$table->data[$row][1] = html_print_checkbox('paginate_module', 1,
$config['paginate_module'], true);
$row++;
$table->data[$row][0] = __('Render data of module type is proc.');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('render_proc', 1, '',
$config["render_proc"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('render_proc', 0, '',
$config["render_proc"], true);
$row++;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// STYLE CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('Style configuration') . '<hr>';
$row++;
$table->data[$row][0] = __('Style template');
$table->data[$row][1] = html_print_select (themes_get_css (), 'style', $config["style"].'.css', '', '', '', true);
$row++;
$table->data[$row][0] = __('Status icon set');
$iconsets["default"] = __('Colors');
$iconsets["faces"] = __('Faces');
$iconsets["color_text"] = __('Colors and text');
$table->data[$row][1] = html_print_select ($iconsets, 'status_images_set', $config["status_images_set"], '', '', '', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'status_set_preview', false, '', '', true);
$row++;
$table->data[$row][0] = __('Login background') . ui_print_help_tip(__('You can place your custom images into the folder images/backgrounds/'), true);
$backgrounds_list_jpg = list_files("images/backgrounds", "jpg", 1, 0);
$backgrounds_list_gif = list_files("images/backgrounds", "gif", 1, 0);
$backgrounds_list_png = list_files("images/backgrounds", "png", 1, 0);
$backgrounds_list = array_merge($backgrounds_list_jpg, $backgrounds_list_png);
$backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif);
asort($backgrounds_list);
$table->data[$row][1] = html_print_select ($backgrounds_list,
'login_background', $config["login_background"], '', __('Default'),
'', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'login_background_preview', false, '', '', true);
$row++;
$table->data[$row][0] = __('Custom logo') . ui_print_help_icon("custom_logo", true);
$table->data[$row][1] = html_print_select(
list_files('images/custom_logo', "png", 1, 0), 'custom_logo',
$config["custom_logo"], '', '', '', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'custom_logo_preview', false, '', '', true);
$row++;
$table->data[$row][0] = __('Fixed header');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('fixed_header', 1, '', $config["fixed_header"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('fixed_header', 0, '', $config["fixed_header"], true);
$row++;
$table->data[$row][0] = __('Fixed menu');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('fixed_menu', 1, '', $config["fixed_menu"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('fixed_menu', 0, '', $config["fixed_menu"], true);
$row++;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// GIS CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('GIS configuration') . '<hr>';
$row++;
$table->data[$row][0] = __('GIS Labels') .
ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true);
$row++;
$listIcons = gis_get_array_list_icons();
$arraySelectIcon = array();
foreach ($listIcons as $index => $value)
$arraySelectIcon[$index] = $index;
$table->data[$row][0] = __('Default icon in GIS') . ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true);
$table->data[$row][1] = html_print_select($arraySelectIcon,
"gis_default_icon", $config["gis_default_icon"], "", __('None'),
'', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'gis_icon_preview', false, '', '', true);
$row++;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// FONT AND TEXT CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('Font and Text configuration') . '<hr>';
$row++;
$table->data[$row][0] = __('Font path');
$fonts = load_fonts();
$table->data[$row][1] = html_print_select($fonts, 'fontpath', $config["fontpath"], '', '', 0, true);
$row++;
if($config['prominent_time'] == 'comparation') {
$table->data[$row][0] = __('Font size');
$font_size_array = array(
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
7 => 7,
8 => 8,
9 => 9,
10 => 10,
11 => 11,
12 => 12,
13 => 13,
14 => 14,
15 => 15);
$table->data[$row][1] = html_print_select($font_size_array, 'font_size',
$config["font_size"], '', '', 0, true);
$row++;
$table->data[$row][0] = __('Agent size text') . ui_print_help_tip(__('When the agent name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = __('Small:') . html_print_input_text ('agent_size_text_small', $config["agent_size_text_small"], '', 3, 3, true);
$table->data[$row][1] .= ' ' . __('Normal:') . html_print_input_text ('agent_size_text_medium', $config["agent_size_text_medium"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Module size text') . ui_print_help_tip(__('When the module name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = __('Small:') . html_print_input_text ('module_size_text_small', $config["module_size_text_small"], '', 3, 3, true);
$table->data[$row][1] .= ' ' . __('Normal:') . html_print_input_text ('module_size_text_medium', $config["module_size_text_medium"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Description size text') . ui_print_help_tip(__('When the description name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = html_print_input_text ('description_size_text', $config["description_size_text"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Item title size text') .
ui_print_help_tip(__('When the item title name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = html_print_input_text('item_title_size_text',
$config["item_title_size_text"], '', 3, 3, true);
$row++;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// CHARS CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('Charts configuration') . '<hr>';
$row++;
$table->data[$row][0] = __('Graph color (min)');
$table->data[$row][1] = html_print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color (avg)');
$table->data[$row][1] = html_print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color (max)');
$table->data[$row][1] = html_print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #4');
$table->data[$row][1] = html_print_input_text ('graph_color4', $config["graph_color4"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #5');
$table->data[$row][1] = html_print_input_text ('graph_color5', $config["graph_color5"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #6');
$table->data[$row][1] = html_print_input_text ('graph_color6', $config["graph_color6"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #7');
$table->data[$row][1] = html_print_input_text ('graph_color7', $config["graph_color7"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #8');
$table->data[$row][1] = html_print_input_text ('graph_color8', $config["graph_color8"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #9');
$table->data[$row][1] = html_print_input_text ('graph_color9', $config["graph_color9"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #10');
$table->data[$row][1] = html_print_input_text ('graph_color10', $config["graph_color10"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph resolution (1-low, 5-high)');
$table->data[$row][1] = html_print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
$row++;
$table->data[$row][0] = __('Default line thickness for the Custom Graph.');
$table->data[$row][1] = html_print_input_text ('custom_graph_width',
$config["custom_graph_width"], '', 5, 5, true);
$row++;
$table->data[$row][0] = __('Use round corners');
$table->data[$row][1] = __('Yes').'&nbsp;'.html_print_radio_button ('round_corner', 1, '', $config["round_corner"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No').'&nbsp;'.html_print_radio_button ('round_corner', 0, '', $config["round_corner"], true);
$row++;
$table->data[$row][0] = __('Interactive charts') .
ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true);
$table->data[$row][1] = __('Yes').'&nbsp;' .
html_print_radio_button ('flash_charts', 1, '', $config["global_flash_charts"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No').'&nbsp;' .
html_print_radio_button ('flash_charts', 0, '', $config["global_flash_charts"], true);
$row++;
if (!isset($config["short_module_graph_data"]))
$config["short_module_graph_data"] = true;
$table->data[$row][0] = __('Shortened module graph data');
$table->data[$row][0] .= ui_print_help_tip(__('The data number of the module graphs will be rounded and shortened'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('short_module_graph_data', 1, '',
$config["short_module_graph_data"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('short_module_graph_data', 0, '',
$config["short_module_graph_data"], true);
$row++;
$table->data[$row][0] = __('Type of module charts');
$table->data[$row][1] = __('Area').'&nbsp;' .
html_print_radio_button ('type_module_charts', 'area', '',
$config["type_module_charts"] == 'area', true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('Line').'&nbsp;' .
html_print_radio_button ('type_module_charts', 'line', '',
$config["type_module_charts"] != 'area', true);
$row++;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// OTHER CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('Other configuration') . '<hr>';
$row++;
if (empty($config["vc_line_thickness"])) $config["vc_line_thickness"] = 2;
$table->data[$row][0] = __('Default line thickness for the Visual Console') . ui_print_help_tip(__('This interval will affect to the lines between elements on the Visual Console'), true);
$table->data[$row][1] = html_print_input_text ('vc_line_thickness', $config["vc_line_thickness"], '', 5, 5, true);
$row++;
// For 5.1 Autohidden menu feature
$table->data['autohidden'][0] = __('Autohidden menu');
$table->data['autohidden'][1] = html_print_checkbox('autohidden_menu',
1, $config['autohidden_menu'], true);
// Juanma (07/05/2014) New feature: Table for custom front page for reports
$table->data[$row][0] = __('Custom report front page') .
ui_print_help_tip(
__('Custom report front page. It will be applied to all reports and templates by default.'), true);
$table->data[$row][1] = html_print_checkbox('custom_report_front', 1,
$config['custom_report_front'], true);
$row++;
//----------------------------------------------------------------------
$dirItems = scandir($config['homedir'] . '/images/custom_logo');
foreach ($dirItems as $entryDir) {
if (strstr($entryDir, '.jpg') !== false) {
$customLogos['images/custom_logo/' . $entryDir] = $entryDir;
}
}
$_fonts = array();
$dirFonts = scandir(_MPDF_TTFONTPATH);
foreach ($dirFonts as $entryDir) {
if (strstr($entryDir, '.ttf') !== false) {
$_fonts[$entryDir] = $entryDir;
}
}
// Font
$table->data['custom_report_front-font'][0] = __('Custom report front') . ' - ' . __('Font family');
$table->data['custom_report_front-font'][1] = html_print_select ($_fonts,
'custom_report_front_font', $config['custom_report_front_font'],
false, __('Default'), '', true);
// Logo
$table->data['custom_report_front-logo'][0] = __('Custom report front') . ' - ' .
__('Custom logo') .
ui_print_help_tip(
__("The dir of custom logos is in your www Pandora Console in \"images/custom_logo\". You can upload more files (ONLY JPEG) in upload tool in console."), true);
$table->data['custom_report_front-logo'][1] = html_print_select(
$customLogos,
'custom_report_front_logo',
$config['custom_report_front_logo'],
'showPreview()',
__('Default'),
'',
true);
// Preview
$table->data['custom_report_front-preview'][0] = __('Custom report front') . ' - ' . 'Preview';
if (empty($config['custom_report_front_logo'])) {
$config['custom_report_front_logo'] = 'images/pandora_logo_white.jpg';
}
$table->data['custom_report_front-preview'][1] = '<span id="preview_image">' .
html_print_image ($config['custom_report_front_logo'], true) . '</span>';
// Header
$table->data['custom_report_front-header'][0] = __('Custom report front') . ' - ' . __('Header');
$table->data['custom_report_front-header'][1] = html_print_textarea('custom_report_front_header', 5, 15,
$config['custom_report_front_header'], 'style="width: 38em;"', true);
// First page
$table->data['custom_report_front-first_page'][0] = __('Custom report front') . ' - ' . __('First page');
$table->data['custom_report_front-first_page'][1] = html_print_textarea('custom_report_front_firstpage', 15, 15,
$config['custom_report_front_firstpage'], 'style="width: 38em; height: 20em;"', true);
// Footer
$table->data['custom_report_front-footer'][0] = __('Custom report front') . ' - ' . __('Footer');
$table->data['custom_report_front-footer'][1] = html_print_textarea('custom_report_front_footer', 5, 15,
$config['custom_report_front_footer'], 'style="width: 38em;"', true);
$table->data[$row][0] = __('Show QR Code icon in the header');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('show_qr_code_header', 1, '',
$config["show_qr_code_header"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('show_qr_code_header', 0, '',
$config["show_qr_code_header"], true);
$row++;
$table->data[$row][0] = __('Custom graphviz directory') .
ui_print_help_tip (__("Custom directory where the graphviz binaries are stored."), true);
$table->data[$row][1] = html_print_input_text ('graphviz_bin_dir',
$config["graphviz_bin_dir"], '', 50, 255, true);
$row++;
$table->data[$row][0] = __('Networkmap max width');
$table->data[$row][1] = html_print_input_text ('networkmap_max_width',
$config["networkmap_max_width"], '', 10, 20, true);
$row++;
$table->data[$row][0] = __('Show only the group name');
$table->data[$row][0] .= ui_print_help_tip(
__('Show the group name instead the group icon.'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('show_group_name', 1, '',
$config["show_group_name"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('show_group_name', 0, '',
$config["show_group_name"], true);
$row++;
$table->data[$row][0] = __('Date format string') . ui_print_help_icon("date_format", true);
$table->data[$row][1] = '<em>'.__('Example').'</em> '.date ($config["date_format"]);
$table->data[$row][1] .= html_print_input_text ('date_format', $config["date_format"], '', 30, 100, true);
$row++;
if ($config['prominent_time'] == 'comparation') {
$timestamp = false;
$comparation = true;
}
@ -65,7 +491,6 @@ else if ($config['prominent_time'] == 'timestamp') {
$timestamp = true;
$comparation = false;
}
$table->data[$row][0] = __('Timestamp or time comparation') . ui_print_help_icon ("time_stamp-comparation", true);
$table->data[$row][1] = __('Comparation in rollover') . ' ';
$table->data[$row][1] .= html_print_radio_button ('prominent_time', "comparation", '', $comparation, true);
@ -74,63 +499,9 @@ $table->data[$row][1] .= html_print_radio_button ('prominent_time', "timestamp",
$row++;
$table->data[$row][0] = __('Graph color (min)');
$table->data[$row][1] = html_print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color (avg)');
$table->data[$row][1] = html_print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color (max)');
$table->data[$row][1] = html_print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #4');
$table->data[$row][1] = html_print_input_text ('graph_color4', $config["graph_color4"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #5');
$table->data[$row][1] = html_print_input_text ('graph_color5', $config["graph_color5"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #6');
$table->data[$row][1] = html_print_input_text ('graph_color6', $config["graph_color6"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #7');
$table->data[$row][1] = html_print_input_text ('graph_color7', $config["graph_color7"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #8');
$table->data[$row][1] = html_print_input_text ('graph_color8', $config["graph_color8"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #9');
$table->data[$row][1] = html_print_input_text ('graph_color9', $config["graph_color9"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #10');
$table->data[$row][1] = html_print_input_text ('graph_color10', $config["graph_color10"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graphic resolution (1-low, 5-high)');
$table->data[$row][1] = html_print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
//----------------------------------------------------------------------
// CUSTOM VALUES POST PROCESS
//----------------------------------------------------------------------
$row++;
$table->data[$row][0] = __('Custom values post process');
$table->data[$row][1] = "<table>";
$table->data[$row][1] .= __('Value') . ':&nbsp;' .
@ -187,324 +558,6 @@ $table->data[$row][1] .= html_print_input_hidden ('interval_values', $config["in
// This hidden field will be filled from jQuery before submit
$table->data[$row][1] .= html_print_input_hidden ('interval_to_delete', '', true);
//----------------------------------------------------------------------
$row++;
$table->data[$row][0] = __('Style template');
$table->data[$row][1] = html_print_select (themes_get_css (), 'style', $config["style"].'.css', '', '', '', true);
$row++;
$table->data[$row][0] = __('Block size for pagination');
$table->data[$row][1] = html_print_input_text ('block_size', $config["global_block_size"], '', 5, 5, true);
$row++;
$table->data[$row][0] = __('Use round corners');
$table->data[$row][1] = __('Yes').'&nbsp;'.html_print_radio_button ('round_corner', 1, '', $config["round_corner"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No').'&nbsp;'.html_print_radio_button ('round_corner', 0, '', $config["round_corner"], true);
$row++;
$table->data[$row][0] = __('Status icon set');
$iconsets["default"] = __('Colors');
$iconsets["faces"] = __('Faces');
$iconsets["color_text"] = __('Colors and text');
$table->data[$row][1] = html_print_select ($iconsets, 'status_images_set', $config["status_images_set"], '', '', '', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'status_set_preview', false, '', '', true);
$row++;
$table->data[$row][0] = __('Font path');
$fonts = load_fonts();
$table->data[$row][1] = html_print_select($fonts, 'fontpath', $config["fontpath"], '', '', 0, true);
$row++;
$table->data[$row][0] = __('Font size');
$font_size_array = array(
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
7 => 7,
8 => 8,
9 => 9,
10 => 10,
11 => 11,
12 => 12,
13 => 13,
14 => 14,
15 => 15);
$table->data[$row][1] = html_print_select($font_size_array, 'font_size', $config["font_size"], '', '', 0, true);
$row++;
$table->data[$row][0] = __('Interactive charts') . ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true);
$table->data[$row][1] = __('Yes').'&nbsp;'.html_print_radio_button ('flash_charts', 1, '', $config["global_flash_charts"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No').'&nbsp;'.html_print_radio_button ('flash_charts', 0, '', $config["global_flash_charts"], true);
$row++;
$table->data[$row][0] = __('Custom logo') . ui_print_help_icon("custom_logo", true);
$table->data[$row][1] = html_print_select(
list_files('images/custom_logo', "png", 1, 0), 'custom_logo',
$config["custom_logo"], '', '', '', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'custom_logo_preview', false, '', '', true);
$row++;
$table->data[$row][0] = __('Login background') . ui_print_help_tip(__('You can place your custom images into the folder images/backgrounds/'), true);
$backgrounds_list_jpg = list_files("images/backgrounds", "jpg", 1, 0);
$backgrounds_list_gif = list_files("images/backgrounds", "gif", 1, 0);
$backgrounds_list_png = list_files("images/backgrounds", "png", 1, 0);
$backgrounds_list = array_merge($backgrounds_list_jpg, $backgrounds_list_png);
$backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif);
asort($backgrounds_list);
$table->data[$row][1] = html_print_select ($backgrounds_list,
'login_background', $config["login_background"], '', __('Default'),
'', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'login_background_preview', false, '', '', true);
$row++;
$values = array ();
$values[5] = human_time_description_raw (5);
$values[30] = human_time_description_raw (30);
$values[SECONDS_1MINUTE] = human_time_description_raw(SECONDS_1MINUTE);
$values[SECONDS_2MINUTES] = human_time_description_raw(SECONDS_2MINUTES);
$values[SECONDS_5MINUTES] = human_time_description_raw(SECONDS_5MINUTES);
$values[SECONDS_10MINUTES] = human_time_description_raw(SECONDS_10MINUTES);
$values[SECONDS_30MINUTES] = human_time_description_raw(SECONDS_30MINUTES);
$table->data[$row][0] = __('Default interval for refresh on Visual Console') . ui_print_help_tip(__('This interval will affect to Visual Console pages'), true);
$table->data[$row][1] = html_print_select ($values, 'vc_refr', $config["vc_refr"], '', 'N/A', 0, true, false, false);
$row++;
if (empty($config["vc_line_thickness"])) $config["vc_line_thickness"] = 2;
$table->data[$row][0] = __('Default line thickness for the Visual Console') . ui_print_help_tip(__('This interval will affect to the lines between elements on the Visual Console'), true);
$table->data[$row][1] = html_print_input_text ('vc_line_thickness', $config["vc_line_thickness"], '', 5, 5, true);
$row++;
$table->data[$row][0] = __('Agent size text') . ui_print_help_tip(__('When the agent name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = __('Small:') . html_print_input_text ('agent_size_text_small', $config["agent_size_text_small"], '', 3, 3, true);
$table->data[$row][1] .= ' ' . __('Normal:') . html_print_input_text ('agent_size_text_medium', $config["agent_size_text_medium"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Module size text') . ui_print_help_tip(__('When the module name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = __('Small:') . html_print_input_text ('module_size_text_small', $config["module_size_text_small"], '', 3, 3, true);
$table->data[$row][1] .= ' ' . __('Normal:') . html_print_input_text ('module_size_text_medium', $config["module_size_text_medium"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Description size text') . ui_print_help_tip(__('When the description name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = html_print_input_text ('description_size_text', $config["description_size_text"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Item title size text') .
ui_print_help_tip(__('When the item title name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = html_print_input_text('item_title_size_text',
$config["item_title_size_text"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('GIS Labels') .
ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true);
$row++;
$listIcons = gis_get_array_list_icons();
$arraySelectIcon = array();
foreach ($listIcons as $index => $value) $arraySelectIcon[$index] = $index;
$table->data[$row][0] = __('Default icon in GIS') . ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true);
$table->data[$row][1] = html_print_select($arraySelectIcon,
"gis_default_icon", $config["gis_default_icon"], "", __('None'),
'', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'gis_icon_preview', false, '', '', true);
$row++;
// For 5.1 Autohidden menu feature
$table->data['autohidden'][0] = __('Autohidden menu');
$table->data['autohidden'][1] = html_print_checkbox('autohidden_menu',
1, $config['autohidden_menu'], true);
// Juanma (07/05/2014) New feature: Table for custom front page for reports
$table->data[$row][0] = __('Custom report front page') .
ui_print_help_tip(__('Custom report front page. It will be applied to all reports and templates by default.'), true);
$table->data[$row][1] = html_print_checkbox('custom_report_front', 1,
$config['custom_report_front'], true);
$row++;
$dirItems = scandir($config['homedir'] . '/images/custom_logo');
foreach ($dirItems as $entryDir) {
if (strstr($entryDir, '.jpg') !== false) {
$customLogos['images/custom_logo/' . $entryDir] = $entryDir;
}
}
$_fonts = array();
$dirFonts = scandir(_MPDF_TTFONTPATH);
foreach ($dirFonts as $entryDir) {
if (strstr($entryDir, '.ttf') !== false) {
$_fonts[$entryDir] = $entryDir;
}
}
// Font
$table->data['custom_report_front-font'][0] = __('Custom report front') . ' - ' . __('Font family');
$table->data['custom_report_front-font'][1] = html_print_select ($_fonts,
'custom_report_front_font', $config['custom_report_front_font'],
false, __('Default'), '', true);
// Logo
$table->data['custom_report_front-logo'][0] = __('Custom report front') . ' - ' .
__('Custom logo') .
ui_print_help_tip(
__("The dir of custom logos is in your www Pandora Console in \"images/custom_logo\". You can upload more files (ONLY JPEG) in upload tool in console."), true);
$table->data['custom_report_front-logo'][1] = html_print_select(
$customLogos,
'custom_report_front_logo',
$config['custom_report_front_logo'],
'showPreview()',
__('Default'),
'',
true);
// Preview
$table->data['custom_report_front-preview'][0] = __('Custom report front') . ' - ' . 'Preview';
if (empty($config['custom_report_front_logo'])) {
$config['custom_report_front_logo'] = 'images/pandora_logo_white.jpg';
}
$table->data['custom_report_front-preview'][1] = '<span id="preview_image">' .
html_print_image ($config['custom_report_front_logo'], true) . '</span>';
// Header
$table->data['custom_report_front-header'][0] = __('Custom report front') . ' - ' . __('Header');
$table->data['custom_report_front-header'][1] = html_print_textarea('custom_report_front_header', 5, 15,
$config['custom_report_front_header'], 'style="width: 38em;"', true);
// First page
$table->data['custom_report_front-first_page'][0] = __('Custom report front') . ' - ' . __('First page');
$table->data['custom_report_front-first_page'][1] = html_print_textarea('custom_report_front_firstpage', 15, 15,
$config['custom_report_front_firstpage'], 'style="width: 38em; height: 20em;"', true);
// Footer
$table->data['custom_report_front-footer'][0] = __('Custom report front') . ' - ' . __('Footer');
$table->data['custom_report_front-footer'][1] = html_print_textarea('custom_report_front_footer', 5, 15,
$config['custom_report_front_footer'], 'style="width: 38em;"', true);
$table->data[$row][0] = __('Paginate module view');
$table->data[$row][1] = html_print_checkbox('paginate_module', 1,
$config['paginate_module'], true);
$row++;
$table->data[$row][0] = __('Show QR Code icon in the header');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('show_qr_code_header', 1, '',
$config["show_qr_code_header"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('show_qr_code_header', 0, '',
$config["show_qr_code_header"], true);
$row++;
$table->data[$row][0] = __('Custom graphviz directory') .
ui_print_help_tip (__("Custom directory where the graphviz binaries are stored."), true);
$table->data[$row][1] = html_print_input_text ('graphviz_bin_dir',
$config["graphviz_bin_dir"], '', 50, 255, true);
$row++;
$table->data[$row][0] = __('Networkmap max width');
$table->data[$row][1] = html_print_input_text ('networkmap_max_width',
$config["networkmap_max_width"], '', 10, 20, true);
$row++;
$table->data[$row][0] = __('Fixed header');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('fixed_header', 1, '', $config["fixed_header"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('fixed_header', 0, '', $config["fixed_header"], true);
$row++;
$table->data[$row][0] = __('Fixed menu');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('fixed_menu', 1, '', $config["fixed_menu"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('fixed_menu', 0, '', $config["fixed_menu"], true);
$row++;
if (!isset($config["short_module_graph_data"]))
$config["short_module_graph_data"] = true;
$table->data[$row][0] = __('Shortened module graph data');
$table->data[$row][0] .= ui_print_help_tip(__('The data number of the module graphs will be rounded and shortened'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('short_module_graph_data', 1, '',
$config["short_module_graph_data"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('short_module_graph_data', 0, '',
$config["short_module_graph_data"], true);
$row++;
$table->data[$row][0] = __('Show only the group name');
$table->data[$row][0] .= ui_print_help_tip(
__('Show the group name instead the group icon.'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('show_group_name', 1, '',
$config["show_group_name"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('show_group_name', 0, '',
$config["show_group_name"], true);
$row++;
$table->data[$row][0] = __('Default line thickness for the Custom Graph.');
$table->data[$row][1] = html_print_input_text ('custom_graph_widht',
$config["custom_graph_widht"], '', 5, 5, true);
$row++;
$table->data[$row][0] = __('Render data of module type is proc.');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('render_proc', 1, '',
$config["render_proc"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('render_proc', 0, '',
$config["render_proc"], true);
$row++;

View File

@ -164,7 +164,7 @@ else
}
echo "<tr>";
echo "<td align='left'>";
html_print_label (__("Name"),'name');
html_print_label (__("Name"), 'name');
echo "</td>";
echo "<td align='left'>";
html_print_input_text ('name_tag', $name_tag);
@ -172,7 +172,7 @@ else
echo "</tr>";
echo "<tr>";
echo "<td align='left'>";
html_print_label (__("Description"),'name');
html_print_label (__("Description"), 'name');
echo "</td>";
echo "<td align='left'>";
html_print_input_text ('description_tag', $description_tag);
@ -181,7 +181,8 @@ else
echo "<tr>";
echo "<td align='left'>";
echo '<b>' . __("Url") . '</b>';
echo ui_print_help_tip (__("Hyperlink to help information that has to exist previously."), true);
echo ui_print_help_tip(
__("Hyperlink to help information that has to exist previously."), true);
echo "</td>";
echo "<td align='left'>";
html_print_input_text ('url_tag', $url_tag);
@ -190,7 +191,8 @@ else
echo "<tr>";
echo "<td align='left'>";
echo '<b>' . __("Email") . '</b>';
echo ui_print_help_tip (__("Associated Email direction to use later in alerts associated to Tags."), true);
echo ui_print_help_tip(
__("Associated Email direction to use later in alerts associated to Tags."), true);
echo "</td>";
echo "<td align='left'>";
html_print_textarea('email_tag', 5, 20, $email_tag);
@ -199,7 +201,8 @@ else
echo "<tr>";
echo "<td align='left'>";
echo '<b>' . __("Phone") . '</b>';
echo ui_print_help_tip (__("Associated phone number to use later in alerts associated to Tags."), true);
echo ui_print_help_tip(
__("Associated phone number to use later in alerts associated to Tags."), true);
echo "</td>";
echo "<td align='left'>";
html_print_textarea('phone_tag', 5, 20, $phone_tag);

View File

@ -140,7 +140,8 @@ if (!defined('METACONSOLE')) {
echo "</td>";
echo "</tr>";
echo "</table>";
}else{
}
else {
$filters = '<form method=post class="filters_form" action="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag=0">';
$filters .= "<table border=0 cellpadding=0 cellspacing=0 class=databox_filters width=70%>";
@ -243,7 +244,7 @@ if (!empty($result)) {
html_print_table ($table);
}
if(defined("METACONSOLE")){
if (defined("METACONSOLE")) {
echo "<table border=0 cellpadding=0 cellspacing=0 width=100%>";
echo "<tr>";
echo "<td align=right>";

View File

@ -415,7 +415,7 @@ if ($delete_profile) {
$table->id = 'user_configuration_table';
$table->width = '98%';
if (defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
if ($id) {
@ -511,7 +511,8 @@ if (!$meta) {
$table->data[11][0] = __('Interactive charts'). ' ' .ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true) ;
$values = array(-1 => __('Use global conf'), 1 => __('Yes'), 0 => __('No'));
$table->data[11][1] = html_print_select($values, 'flash_charts', $user_info["flash_chart"], '', '', -1, true, false, false);
$table->data[11][1] = html_print_select($values, 'flash_charts',
$user_info["flash_chart"], '', '', -1, true, false, false);
$table->data[12][0] = __('Block size for pagination');
$table->data[12][1] = html_print_input_text ('block_size', $user_info["block_size"], '', 5, 5, true);
@ -596,7 +597,7 @@ if (!empty ($id) && !$new_user) {
echo '<h4>'. __('Profiles/Groups assigned to this user') . '</h4>';
$table->width = '98%';
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->head_colspan[0] = 0;
$table->width = '100%';
$table->class = 'databox_tactical data';
@ -606,7 +607,7 @@ if (!empty ($id) && !$new_user) {
$table->head = array ();
$table->align = array ();
$table->style = array ();
if (!defined("METACONSOLE")){
if (!defined("METACONSOLE")) {
$table->style[0] = 'font-weight: bold';
$table->style[1] = 'font-weight: bold';
}

View File

@ -338,7 +338,7 @@ if ($profiles === false) {
$img = html_print_image ("images/ok.png", true, array ("border" => 0));
foreach ($profiles as $profile) {
$data['profiles'] = '<a href="index.php?sec='.$sec.'&amp;sec2=godmode/users/configure_profile&id='.$profile["id_perfil"].'&pure='.$pure.'"><b>'.$profile["name"].'</b></a>';
$data['profiles'] = '<a href="index.php?sec=' . $sec . '&amp;sec2=godmode/users/configure_profile&id='.$profile["id_perfil"].'&pure='.$pure.'"><b>'.$profile["name"].'</b></a>';
$data['IR'] = ($profile["incident_view"] ? $img : '');
$data['IW'] = ($profile["incident_edit"] ? $img : '');
$data['IM'] = ($profile["incident_management"] ? $img : '');

View File

@ -235,13 +235,14 @@ $table->data[0][4] = html_print_submit_button(__('Search'), 'search',
false, array('class' => 'sub search'), true);
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '96%';
$form_filter = "<form class='filters_form' method='post'>";
$form_filter .= html_print_table($table, true);
$form_filter .= "</form>";
ui_toggle($form_filter, __('Show Options'));
}else{
}
else {
$form_filter = "<form method='post'>";
$form_filter .= html_print_table($table, true);
$form_filter .= "</form>";
@ -250,13 +251,13 @@ if(defined('METACONSOLE')){
}
$table = null;
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->width = '100%';
$table->class = "databox";
}
else{
else {
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->width = '99%';
@ -430,7 +431,7 @@ foreach ($info as $user_id => $user_info) {
$data[4] = "";
$result = db_get_all_rows_field_filter ("tusuario_perfil", "id_usuario", $user_id);
if ($result !== false) {
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$data[4] .= "<div width='100%'>";
foreach ($result as $row) {
$data[4] .= "<div style='float:left;'>";
@ -444,7 +445,7 @@ foreach ($info as $user_id => $user_info) {
}
$data[4] .= "</div>";
}
else{
else {
$data[4] .= "<table width='100%'>";
foreach ($result as $row) {
$data[4] .= "<tr>";
@ -475,7 +476,7 @@ foreach ($info as $user_id => $user_info) {
if ($config["admin_can_delete_user"] && $user_info['id_user'] != $config['id_user']) {
$data[6] .= "<a href='index.php?sec=".$sec."&sec2=godmode/users/user_list&user_del=1&pure=".$pure."&delete_user=".$user_info['id_user']."'>".html_print_image('images/cross.png', true, array ('title' => __('Delete'), 'onclick' => "if (! confirm ('" .__('Deleting User'). " ". $user_info['id_user'] . ". " . __('Are you sure?') ."')) return false"))."</a>";
if (defined('METACONSOLE')) {
$data[6] .= "<a href='index.php?sec=".$sec."&sec2=godmode/users/user_list&user_del=1&pure=".$pure."&delete_user=".$user_info['id_user']."&delete_all=1'>".html_print_image('images/cross_double.png', true, array ('title' => __('Delete from all consoles'), 'onclick' => "if (! confirm ('" .__('Deleting User %s from all consoles', $user_info['id_user']) . ". " . __('Are you sure?') ."')) return false"))."</a>";
$data[6] .= "<a href='index.php?sec=" . $sec . "&sec2=godmode/users/user_list&user_del=1&pure=".$pure."&delete_user=".$user_info['id_user']."&delete_all=1'>".html_print_image('images/cross_double.png', true, array ('title' => __('Delete from all consoles'), 'onclick' => "if (! confirm ('" .__('Deleting User %s from all consoles', $user_info['id_user']) . ". " . __('Are you sure?') ."')) return false"))."</a>";
}
}
else {

View File

@ -175,13 +175,14 @@ if ($get_module_detail) {
"width" => "230px"),
);
if($config['prominent_time']=='comparation'){
if($config['prominent_time']=='comparation') {
$columns["Time"] = array(
"utimestamp",
"modules_format_time",
"align" => "left",
"width" => "50px");
}else{
}
else {
$columns["Timestamp"] = array(
"utimestamp",
"modules_format_timestamp",
@ -499,10 +500,10 @@ if ($list_modules) {
$status_filter_sql = 'tagente_estado.estado = ' . $status_filter_monitor;
}
if($status_module_group != -1){
if ($status_module_group != -1) {
$status_module_group_filter = 'id_module_group = ' . $status_module_group;
}
else{
else {
$status_module_group_filter = 'id_module_group >= 0';
}
@ -886,8 +887,8 @@ if ($list_modules) {
$salida = "<span style='$style'>$salida</span>";
}
else {
if (is_numeric($module["datos"]) && !modules_is_string_type($module['id_tipo_modulo'])){
if ( $config["render_proc"] ){
if (is_numeric($module["datos"]) && !modules_is_string_type($module['id_tipo_modulo'])) {
if ( $config["render_proc"] ) {
switch($module["id_tipo_modulo"]) {
case 2:
case 6:
@ -904,11 +905,12 @@ if ($list_modules) {
$salida = format_numeric($module["datos"]);
break;
}
}else{
}
else {
$salida = format_numeric($module["datos"]);
}
// Show units ONLY in numeric data types
if (isset($module["unit"])){
if (isset($module["unit"])) {
$salida .= "&nbsp;" . '<i>'. io_safe_output($module["unit"]) . '</i>';
}
}

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