[poweradmin] new upstream release (includes template fix from svn r512)
Sven Lankes
slankes at fedoraproject.org
Sun Sep 4 19:17:43 UTC 2011
commit b962f45fe08a15c991a18cbfef56d1d77e05d2bd
Author: Sven Lankes <sven at lank.es>
Date: Sun Sep 4 21:16:36 2011 +0200
new upstream release (includes template fix from svn r512)
poweradmin-2.5.0-templatefix.diff | 61 +++++++++++++++++++++++++++++++++++++
poweradmin.spec | 13 +++++--
2 files changed, 70 insertions(+), 4 deletions(-)
---
diff --git a/poweradmin-2.5.0-templatefix.diff b/poweradmin-2.5.0-templatefix.diff
new file mode 100644
index 0000000..9de939b
--- /dev/null
+++ b/poweradmin-2.5.0-templatefix.diff
@@ -0,0 +1,61 @@
+Index: /edit.php
+===================================================================
+--- /edit.php (revision 510)
++++ /edit.php (revision 512)
+@@ -60,5 +60,5 @@
+ success(SUC_ZONE_TEMPL_ADD);
+ $records = get_records_from_domain_id($zone_id);
+- add_zone_templ_save_as($_POST['templ_name'], $_POST['templ_descr'], $_SESSION['userid'], $records);
++ add_zone_templ_save_as($_POST['templ_name'], $_POST['templ_descr'], $_SESSION['userid'], $records, get_zone_name_from_id($zone_id));
+ }
+ }
+Index: /inc/record.inc.php
+===================================================================
+--- /inc/record.inc.php (revision 509)
++++ /inc/record.inc.php (revision 512)
+@@ -1278,4 +1278,5 @@
+
+ if($zone_master_add == "1" || $zone_slave_add == "1") {
++ $domain = get_zone_name_from_id($zone_id);
+ $now = time();
+ $templ_records = get_zone_templ_records($zone_template);
+@@ -1283,7 +1284,7 @@
+ if ((preg_match('/in-addr.arpa/i', $zone_id) && ($r["type"] == "NS" || $r["type"] == "SOA")) || (!preg_match('/in-addr.arpa/i', $zone_id)))
+ {
+- $name = parse_template_value($r["name"], $zone_id);
++ $name = parse_template_value($r["name"], $domain);
+ $type = $r["type"];
+- $content = parse_template_value($r["content"], $zone_id);
++ $content = parse_template_value($r["content"], $domain);
+ $ttl = $r["ttl"];
+ $prio = intval($r["prio"]);
+@@ -1309,5 +1310,5 @@
+ $query = "UPDATE zones
+ SET zone_templ_id = " . $db->quote($zone_template, 'integer') . "
+- WHERE id = " . $db->quote($zone_id, 'integer') ;
++ WHERE domain_id = " . $db->quote($zone_id, 'integer') ;
+ $response = $db->exec($query);
+
+Index: /inc/templates.inc.php
+===================================================================
+--- /inc/templates.inc.php (revision 509)
++++ /inc/templates.inc.php (revision 512)
+@@ -314,5 +314,5 @@
+ // Add a zone template from zone / another template.
+
+-function add_zone_templ_save_as($template_name, $description, $userid, $records) {
++function add_zone_templ_save_as($template_name, $description, $userid, $records, $domain = null) {
+ global $db;
+
+@@ -341,7 +341,10 @@
+ }
+
++ $name = $domain ? preg_replace('/'.$domain.'/', '[ZONE]',$record['name']) : $record['name'];
++ $content = $domain ? preg_replace('/'.$domain.'/', '[ZONE]',$content) : $content;
++
+ $query2 = "INSERT INTO zone_templ_records (zone_templ_id, name, type, content, ttl, prio) VALUES ("
+ . $db->quote($zone_templ_id, 'integer') . ","
+- . $db->quote($record['name'], 'text') . ","
++ . $db->quote($name, 'text') . ","
+ . $db->quote($record['type'], 'text') . ","
+ . $content . ","
diff --git a/poweradmin.spec b/poweradmin.spec
index 0a4df78..bc01b9b 100644
--- a/poweradmin.spec
+++ b/poweradmin.spec
@@ -1,15 +1,16 @@
-%global alphatag rc1
+%define _default_patch_fuzz 2
Name: poweradmin
Version: 2.1.5
-Release: 0.3.%{alphatag}%{?dist}
+Release: 1%{?dist}
Summary: A friendly web-based DNS administration tool for Bert Hubert's PowerDNS server
Group: Applications/Internet
License: GPLv3+
URL: http://www.poweradmin.org
-Source0: https://www.poweradmin.org/download/%{name}-%{version}%{alphatag}.tgz
+Source0: https://www.poweradmin.org/download/%{name}-%{version}.tgz
Source1: %{name}.conf
Source2: %{name}-config.inc.php
+Patch0: poweradmin-2.5.0-templatefix.diff
BuildArch: noarch
Requires: httpd
@@ -27,7 +28,8 @@ for IPv6 and comes with multi-language support.
%prep
-%setup -q -n %{name}-%{version}%{alphatag}
+%setup -q -n %{name}-%{version}
+%patch0 -p1
%build
@@ -59,6 +61,9 @@ ln -s %{_sysconfdir}/%{name}/config.inc.php %{buildroot}/%{_datadir}/%{name}/inc
%changelog
+* Sun Sep 04 2011 Sven Lankes <sven at lank.es> 2.1.5-1
+- new upstream release (includes template fix from svn r512)
+
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.1.5-0.3.rc1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
More information about the scm-commits
mailing list