Merge remote-tracking branch 'origin/develop' into ent-6661-giss-agregar-elementos-en-servicios
|
@ -9,3 +9,5 @@ MYMETA.yml
|
|||
**/PandoraFMS-Enterprise/pm_to_blib
|
||||
**/pandora_console/attachment/cache
|
||||
**/pandora_console/attachment/agents
|
||||
pandora_console/.DS_Store
|
||||
.DS_Store
|
|
@ -1,257 +1,252 @@
|
|||
* {
|
||||
font-family: "Open Sans", "Noto Sans", sans-serif
|
||||
}
|
||||
|
||||
body {
|
||||
min-width: 425px;
|
||||
min-height: 540px;
|
||||
margin: 5px;
|
||||
font-family: Tahoma, Geneva, Arial;
|
||||
font-size: 10pt;
|
||||
min-width: 425px;
|
||||
min-height: 540px;
|
||||
margin: 5px;
|
||||
font-size: 10pt;
|
||||
}
|
||||
h1 {
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
margin: 2px 0px 2px 0px;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
margin: 2px 0px 2px 0px;
|
||||
}
|
||||
h2 {
|
||||
color : #333;
|
||||
color: #333;
|
||||
}
|
||||
p {
|
||||
font-size: 20px;
|
||||
font-size: 20px;
|
||||
}
|
||||
a {
|
||||
color: #254533;
|
||||
text-decoration: none;
|
||||
color: #254533;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:visited {
|
||||
color: #254533; text-decoration:none;
|
||||
color: #254533;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:visited:hover {
|
||||
text-decoration: underline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.res {
|
||||
font-size: 80%;
|
||||
color: #555;
|
||||
font-size: 80%;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
img.pm {
|
||||
margin-right: 3px;
|
||||
cursor: pointer;
|
||||
margin-top: 2px;
|
||||
float: right;
|
||||
margin-right: 3px;
|
||||
cursor: pointer;
|
||||
margin-top: 2px;
|
||||
float: right;
|
||||
}
|
||||
div.main {
|
||||
background-color: white;
|
||||
height: 500px;
|
||||
width: 400px;
|
||||
background-color: white;
|
||||
height: 500px;
|
||||
width: 400px;
|
||||
}
|
||||
div.textarea {
|
||||
background-color: #D5DED5;
|
||||
width: 100%
|
||||
background-color: #d5ded5;
|
||||
width: 100%;
|
||||
}
|
||||
div.e {
|
||||
text-align: right;
|
||||
font-size:8pt;
|
||||
text-align: right;
|
||||
font-size: 8pt;
|
||||
}
|
||||
div.b {
|
||||
background-color:white;
|
||||
display: none;
|
||||
background-color: white;
|
||||
display: none;
|
||||
}
|
||||
div.b p a {
|
||||
font-size: 10pt;
|
||||
font-size: 10pt;
|
||||
}
|
||||
div.b div.items p {
|
||||
margin: 2px 0px 8px 0px;
|
||||
width: 355px;
|
||||
float: left;
|
||||
display: block;
|
||||
margin: 2px 0px 8px 0px;
|
||||
width: 355px;
|
||||
float: left;
|
||||
display: block;
|
||||
}
|
||||
div.b div.items p img {
|
||||
float: left;
|
||||
margin: 0px 3px 0px 0px;
|
||||
float: left;
|
||||
margin: 0px 3px 0px 0px;
|
||||
}
|
||||
|
||||
div.options_header {
|
||||
margin: 10px 10px;
|
||||
margin: 10px 10px;
|
||||
}
|
||||
|
||||
div.options_divider {
|
||||
width: 627px;
|
||||
margin-top: 30px;
|
||||
width: 627px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
div.options_divider h2{
|
||||
margin: 20px 20px 0;
|
||||
padding: 5px;
|
||||
font-weight: 500;
|
||||
border: 2px solid #82b92e;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background: #82b92e;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
div.options_divider h2 {
|
||||
margin: 20px 20px 0;
|
||||
padding: 5px;
|
||||
border: 2px solid #82b92e;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background: #82b92e;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
div.options_textarea {
|
||||
background-color: #f6f6f6;
|
||||
width: 550px;
|
||||
margin: 0 20px;
|
||||
padding: 10px 10px 25px 25px;
|
||||
border-bottom-left-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
border: 1px solid #e4e4e4;
|
||||
border-top: 0;
|
||||
background-color: #f6f6f6;
|
||||
width: 550px;
|
||||
margin: 0 20px;
|
||||
padding: 10px 10px 25px 25px;
|
||||
border-bottom-left-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
border: 1px solid #e4e4e4;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
div.options_footer {
|
||||
width: 550px;
|
||||
margin: 10px 10px;
|
||||
padding: 10px;
|
||||
width: 550px;
|
||||
margin: 10px 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
select {
|
||||
background: white;
|
||||
border: 1px solid #888;
|
||||
font-size: smaller;
|
||||
padding: 2px 1px;
|
||||
width: 250px;
|
||||
background: white;
|
||||
border: 1px solid #888;
|
||||
font-size: smaller;
|
||||
padding: 2px 1px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.sound_selector td:first-child {
|
||||
padding-left: 25px;
|
||||
width: 39%;
|
||||
padding-left: 25px;
|
||||
width: 39%;
|
||||
}
|
||||
|
||||
.options_textarea button {
|
||||
background-color: #82b92e;
|
||||
border: 1px solid #82b92e;
|
||||
color: white;
|
||||
padding: 6px 32px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
border-radius: 2px;
|
||||
margin: 25px 0px 0px 422px;
|
||||
background-color: #82b92e;
|
||||
border: 1px solid #82b92e;
|
||||
color: white;
|
||||
padding: 6px 32px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
border-radius: 2px;
|
||||
margin: 25px 0px 0px 422px;
|
||||
}
|
||||
|
||||
.options_textarea button:hover {
|
||||
background-color: transparent;
|
||||
color: #82b92e;
|
||||
cursor: pointer;
|
||||
background-color: transparent;
|
||||
color: #82b92e;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.options_textarea h3 {
|
||||
text-align: left;
|
||||
font-size: 11.4pt;
|
||||
text-align: left;
|
||||
font-size: 11.4pt;
|
||||
}
|
||||
|
||||
button h3 {
|
||||
margin: 0;
|
||||
font-size: 10pt !important;
|
||||
margin: 0;
|
||||
font-size: 10pt !important;
|
||||
}
|
||||
|
||||
.tooltip {
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
height: 70px;
|
||||
width: 160px;
|
||||
padding: 25px;
|
||||
color: #eee;
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
height: 70px;
|
||||
width: 160px;
|
||||
padding: 25px;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-left: -50px;
|
||||
margin-top: -50px;
|
||||
text-align: center;
|
||||
z-index: 1234;
|
||||
overflow: auto;
|
||||
width: 100px;
|
||||
height: 102px;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-left: -50px;
|
||||
margin-top: -50px;
|
||||
text-align: center;
|
||||
z-index: 1234;
|
||||
overflow: auto;
|
||||
width: 100px;
|
||||
height: 102px;
|
||||
}
|
||||
|
||||
.error {
|
||||
display: flex;
|
||||
border: solid #e4e4e4 1px;
|
||||
border-radius: 2px;
|
||||
background: #f6f6f6;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
margin-top: 35px;
|
||||
display: flex;
|
||||
border: solid #e4e4e4 1px;
|
||||
border-radius: 2px;
|
||||
background: #f6f6f6;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
margin-top: 35px;
|
||||
}
|
||||
|
||||
.error_text {
|
||||
margin: 0 10px;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.result {
|
||||
margin: 10px;
|
||||
height: 500;
|
||||
overflow-y: auto;
|
||||
margin: 10px;
|
||||
height: 500;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#events_title {
|
||||
padding: 5px 0;
|
||||
margin: 0;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 5px 0;
|
||||
margin: 0;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.event {
|
||||
border: solid 1px #e5e5e5;
|
||||
border-top: 0;
|
||||
padding: 5px 6px;
|
||||
color: white;
|
||||
border: solid 1px #e5e5e5;
|
||||
border-top: 0;
|
||||
padding: 5px 6px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.event a {
|
||||
margin-left: 5px;
|
||||
color: white;
|
||||
font-size: 9pt;
|
||||
margin-left: 5px;
|
||||
color: white;
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
.sev-Warning a {
|
||||
margin-left: 5px;
|
||||
color: #333;
|
||||
margin-left: 5px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.event p {
|
||||
margin: 0 0 0 6px;
|
||||
padding-top: 2px;
|
||||
display: none;
|
||||
font-size: 8pt;
|
||||
margin: 0 0 0 6px;
|
||||
padding-top: 2px;
|
||||
display: none;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
.sev-Warning {
|
||||
background: #FDDD30;
|
||||
color: #333;
|
||||
background: #fddd30;
|
||||
color: #333;
|
||||
}
|
||||
.sev-Critical {
|
||||
background: #F84348;
|
||||
background: #f84348;
|
||||
}
|
||||
.sev-Informational {
|
||||
background: #4CA8E0;
|
||||
background: #4ca8e0;
|
||||
}
|
||||
.sev-Normal {
|
||||
background: #84B839;
|
||||
background: #84b839;
|
||||
}
|
||||
.sev-Maintenance {
|
||||
background: #A8A8A8;
|
||||
background: #a8a8a8;
|
||||
}
|
||||
.sev-Minor {
|
||||
background: #F099A2;
|
||||
color: #333;
|
||||
background: #f099a2;
|
||||
color: #333;
|
||||
}
|
||||
.sev-Major {
|
||||
background: #C97A4A;
|
||||
}
|
||||
background: #c97a4a;
|
||||
}
|
||||
|
|
|
@ -1,22 +1,43 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<title>Wicket Alert</title>
|
||||
<style type="text/css">
|
||||
body { margin:0; font-family:arial; font-size:10pt }
|
||||
h1 { font-weight:bold; font-size:16px; margin:2px 0 2px 4px; color:#237948; font-family:arial; }
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
|
||||
<title>Wicket Alert</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 0;
|
||||
font-size: 10pt;
|
||||
}
|
||||
h1 {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
margin: 2px 0 2px 4px;
|
||||
color: #237948;
|
||||
}
|
||||
|
||||
a { color: #237948; text-decoration:none; }
|
||||
a:hover { text-decoration:underline; }
|
||||
a:visited { color: #237948; text-decoration:none; }
|
||||
a:visited:hover { text-decoration:underline; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Event Alert</h1>
|
||||
<div id="e" style="background:url('images/icon.png') no-repeat 0% 50%; margin:0 4px; padding-left:50px; min-height:48px;">
|
||||
<script src="js/notification.js"></script>
|
||||
</div>
|
||||
</body>
|
||||
a {
|
||||
color: #237948;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:visited {
|
||||
color: #237948;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:visited:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Event Alert</h1>
|
||||
<div
|
||||
id="e"
|
||||
style="background:url('images/icon.png') no-repeat 0% 50%; margin:0 4px; padding-left:50px; min-height:48px;"
|
||||
>
|
||||
<script src="js/notification.js"></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -428,7 +428,7 @@ mv $CONSOLE_PATH/install.php $CONSOLE_PATH/install.done
|
|||
sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini
|
||||
sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini
|
||||
sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini
|
||||
sed -i -e "s/^memory_limit.*/memory_limit = 500M/g" /etc/php.ini
|
||||
sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini
|
||||
|
||||
cat > /var/www/html/index.html << EOF_INDEX
|
||||
<meta HTTP-EQUIV="REFRESH" content="0; url=/pandora_console/">
|
||||
|
|
|
@ -148,7 +148,7 @@ EOF_INDEX
|
|||
sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini
|
||||
sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini
|
||||
sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini
|
||||
sed -i -e "s/^memory_limit.*/memory_limit = 500M/g" /etc/php.ini
|
||||
sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini
|
||||
|
||||
echo "- Setting Public URL: $PUBLICURL"
|
||||
q=$(mysql -u$DBUSER -p$DBPASS $DBNAME -h$DBHOST -sNe "select token from tconfig;" | grep public_url)
|
||||
|
|
|
@ -1,71 +1,116 @@
|
|||
body {
|
||||
min-width:425px;
|
||||
min-height:540px;
|
||||
margin:5px;
|
||||
font-family:Tahoma, Geneva, Arial;
|
||||
font-size:10pt;
|
||||
min-width: 425px;
|
||||
min-height: 540px;
|
||||
margin: 5px;
|
||||
font-size: 10pt;
|
||||
}
|
||||
h1 { font-weight: bold; font-size:16px; margin:2px 0px 2px 0px; color:#237948; font-family:arial }
|
||||
h2{
|
||||
color : blue;
|
||||
h1 {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
margin: 2px 0px 2px 0px;
|
||||
color: #237948;
|
||||
}
|
||||
h2 {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
label { color: #254533; text-decoration:none; }
|
||||
label:hover { text-decoration:underline; }
|
||||
label:visited { color: #254533; text-decoration:none; }
|
||||
label:visited:hover { text-decoration:underline; }
|
||||
|
||||
|
||||
label.text-link { color: #254533; text-decoration:none; }
|
||||
label.text-link :hover { text-decoration:underline; }
|
||||
label.text-link :visited { color: #254533; text-decoration:none; }
|
||||
label.text-link :visited:hover { text-decoration:underline; }
|
||||
|
||||
|
||||
span.res { font-size:80%; color:#555; }
|
||||
|
||||
image.pm { margin-right:3px;cursor:pointer; margin-top:0px; }
|
||||
.main{
|
||||
background-color : white;
|
||||
height: 500px;
|
||||
width: 400px;
|
||||
label {
|
||||
color: #254533;
|
||||
text-decoration: none;
|
||||
}
|
||||
.textarea{
|
||||
background-color : #D5DED5;
|
||||
width :100%
|
||||
label:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
label:visited {
|
||||
color: #254533;
|
||||
text-decoration: none;
|
||||
}
|
||||
label:visited:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
label.text-link {
|
||||
color: #254533;
|
||||
text-decoration: none;
|
||||
}
|
||||
label.text-link :hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
label.text-link :visited {
|
||||
color: #254533;
|
||||
text-decoration: none;
|
||||
}
|
||||
label.text-link :visited:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.res {
|
||||
font-size: 80%;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
image.pm {
|
||||
margin-right: 3px;
|
||||
cursor: pointer;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.main {
|
||||
background-color: white;
|
||||
height: 500px;
|
||||
width: 400px;
|
||||
}
|
||||
.textarea {
|
||||
background-color: #d5ded5;
|
||||
width: 100%;
|
||||
}
|
||||
vbox.e {
|
||||
text-align: right;
|
||||
font-size: 8pt;
|
||||
}
|
||||
vbox.b {
|
||||
background-color: white;
|
||||
border: 1px solid #bababa;
|
||||
margin: 5px;
|
||||
padding: 4px;
|
||||
}
|
||||
vbox.b description label {
|
||||
font-size: 10pt;
|
||||
}
|
||||
vbox.b description {
|
||||
margin: 2px 0px 4px 0px;
|
||||
color: #333;
|
||||
font-size: 9pt;
|
||||
}
|
||||
vbox.e{ text-align:right; font-size:8pt; }
|
||||
vbox.b { background-color:white; border:1px solid #BABABA; margin:5px; padding:4px; }
|
||||
vbox.b description label { font-size: 10pt; }
|
||||
vbox.b description { margin:2px 0px 4px 0px; color:#333; font-size:9pt; }
|
||||
vbox.b vbox.items description {
|
||||
margin:2px 0px 8px 0px; color:#333; width:355px;float:left; display:block;
|
||||
margin: 2px 0px 8px 0px;
|
||||
color: #333;
|
||||
width: 355px;
|
||||
float: left;
|
||||
display: block;
|
||||
}
|
||||
vbox.b vbox.items description image {
|
||||
float:left;margin:0px 3px 0px 0px;
|
||||
float: left;
|
||||
margin: 0px 3px 0px 0px;
|
||||
}
|
||||
|
||||
|
||||
.tooltip {
|
||||
display:none;
|
||||
font-size:12px;
|
||||
height:70px;
|
||||
width:160px;
|
||||
padding:25px;
|
||||
color:#eee;
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
height: 70px;
|
||||
width: 160px;
|
||||
padding: 25px;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-left: -50px; /* half width of the spinner gif */
|
||||
margin-top: -50px; /* half height of the spinner gif */
|
||||
text-align:center;
|
||||
z-index:1234;
|
||||
overflow: auto;
|
||||
width: 100px; /* width of the spinner gif */
|
||||
height: 102px; /*hight of the spinner gif +2px to fix IE8 issue */
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-left: -50px; /* half width of the spinner gif */
|
||||
margin-top: -50px; /* half height of the spinner gif */
|
||||
text-align: center;
|
||||
z-index: 1234;
|
||||
overflow: auto;
|
||||
width: 100px; /* width of the spinner gif */
|
||||
height: 102px; /*hight of the spinner gif +2px to fix IE8 issue */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, AIX version
|
||||
# Version 7.0NG.755, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, FreeBSD Version
|
||||
# Version 7.0NG.755, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, HP-UX Version
|
||||
# Version 7.0NG.755, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, GNU/Linux
|
||||
# Version 7.0NG.755, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, GNU/Linux
|
||||
# Version 7.0NG.755, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, Solaris Version
|
||||
# Version 7.0NG.755, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.754
|
||||
# Version 7.0NG.755
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.754, AIX version
|
||||
# Version 7.0NG.755, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.754
|
||||
# Version 7.0NG.755
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.754, HPUX Version
|
||||
# Version 7.0NG.755, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754
|
||||
# Version 7.0NG.755
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754
|
||||
# Version 7.0NG.755
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754
|
||||
# Version 7.0NG.755
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.754, Solaris version
|
||||
# Version 7.0NG.755, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, AIX version
|
||||
# Version 7.0NG.755, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.754-210607
|
||||
Version: 7.0NG.755-210621
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.754-210607"
|
||||
pandora_version="7.0NG.755-210621"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -6,11 +6,18 @@ function error {
|
|||
exit 1
|
||||
}
|
||||
|
||||
# Gets information about Apple notarization process
|
||||
function get_notarization_info() {
|
||||
CALL=$(xcrun altool --notarization-info "$1" -u $APPLE_USER -p "$APPLE_PASS"| grep -Ei "Status:|Status Message")
|
||||
STATUS=`echo $CALL |grep -ic "in progress"`
|
||||
MESSAGE=`echo $CALL |grep -ic "package approved"`
|
||||
}
|
||||
|
||||
# Keeping this for future CICD integration
|
||||
if [ "$CI_PROJECT_DIR" != "" ]; then
|
||||
LOCALINST="$CODEHOME/pandora_agents/unix/Darwin/dmg"
|
||||
else
|
||||
LOCALINST="/root/code/pandorafms/pandora_agents/unix/Darwin/dmg"
|
||||
LOCALINST="/opt/code/pandorafms/pandora_agents/unix/Darwin/dmg"
|
||||
fi
|
||||
|
||||
# DMG package name
|
||||
|
@ -24,21 +31,26 @@ fi
|
|||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.754"
|
||||
VERSION="7.0NG.755"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG file
|
||||
if [ "$#" -ge 3 ]; then
|
||||
BUILD_PATH="$3"
|
||||
else
|
||||
BUILD_PATH="/root/code/pandorafms/pandora_agents/unix/Darwin/dmg"
|
||||
BUILD_PATH="/opt/code/pandorafms/pandora_agents/unix/Darwin/dmg"
|
||||
fi
|
||||
|
||||
BUILD_DMG="$BUILD_PATH/build"
|
||||
BUILD_TMP="$BUILD_PATH/buildtmp"
|
||||
APPLE_USER="kevin.rojas@pandorafms.com"
|
||||
APPLE_PASS="@keychain:signing"
|
||||
APPLE_DEVNAME="Developer ID Installer: Artica Soluciones Tecnologicas SL"
|
||||
APPLE_DEVAPP="Developer ID Application: Artica Soluciones Tecnologicas SL"
|
||||
APPLE_DEVID="Q35RP2Y7WU"
|
||||
|
||||
FULLNAME="$DMGNAME-$VERSION.dmg"
|
||||
echo "VERSION-"$VERSION" NAME-"$DMGNAME
|
||||
printf "VERSION-'$VERSION' NAME-'$DMGNAME'\n"
|
||||
pushd .
|
||||
cd $LOCALINST
|
||||
|
||||
|
@ -49,8 +61,20 @@ cp ../../../../pandora_agents/unix/tentacle* files/pandorafms/
|
|||
cp -R ../../../../pandora_agents/unix/plugins files/pandorafms/
|
||||
cp -R ../../../../pandora_agents/unix/man files/pandorafms/
|
||||
cp -R ../../../../pandora_agents/unix/Darwin/pandora_agent.conf files/pandorafms/
|
||||
mkdir $BUILD_DMG
|
||||
mkdir $BUILD_TMP
|
||||
mkdir -p $BUILD_DMG
|
||||
mkdir -p $BUILD_TMP
|
||||
|
||||
# Make sure the scripts have execution privileges
|
||||
chmod +x "./scripts/preinstall"
|
||||
chmod +x "./scripts/postinstall"
|
||||
chmod +x "./files/pandorafms/inst_utilities/get_group.scpt"
|
||||
chmod +x "./files/pandorafms/inst_utilities/get_remotecfg.scpt"
|
||||
chmod +x "./files/pandorafms/inst_utilities/get_serverip.scpt"
|
||||
chmod +x "./files/pandorafms/inst_utilities/print_conf.pl"
|
||||
chmod +x "./files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/MacOS/uninstall.sh"
|
||||
chmod +x "./files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Resources/ask_root"
|
||||
chmod +x "./files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Resources/confirm_uninstall"
|
||||
chmod +x "./files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Resources/uninstall"
|
||||
|
||||
# Build pandorafms agent component
|
||||
pkgbuild --root files/pandorafms/ \
|
||||
|
@ -72,13 +96,53 @@ productbuild --distribution extras/distribution.xml \
|
|||
--resources resources \
|
||||
--scripts scripts \
|
||||
--version "$VERSION" \
|
||||
$BUILD_TMP/pandorafms_agent.pkg || error
|
||||
$BUILD_TMP/pfms_agent.pkg || error
|
||||
|
||||
# Sign the package
|
||||
productsign --sign "$APPLE_DEVNAME ($APPLE_DEVID)" \
|
||||
$BUILD_TMP/pfms_agent.pkg \
|
||||
$BUILD_TMP/pandorafms_agent.pkg
|
||||
|
||||
# Notarize
|
||||
NOTARIZE=$(xcrun altool --notarize-app \
|
||||
--primary-bundle-id "com.pandorafms.pandorafms" \
|
||||
--asc-provider "$APPLE_DEVID" \
|
||||
--username "$APPLE_USER" \
|
||||
--password "$APPLE_PASS" \
|
||||
--file "$BUILD_TMP/pandorafms_agent.pkg")
|
||||
|
||||
if [ $(echo $NOTARIZE |grep -c UUID) -ne 1 ]
|
||||
then
|
||||
printf "Unable to send the package to notarization. Exiting..."
|
||||
error
|
||||
fi
|
||||
|
||||
RUUID=$(echo $NOTARIZE | awk '{print $NF}')
|
||||
|
||||
printf "PKG sent for notarization (Request UUID=$RUUID). This may take a few minutes...\n"
|
||||
|
||||
# In order to staple the pkg, notarization must be approved!
|
||||
STATUS=1
|
||||
while [ $STATUS -eq 1 ]; do
|
||||
get_notarization_info "$RUUID"
|
||||
printf "PKG not yet notarized by Apple. Trying again in 60 seconds...\n"
|
||||
sleep 60
|
||||
done
|
||||
|
||||
if [ $MESSAGE -eq 1 ]
|
||||
then
|
||||
echo "Package notarized. Stapling PKG..."
|
||||
xcrun stapler staple "$BUILD_TMP/pandorafms_agent.pkg" || error
|
||||
fi
|
||||
|
||||
|
||||
# Clean and prepare dmg creation
|
||||
rm $BUILD_TMP/pfms_agent.pkg
|
||||
rm $BUILD_TMP/pandorafms_src.pdk
|
||||
rm $BUILD_TMP/pandorafms_uninstall.pdk
|
||||
|
||||
#Create dmg file
|
||||
printf "Creating DMG file...\n"
|
||||
hdiutil create -volname "Pandora FMS agent installer" \
|
||||
-srcfolder "$BUILD_TMP" \
|
||||
-ov -format UDZO \
|
||||
|
@ -90,6 +154,10 @@ DeRez -only icns extras/pandora_installer.png > tmpicns.rsrc || error
|
|||
Rez -append tmpicns.rsrc -o "$BUILD_DMG/$FULLNAME" || error
|
||||
SetFile -a C "$BUILD_DMG/$FULLNAME" || error
|
||||
|
||||
# Sign DMG. Not needed, but does not harm
|
||||
printf "Signing DMG file...\n"
|
||||
codesign --timestamp --options=runtime --sign "$APPLE_DEVAPP ($APPLE_DEVID)" \
|
||||
"$BUILD_DMG/$FULLNAME" || error
|
||||
|
||||
# Copy and clean folder
|
||||
rm -Rf $BUILD_TMP
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.754" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.755" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.754" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.755" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<!-- <installation-check script="check()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||
|
||||
<key>CFBundleVersion</key> <string>7.0NG.754</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.754 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.754</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.755</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.755 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.755</string>
|
||||
|
||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
Installation complete! Thank you for installing Pandora FMS agent for MacOS.
|
||||
Agent's service has been automatically started. You can manage the service with:
|
||||
sudo launchctl start com.pandorafms.pandorafms to start it, and sudo launchctl
|
||||
stop com.pandorafms.pandorafms to stop it.
|
||||
Installation complete!
|
||||
|
||||
Thank you for installing Pandora FMS agent for MacOS. Agent's service has been automatically started.
|
||||
|
||||
You can manage the service with:
|
||||
sudo launchctl start com.pandorafms.pandorafms
|
||||
to start it, and
|
||||
sudo launchctl stop com.pandorafms.pandorafms
|
||||
to stop it.
|
|
@ -1,237 +1,93 @@
|
|||
GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free
|
||||
Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||
document, but changing it is not allowed. Preamble The licenses for most
|
||||
software are designed to take away your freedom to share and change it. By
|
||||
contrast, the GNU General Public License is intended to guarantee your freedom
|
||||
to share and change free software--to make sure the software is free for all its
|
||||
users. This General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to using it.
|
||||
(Some other Free Software Foundation software is covered by the GNU Library
|
||||
General Public License instead.) You can apply it to your programs, too. When we
|
||||
speak of free software, we are referring to freedom, not price. Our General
|
||||
Public Licenses are designed to make sure that you have the freedom to
|
||||
distribute copies of free software (and charge for this service if you wish),
|
||||
that you receive source code or can get it if you want it, that you can change
|
||||
the software or use pieces of it in new free programs; and that you know you can
|
||||
do these things. To protect your rights, we need to make restrictions that
|
||||
forbid anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it. For example, if you
|
||||
distribute copies of such a program, whether gratis or for a fee, you must give
|
||||
the recipients all the rights that you have. You must make sure that they, too,
|
||||
receive or can get the source code. And you must show them these terms so they
|
||||
know their rights. We protect your rights with two steps: (1) copyright the
|
||||
software, and (2) offer you this license which gives you legal permission to
|
||||
copy, distribute and/or modify the software. Also, for each author's protection
|
||||
and ours, we want to make certain that everyone understands that there is no
|
||||
warranty for this free software. If the software is modified by someone else and
|
||||
passed on, we want its recipients to know that what they have is not the
|
||||
original, so that any problems introduced by others will not reflect on the
|
||||
original authors' reputations. Finally, any free program is threatened
|
||||
constantly by software patents. We wish to avoid the danger that redistributors
|
||||
of a free program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any patent must
|
||||
be licensed for everyone's free use or not licensed at all. The precise terms
|
||||
and conditions for copying, distribution and modification follow. GNU GENERAL
|
||||
PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
0. This License applies to any program or other work which contains a notice
|
||||
placed by the copyright holder saying it may be distributed under the terms of
|
||||
this General Public License. The "Program", below, refers to any such program or
|
||||
work, and a "work based on the Program" means either the Program or any
|
||||
derivative work under copyright law: that is to say, a work containing the
|
||||
Program or a portion of it, either verbatim or with modifications and/or
|
||||
translated into another language. (Hereinafter, translation is included without
|
||||
limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
Activities other than copying, distribution and modification are not covered by
|
||||
this License; they are outside its scope. The act of running the Program is not
|
||||
restricted, and the output from the Program is covered only if its contents
|
||||
constitute a work based on the Program (independent of having been made by
|
||||
running the Program). Whether that is true depends on what the Program does. 1.
|
||||
You may copy and distribute verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and appropriately
|
||||
publish on each copy an appropriate copyright notice and disclaimer of warranty;
|
||||
keep intact all the notices that refer to this License and to the absence of any
|
||||
warranty; and give any other recipients of the Program a copy of this License
|
||||
along with the Program. You may charge a fee for the physical act of
|
||||
transferring a copy, and you may at your option offer warranty protection in
|
||||
exchange for a fee. 2. You may modify your copy or copies of the Program or any
|
||||
portion of it, thus forming a work based on the Program, and copy and distribute
|
||||
such modifications or work under the terms of Section 1 above, provided that you
|
||||
also meet all of these conditions: a) You must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of any change.
|
||||
b) You must cause any work that you distribute or publish, that in whole or in
|
||||
part contains or is derived from the Program or any part thereof, to be licensed
|
||||
as a whole at no charge to all third parties under the terms of this License. c)
|
||||
If the modified program normally reads commands interactively when run, you must
|
||||
cause it, when started running for such interactive use in the most ordinary
|
||||
way, to print or display an announcement including an appropriate copyright
|
||||
notice and a notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under these conditions,
|
||||
and telling the user how to view a copy of this License. (Exception: if the
|
||||
Program itself is interactive but does not normally print such an announcement,
|
||||
your work based on the Program is not required to print an announcement.) These
|
||||
requirements apply to the modified work as a whole. If identifiable sections of
|
||||
that work are not derived from the Program, and can be reasonably considered
|
||||
independent and separate works in themselves, then this License, and its terms,
|
||||
do not apply to those sections when you distribute them as separate works. But
|
||||
when you distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of this
|
||||
License, whose permissions for other licensees extend to the entire whole, and
|
||||
thus to each and every part regardless of who wrote it. Thus, it is not the
|
||||
intent of this section to claim rights or contest your rights to work written
|
||||
entirely by you; rather, the intent is to exercise the right to control the
|
||||
distribution of derivative or collective works based on the Program. In
|
||||
addition, mere aggregation of another work not based on the Program with the
|
||||
Program (or with a work based on the Program) on a volume of a storage or
|
||||
distribution medium does not bring the other work under the scope of this
|
||||
License. 3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of Sections 1
|
||||
and 2 above provided that you also do one of the following: a) Accompany it with
|
||||
the complete corresponding machine-readable source code, which must be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium customarily
|
||||
used for software interchange; or, b) Accompany it with a written offer, valid
|
||||
for at least three years, to give any third party, for a charge no more than
|
||||
your cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be distributed under
|
||||
the terms of Sections 1 and 2 above on a medium customarily used for software
|
||||
interchange; or, c) Accompany it with the information you received as to the
|
||||
offer to distribute corresponding source code. (This alternative is allowed only
|
||||
for noncommercial distribution and only if you received the program in object
|
||||
code or executable form with such an offer, in accord with Subsection b above.)
|
||||
The source code for a work means the preferred form of the work for making
|
||||
modifications to it. For an executable work, complete source code means all the
|
||||
source code for all modules it contains, plus any associated interface
|
||||
definition files, plus the scripts used to control compilation and installation
|
||||
of the executable. However, as a special exception, the source code distributed
|
||||
need not include anything that is normally distributed (in either source or
|
||||
binary form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component itself
|
||||
accompanies the executable. If distribution of executable or object code is made
|
||||
by offering access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as distribution of the
|
||||
source code, even though third parties are not compelled to copy the source
|
||||
along with the object code. 4. You may not copy, modify, sublicense, or
|
||||
distribute the Program except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense or distribute the Program is void,
|
||||
and will automatically terminate your rights under this License. However,
|
||||
parties who have received copies, or rights, from you under this License will
|
||||
not have their licenses terminated so long as such parties remain in full
|
||||
compliance. 5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or distribute
|
||||
the Program or its derivative works. These actions are prohibited by law if you
|
||||
do not accept this License. Therefore, by modifying or distributing the Program
|
||||
(or any work based on the Program), you indicate your acceptance of this License
|
||||
to do so, and all its terms and conditions for copying, distributing or
|
||||
modifying the Program or works based on it. 6. Each time you redistribute the
|
||||
Program (or any work based on the Program), the recipient automatically receives
|
||||
a license from the original licensor to copy, distribute or modify the Program
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein. You are
|
||||
not responsible for enforcing compliance by third parties to this License. 7.
|
||||
If, as a consequence of a court judgment or allegation of patent infringement or
|
||||
for any other reason (not limited to patent issues), conditions are imposed on
|
||||
you (whether by court order, agreement or otherwise) that contradict the
|
||||
conditions of this License, they do not excuse you from the conditions of this
|
||||
License. If you cannot distribute so as to satisfy simultaneously your
|
||||
obligations under this License and any other pertinent obligations, then as a
|
||||
consequence you may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by all those
|
||||
who receive copies directly or indirectly through you, then the only way you
|
||||
could satisfy both it and this License would be to refrain entirely from
|
||||
distribution of the Program. If any portion of this section is held invalid or
|
||||
unenforceable under any particular circumstance, the balance of the section is
|
||||
intended to apply and the section as a whole is intended to apply in other
|
||||
circumstances. It is not the purpose of this section to induce you to infringe
|
||||
any patents or other property right claims or to contest validity of any such
|
||||
claims; this section has the sole purpose of protecting the integrity of the
|
||||
free software distribution system, which is implemented by public license
|
||||
practices. Many people have made generous contributions to the wide range of
|
||||
software distributed through that system in reliance on consistent application
|
||||
of that system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot impose
|
||||
that choice. This section is intended to make thoroughly clear what is believed
|
||||
to be a consequence of the rest of this License. 8. If the distribution and/or
|
||||
use of the Program is restricted in certain countries either by patents or by
|
||||
copyrighted interfaces, the original copyright holder who places the Program
|
||||
under this License may add an explicit geographical distribution limitation
|
||||
excluding those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates the
|
||||
limitation as if written in the body of this License. 9. The Free Software
|
||||
Foundation may publish revised and/or new versions of the General Public License
|
||||
from time to time. Such new versions will be similar in spirit to the present
|
||||
version, but may differ in detail to address new problems or concerns. Each
|
||||
version is given a distinguishing version number. If the Program specifies a
|
||||
version number of this License which applies to it and "any later version", you
|
||||
have the option of following the terms and conditions either of that version or
|
||||
of any later version published by the Free Software Foundation. If the Program
|
||||
does not specify a version number of this License, you may choose any version
|
||||
ever published by the Free Software Foundation. 10. If you wish to incorporate
|
||||
parts of the Program into other free programs whose distribution conditions are
|
||||
different, write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free Software
|
||||
Foundation; we sometimes make exceptions for this. Our decision will be guided
|
||||
by the two goals of preserving the free status of all derivatives of our free
|
||||
software and of promoting the sharing and reuse of software generally. NO
|
||||
WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE
|
||||
THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU
|
||||
ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO
|
||||
EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
|
||||
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
|
||||
PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
|
||||
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY
|
||||
TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
|
||||
THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND
|
||||
CONDITIONS How to Apply These Terms to Your New Programs If you develop a new
|
||||
program, and you want it to be of the greatest possible use to the public, the
|
||||
best way to achieve this is to make it free software which everyone can
|
||||
redistribute and change under these terms. To do so, attach the following
|
||||
notices to the program. It is safest to attach them to the start of each source
|
||||
file to most effectively convey the exclusion of warranty; and each file should
|
||||
have at least the "copyright" line and a pointer to where the full notice is
|
||||
found. <one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C)
|
||||
<year>
|
||||
<name of author>
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at your option)
|
||||
any later version. This program is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
Public License for more details. You should have received a copy of the GNU
|
||||
General Public License along with this program; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
USA Also add information on how to contact you by electronic and paper mail.
|
||||
If the program is interactive, make it output a short notice like this when
|
||||
it starts in an interactive mode: Gnomovision version 69, Copyright (C) year
|
||||
name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
|
||||
type `show w'. This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details. The hypothetical
|
||||
commands `show w' and `show c' should show the appropriate parts of the
|
||||
General Public License. Of course, the commands you use may be called
|
||||
something other than `show w' and `show c'; they could even be mouse-clicks
|
||||
or menu items--whatever suits your program. You should also get your
|
||||
employer (if you work as a programmer) or your school, if any, to sign a
|
||||
"copyright disclaimer" for the program, if necessary. Here is a sample;
|
||||
alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in
|
||||
the program `Gnomovision' (which makes passes at compilers) written by James
|
||||
Hacker.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
<signature of Ty Coon
|
||||
>, 1 April 1989 Ty Coon, President of Vice This General Public License
|
||||
does not permit incorporating your program into proprietary programs. If
|
||||
your program is a subroutine library, you may consider it more useful to
|
||||
permit linking proprietary applications with the library. If this is what
|
||||
you want to do, use the GNU Library General Public License instead of this
|
||||
License.
|
||||
</signature></name
|
||||
></year
|
||||
>
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
|
@ -1,5 +1,9 @@
|
|||
Welcome to Pandora FMS agent for MacOS installer. This will install Pandora FMS
|
||||
agent in the root disk of this system, specifically in:
|
||||
/usr/local/share/pandora_agent/ /etc/pandora/ It will also create an Uninstaller
|
||||
at your Applications folder. If you wish to perform a custom installation,
|
||||
please use the Linux tarball installer instead.
|
||||
Welcome to Pandora FMS agent for MacOS installer.
|
||||
|
||||
This will install Pandora FMS agent in the root disk of this system, specifically in:
|
||||
/usr/local/share/pandora_agent/
|
||||
/etc/pandora/
|
||||
|
||||
It will also create an Uninstaller at your Applications folder.
|
||||
|
||||
If you wish to perform a custom installation, please use the Linux tarball installer instead.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, GNU/Linux
|
||||
# Version 7.0NG.755, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, FreeBSD Version
|
||||
# Version 7.0NG.755, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, HP-UX Version
|
||||
# Version 7.0NG.755, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, GNU/Linux
|
||||
# Version 7.0NG.755, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, GNU/Linux
|
||||
# Version 7.0NG.755, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, NetBSD Version
|
||||
# Version 7.0NG.755, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.754, Solaris Version
|
||||
# Version 7.0NG.755, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1014,8 +1014,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.754';
|
||||
use constant AGENT_BUILD => '210607';
|
||||
use constant AGENT_VERSION => '7.0NG.755';
|
||||
use constant AGENT_BUILD => '210621';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.754
|
||||
%define release 210607
|
||||
%define version 7.0NG.755
|
||||
%define release 210621
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.754
|
||||
%define release 210607
|
||||
%define version 7.0NG.755
|
||||
%define release 210621
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.754"
|
||||
PI_BUILD="210607"
|
||||
PI_VERSION="7.0NG.755"
|
||||
PI_BUILD="210621"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.754
|
||||
# Version 7.0NG.755
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.754}
|
||||
{Pandora FMS Windows Agent v7.0NG.755}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{210607}
|
||||
{210621}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.754 Build 210607")
|
||||
#define PANDORA_VERSION ("7.0NG.755 Build 210621")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.754(Build 210607))"
|
||||
VALUE "ProductVersion", "(7.0NG.755(Build 210621))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.754-210607
|
||||
Version: 7.0NG.755-210621
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.754-210607"
|
||||
pandora_version="7.0NG.755-210621"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -64,7 +64,7 @@ sed "s/.*error_reporting =.*/error_reporting = E_ALL \& \~E_DEPRECATED \& \~E_NO
|
|||
sed "s/.*max_execution_time =.*/max_execution_time = 0/" /etc/php.ini > /tmp/php.ini && mv /tmp/php.ini /etc/php.ini
|
||||
sed "s/.*max_input_time =.*/max_input_time = -1/" /etc/php.ini > /tmp/php.ini && mv /tmp/php.ini /etc/php.ini
|
||||
sed "s/.*upload_max_filesize =.*/upload_max_filesize = 800M/" /etc/php.ini > /tmp/php.ini && mv /tmp/php.ini /etc/php.ini
|
||||
sed "s/.*memory_limit =.*/memory_limit = 500M/" /etc/php.ini > /tmp/php.ini && mv /tmp/php.ini /etc/php.ini
|
||||
sed "s/.*memory_limit =.*/memory_limit = 800M/" /etc/php.ini > /tmp/php.ini && mv /tmp/php.ini /etc/php.ini
|
||||
sed "s/.*post_max_size =.*/post_max_size = 100M/" /etc/php.ini > /tmp/php.ini && mv /tmp/php.ini /etc/php.ini
|
||||
|
||||
cd /var/www/html/pandora_console && mv -f install.php install.php.done
|
||||
|
|
|
@ -103,7 +103,7 @@ function load_matrix_console()
|
|||
context.fillRect(0, 0, width, height);
|
||||
|
||||
context.fillStyle = "#0F0"; // Green text
|
||||
context.font = font_size + "px arial";
|
||||
context.font = font_size + "px lato";
|
||||
// Looping over drops
|
||||
for (var i = 0; i < drops.length; i++) {
|
||||
if (drops[i] == -1) {
|
||||
|
|
|
@ -73,7 +73,7 @@ enterprise/extensions/ipam.php
|
|||
enterprise/extensions/ipam
|
||||
enterprise/extensions/disabled/visual_console_manager.php
|
||||
enterprise/extensions/visual_console_manager.php
|
||||
pandora_console/extensions/net_tools.php
|
||||
extensions/net_tools.php
|
||||
enterprise/godmode/agentes/module_manager_editor_web.php
|
||||
enterprise/include/ajax/web_server_module_debug.php
|
||||
enterprise/include/class/WebServerModuleDebug.class.php
|
||||
|
@ -82,4 +82,11 @@ include/lib/WSManager.php
|
|||
include/lib/WebSocketServer.php
|
||||
include/lib/WebSocketUser.php
|
||||
operation/network/network_explorer.php
|
||||
operation/vsual_console/pure_ajax.php
|
||||
operation/visual_console/pure_ajax.php
|
||||
include/ajax/update_manager.ajax.php
|
||||
godmode/update_manager/update_manager.css
|
||||
godmode/update_manager/update_manager.offline.php
|
||||
godmode/update_manager/update_manager.online.php
|
||||
include/javascript/update_manager.js
|
||||
enterprise/include/functions_update_manager.php
|
||||
include/ajax/rolling_release.ajax.php
|
|
@ -21,4 +21,7 @@ PREPARE pr_oum755 FROM @st_oum755;
|
|||
EXECUTE pr_oum755;
|
||||
DEALLOCATE PREPARE pr_oum755;
|
||||
|
||||
UPDATE `tconfig` set value = 'lato.ttf' WHERE token LIKE 'custom_report_front_font';
|
||||
UPDATE `tconfig` set value = 'lato.ttf' WHERE token LIKE 'fontpath';
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -1438,13 +1438,13 @@ ALTER TABLE `ttag` MODIFY COLUMN `name` text NOT NULL default '';
|
|||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 44);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 47);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
|
||||
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
|
||||
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', 752);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 755);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
|
||||
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
|
||||
|
|
|
@ -31,27 +31,25 @@ if (!$config['MR']) {
|
|||
$config['MR'] = 0;
|
||||
}
|
||||
|
||||
echo '<a class="footer" target="_blank" href="'.$config['homeurl'].$license_file.'">';
|
||||
echo '<a class="footer"target="_blank" href="'.$config['homeurl'].$license_file.'">';
|
||||
|
||||
require_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
|
||||
$current_package = update_manager_get_current_package();
|
||||
|
||||
if ($current_package == 0) {
|
||||
$build_package_version = $build_version;
|
||||
if ($current_package === null) {
|
||||
$build_package_version = 'Build '.$build_version;
|
||||
} else {
|
||||
$build_package_version = $current_package;
|
||||
$build_package_version = 'OUM '.$current_package;
|
||||
}
|
||||
|
||||
echo __(
|
||||
'%s %s - Build %s - MR %s',
|
||||
'%s %s - %s - MR %s',
|
||||
get_product_name(),
|
||||
$pandora_version,
|
||||
$build_package_version,
|
||||
$config['MR']
|
||||
);
|
||||
echo '</a><br />';
|
||||
echo '<small><span>'.__('Page generated on %s', date('Y-m-d H:i:s')).'</span></small>';
|
||||
).'</a><br><span>'.__('Page generated on %s', date('Y-m-d H:i:s')).'</span><br>';
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
/**
|
||||
* Static page to lock access to console
|
||||
*
|
||||
* @category Wizard
|
||||
* @package Pandora FMS
|
||||
* @subpackage Applications.VMware
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
ui_require_css_file('maintenance');
|
||||
?>
|
||||
<html>
|
||||
<body>
|
||||
<h1>Ups ...</h1>
|
||||
<div class="responsive">
|
||||
|
||||
<p><?php echo __('Maintenance tasks in progress'); ?></p>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
html_print_image(
|
||||
'images/maintenance.png',
|
||||
false,
|
||||
[
|
||||
'class' => 'responsive',
|
||||
'width' => 800,
|
||||
]
|
||||
);
|
||||
?>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<p><?php echo __('You will be automatically redirected when all tasks finish'); ?></p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
setTimeout(
|
||||
function() {
|
||||
location.reload();
|
||||
},
|
||||
10000
|
||||
);
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
|
@ -28,7 +28,6 @@
|
|||
.modalheadertex{
|
||||
color:white;
|
||||
position:relative;
|
||||
font-family:Nunito;
|
||||
font-size:13pt;
|
||||
top:8px;
|
||||
}
|
||||
|
@ -70,7 +69,6 @@
|
|||
}
|
||||
.modalwikibuttontex{
|
||||
color:#ffffff;
|
||||
font-family:Nunito;
|
||||
font-size:10pt;
|
||||
position:relative;
|
||||
top:6px;
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
}
|
||||
.modalheadertex{
|
||||
color:#000;
|
||||
font-family:Nunito;
|
||||
line-height: 40px;
|
||||
font-size: 23pt;
|
||||
margin-bottom:30px;
|
||||
|
@ -66,7 +65,6 @@
|
|||
}
|
||||
.modalokbuttontex{
|
||||
color:#82b92e;
|
||||
font-family:Nunito;
|
||||
font-size:13pt;
|
||||
}
|
||||
.modalgobutto{
|
||||
|
@ -80,7 +78,6 @@
|
|||
}
|
||||
.modalgobuttontex{
|
||||
color:#82b92e;
|
||||
font-family:Nunito;
|
||||
font-size:10pt;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
}
|
||||
.modalheadertex{
|
||||
color:#000;
|
||||
font-family:Nunito;
|
||||
line-height: 40px;
|
||||
font-size: 23pt;
|
||||
margin-bottom:30px;
|
||||
|
@ -66,7 +65,6 @@
|
|||
}
|
||||
.modalokbuttontex{
|
||||
color:#82b92e;
|
||||
font-family:Nunito;
|
||||
font-size:13pt;
|
||||
}
|
||||
.modalgobutto{
|
||||
|
@ -80,7 +78,6 @@
|
|||
}
|
||||
.modalgobuttontex{
|
||||
color:#82b92e;
|
||||
font-family:Nunito;
|
||||
font-size:10pt;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,24 +29,16 @@
|
|||
// Begin.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
require_once $config['homedir'].'/include/functions_register.php';
|
||||
require_once $config['homedir'].'/include/class/WelcomeWindow.class.php';
|
||||
|
||||
|
||||
if (is_ajax()) {
|
||||
if ((bool) is_ajax() === true) {
|
||||
// Parse responses, flow control.
|
||||
$configuration_wizard = get_parameter('save_required_wizard', 0);
|
||||
$change_language = get_parameter('change_language', 0);
|
||||
$cancel_wizard = get_parameter('cancel_wizard', 0);
|
||||
|
||||
// Console registration.
|
||||
$cancel_registration = get_parameter('cancel_registration', 0);
|
||||
$register_console = get_parameter('register_console', 0);
|
||||
|
||||
// Newsletter.
|
||||
$cancel_newsletter = get_parameter('cancel_newsletter', 0);
|
||||
$register_newsletter = get_parameter('register_newsletter', 0);
|
||||
|
||||
// Load wizards.
|
||||
$load_wizards = get_parameter('load_wizards', '');
|
||||
|
||||
|
@ -58,16 +50,8 @@ if (is_ajax()) {
|
|||
case 'initial':
|
||||
return config_wiz_modal(false, false);
|
||||
|
||||
case 'registration':
|
||||
return registration_wiz_modal(false, false);
|
||||
|
||||
case 'newsletter':
|
||||
return newsletter_wiz_modal(false, false);
|
||||
|
||||
case 'all':
|
||||
config_wiz_modal(false, false);
|
||||
registration_wiz_modal(false, false);
|
||||
newsletter_wiz_modal(false, false);
|
||||
return;
|
||||
|
||||
default:
|
||||
|
@ -90,31 +74,7 @@ if (is_ajax()) {
|
|||
config_update_value('initial_wizard', 1);
|
||||
}
|
||||
|
||||
// Update Manager registration.
|
||||
if ($cancel_registration) {
|
||||
config_update_value('pandora_uid', 'OFFLINE');
|
||||
}
|
||||
|
||||
if ($register_console) {
|
||||
$feedback = registration_wiz_process();
|
||||
}
|
||||
|
||||
// Newsletter.
|
||||
if ($cancel_newsletter) {
|
||||
db_process_sql_update(
|
||||
'tusuario',
|
||||
['middlename' => -1],
|
||||
['id_user' => $config['id_user']]
|
||||
);
|
||||
|
||||
// XXX: Also notify UpdateManager.
|
||||
}
|
||||
|
||||
if ($register_newsletter) {
|
||||
$feedback = newsletter_wiz_process();
|
||||
}
|
||||
|
||||
if (is_array($feedback)) {
|
||||
if (is_array($feedback) === true) {
|
||||
echo json_encode($feedback);
|
||||
}
|
||||
|
||||
|
@ -123,60 +83,23 @@ if (is_ajax()) {
|
|||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
ui_require_css_file('register');
|
||||
|
||||
$initial = isset($config['initial_wizard']) !== true
|
||||
|| $config['initial_wizard'] != '1';
|
||||
|
||||
$newsletter = db_get_value(
|
||||
'middlename',
|
||||
'tusuario',
|
||||
'id_user',
|
||||
$config['id_user']
|
||||
);
|
||||
$show_newsletter = $newsletter == '0' || $newsletter == '';
|
||||
|
||||
$registration = isset($config['pandora_uid']) !== true
|
||||
|| $config['pandora_uid'] == '';
|
||||
|
||||
|
||||
if ($initial && users_is_admin()) {
|
||||
// Show all forms in order.
|
||||
// 1- Ask for email, timezone, etc. Fullfill alerts and user mail.
|
||||
config_wiz_modal(
|
||||
false,
|
||||
true,
|
||||
(($registration === true) ? 'show_registration_wizard()' : null),
|
||||
null,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!$config['disabled_newsletter']) {
|
||||
if ($registration && users_is_admin()) {
|
||||
// Prepare registration wizard, not launch. leave control to flow.
|
||||
registration_wiz_modal(
|
||||
false,
|
||||
// Launch only if not being launch from 'initial'.
|
||||
!$initial,
|
||||
(($show_newsletter === false) ? 'force_run_newsletter()' : null),
|
||||
true
|
||||
);
|
||||
} else {
|
||||
if ($show_newsletter) {
|
||||
// Show newsletter wizard for current user.
|
||||
newsletter_wiz_modal(
|
||||
false,
|
||||
// Launch only if not being call from 'registration'.
|
||||
!$registration && !$initial,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$welcome = !$registration && !$show_newsletter && !$initial;
|
||||
$welcome = !$initial;
|
||||
try {
|
||||
$welcome_window = new WelcomeWindow($welcome);
|
||||
if ($welcome_window !== null) {
|
||||
|
@ -271,8 +194,6 @@ if (!$double_auth_enabled
|
|||
echo '</div>';
|
||||
}
|
||||
|
||||
$newsletter = null;
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
|
|
@ -1015,7 +1015,21 @@ $table->data['module'][1] = "
|
|||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
)."</td>
|
||||
<td class='datos2 button_cell' style='text-align: right; width:10%;' id=''>".'<div id="add_button_div">'.'<a class="add_button" href="">'.html_print_image(
|
||||
'images/add.png',
|
||||
|
|
|
@ -272,6 +272,8 @@ if ($idReport != 0) {
|
|||
}
|
||||
}
|
||||
|
||||
$helpers = ($helpers ?? '');
|
||||
|
||||
switch ($action) {
|
||||
case 'sort_items':
|
||||
switch ($activeTab) {
|
||||
|
@ -548,7 +550,7 @@ switch ($action) {
|
|||
|
||||
$subsection = $data_tab['subsection'];
|
||||
$buttons = $data_tab['buttons'];
|
||||
$helpers = $data_tab['helpers'];
|
||||
$helpers = $data_tab['helper'];
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -211,26 +211,6 @@ $fonts = [
|
|||
'196pt' => '196pt',
|
||||
];
|
||||
|
||||
/*
|
||||
$fontf = array('andale mono,times' => 'Andale Mono',
|
||||
'arial,helvetica,sans-serif' => 'Arial',
|
||||
'arial black,avant garde' => 'Arial Black',
|
||||
'comic sans ms,sans-serif' => 'Comic Sans MS',
|
||||
'courier new,courier' => 'Courier New',
|
||||
'georgia,palatino' => 'Georgia',
|
||||
'helvetica,impact' => 'Helvetica',
|
||||
'impact,chicago' => 'Impact',
|
||||
'symbol' => 'Symbol',
|
||||
'tahoma,arial,helvetica,sans-serif' => 'Tahoma',
|
||||
'terminal,monaco' => 'Terminal',
|
||||
'times new roman,times' => 'Times New Roman',
|
||||
'trebuchet ms,geneva' => 'Trebuchet MS',
|
||||
'verdana,geneva' => 'Verdana',
|
||||
'Webdings' => 'Webdings',
|
||||
'Wingdings' => 'Wingdings'
|
||||
);
|
||||
*/
|
||||
|
||||
$table->rowstyle['all_9'] = 'display: none;';
|
||||
$table->data['all_9'][0] = __('Font');
|
||||
$table->colspan['all_9'][1] = '3';
|
||||
|
|
|
@ -56,6 +56,10 @@ if (is_metaconsole()) {
|
|||
enterprise_include_once('include/functions_license.php');
|
||||
}
|
||||
|
||||
if ($renew_license_result !== null) {
|
||||
echo $renew_license_result;
|
||||
}
|
||||
|
||||
if ($update_settings) {
|
||||
if (!is_metaconsole()) {
|
||||
// Node.
|
||||
|
@ -80,14 +84,23 @@ foreach ($rows as $row) {
|
|||
$settings->{$row['key']} = $row['value'];
|
||||
}
|
||||
|
||||
echo '<script type="text/javascript">';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var texts = {
|
||||
error_connecting: '<?php echo __('Error while connecting to licence server.'); ?>',
|
||||
error_license: '<?php echo __('Invalid response while validating license.'); ?>',
|
||||
error_unknown: '<?php echo __('Unknown error'); ?>',
|
||||
}
|
||||
|
||||
<?php
|
||||
if (enterprise_installed()) {
|
||||
print_js_var_enteprise();
|
||||
}
|
||||
?>
|
||||
|
||||
echo '</script>';
|
||||
|
||||
echo '<form method="post">';
|
||||
</script>
|
||||
<?php
|
||||
echo '<form method="post" id="form-license">';
|
||||
// Retrieve UM url configured (or default).
|
||||
$url = get_um_url();
|
||||
|
||||
|
@ -147,8 +160,8 @@ if (enterprise_installed() || defined('DESTDIR')) {
|
|||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
ui_require_css_file('pandora_enterprise', '../../'.ENTERPRISE_DIR.'/include/styles/');
|
||||
ui_require_css_file('register', '../../include/styles/');
|
||||
ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/');
|
||||
ui_require_css_file('register', 'include/styles/');
|
||||
} else {
|
||||
ui_require_css_file('pandora');
|
||||
ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/');
|
||||
|
|
|
@ -116,7 +116,12 @@ $table_remote->data['ehorus_test'] = $row;
|
|||
// Print.
|
||||
echo '<div class="center pdd_b_20px">';
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="http://ehorus.com">';
|
||||
html_print_image('include/ehorus/images/ehorus-logo-grey.png');
|
||||
if ($config['style'] === 'pandora_black') {
|
||||
html_print_image('include/ehorus/images/ehorus-logo.png');
|
||||
} else {
|
||||
html_print_image('include/ehorus/images/ehorus-logo-grey.png');
|
||||
}
|
||||
|
||||
echo '</a>';
|
||||
echo '<br />';
|
||||
echo '<div class="ehorus_title">';
|
||||
|
|
|
@ -616,36 +616,6 @@ $table_font->style[0] = 'font-weight: bold;';
|
|||
$table_font->size[0] = '50%';
|
||||
$table_font->data = [];
|
||||
|
||||
$table_font->data[$row][0] = __('Graphs font family');
|
||||
|
||||
// Load font families.
|
||||
$fonts = [];
|
||||
$dirFonts = scandir(_MPDF_TTFONTPATH);
|
||||
foreach ($dirFonts as $entryDir) {
|
||||
if (strstr($entryDir, '.ttf') !== false) {
|
||||
$explode = explode('-', $entryDir);
|
||||
if (count($explode) === 1) {
|
||||
$fonts[$entryDir] = substr($entryDir, 0, (strlen($entryDir) - 4));
|
||||
}
|
||||
|
||||
if ($explode[1] === 'Regular.ttf') {
|
||||
$fonts[$explode[0].'.ttf'] = $explode[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$table_font->data[$row][1] = html_print_select(
|
||||
$fonts,
|
||||
'fontpath',
|
||||
io_safe_output($config['fontpath']),
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
$row++;
|
||||
|
||||
$table_font->data[$row][0] = __('Graphs font size');
|
||||
|
||||
$font_size_array = [
|
||||
|
@ -1150,20 +1120,6 @@ $table_report->data[$row][1] = "<input type ='number' value=".$config['font_size
|
|||
|
||||
$row++;
|
||||
|
||||
$table_report->data[$row][0] = __('PDF font family');
|
||||
$table_report->data[$row][1] = html_print_select(
|
||||
$fonts,
|
||||
'custom_report_front_font',
|
||||
$config['custom_report_front_font'],
|
||||
false,
|
||||
__('Default'),
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$row++;
|
||||
|
||||
|
||||
$table_report->data[$row][0] = __('Graph image height for HTML reports');
|
||||
$table_report->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true);
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
Testing
|
||||
-------
|
||||
Using phpunit8 under an unprivileged user:
|
||||
|
||||
phpunit8 --cache-result-file=/tmp/ .
|
||||
|
||||
|
||||
Using phpunit (
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
/**
|
||||
* Update Manager Client API for MC distributed updates.
|
||||
*
|
||||
* This is an atomic package, this file must be referenced from general product
|
||||
* menu entries in order to give Update Manager Client work.
|
||||
*
|
||||
* DO NOT EDIT THIS FILE. ONLY SETTINGS SECTION.
|
||||
*
|
||||
* @category Class
|
||||
* @package Update Manager
|
||||
* @subpackage Client
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
if (file_exists(__DIR__.'/../../include/config.php') === true) {
|
||||
include_once __DIR__.'/../../include/config.php';
|
||||
}
|
||||
|
||||
require_once __DIR__.'/vendor/autoload.php';
|
||||
require_once __DIR__.'/resources/helpers.php';
|
||||
|
||||
use UpdateManager\API\Server;
|
||||
|
||||
$puid = null;
|
||||
$repo_path = null;
|
||||
|
||||
if (is_array($config) === true) {
|
||||
$puid = $config['pandora_uid'];
|
||||
$repo_path = $config['remote_config'].'/updates/repo';
|
||||
if (is_dir($repo_path) === false) {
|
||||
mkdir($repo_path, 0777, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (function_exists('db_get_value') === true) {
|
||||
$license = db_get_value(
|
||||
db_escape_key_identifier('value'),
|
||||
'tupdate_settings',
|
||||
db_escape_key_identifier('key'),
|
||||
'customer_key'
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($license) === true) {
|
||||
$license = 'PANDORA-FREE';
|
||||
}
|
||||
|
||||
try {
|
||||
$server = new Server(
|
||||
[
|
||||
'registration_code' => $puid,
|
||||
'repo_path' => $repo_path,
|
||||
'license' => $license,
|
||||
]
|
||||
);
|
||||
|
||||
$server->run();
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(
|
||||
['error' => $e->getMessage()]
|
||||
);
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "articapfms/update_manager_client",
|
||||
"description": "Artica PFMS Update Manager Client",
|
||||
"type": "library",
|
||||
"license": "GPL2",
|
||||
"authors": [
|
||||
{
|
||||
"name": "fbsanchez",
|
||||
"email": "fborja.sanchez@artica.es"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"UpdateManager\\": "lib/UpdateManager"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.5.14"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,395 @@
|
|||
<?php
|
||||
/**
|
||||
* Update Manager Client.
|
||||
*
|
||||
* This is an atomic package, this file must be referenced from general product
|
||||
* menu entries in order to give Update Manager Client work.
|
||||
*
|
||||
* DO NOT EDIT THIS FILE. ONLY SETTINGS SECTION.
|
||||
*
|
||||
* @category Class
|
||||
* @package Update Manager
|
||||
* @subpackage Client
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
require_once __DIR__.'/vendor/autoload.php';
|
||||
require_once __DIR__.'/resources/helpers.php';
|
||||
|
||||
use PandoraFMS\Enterprise\Metaconsole\Synchronizer;
|
||||
use UpdateManager\UI\Manager;
|
||||
|
||||
if (function_exists('check_login') === true) {
|
||||
check_login();
|
||||
}
|
||||
|
||||
if (function_exists('check_acl') === true
|
||||
&& function_exists('is_user_admin') === true
|
||||
) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') !== true
|
||||
&& (bool) is_user_admin($config['id_user']) !== true
|
||||
) {
|
||||
db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (function_exists('db_get_value') === true) {
|
||||
$license = db_get_value(
|
||||
db_escape_key_identifier('value'),
|
||||
'tupdate_settings',
|
||||
db_escape_key_identifier('key'),
|
||||
'customer_key'
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($license) === true) {
|
||||
$license = 'PANDORA-FREE';
|
||||
}
|
||||
|
||||
if (function_exists('enterprise_hook') === true) {
|
||||
enterprise_include_once('/include/functions_license.php');
|
||||
$license_data = enterprise_hook('license_get_info');
|
||||
if ($license_data !== ENTERPRISE_NOT_HOOK) {
|
||||
$days_to_expiry = ((strtotime($license_data['expiry_date']) - time()) / (60 * 60 * 24));
|
||||
|
||||
if ((int) $license_data['limit_mode'] === 0) {
|
||||
$limit = db_get_value('count(*)', 'tagente', 'disabled', 0);
|
||||
} else {
|
||||
$limit = db_get_value('count(*)', 'tagente_modulo', 'disabled', 0);
|
||||
}
|
||||
|
||||
if ($limit > $license_data['limit']) {
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'You cannot use update manager %s. You are exceding monitoring limits by %s elements. Please update your license or disable enterprise section by moving enterprise directory to another location and try again.',
|
||||
$mode_str,
|
||||
($limit - $license_data['limit'])
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($days_to_expiry < 0) {
|
||||
$mode_str = '';
|
||||
if ($mode === Manager::MODE_ONLINE) {
|
||||
$mode_str = 'online';
|
||||
} else if ($mode === Manager::MODE_OFFLINE) {
|
||||
$mode_str = 'offline';
|
||||
}
|
||||
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'You cannot use update manager %s. This license has expired %d days ago. Please update your license or disable enterprise section by moving enterprise directory to another location and try again.',
|
||||
$mode_str,
|
||||
abs($days_to_expiry)
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
$license_data = [];
|
||||
$license_data['count_enabled'] = db_get_value(
|
||||
'count(*)',
|
||||
'tagente',
|
||||
'disabled',
|
||||
0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set dbh.
|
||||
if (is_array($config) === true && $config['dbconnection'] !== null) {
|
||||
$dbh = (object) $config['dbconnection'];
|
||||
} else {
|
||||
$dbh = null;
|
||||
}
|
||||
|
||||
// Retrieve current definition.
|
||||
if ($dbh !== null) {
|
||||
$stm = $dbh->query(
|
||||
'SELECT `value` FROM `tconfig`
|
||||
WHERE `token`="current_package"'
|
||||
);
|
||||
if ($stm !== false) {
|
||||
$current_package = $stm->fetch_array();
|
||||
if ($current_package !== null) {
|
||||
$current_package = $current_package[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($current_package) === true) {
|
||||
// If no current_package is present, use current_package_enterprise.
|
||||
$stm = $dbh->query(
|
||||
'SELECT MAX(`value`) FROM `tconfig`
|
||||
WHERE `token`="current_package_enterprise"'
|
||||
);
|
||||
if ($stm !== false) {
|
||||
$current_package = $stm->fetch_array();
|
||||
|
||||
if ($current_package !== null) {
|
||||
$current_package = $current_package[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mr = 0;
|
||||
$stm = $dbh->query(
|
||||
'SELECT MAX(`value`) FROM `tconfig`
|
||||
WHERE `token`="MR" OR `token`="minor_release"'
|
||||
);
|
||||
if ($stm !== false) {
|
||||
$mr = $stm->fetch_array();
|
||||
if ($mr !== null) {
|
||||
$mr = $mr[0];
|
||||
}
|
||||
}
|
||||
|
||||
$puid = null;
|
||||
$stm = $dbh->query(
|
||||
'SELECT `value` FROM `tconfig`
|
||||
WHERE `token`="pandora_uid"'
|
||||
);
|
||||
if ($stm !== false) {
|
||||
$puid = $stm->fetch_array();
|
||||
if ($puid !== null) {
|
||||
$puid = $puid[0];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$current_package = 0;
|
||||
$mr = 0;
|
||||
$puid = null;
|
||||
}
|
||||
|
||||
if (is_ajax() !== true) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var clientMode = '<?php echo $mode; ?>';
|
||||
</script>
|
||||
<?php
|
||||
if (function_exists('db_get_value_sql') === true) {
|
||||
$server_version = (string) db_get_value_sql(
|
||||
'SELECT `version` FROM `tserver` ORDER BY `master` DESC'
|
||||
);
|
||||
if ($server_version !== false
|
||||
&& preg_match('/NG\.(\d\.*\d*?) /', $server_version, $matches) > 0
|
||||
) {
|
||||
if ((float) $matches[1] !== (float) $current_package) {
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'Master server version %s does not match console version %s.',
|
||||
(float) $matches[1],
|
||||
(float) $current_package
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Load styles.
|
||||
if (function_exists('ui_require_css_file') === true) {
|
||||
ui_require_css_file('pandora', 'godmode/um_client/resources/styles/');
|
||||
}
|
||||
|
||||
if (isset($mode) === false) {
|
||||
$mode = Manager::MODE_ONLINE;
|
||||
if (function_exists('get_parameter') === true) {
|
||||
$mode = (int) get_parameter('mode', null);
|
||||
} else {
|
||||
$mode = ($_REQUEST['mode'] ?? Manager::MODE_ONLINE);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_int($mode) === false) {
|
||||
switch ($mode) {
|
||||
case 'offline':
|
||||
$mode = Manager::MODE_OFFLINE;
|
||||
break;
|
||||
|
||||
case 'register':
|
||||
$mode = Manager::MODE_REGISTER;
|
||||
break;
|
||||
|
||||
case 'online':
|
||||
default:
|
||||
$mode = Manager::MODE_ONLINE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$dbhHistory = null;
|
||||
|
||||
if (is_array($config) === true
|
||||
&& (bool) $config['history_db_enabled'] === true
|
||||
) {
|
||||
ob_start();
|
||||
$dbhHistory = db_connect(
|
||||
$config['history_db_host'],
|
||||
$config['history_db_name'],
|
||||
$config['history_db_user'],
|
||||
$config['history_db_pass'],
|
||||
$config['history_db_port']
|
||||
);
|
||||
ob_get_clean();
|
||||
|
||||
if ($dbhHistory === false) {
|
||||
$dbhHistory = null;
|
||||
}
|
||||
}
|
||||
|
||||
$url_update_manager = null;
|
||||
$homedir = sys_get_temp_dir();
|
||||
$dbconnection = null;
|
||||
$remote_config = null;
|
||||
$is_metaconsole = false;
|
||||
$insecure = false;
|
||||
$pandora_url = ui_get_full_url('godmode/um_client', false, false, false);
|
||||
|
||||
if (is_array($config) === true) {
|
||||
if (isset($config['secure_update_manager']) === false) {
|
||||
$config['secure_update_manager'] = null;
|
||||
}
|
||||
|
||||
if ($config['secure_update_manager'] === ''
|
||||
|| $config['secure_update_manager'] === null
|
||||
) {
|
||||
$insecure = false;
|
||||
} else {
|
||||
// Directive defined.
|
||||
$insecure = !$config['secure_update_manager'];
|
||||
}
|
||||
|
||||
if ((bool) is_ajax() === false) {
|
||||
if ($mode === Manager::MODE_ONLINE
|
||||
&& ($puid === null || $puid === 'OFFLINE')
|
||||
) {
|
||||
ui_print_error_message(__('Update manager online requires registration.'));
|
||||
}
|
||||
}
|
||||
|
||||
$url_update_manager = $config['url_update_manager'];
|
||||
$homedir = $config['homedir'];
|
||||
$dbconnection = $config['dbconnection'];
|
||||
$remote_config = $config['remote_config'];
|
||||
if (function_exists('is_metaconsole') === true) {
|
||||
$is_metaconsole = (bool) is_metaconsole();
|
||||
}
|
||||
|
||||
if ($is_metaconsole === false) {
|
||||
if ((bool) $config['node_metaconsole'] === true) {
|
||||
$url_update_manager = $config['metaconsole_base_url'];
|
||||
$url_update_manager .= 'godmode/um_client/api.php';
|
||||
}
|
||||
} else if ($is_metaconsole === true) {
|
||||
$sc = new Synchronizer();
|
||||
$url_meta_base = ui_get_full_url('/', false, false, false);
|
||||
$sc->apply(
|
||||
function ($node, $sync) use ($url_meta_base) {
|
||||
try {
|
||||
global $config;
|
||||
|
||||
$sync->connect($node);
|
||||
|
||||
$config['metaconsole_base_url'] = db_get_value(
|
||||
'value',
|
||||
'tconfig',
|
||||
'token',
|
||||
'metaconsole_base_url'
|
||||
);
|
||||
|
||||
if ($config['metaconsole_base_url'] === false) {
|
||||
// Unset to create new value if does not exist previously.
|
||||
$config['metaconsole_base_url'] = null;
|
||||
}
|
||||
|
||||
config_update_value(
|
||||
'metaconsole_base_url',
|
||||
$url_meta_base
|
||||
);
|
||||
|
||||
$sync->disconnect();
|
||||
} catch (Exception $e) {
|
||||
ui_print_error_message(
|
||||
'Cannot update node settings: ',
|
||||
$e->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$PHPmemory_limit_min = config_return_in_bytes('800M');
|
||||
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
|
||||
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== '-1') {
|
||||
$msg = __(
|
||||
'\'%s\' recommended value is %s or greater. Please, change it on your PHP configuration file (php.ini) or contact with administrator',
|
||||
'memory_limit',
|
||||
'800M'
|
||||
);
|
||||
if (function_exists('ui_print_warning_message') === true) {
|
||||
ui_print_warning_message($msg);
|
||||
} else {
|
||||
echo $msg;
|
||||
}
|
||||
}
|
||||
|
||||
$ui = new Manager(
|
||||
((is_array($config) === true) ? $pandora_url : 'http://'.$_SERVER['SERVER_ADDR'].'/'),
|
||||
((is_array($config) === true) ? ui_get_full_url('ajax.php') : ''),
|
||||
((is_array($config) === true) ? 'godmode/um_client/index' : ''),
|
||||
[
|
||||
'url' => $url_update_manager,
|
||||
'insecure' => $insecure,
|
||||
'license' => $license,
|
||||
'limit_count' => ((is_array($license_data) === true) ? $license_data['count_enabled'] : null),
|
||||
'language' => ((is_array($config) === true) ? $config['language'] : null),
|
||||
'timezone' => ((is_array($config) === true) ? $config['timezone'] : null),
|
||||
'homedir' => $homedir,
|
||||
'dbconnection' => $dbconnection,
|
||||
'historydb' => $dbhHistory,
|
||||
'current_package' => $current_package,
|
||||
'MR' => $mr,
|
||||
'registration_code' => $puid,
|
||||
'remote_config' => $remote_config,
|
||||
'propagate_updates' => $is_metaconsole,
|
||||
'set_maintenance_mode' => function () {
|
||||
if (function_exists('config_update_value') === true) {
|
||||
config_update_value('maintenance_mode', 1);
|
||||
}
|
||||
},
|
||||
'clear_maintenance_mode' => function () {
|
||||
if (function_exists('config_update_value') === true) {
|
||||
config_update_value('maintenance_mode', 0);
|
||||
}
|
||||
},
|
||||
],
|
||||
$mode
|
||||
);
|
||||
|
||||
$ui->run();
|
|
@ -0,0 +1,261 @@
|
|||
<?php
|
||||
/**
|
||||
* UpdateManager API Server.
|
||||
*
|
||||
* @category Class
|
||||
* @package Update Manager
|
||||
* @subpackage API Server
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
namespace UpdateManager\API;
|
||||
|
||||
use UpdateManager\RepoMC;
|
||||
|
||||
/**
|
||||
* Microserver to populate updates to nodes.
|
||||
*/
|
||||
class Server
|
||||
{
|
||||
|
||||
/**
|
||||
* Repository path.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $repoPath;
|
||||
|
||||
/**
|
||||
* MC License to use as verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $licenseToken;
|
||||
|
||||
/**
|
||||
* Disk repository.
|
||||
*
|
||||
* @var RepoMC
|
||||
*/
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* Registration code.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $registrationCode;
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a micro server object.
|
||||
*
|
||||
* @param array $settings Values.
|
||||
*/
|
||||
public function __construct(array $settings)
|
||||
{
|
||||
$this->repoPath = '';
|
||||
$this->licenseToken = '';
|
||||
|
||||
if (isset($settings['repo_path']) === true) {
|
||||
$this->repoPath = $settings['repo_path'];
|
||||
}
|
||||
|
||||
if (isset($settings['license']) === true) {
|
||||
$this->licenseToken = $settings['license'];
|
||||
}
|
||||
|
||||
if (isset($settings['registration_code']) === true) {
|
||||
$this->registrationCode = $settings['registration_code'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle requests and reponse as UMS.
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception On error.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
// Requests are handled via POST to hide the user.
|
||||
self::assertPost();
|
||||
|
||||
$action = self::input('action');
|
||||
|
||||
try {
|
||||
if ($action === 'get_server_package'
|
||||
|| $action === 'get_server_package_signature'
|
||||
) {
|
||||
$this->repository = new RepoMC(
|
||||
$this->repoPath,
|
||||
'tar.gz'
|
||||
);
|
||||
} else {
|
||||
$this->repository = new RepoMC(
|
||||
$this->repoPath,
|
||||
'oum'
|
||||
);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
self::error(500, $e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
$this->validateRequest();
|
||||
|
||||
switch ($action) {
|
||||
case 'newest_package':
|
||||
echo json_encode(
|
||||
$this->repository->newest_package(
|
||||
self::input('current_package')
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
||||
case 'newer_packages':
|
||||
echo json_encode(
|
||||
$this->repository->newer_packages(
|
||||
self::input('current_package')
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
||||
case 'get_package':
|
||||
$this->repository->send_package(
|
||||
self::input('package')
|
||||
);
|
||||
break;
|
||||
|
||||
case 'get_server_package':
|
||||
$this->repository->send_server_package(
|
||||
self::input('version')
|
||||
);
|
||||
break;
|
||||
|
||||
case 'new_register':
|
||||
echo json_encode(
|
||||
[
|
||||
'success' => 1,
|
||||
'pandora_uid' => $this->registrationCode,
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
// Download a package signature.
|
||||
case 'get_package_signature':
|
||||
echo $this->repository->send_package_signature(
|
||||
self::input('package')
|
||||
);
|
||||
break;
|
||||
|
||||
// Download a server package signature.
|
||||
case 'get_server_package_signature':
|
||||
echo $this->repository->send_server_package_signature(
|
||||
self::input('version')
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \Exception('invalid action');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
if ($e->getMessage() === 'file not found in repository') {
|
||||
self::error(404, $e->getMessage());
|
||||
} else {
|
||||
self::error(500, 'Error: '.$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Exit if not a POST request.
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception If not running using POST.
|
||||
*/
|
||||
private static function assertPost()
|
||||
{
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
self::error(500, 'Error: only POST requests are accepted.');
|
||||
throw new \Exception('use POST');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate request.
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception On error.
|
||||
*/
|
||||
private function validateRequest()
|
||||
{
|
||||
$reported_license = self::input('license', null);
|
||||
|
||||
if ($reported_license !== $this->licenseToken) {
|
||||
throw new \Exception('Invalid license', 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return headers with desired error.
|
||||
*
|
||||
* @param integer $err_code Error code.
|
||||
* @param string $msg Message.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private static function error(int $err_code, string $msg='')
|
||||
{
|
||||
header('HTTP/1.1 '.$err_code.' '.$msg);
|
||||
if (empty($msg) !== false) {
|
||||
echo $msg."\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve fields from request.
|
||||
*
|
||||
* @param string $name Variable name.
|
||||
* @param mixed $default Default value.
|
||||
*
|
||||
* @return mixed Variable value.
|
||||
*/
|
||||
private static function input(string $name, $default=null)
|
||||
{
|
||||
if (isset($_REQUEST[$name]) === true) {
|
||||
return $_REQUEST[$name];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,295 @@
|
|||
<?php
|
||||
|
||||
require_once 'constants.php';
|
||||
|
||||
/**
|
||||
* Software repository abstraction layer.
|
||||
*/
|
||||
abstract class Repo
|
||||
{
|
||||
|
||||
/**
|
||||
* Path of the package repository.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $path;
|
||||
|
||||
/**
|
||||
* Files in the package repository.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $files;
|
||||
|
||||
|
||||
/**
|
||||
* Class Constructor.
|
||||
*
|
||||
* @param string $path Path of the package repository.
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception On error.
|
||||
*/
|
||||
public function __construct($path=false)
|
||||
{
|
||||
if ($path === false) {
|
||||
throw new Exception('no repository path was provided');
|
||||
}
|
||||
|
||||
$this->path = $path;
|
||||
$this->files = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load repository files.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected abstract function load();
|
||||
|
||||
|
||||
/**
|
||||
* Reload repository files.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public abstract function reload();
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of all the packages in the repository.
|
||||
*
|
||||
* @return array The list of packages.
|
||||
*/
|
||||
public function all_packages()
|
||||
{
|
||||
$this->load();
|
||||
return array_values($this->files);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of packages newer than then given package.
|
||||
*
|
||||
* @param integer $current_package Current package number.
|
||||
*
|
||||
* @return array The list of packages as an array.
|
||||
*/
|
||||
public function newer_packages($current_package=0)
|
||||
{
|
||||
$this->load();
|
||||
$new_packages = [];
|
||||
|
||||
foreach ($this->files as $utimestamp => $file_name) {
|
||||
if ($utimestamp <= $current_package) {
|
||||
break;
|
||||
}
|
||||
|
||||
$new_packages[] = $file_name;
|
||||
}
|
||||
|
||||
// Return newer packages in ascending order so that the client
|
||||
// can update sequentially!
|
||||
return array_reverse($new_packages);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the name of the newest package.
|
||||
*
|
||||
* @param integer $current_package Current package number.
|
||||
*
|
||||
* @return string The name of the newest package inside an array.
|
||||
*/
|
||||
public function newest_package($current_package=0)
|
||||
{
|
||||
$this->load();
|
||||
$newest_package = [];
|
||||
|
||||
reset($this->files);
|
||||
$newest_utimestamp = key($this->files);
|
||||
|
||||
if ($newest_utimestamp > $current_package) {
|
||||
$newest_package[0] = $this->files[$newest_utimestamp];
|
||||
}
|
||||
|
||||
return $newest_package;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send back the requested package.
|
||||
*
|
||||
* @param string $package_name Name of the package.
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception Exception if the file was not found.
|
||||
*/
|
||||
public function send_package($package_name)
|
||||
{
|
||||
$this->load();
|
||||
|
||||
// Check the file exists in the repo.
|
||||
if ($package_name == false || ! in_array($package_name, array_values($this->files))) {
|
||||
throw new Exception('file not found in repository');
|
||||
}
|
||||
|
||||
// Check if the file exists in the filesystem.
|
||||
$file = $this->path.'/'.$package_name;
|
||||
if (! file_exists($file)) {
|
||||
throw new Exception('file not found');
|
||||
}
|
||||
|
||||
// Do not set headers if we are debugging!
|
||||
if ($_ENV['UM_DEBUG'] == '') {
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename='.basename($file));
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: '.filesize($file));
|
||||
ob_clean();
|
||||
flush();
|
||||
}
|
||||
|
||||
// Do not time out if the file is too big!
|
||||
set_time_limit(0);
|
||||
readfile($file);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send back the signature for the given package.
|
||||
*
|
||||
* @param string $package_name Name of the package.
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception Exception if the file was not found.
|
||||
*/
|
||||
public function send_package_signature($package_name)
|
||||
{
|
||||
$this->load();
|
||||
|
||||
// Check the file exists in the repo.
|
||||
if ($package_name == false || ! in_array($package_name, array_values($this->files))) {
|
||||
throw new Exception('file not found in repository');
|
||||
}
|
||||
|
||||
// Check if the file exists in the filesystem.
|
||||
$file = $this->path.'/'.$package_name.SIGNATURE_EXTENSION;
|
||||
if (! file_exists($file)) {
|
||||
throw new Exception('file not found');
|
||||
}
|
||||
|
||||
// Send the signature.
|
||||
readfile($file);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send back the requested server package. This function simply calls send_package.
|
||||
* Repos may implement their own version on top of it.
|
||||
*
|
||||
* @param string $package_name Name of the package.
|
||||
*/
|
||||
function send_server_package($file)
|
||||
{
|
||||
$this->send_package($file);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send back the sinature for the given server package. This function
|
||||
* simply calls send_package_signature. * Repos may implement their own
|
||||
* version on top of it.
|
||||
*
|
||||
* @param string $package_name Name of the package.
|
||||
*/
|
||||
function send_server_package_signature($file)
|
||||
{
|
||||
$this->send_package_signature($file);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the number of packages in the repository.
|
||||
*
|
||||
* @param array $db DB object connected to the database.
|
||||
*
|
||||
* @return integer The total number of packages.
|
||||
*/
|
||||
public function package_count($db=false)
|
||||
{
|
||||
$this->load();
|
||||
return count($this->files);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a package is in the repository.
|
||||
*
|
||||
* @param string $package_name Package name.
|
||||
*
|
||||
* @return boolean True if file is in the repository, FALSE if not.
|
||||
*/
|
||||
public function package_exists($package_name)
|
||||
{
|
||||
$file = $this->path.'/'.$package_name;
|
||||
if (file_exists($file)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a package is signed.
|
||||
*
|
||||
* @param string $package_name Package name.
|
||||
* @param string $verify Verify the signature.
|
||||
*
|
||||
* @return boolean True if the package is signed, FALSE if not.
|
||||
*/
|
||||
public function package_signed($package_name, $verify=false)
|
||||
{
|
||||
$file = $this->path.'/'.$package_name;
|
||||
$file_sig = $file.SIGNATURE_EXTENSION;
|
||||
|
||||
// No signature found.
|
||||
if (!file_exists($file_sig)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// No need to verify the signature.
|
||||
if ($verify === false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Read the signature.
|
||||
$signature = base64_decode(file_get_contents($file_sig));
|
||||
if ($signature === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compute the hash of the data.
|
||||
$hex_hash = hash_file('sha512', $file);
|
||||
if ($hex_hash === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Verify the signature.
|
||||
if (openssl_verify($hex_hash, $signature, PUB_KEY, 'sha512') === 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
<?php
|
||||
require_once __DIR__.'/Repo.php';
|
||||
|
||||
/**
|
||||
* Disk repository abstraction layer.
|
||||
*/
|
||||
class RepoDisk extends Repo
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Class Constructor.
|
||||
*
|
||||
* @param $path Path of the package repository.
|
||||
*/
|
||||
function __construct($path=false, $extension='oum')
|
||||
{
|
||||
// Check the repository can be opened.
|
||||
if (($dh = opendir($path)) === false) {
|
||||
throw new Exception('error opening repository '.$path);
|
||||
}
|
||||
|
||||
closedir($dh);
|
||||
|
||||
parent::__construct($path);
|
||||
|
||||
$this->extension = $extension;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a directory and its contents recursively
|
||||
*/
|
||||
public static function delete_dir($dirname)
|
||||
{
|
||||
if (is_dir($dirname)) {
|
||||
$dir_handle = @opendir($dirname);
|
||||
}
|
||||
|
||||
if (!$dir_handle) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while ($file = readdir($dir_handle)) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (!is_dir($dirname.'/'.$file)) {
|
||||
@unlink($dirname.'/'.$file);
|
||||
} else {
|
||||
self::delete_dir($dirname.'/'.$file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dir_handle);
|
||||
@rmdir($dirname);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load repository files.
|
||||
*/
|
||||
protected function load()
|
||||
{
|
||||
if ($this->files !== false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Read files in the repository.
|
||||
if (($dh = opendir($this->path)) === false) {
|
||||
throw new Exception('error opening repository');
|
||||
}
|
||||
|
||||
$this->files = [];
|
||||
while ($file_name = readdir($dh)) {
|
||||
// Files must contain a version number.
|
||||
if (preg_match('/(\d+)\_x86_64.'.$this->extension.'$/', $file_name, $utimestamp) === 1
|
||||
|| preg_match('/(\d+)\.'.$this->extension.'$/', $file_name, $utimestamp) === 1
|
||||
) {
|
||||
// Add the file to the repository.
|
||||
$this->files[$utimestamp[1]] = $file_name;
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dh);
|
||||
|
||||
// Sort them according to the package UNIX timestamp.
|
||||
krsort($this->files);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reload repository files.
|
||||
*/
|
||||
public function reload()
|
||||
{
|
||||
$this->files = false;
|
||||
$this->load();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
<?php
|
||||
// phpcs:disable Squiz.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
namespace UpdateManager;
|
||||
|
||||
require_once __DIR__.'/RepoDisk.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class to implement distributed updates.
|
||||
*/
|
||||
class RepoMC extends \RepoDisk
|
||||
{
|
||||
|
||||
/**
|
||||
* Base server name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $FNAME = 'pandorafms_server_enterprise-7.0NG.%s_x86_64.tar.gz';
|
||||
|
||||
|
||||
/**
|
||||
* Class Constructor.
|
||||
*
|
||||
* @param string|null $path Path of the package repository.
|
||||
* @param string $extension Files to include.
|
||||
*
|
||||
* @throws \Exception On error.
|
||||
*/
|
||||
public function __construct(?string $path=null, string $extension='oum')
|
||||
{
|
||||
parent::__construct($path, $extension);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the server package that corresponds to a given version.
|
||||
*
|
||||
* @param float $version Version string.
|
||||
* @param boolean $dry_run Only check if the package exists.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function send_server_package($version, bool $dry_run=false)
|
||||
{
|
||||
$package_name = sprintf($this->FNAME, $version);
|
||||
$this->load();
|
||||
|
||||
// Check if the package exists.
|
||||
if ($dry_run === true) {
|
||||
return $this->package_exists($package_name);
|
||||
}
|
||||
|
||||
parent::send_server_package($package_name);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of packages newer than then given package.
|
||||
*
|
||||
* @param integer $current_package Current package number.
|
||||
*
|
||||
* @return array The list of packages as an array.
|
||||
*/
|
||||
public function newer_packages($current_package=0)
|
||||
{
|
||||
$this->load();
|
||||
$new_packages = [];
|
||||
|
||||
foreach ($this->files as $utimestamp => $file_name) {
|
||||
if ($utimestamp <= $current_package) {
|
||||
break;
|
||||
}
|
||||
|
||||
$new_packages[] = [
|
||||
'file_name' => $file_name,
|
||||
'version' => $utimestamp,
|
||||
'description' => 'Update available from the Metaconsole.',
|
||||
];
|
||||
}
|
||||
|
||||
// Return newer packages in ascending order so that the client
|
||||
// can update sequentially!
|
||||
return array_reverse($new_packages);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve OUM signature.
|
||||
*
|
||||
* @param integer $package_name Console package name.
|
||||
*
|
||||
* @return string Signature codified in base64.
|
||||
*/
|
||||
public function send_package_signature($package_name)
|
||||
{
|
||||
$signature_file = $this->path.'/'.$package_name.SIGNATURE_EXTENSION;
|
||||
$this->load();
|
||||
|
||||
if ($this->package_exists($package_name) === true
|
||||
&& file_exists($signature_file) === true
|
||||
) {
|
||||
$signature = file_get_contents($signature_file);
|
||||
return $signature;
|
||||
}
|
||||
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve server package signature.
|
||||
*
|
||||
* @param integer $version Server package version.
|
||||
*
|
||||
* @return string Signature codified in base64.
|
||||
*/
|
||||
public function send_server_package_signature($version)
|
||||
{
|
||||
$package_name = sprintf($this->FNAME, $version);
|
||||
$signature_file = $this->path.'/'.$package_name.SIGNATURE_EXTENSION;
|
||||
$this->load();
|
||||
|
||||
if ($this->package_exists($package_name) === true
|
||||
&& file_exists($signature_file) === true
|
||||
) {
|
||||
$signature = file_get_contents($signature_file);
|
||||
return $signature;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,751 @@
|
|||
<?php
|
||||
/**
|
||||
* Update Manager client
|
||||
*
|
||||
* @category Class
|
||||
* @package Update Manager
|
||||
* @subpackage Client UI
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
namespace UpdateManager\UI;
|
||||
|
||||
use UpdateManager\Client;
|
||||
|
||||
/**
|
||||
* Undocumented class
|
||||
*/
|
||||
class Manager
|
||||
{
|
||||
|
||||
const MODE_ONLINE = 0;
|
||||
const MODE_OFFLINE = 1;
|
||||
const MODE_REGISTER = 2;
|
||||
|
||||
/**
|
||||
* Current mode (view).
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $mode;
|
||||
|
||||
/**
|
||||
* Update Manager Client.
|
||||
*
|
||||
* @var Client
|
||||
*/
|
||||
private $umc;
|
||||
|
||||
/**
|
||||
* Public url
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $publicUrl;
|
||||
|
||||
/**
|
||||
* Public url for Ajax calls.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $ajaxUrl;
|
||||
|
||||
/**
|
||||
* Ajax page.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $ajaxPage;
|
||||
|
||||
/**
|
||||
* AJAX auth code to avoid direct calls.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $authCode;
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param string $public_url Url to access resources, ui_get_full_url.
|
||||
* @param string $ajax_url Ajax url, ui_get_full_url('ajax.php').
|
||||
* @param string|null $page Ajax page (Artica style).
|
||||
* @param array $settings UMC settings.
|
||||
* @param integer|null $mode Update Manager mode (online, offline or
|
||||
* register).
|
||||
*/
|
||||
public function __construct(
|
||||
string $public_url,
|
||||
string $ajax_url,
|
||||
?string $page,
|
||||
array $settings,
|
||||
?int $mode=null
|
||||
) {
|
||||
$this->mode = 0;
|
||||
$this->publicUrl = '/';
|
||||
$this->ajaxUrl = '/';
|
||||
$this->mode = self::MODE_ONLINE;
|
||||
|
||||
if (empty($public_url) === false) {
|
||||
$this->publicUrl = $public_url;
|
||||
}
|
||||
|
||||
if (empty($ajax_url) === false) {
|
||||
$this->ajaxUrl = $ajax_url;
|
||||
}
|
||||
|
||||
if (empty($page) === false) {
|
||||
$this->ajaxPage = $page;
|
||||
}
|
||||
|
||||
if (empty($mode) === false) {
|
||||
$this->mode = $mode;
|
||||
}
|
||||
|
||||
if (session_status() !== PHP_SESSION_ACTIVE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
if (isset($_SESSION['cors-auth-code']) === true) {
|
||||
$this->authCode = $_SESSION['cors-auth-code'];
|
||||
}
|
||||
|
||||
if (empty($this->authCode) === true) {
|
||||
$this->authCode = hash('sha256', session_id().time().rand());
|
||||
$_SESSION['cors-auth-code'] = $this->authCode;
|
||||
}
|
||||
|
||||
if (session_status() === PHP_SESSION_ACTIVE) {
|
||||
session_write_close();
|
||||
}
|
||||
|
||||
if ($mode === self::MODE_OFFLINE) {
|
||||
$settings['offline'] = true;
|
||||
}
|
||||
|
||||
$this->umc = new Client($settings);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Run view.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
if (isset($_REQUEST['data']) === true) {
|
||||
$data = json_decode($_REQUEST['data'], true);
|
||||
if (json_last_error() === JSON_ERROR_NONE) {
|
||||
foreach ($data as $k => $v) {
|
||||
$_REQUEST[$k] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['ajax']) === true
|
||||
&& (int) $_REQUEST['ajax'] === 1
|
||||
) {
|
||||
$this->ajax();
|
||||
return;
|
||||
}
|
||||
|
||||
switch ($this->mode) {
|
||||
case self::MODE_OFFLINE:
|
||||
$this->offline();
|
||||
break;
|
||||
|
||||
case self::MODE_REGISTER:
|
||||
$this->register();
|
||||
break;
|
||||
|
||||
default:
|
||||
case self::MODE_ONLINE:
|
||||
$this->online();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update Manager Client Online Mode page.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function online()
|
||||
{
|
||||
if ($this->umc->isRegistered() === false) {
|
||||
$this->register();
|
||||
} else {
|
||||
View::render(
|
||||
'online',
|
||||
[
|
||||
'version' => $this->umc->getVersion(),
|
||||
'mr' => $this->umc->getMR(),
|
||||
'error' => $this->umc->getLastError(),
|
||||
'asset' => function ($rp) {
|
||||
echo $this->getUrl($rp);
|
||||
},
|
||||
'authCode' => $this->authCode,
|
||||
'ajax' => $this->ajaxUrl,
|
||||
'ajaxPage' => $this->ajaxPage,
|
||||
'progress' => $this->umc->getUpdateProgress(),
|
||||
'running' => $this->umc->isRunning(),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update Manager Client Offline Mode page.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offline()
|
||||
{
|
||||
View::render(
|
||||
'offline',
|
||||
[
|
||||
'version' => $this->umc->getVersion(),
|
||||
'mr' => $this->umc->getMR(),
|
||||
'error' => $this->umc->getLastError(),
|
||||
'asset' => function ($rp) {
|
||||
echo $this->getUrl($rp);
|
||||
},
|
||||
'authCode' => $this->authCode,
|
||||
'ajax' => $this->ajaxUrl,
|
||||
'ajaxPage' => $this->ajaxPage,
|
||||
'progress' => $this->umc->getUpdateProgress(),
|
||||
'running' => $this->umc->isRunning(),
|
||||
'insecure' => $this->umc->isInsecure(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update Manager Client Registration page.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
View::render(
|
||||
'register',
|
||||
[
|
||||
'version' => $this->umc->getVersion(),
|
||||
'mr' => $this->umc->getMR(),
|
||||
'error' => $this->umc->getLastError(),
|
||||
'asset' => function ($rp) {
|
||||
echo $this->getUrl($rp);
|
||||
},
|
||||
'authCode' => $this->authCode,
|
||||
'ajax' => $this->ajaxUrl,
|
||||
'ajaxPage' => $this->ajaxPage,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve full url to a relative path if given.
|
||||
*
|
||||
* @param string|null $relative_path Relative path to reach publicly.
|
||||
*
|
||||
* @return string Url.
|
||||
*/
|
||||
public function getUrl(?string $relative_path)
|
||||
{
|
||||
return $this->publicUrl.'/'.$relative_path;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return ajax response.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function ajax()
|
||||
{
|
||||
if (function_exists('getallheaders') === true) {
|
||||
$headers = getallheaders();
|
||||
} else {
|
||||
$headers = [];
|
||||
foreach ($_SERVER as $name => $value) {
|
||||
if (substr($name, 0, 5) === 'HTTP_') {
|
||||
$headers[str_replace(
|
||||
' ',
|
||||
'-',
|
||||
ucwords(
|
||||
strtolower(
|
||||
str_replace(
|
||||
'_',
|
||||
' ',
|
||||
substr($name, 5)
|
||||
)
|
||||
)
|
||||
)
|
||||
)] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->authCode !== $_REQUEST['cors']) {
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
// Execute target action.
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'nextUpdate':
|
||||
$result = $this->umc->updateNextVersion();
|
||||
if ($result !== true) {
|
||||
$error = $this->umc->getLastError();
|
||||
}
|
||||
|
||||
$return = [
|
||||
'version' => $this->umc->getVersion(),
|
||||
'mr' => $this->umc->getMR(),
|
||||
'messages' => $this->umc->getLastError(),
|
||||
];
|
||||
break;
|
||||
|
||||
case 'latestUpdate':
|
||||
$result = $this->umc->updateLastVersion();
|
||||
if ($result !== true) {
|
||||
$error = $this->umc->getLastError();
|
||||
}
|
||||
|
||||
$return = [
|
||||
'version' => $this->umc->getVersion(),
|
||||
'mr' => $this->umc->getMR(),
|
||||
'messages' => $this->umc->getLastError(),
|
||||
];
|
||||
break;
|
||||
|
||||
case 'status':
|
||||
$return = $this->umc->getUpdateProgress();
|
||||
break;
|
||||
|
||||
case 'getUpdates':
|
||||
$return = $this->getUpdatesList();
|
||||
break;
|
||||
|
||||
case 'uploadOUM':
|
||||
$return = $this->processOUMUpload();
|
||||
break;
|
||||
|
||||
case 'validateUploadedOUM':
|
||||
$return = $this->validateUploadedOUM();
|
||||
break;
|
||||
|
||||
case 'installUploadedOUM':
|
||||
$return = $this->installOUMUpdate();
|
||||
break;
|
||||
|
||||
case 'register':
|
||||
$return = $this->registerConsole();
|
||||
break;
|
||||
|
||||
case 'unregister':
|
||||
$return = $this->unRegisterConsole();
|
||||
break;
|
||||
|
||||
default:
|
||||
$error = 'Unknown action '.$_REQUEST['action'];
|
||||
header('HTTP/1.1 501 Unknown action');
|
||||
break;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$error = 'Error '.$e->getMessage();
|
||||
$error .= ' in '.$e->getFile().':'.$e->getLine();
|
||||
header('HTTP/1.1 500 '.$error);
|
||||
}
|
||||
|
||||
// Response.
|
||||
if (empty($error) === false) {
|
||||
if ($headers['Accept'] === 'application/json') {
|
||||
echo json_encode(
|
||||
['error' => $error]
|
||||
);
|
||||
} else {
|
||||
echo $error;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($headers['Accept'] === 'application/json') {
|
||||
echo json_encode(
|
||||
['result' => $return]
|
||||
);
|
||||
} else {
|
||||
echo $return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prints a pretty list of updates.
|
||||
*
|
||||
* @return string HTML code.
|
||||
*/
|
||||
private function getUpdatesList()
|
||||
{
|
||||
$updates = $this->umc->listUpdates();
|
||||
if (empty($updates) === true) {
|
||||
if ($updates === null) {
|
||||
header('HTTP/1.1 403 '.$this->umc->getLastError());
|
||||
return $this->umc->getLastError();
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
if (count($updates) > 0) {
|
||||
$next = $updates[0];
|
||||
$return = '<p><b>'.\__('Next update').':</b><span id="next-version">';
|
||||
$return .= $next['version'].'</span>';
|
||||
$return .= ' - <a id="um-package-details-next" ';
|
||||
$return .= ' class="um-package-details" ';
|
||||
$return .= 'href="javascript: umShowUpdateDetails(\''.$next['version'].'\');">';
|
||||
$return .= \__('Show details').'</a></p>';
|
||||
|
||||
$updates = array_reduce(
|
||||
$updates,
|
||||
function ($carry, $item) {
|
||||
$carry[$item['version']] = $item;
|
||||
return $carry;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
// This var stores all update descriptions retrieved from UMS.
|
||||
$return .= '<script type="text/javascript">';
|
||||
$return .= 'var nextUpdateVersion = "'.$next['version'].'";';
|
||||
$return .= 'var lastUpdateVersion = "';
|
||||
$return .= end($updates)['version'].'";';
|
||||
$return .= 'var updates = '.json_encode($updates).';';
|
||||
$return .= '</script>';
|
||||
$return .= '</div>';
|
||||
|
||||
array_shift($updates);
|
||||
|
||||
if (count($updates) > 0) {
|
||||
$return .= '<a href="#" onclick="umToggleUpdateList();">';
|
||||
$return .= \__(
|
||||
'%s update(s) available more',
|
||||
'<span id="updates_left">'.count($updates).'</span>'
|
||||
);
|
||||
$return .= '</a>';
|
||||
$return .= '<div id="update-list">';
|
||||
foreach ($updates as $update) {
|
||||
$return .= '<div class="update">';
|
||||
$return .= '<div class="version">';
|
||||
$return .= $update['version'];
|
||||
$return .= '</div>';
|
||||
$return .= '<a class="um-package-details" ';
|
||||
$return .= 'href="javascript: umShowUpdateDetails(\''.$update['version'].'\');">';
|
||||
$return .= \__('details').'</a></p>';
|
||||
$return .= '</div>';
|
||||
}
|
||||
|
||||
$return .= '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validates OUM uploaded by user.
|
||||
*
|
||||
* @return string JSON response.
|
||||
*/
|
||||
private function processOUMUpload()
|
||||
{
|
||||
$return = [];
|
||||
|
||||
if (isset($_FILES['upfile']) === true
|
||||
&& $_FILES['upfile']['error'] === 0
|
||||
) {
|
||||
$file_data = pathinfo($_FILES['upfile']['name']);
|
||||
$server_update = false;
|
||||
|
||||
$extension = $file_data['extension'];
|
||||
$version = $file_data['filename'];
|
||||
|
||||
if (preg_match('/pandorafms_server/', $file_data['filename']) > 0) {
|
||||
$tgz = pathinfo($file_data['filename']);
|
||||
if ($tgz !== null) {
|
||||
$extension = $tgz['extension'].'.'.$extension;
|
||||
$server_update = true;
|
||||
$matches = [];
|
||||
if (preg_match(
|
||||
'/pandorafms_server(.*?)-.*NG\.(\d+\.{0,1}\d*?)_.*/',
|
||||
$tgz['filename'],
|
||||
$matches
|
||||
) > 0
|
||||
) {
|
||||
$version = $matches[2];
|
||||
if (empty($matches[1]) === true) {
|
||||
$version .= ' OpenSource';
|
||||
} else {
|
||||
$version .= ' Enterprise';
|
||||
}
|
||||
} else {
|
||||
$version = $tgz['filename'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (preg_match(
|
||||
'/package_(\d+\.{0,1}\d*)/',
|
||||
$file_data['filename'],
|
||||
$matches
|
||||
) > 0
|
||||
) {
|
||||
$version = $matches[1];
|
||||
} else {
|
||||
$version = $file_data['filename'];
|
||||
}
|
||||
}
|
||||
|
||||
// The package extension should be .oum.
|
||||
if (strtolower($extension) === 'oum'
|
||||
|| strtolower($extension) === 'tar.gz'
|
||||
) {
|
||||
$path = $_FILES['upfile']['tmp_name'];
|
||||
|
||||
// The package files will be saved in [user temp dir]/pandora_oum/package_name.
|
||||
if (is_dir(sys_get_temp_dir().'/pandora_oum/') !== true) {
|
||||
mkdir(sys_get_temp_dir().'/pandora_oum/');
|
||||
}
|
||||
|
||||
if (is_dir(sys_get_temp_dir().'/pandora_oum/') !== true) {
|
||||
$return['status'] = 'error';
|
||||
$return['message'] = __('Failed creating temporary directory.');
|
||||
return json_encode($return);
|
||||
}
|
||||
|
||||
$file_path = sys_get_temp_dir();
|
||||
$file_path .= '/pandora_oum/'.$_FILES['upfile']['name'];
|
||||
move_uploaded_file($_FILES['upfile']['tmp_name'], $file_path);
|
||||
|
||||
if (is_file($file_path) === false) {
|
||||
$return['status'] = 'error';
|
||||
$return['message'] = __('Failed storing uploaded file.');
|
||||
return json_encode($return);
|
||||
}
|
||||
|
||||
$return['status'] = 'success';
|
||||
$return['packageId'] = hash('sha256', $file_path);
|
||||
$return['version'] = $version;
|
||||
$return['server_update'] = $server_update;
|
||||
|
||||
if ($server_update === false) {
|
||||
$return['files'] = Client::checkOUMContent($file_path);
|
||||
} else {
|
||||
$return['files'] = Client::checkTGZContent($file_path);
|
||||
}
|
||||
|
||||
if (session_status() !== PHP_SESSION_ACTIVE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
$_SESSION['umc-uploaded-file-id'] = $return['packageId'];
|
||||
$_SESSION['umc-uploaded-file-version'] = $version;
|
||||
$_SESSION['umc-uploaded-file-path'] = $file_path;
|
||||
$_SESSION['umc-uploaded-type-server'] = $server_update;
|
||||
|
||||
if (session_status() === PHP_SESSION_ACTIVE) {
|
||||
session_write_close();
|
||||
}
|
||||
|
||||
return json_encode($return);
|
||||
} else {
|
||||
$return['status'] = 'error';
|
||||
$return['message'] = __(
|
||||
'Invalid extension. The package needs to be in `%s` or `%s` format.',
|
||||
'.oum',
|
||||
'.tar.gz'
|
||||
);
|
||||
return json_encode($return);
|
||||
}
|
||||
}
|
||||
|
||||
$return['status'] = 'error';
|
||||
$return['message'] = __('Failed uploading file.');
|
||||
|
||||
return json_encode($return);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verifies uploaded file signature against given one.
|
||||
*
|
||||
* @return string JSON result.
|
||||
*/
|
||||
private function validateUploadedOUM()
|
||||
{
|
||||
if (session_status() !== PHP_SESSION_ACTIVE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
$file_path = $_SESSION['umc-uploaded-file-path'];
|
||||
$packageId = $_SESSION['umc-uploaded-file-id'];
|
||||
$signature = $_REQUEST['signature'];
|
||||
$version = $_SESSION['umc-uploaded-file-version'];
|
||||
$server_update = $_SESSION['umc-uploaded-type-server'];
|
||||
|
||||
if ($packageId !== $_REQUEST['packageId']) {
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
exit;
|
||||
}
|
||||
|
||||
$valid = $this->umc->validateSignature(
|
||||
$file_path,
|
||||
$signature
|
||||
);
|
||||
|
||||
if ($valid !== true) {
|
||||
$return['status'] = 'error';
|
||||
$return['message'] = __('Signatures does not match.');
|
||||
} else {
|
||||
$return['status'] = 'success';
|
||||
if ($this->umc->isPropagatingUpdates() === true) {
|
||||
$this->umc->saveSignature($signature, $file_path);
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process installation of manually uploaded file.
|
||||
*
|
||||
* @return string JSON response.
|
||||
*/
|
||||
private function installOUMUpdate()
|
||||
{
|
||||
if (session_status() !== PHP_SESSION_ACTIVE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
$file_path = $_SESSION['umc-uploaded-file-path'];
|
||||
$packageId = $_SESSION['umc-uploaded-file-id'];
|
||||
$version = $_SESSION['umc-uploaded-file-version'];
|
||||
$server_update = $_SESSION['umc-uploaded-type-server'];
|
||||
|
||||
if ($packageId !== $_REQUEST['packageId']) {
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
exit;
|
||||
}
|
||||
|
||||
unset($_SESSION['umc-uploaded-type-server']);
|
||||
unset($_SESSION['umc-uploaded-file-path']);
|
||||
unset($_SESSION['umc-uploaded-file-version']);
|
||||
|
||||
if (session_status() === PHP_SESSION_ACTIVE) {
|
||||
session_write_close();
|
||||
}
|
||||
|
||||
if ($server_update === true) {
|
||||
// Server update.
|
||||
$result = $this->umc->updateServerPackage(
|
||||
[
|
||||
'version' => $version,
|
||||
'file_path' => $file_path,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
// Console update.
|
||||
$result = $this->umc->updateNextVersion(
|
||||
[
|
||||
'version' => $version,
|
||||
'file_path' => $file_path,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$message = \__('Update %s successfully installed.', $version);
|
||||
if ($result !== true) {
|
||||
$message = \__(
|
||||
'Failed while updating: %s',
|
||||
$this->umc->getLastError()
|
||||
);
|
||||
}
|
||||
|
||||
return [
|
||||
'result' => $message,
|
||||
'error' => $this->umc->getLastError(),
|
||||
'version' => $this->umc->getVersion(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register console into UMS
|
||||
*
|
||||
* @return array Result.
|
||||
*/
|
||||
private function registerConsole()
|
||||
{
|
||||
$email = $_REQUEST['email'];
|
||||
$rc = $this->umc->getRegistrationCode();
|
||||
if ($rc === null) {
|
||||
// Register.
|
||||
$rc = $this->umc->register($email);
|
||||
}
|
||||
|
||||
return [
|
||||
'result' => $rc,
|
||||
'error' => $this->umc->getLastError(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unregister this console from UMS
|
||||
*
|
||||
* @return array Result.
|
||||
*/
|
||||
private function unRegisterConsole()
|
||||
{
|
||||
$this->umc->unRegister();
|
||||
|
||||
return [
|
||||
'result' => true,
|
||||
'error' => $this->umc->getLastError(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
/**
|
||||
* Loader for views.
|
||||
*
|
||||
* @category Loader
|
||||
* @package Pandora FMS
|
||||
* @subpackage Enterprise
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
namespace UpdateManager\UI;
|
||||
|
||||
/**
|
||||
* View class.
|
||||
*/
|
||||
class View
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Render view.
|
||||
*
|
||||
* @param string $view View to be loaded.
|
||||
* @param array|null $data Array data if necessary for view.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function render(string $view, ?array $data=null)
|
||||
{
|
||||
if (is_array($data) === true) {
|
||||
extract($data);
|
||||
}
|
||||
|
||||
$path = __DIR__.'/../../../views/';
|
||||
$page = $path.$view.'.php';
|
||||
|
||||
if (file_exists($page) === true) {
|
||||
include $page;
|
||||
} else {
|
||||
echo 'view '.$view.' not found';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
<?php
|
||||
/**
|
||||
* Defines some useful constants.
|
||||
*
|
||||
* @file constants.php
|
||||
* @package UMC distributed updates.
|
||||
* @subpackage constants
|
||||
*/
|
||||
|
||||
/**
|
||||
* Application version.
|
||||
*/
|
||||
defined('VERSION') || define(
|
||||
'VERSION',
|
||||
'4.0'
|
||||
);
|
||||
|
||||
/*
|
||||
* Application build.
|
||||
*/
|
||||
|
||||
defined('BUILD') || define(
|
||||
'BUILD',
|
||||
'20131120'
|
||||
);
|
||||
|
||||
/*
|
||||
* Extension of open packages (without a leading dot).
|
||||
*/
|
||||
|
||||
defined('OPEN_EXTENSION') || define(
|
||||
'OPEN_EXTENSION',
|
||||
'tar.gz'
|
||||
);
|
||||
|
||||
/*
|
||||
* Extension of server packages (without a leading dot).
|
||||
*/
|
||||
|
||||
defined('SERVER_EXTENSION') || define(
|
||||
'SERVER_EXTENSION',
|
||||
'tar.gz'
|
||||
);
|
||||
|
||||
/*
|
||||
* Package statuses.
|
||||
*/
|
||||
|
||||
defined('PACKAGE_STATUSES') || define(
|
||||
'PACKAGE_STATUSES',
|
||||
serialize([ 0 => 'disabled', 1 => 'testing', 2 => 'published'])
|
||||
);
|
||||
|
||||
/*
|
||||
* License modes.
|
||||
*/
|
||||
|
||||
defined('LICENSE_MODES') || define(
|
||||
'LICENSE_MODES',
|
||||
serialize([ 0 => 'trial', 1 => 'client'])
|
||||
);
|
||||
|
||||
/*
|
||||
* Limit modes.
|
||||
*/
|
||||
|
||||
defined('LIMIT_MODES') || define(
|
||||
'LIMIT_MODES',
|
||||
serialize([ 0 => 'agents', 1 => 'modules'])
|
||||
);
|
||||
|
||||
/*
|
||||
* License types. Offline licenses must be 3, not 2!
|
||||
*/
|
||||
|
||||
defined('LICENSE_TYPES') || define(
|
||||
'LICENSE_TYPES',
|
||||
serialize([ 0 => 'console', 1 => 'metaconsole', 3 => 'offline'])
|
||||
);
|
||||
|
||||
/*
|
||||
* Extension of digital signatures.
|
||||
*/
|
||||
|
||||
defined('SIGNATURE_EXTENSION') || define(
|
||||
'SIGNATURE_EXTENSION',
|
||||
'.sig'
|
||||
);
|
||||
|
||||
/*
|
||||
* Public key used to verify signatures.
|
||||
*/
|
||||
|
||||
defined('PUB_KEY') || define(
|
||||
'PUB_KEY',
|
||||
'-----BEGIN CERTIFICATE-----
|
||||
MIIGbDCCBVSgAwIBAgIRAO+uHm0PBdm1YtvKjFwNqg4wDQYJKoZIhvcNAQELBQAw
|
||||
gY8xCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
|
||||
BgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE3MDUGA1UE
|
||||
AxMuU2VjdGlnbyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD
|
||||
QTAeFw0xOTEwMDEwMDAwMDBaFw0yMTEwMjAyMzU5NTlaMFgxITAfBgNVBAsTGERv
|
||||
bWFpbiBDb250cm9sIFZhbGlkYXRlZDEdMBsGA1UECxMUUG9zaXRpdmVTU0wgV2ls
|
||||
ZGNhcmQxFDASBgNVBAMMCyouYXJ0aWNhLmVzMIIBIjANBgkqhkiG9w0BAQEFAAOC
|
||||
AQ8AMIIBCgKCAQEAvYafsbq6mH/GP9jc1zAHXeuh7kz8WYitCawXx5CYUFvO0ch8
|
||||
H5v8a7aiLJ+pgrgFyZeZ489a+FJW0wddyMGnch+lGU5BbvoH91BMjZV1CLTOexB2
|
||||
liid9aAEasFRBWkwIGMo4fkYFjBwBNofFd8y8vUu9550wZ4QbcshNrhk4E932BuZ
|
||||
P6WWCR0fEoyP0mQRIRMUTAT5WeOYZHkSIJFiQ5JYH5ClVEOogJkO9QTn5t6GT3Py
|
||||
SKhFYqskOOtHODztXdX/qKE+wZ2yssOEie5VvfmcoTAwkwLVZAY8Q7wqjtkaQ9kv
|
||||
weonYXq40KpQ2fksPP0x1FL0rrfsROL/tyv/wwIDAQABo4IC9zCCAvMwHwYDVR0j
|
||||
BBgwFoAUjYxexFStiuF36Zv5mwXhuAGNYeEwHQYDVR0OBBYEFDxO4vgu+Bht6JnH
|
||||
Xv4uwf459n7cMA4GA1UdDwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMB0GA1UdJQQW
|
||||
MBQGCCsGAQUFBwMBBggrBgEFBQcDAjBJBgNVHSAEQjBAMDQGCysGAQQBsjEBAgIH
|
||||
MCUwIwYIKwYBBQUHAgEWF2h0dHBzOi8vc2VjdGlnby5jb20vQ1BTMAgGBmeBDAEC
|
||||
ATCBhAYIKwYBBQUHAQEEeDB2ME8GCCsGAQUFBzAChkNodHRwOi8vY3J0LnNlY3Rp
|
||||
Z28uY29tL1NlY3RpZ29SU0FEb21haW5WYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0Eu
|
||||
Y3J0MCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5zZWN0aWdvLmNvbTAhBgNVHREE
|
||||
GjAYggsqLmFydGljYS5lc4IJYXJ0aWNhLmVzMIIBfQYKKwYBBAHWeQIEAgSCAW0E
|
||||
ggFpAWcAdwD2XJQv0XcwIhRUGAgwlFaO400TGTO/3wwvIAvMTvFk4wAAAW2Gc+pN
|
||||
AAAEAwBIMEYCIQDweXVdMk4MVPxu0H7MDSs8g9FFLfjthnFv1GBO9wpOvQIhAKvI
|
||||
fGbNpA2GWSP+L+opz5KnIwoJSL/JD7CMLbboexZsAHUARJRlLrDuzq/EQAfYqP4o
|
||||
wNrmgr7YyzG1P9MzlrW2gagAAAFthnPqagAABAMARjBEAiAWnW/bqGiL7elEQASm
|
||||
YT6V0oQOviCJ4vYi+ekYtyHi1QIgDb3PCSOf9TZXnCx8d48NrD1OvabV9LaOimVF
|
||||
NPfEZQ4AdQBVgdTCFpA2AUrqC5tXPFPwwOQ4eHAlCBcvo6odBxPTDAAAAW2Gc+pK
|
||||
AAAEAwBGMEQCIEoT2BgNg+WrJcqPeNDcBfiWyT8GoJyscj9UxpAXmMJkAiANowLt
|
||||
4mz/mc4uYjRxwZnA/BMZgOVPMLtMwaA0b1C32TANBgkqhkiG9w0BAQsFAAOCAQEA
|
||||
MNwCq90OYGnqoQ4vmX9BPe7e5qoQ7asU82u3XH/nA+lMuD5D4pKHFNFcA/KZbmvc
|
||||
OXcFt0CwbeWOuAbBom8hvFaF8abtkayG27pknQSv4i5YRKF1pEx3hrMgC8c9e32e
|
||||
ebGE1kQoj1TQkf6e0t7Ss/XvdnSITSo5Onio/g/dUv9MFI1bjcf+8gWWDueTOKyt
|
||||
FcVU5xb8g3EtXju01C70KVcN9SgHzSmyBrcBSEvJQ7emnZjyg0xdmlytvSo1Y7jf
|
||||
JWkEbLlOEtYdkgyWy1ZFi/oO5U4UR6X6xgHiJTRZyXvPoS3mk7k+YgAkdOad0vEI
|
||||
5JdvxQyReDoCO3u4FtKHEA==
|
||||
-----END CERTIFICATE-----'
|
||||
);
|
|
@ -0,0 +1,182 @@
|
|||
<?php
|
||||
|
||||
if (function_exists('ui_get_full_url') === false) {
|
||||
|
||||
|
||||
/**
|
||||
* Get public url.
|
||||
*
|
||||
* @param string $url Relative url.
|
||||
*
|
||||
* @return string Dependant url.
|
||||
*/
|
||||
function ui_get_full_url(string $url='')
|
||||
{
|
||||
global $config;
|
||||
if (is_array($config) === true) {
|
||||
if (empty($config['homeurl']) === false) {
|
||||
return $config['homeurl'].'/'.$url;
|
||||
}
|
||||
|
||||
if (empty($config['baseurl']) === false) {
|
||||
return $config['baseurl'].'/'.$url;
|
||||
}
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (function_exists('__') === false) {
|
||||
|
||||
|
||||
/**
|
||||
* Override for translation function if not available.
|
||||
*
|
||||
* @param string|null $str String to be translated.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function __(?string $str)
|
||||
{
|
||||
if ($str !== null) {
|
||||
$ret = $str;
|
||||
try {
|
||||
$args = func_get_args();
|
||||
array_shift($args);
|
||||
$ret = vsprintf($str, $args);
|
||||
} catch (Exception $e) {
|
||||
return $str;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (function_exists('html_print_image') === false) {
|
||||
|
||||
|
||||
/**
|
||||
* Prints an image HTML element.
|
||||
*
|
||||
* @param string $src Image source filename.
|
||||
* @param boolean $return Whether to return or print.
|
||||
* @param array $options Array with optional HTML options to set.
|
||||
* At this moment, the following options are supported:
|
||||
* align, border, hspace, ismap, vspace, style, title, height,
|
||||
* longdesc, usemap, width, id, class, lang, xml:lang, onclick,
|
||||
* ondblclick, onmousedown, onmouseup, onmouseover, onmousemove,
|
||||
* onmouseout, onkeypress, onkeydown, onkeyup, pos_tree, alt.
|
||||
* @param boolean $return_src Whether to return src field of image
|
||||
* ('images/*.*') or complete html img tag ('<img src="..." alt="...">').
|
||||
* @param boolean $relative Whether to use relative path to image or not
|
||||
* (i.e. $relative= true : /pandora/<img_src>).
|
||||
* @param boolean $no_in_meta Do not show on metaconsole folder at first. Go
|
||||
* directly to the node.
|
||||
* @param boolean $isExternalLink Do not shearch for images in Pandora.
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
function html_print_image(
|
||||
$src,
|
||||
$return=false,
|
||||
$options=false,
|
||||
$return_src=false,
|
||||
$relative=false,
|
||||
$no_in_meta=false,
|
||||
$isExternalLink=false
|
||||
) {
|
||||
$attr = '';
|
||||
if (is_array($options) === true) {
|
||||
foreach ($options as $k => $v) {
|
||||
$attr = $k.'="'.$v.'" ';
|
||||
}
|
||||
}
|
||||
|
||||
$output = '<img src="'.ui_get_full_url($src).'" '.$attr.'/>';
|
||||
if ($return === false) {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (function_exists('html_print_submit_button') === false) {
|
||||
|
||||
|
||||
/**
|
||||
* Render an submit input button element.
|
||||
*
|
||||
* The element will have an id like: "submit-$name"
|
||||
*
|
||||
* @param string $label Input label.
|
||||
* @param string $name Input name.
|
||||
* @param boolean $disabled Whether to disable by default or not. Enabled by default.
|
||||
* @param array $attributes Additional HTML attributes.
|
||||
* @param boolean $return Whether to return an output string or echo now (optional, echo by default).
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
function html_print_submit_button(
|
||||
$label='OK',
|
||||
$name='',
|
||||
$disabled=false,
|
||||
$attributes='',
|
||||
$return=false
|
||||
) {
|
||||
if (!$name) {
|
||||
$name = 'unnamed';
|
||||
}
|
||||
|
||||
if (is_array($attributes)) {
|
||||
$attr_array = $attributes;
|
||||
$attributes = '';
|
||||
foreach ($attr_array as $attribute => $value) {
|
||||
$attributes .= $attribute.'="'.$value.'" ';
|
||||
}
|
||||
}
|
||||
|
||||
$output = '<input type="submit" id="submit-'.$name.'" name="'.$name.'" value="'.$label.'" '.$attributes;
|
||||
if ($disabled) {
|
||||
$output .= ' disabled="disabled"';
|
||||
}
|
||||
|
||||
$output .= ' />';
|
||||
if (!$return) {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (function_exists('get_product_name') === false) {
|
||||
|
||||
|
||||
/**
|
||||
* Returns product name.
|
||||
*
|
||||
* @return string PRoduct name.
|
||||
*/
|
||||
function get_product_name()
|
||||
{
|
||||
return 'UMC';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// End.
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 284 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 432 B |
After Width: | Height: | Size: 260 B |
After Width: | Height: | Size: 251 B |
After Width: | Height: | Size: 180 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 104 B |
After Width: | Height: | Size: 125 B |
After Width: | Height: | Size: 120 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 111 B |
After Width: | Height: | Size: 110 B |
After Width: | Height: | Size: 119 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 90 B |
After Width: | Height: | Size: 101 B |
After Width: | Height: | Size: 129 B |
After Width: | Height: | Size: 4.3 KiB |