Update to 1.0.2

This commit is contained in:
Morten Stevens 2017-02-12 22:10:31 +01:00
parent c793bfa679
commit 238a425e78
10 changed files with 18 additions and 8371 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
/cacti-0.8.8g.tar.gz
/cacti-0.8.8h.tar.gz
/cacti-1.0.0.tar.gz
/cacti-1.0.2.tar.gz

File diff suppressed because one or more lines are too long

View File

@ -1,11 +0,0 @@
--- cacti-0.8.8h/include/config.php.orig 2016-02-07 20:26:54.000000000 +0100
+++ cacti-0.8.8h/include/config.php 2017-01-18 15:51:15.979783797 +0100
@@ -23,7 +23,7 @@
*/
/* make sure these values refect your actual database/host/user/password */
-$database_type = "mysql";
+$database_type = "mysqli";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";

View File

@ -1,163 +0,0 @@
diff -aur cacti/install/index.php cacti-PHP7/install/index.php
--- cacti/install/index.php 2016-02-07 20:26:54.000000000 +0100
+++ cacti-PHP7/install/index.php 2016-02-24 22:33:10.713574142 +0100
@@ -63,7 +63,7 @@
}
function verify_php_extensions() {
- $extensions = array("session", "sockets", "mysql", "xml");
+ $extensions = array("session", "sockets", "pdo_mysql", "xml");
$ok = true;
$missing_extension = " <p style='font-family: Verdana, Arial; font-size: 16px; font-weight: bold; color: red;'>Error</p>
<p style='font-family: Verdana, Arial; font-size: 12px;'>The following PHP extensions are missing:</p><ul>";
diff -aur cacti/lib/adodb/adodb.inc.php cacti-PHP7/lib/adodb/adodb.inc.php
--- cacti/lib/adodb/adodb.inc.php 2010-08-21 17:03:22.000000000 +0200
+++ cacti-PHP7/lib/adodb/adodb.inc.php 2016-02-24 22:19:33.915880478 +0100
@@ -863,13 +863,13 @@
}
if ($this->_queryID === true) { // return simplified recordset for inserts/updates/deletes with lower overhead
- $rs =& new ADORecordSet_empty();
+ $rs = new ADORecordSet_empty();
return $rs;
}
// return real recordset from select statement
$rsclass = $this->rsPrefix.$this->databaseType;
- $rs =& new $rsclass($this->_queryID,$this->fetchMode);
+ $rs = new $rsclass($this->_queryID,$this->fetchMode);
$rs->connection = &$this; // Pablo suggestion
$rs->Init();
if (is_array($sql)) $rs->sql = $sql[0];
@@ -1180,7 +1180,7 @@
$arrayClass = $this->arrayClass;
- $rs2 =& new $arrayClass();
+ $rs2 = new $arrayClass();
$rs2->connection = &$this;
$rs2->sql = $rs->sql;
$rs2->dataProvider = $this->dataProvider;
@@ -1958,7 +1958,7 @@
$retarr = array();
while (!$rs->EOF) { //print_r($rs->fields);
- $fld =& new ADOFieldObject();
+ $fld = new ADOFieldObject();
$fld->name = $rs->fields[0];
$fld->type = $rs->fields[1];
if (isset($rs->fields[3]) && $rs->fields[3]) {
@@ -3024,7 +3024,7 @@
function &FetchObject($isupper=true)
{
if (empty($this->_obj)) {
- $this->_obj =& new ADOFetchObj();
+ $this->_obj = new ADOFetchObj();
$this->_names = array();
for ($i=0; $i <$this->_numOfFields; $i++) {
$f = $this->FetchField($i);
@@ -3589,7 +3589,7 @@
return $false;
}
- $obj =& new $cls();
+ $obj = new $cls();
}
# constructor should not fail
@@ -3664,7 +3664,7 @@
@include_once(ADODB_DIR."/perf/perf-$drivername.inc.php");
$class = "Perf_$drivername";
if (!class_exists($class)) return $false;
- $perf =& new $class($conn);
+ $perf = new $class($conn);
return $perf;
}
@@ -3684,7 +3684,7 @@
}
include_once($path);
$class = "ADODB2_$drivername";
- $dict =& new $class();
+ $dict = new $class();
$dict->dataProvider = $conn->dataProvider;
$dict->connection = &$conn;
$dict->upperName = strtoupper($drivername);
diff -aur cacti/lib/adodb/drivers/adodb-pdo.inc.php cacti-PHP7/lib/adodb/drivers/adodb-pdo.inc.php
--- cacti/lib/adodb/drivers/adodb-pdo.inc.php 2010-08-21 17:03:22.000000000 +0200
+++ cacti-PHP7/lib/adodb/drivers/adodb-pdo.inc.php 2016-02-24 22:20:42.780689777 +0100
@@ -43,16 +43,16 @@
$this->_connectionID = new PDO($argDSN, $argUsername, $argPassword);
if ($this->_connectionID) {
switch(ADODB_ASSOC_CASE){
- case 0: $m = PDO_CASE_LOWER; break;
- case 1: $m = PDO_CASE_UPPER; break;
+ case 0: $m = PDO::CASE_LOWER; break;
+ case 1: $m = PDO::CASE_UPPER; break;
default:
- case 2: $m = PDO_CASE_NATURAL; break;
+ case 2: $m = PDO::CASE_NATURAL; break;
}
- //$this->_connectionID->setAttribute(PDO_ATTR_ERRMODE,PDO_ERRMODE_SILENT );
- $this->_connectionID->setAttribute(PDO_ATTR_CASE,$m);
+ //$this->_connectionID->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_SILENT );
+ $this->_connectionID->setAttribute(PDO::ATTR_CASE,$m);
- //$this->_connectionID->setAttribute(PDO_ATTR_AUTOCOMMIT,true);
+ //$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
return true;
}
@@ -96,7 +96,7 @@
if ($this->transOff) return true;
$this->transCnt += 1;
$this->_autocommit = false;
- $this->_connectionID->setAttribute(PDO_ATTR_AUTOCOMMIT,false);
+ $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,false);
return $this->_connectionID->beginTransaction();
}
@@ -108,7 +108,7 @@
$this->_autocommit = true;
$ret = $this->_connectionID->commit();
- $this->_connectionID->setAttribute(PDO_ATTR_AUTOCOMMIT,true);
+ $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
return $ret;
}
@@ -119,7 +119,7 @@
$this->_autocommit = true;
$ret = $this->_connectionID->rollback();
- $this->_connectionID->setAttribute(PDO_ATTR_AUTOCOMMIT,true);
+ $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
return $ret;
}
@@ -242,9 +242,9 @@
}
switch($mode) {
default:
- case ADODB_FETCH_BOTH: $mode = PDO_FETCH_BOTH; break;
- case ADODB_FETCH_NUM: $mode = PDO_FETCH_NUM; break;
- case ADODB_FETCH_ASSOC: $mode = PDO_FETCH_ASSOC; break;
+ case ADODB_FETCH_BOTH: $mode = PDO::FETCH_BOTH; break;
+ case ADODB_FETCH_NUM: $mode = PDO::FETCH_NUM; break;
+ case ADODB_FETCH_ASSOC: $mode = PDO::FETCH_ASSOC; break;
}
$this->fetchMode = $mode;
diff -aur cacti/lib/html_tree.php cacti-PHP7/lib/html_tree.php
--- cacti/lib/html_tree.php 2015-11-17 02:39:54.000000000 +0100
+++ cacti-PHP7/lib/html_tree.php 2016-02-24 22:24:00.738287850 +0100
@@ -510,7 +510,7 @@
$default_tree_id = read_graph_config_option('default_tree_id');
- if (empty($default_tree_id)) {
+ if (empty($default_tree_id) && isset($_SESSION['sess_user_id'])) {
$user = db_fetch_row('SELECT * FROM user_auth WHERE id=' . $_SESSION['sess_user_id']);
if ($user['policy_trees'] == 1) {

View File

@ -1,11 +0,0 @@
--- cacti-0.8.8g/lib/adodb/adodb-lib.inc.php 2010-08-21 17:03:22.000000000 +0200
+++ cacti-0.8.8g-php7/lib/adodb/adodb-lib.inc.php 2016-04-21 12:30:45.707940772 +0200
@@ -534,7 +534,7 @@
//because we have to call MetaType.
//php can't do a $rsclass::MetaType()
$rsclass = $zthis->rsPrefix.$zthis->databaseType;
- $recordSet =& new $rsclass(-1,$zthis->fetchMode);
+ $recordSet = new $rsclass(-1,$zthis->fetchMode);
$recordSet->connection = &$zthis;
if (is_string($cacheRS) && $cacheRS == $rs) {

View File

@ -1,6 +1,6 @@
Name: cacti
Version: 0.8.8h
Release: 3%{?dist}
Version: 1.0.2
Release: 1%{?dist}
Summary: An rrd based graphing tool
License: GPLv2+
URL: http://www.cacti.net/
@ -8,14 +8,7 @@ Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
Source1: cacti-httpd.conf
Source2: cacti.logrotate
Source3: cacti.README.fedora
Source4: d.gif
Source5: d.png
Source6: throbber.gif
Source7: %{name}.cron
Patch0: cacti-0.8.8a-legal.patch
Patch1: cacti-php7.patch
Patch2: cacti-php7_2.patch
Patch3: cacti-mysqli.patch
Requires: php, php-mysqlnd, php-snmp, php-pdo, php-xml, mariadb, httpd, rrdtool, net-snmp
Requires: net-snmp-utils
@ -41,13 +34,6 @@ driven.
%prep
%setup -q
%patch0 -p1 -b .legal-patch
%patch1 -p1 -b .php7-patch1
%patch2 -p1 -b .php7-patch2
%patch3 -p1 -b .php7-mysqli
cp %{SOURCE4} %{SOURCE5} %{SOURCE6} include/js/jquery/themes/default/
chmod -R 0644 include/js/images/*
%build
# cacti's build is a noop
@ -74,7 +60,7 @@ install -D -m 0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/cacti
sed -i %{buildroot}/%{_sysconfdir}/logrotate.d/cacti -e '/^[ \t]*su /d'
%endif
cp -a images/ include/ install/ lib/ plugins/ resource/ %{buildroot}%{_datadir}/%{name}
cp -ar formats/ images/ include/ install/ lib/ locales/ mibs/ plugins/ resource/ %{buildroot}%{_datadir}/%{name}
cp %{SOURCE3} ./docs/README.fedora
cp -a docs/ %{buildroot}/%{_pkgdocdir}
mv %{buildroot}/%{_datadir}/%{name}/include/config.php %{buildroot}/%{_sysconfdir}/%{name}/db.php
@ -104,25 +90,29 @@ fi
%dir %{_localstatedir}/lib/%{name}
%dir %{_localstatedir}/lib/%{name}/cli
%dir %{_localstatedir}/lib/%{name}/scripts
%doc docs/ README cacti.sql
%doc docs/ README.md cacti.sql
%license LICENSE
%config(noreplace) %{_sysconfdir}/cron.d/cacti
%config(noreplace) %{_sysconfdir}/httpd/conf.d/cacti.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%attr(0640,cacti,apache) %config(noreplace) %{_sysconfdir}/%{name}/db.php
%{_datadir}/%{name}/*.php
%{_datadir}/%{name}/formats/
%{_datadir}/%{name}/images/
%{_datadir}/%{name}/include/
%{_datadir}/%{name}/install/
%{_datadir}/%{name}/lib/
%{_datadir}/%{name}/locales/*
%{_datadir}/%{name}/log
%{_datadir}/%{name}/mibs
%{_datadir}/%{name}/plugins/
%{_datadir}/%{name}/resource/
%{_datadir}/%{name}/rra
%{_datadir}/%{name}/scripts
%{_datadir}/%{name}/cli
%{_localstatedir}/lib/%{name}/scripts/*[^p]
%ghost %attr(-,cacti,apache) %{_localstatedir}/log/%{name}/
%dir %attr(-,cacti,apache) %{_localstatedir}/log/%{name}/
%attr(-,cacti,apache) %{_localstatedir}/log/%{name}/%{name}.log
%attr(-,cacti,root) %{_localstatedir}/lib/%{name}/rra/
%attr(0644,root,root) %{_localstatedir}/lib/%{name}/scripts/*php
%attr(0644,root,root) %{_localstatedir}/lib/%{name}/cli/*php
@ -130,6 +120,12 @@ fi
%attr(0644,root,root) %{_localstatedir}/lib/%{name}/lib
%changelog
* Sun Feb 12 2017 Morten Stevens <mstevens@fedoraproject.org> - 1.0.2-1
- Update to 1.0.2
* Mon Jan 30 2017 Morten Stevens <mstevens@fedoraproject.org> - 1.0.0-1
- Update to 1.0.0
* Wed Jan 18 2017 Morten Stevens <mstevens@fedoraproject.org> - 0.8.8h-3
- Fixes for PHP7 backported from Arch Linux (#1390770)

BIN
d.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

BIN
d.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -1 +1 @@
e5a2eb9e1b187a92284f46e7d4cd6505 cacti-0.8.8h.tar.gz
SHA512 (cacti-1.0.2.tar.gz) = f7842cc4b89a9a8ca9e1d2c113300aee81d364806bbbcaac87e95a09e3dfbb81cd4dfbb15bf0667e35715a81712bb91e4a3b66af381c95b42e0f0b29d7b05243

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB