- Update to 2.1.6

PR:		175699
Submitted by:	Edmondas Girkantas <eg@fbsd.lt> (maintainer)
This commit is contained in:
Dmitry Marakasov 2013-02-04 01:22:56 +00:00
parent 04a26f0dd7
commit faa3066089
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=311533
7 changed files with 3 additions and 171 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= poweradmin
PORTVERSION= 2.1.5
PORTVERSION= 2.1.6
CATEGORIES= dns www
MASTER_SITES= SF/${PORTNAME} \
https://www.poweradmin.org/download/

View File

@ -1,2 +1,2 @@
SHA256 (poweradmin-2.1.5.tgz) = fe296a512dc1fe24483ebb4fc63d469e555ac64ae83f6a9ae2e6947cb94aef52
SIZE (poweradmin-2.1.5.tgz) = 179862
SHA256 (poweradmin-2.1.6.tgz) = ea728a522641bce59dfbe67b080c168b5484aa67b1af90a61c52f36ee573097d
SIZE (poweradmin-2.1.6.tgz) = 254258

View File

@ -1,39 +0,0 @@
--- add_zone_master.php.orig 2011-05-30 12:33:42.399768001 +0300
+++ add_zone_master.php 2011-05-30 12:34:41.423768002 +0300
@@ -36,7 +36,10 @@
if (isset($_POST['domain'])) {
$temp = array();
foreach ($_POST['domain'] as $domain) {
- $temp[] = trim($domain);
+ if($domain != "")
+ {
+ $temp[] = trim($domain);
+ }
}
$domains = $temp;
} else {
@@ -56,6 +59,7 @@
(verify_permission('user_view_others')) ? $perm_view_others = "1" : $perm_view_others = "0" ;
if (isset($_POST['submit']) && $zone_master_add == "1" ) {
+ $error = false;
foreach ($domains as $domain) {
if (domain_exists($domain)) {
error($domain . " failed - " . ERR_DOMAIN_EXISTS);
@@ -63,7 +67,6 @@
$error = true;
} elseif (add_domain($domain, $owner, $dom_type, '', $zone_template)) {
success("<a href=\"edit.php?id=" . get_zone_id_from_name($domain) . "\">".$domain . " - " . SUC_ZONE_ADD.'</a>');
- $error = false;
}
}
@@ -139,7 +142,7 @@
echo " <tr>\n";
echo " <td class=\"n\">&nbsp;</td>\n";
echo " <td class=\"n\">\n";
- echo " <input type=\"submit\" class=\"button\" name=\"submit\" value=\"" . _('Add zone') . "\">\n";
+ echo " <input type=\"submit\" class=\"button\" name=\"submit\" value=\"" . _('Add zone') . "\" onclick=\"checkDomainFilled();return false;\">\n";
echo " </td>\n";
echo " <td class=\"n\">&nbsp;</td>\n";
echo " </tr>\n";

View File

@ -1,20 +0,0 @@
--- edit.php.orig 2011-05-30 13:41:59.411768002 +0300
+++ edit.php 2011-05-30 12:59:05.851768002 +0300
@@ -51,9 +51,15 @@
}
if (isset($_POST['save_as'])) {
+ if (zone_templ_name_exists($_POST['templ_name'])) {
+ error(ERR_ZONE_TEMPL_EXIST);
+ } elseif ($_POST['templ_name'] == '') {
+ error(ERR_ZONE_TEMPL_IS_EMPTY);
+ } else {
+ 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));
+ }
}
/*

View File

@ -1,55 +0,0 @@
--- inc/helper.js.orig 2011-05-30 12:32:41.799768002 +0300
+++ inc/helper.js 2011-05-30 12:35:03.911768000 +0300
@@ -47,3 +47,52 @@
field_area.innerHTML += "<li><input name='domain[]' id='"+(field+count)+"' type='text' class='input' /> <a onclick=\"this.parentNode.parentNode.removeChild(this.parentNode);\">Remove Field</a></li>";
}
}
+
+function getDomainsElements(){
+ var
+ coll=document.getElementsByTagName('input'),
+ re=/^domain\[\]$/,
+ t,
+ elm,
+ i=0,
+ key=0,
+ records=new Array();
+
+ while(elm=coll.item(i++))
+ {
+ t=re.exec(elm.name);
+ if(t!=null)
+ {
+ records[key]=elm;
+ key++;
+ }
+ }
+ return records;
+}
+
+function checkDomainFilled(){
+ var
+ domains= new Array(),
+ allEmpty=true,
+ domains=getDomainsElements();
+
+ if (domains.length == 1) {
+ if ((domains[0].value.length == 0 || domains[0].value == null || domains[0].value == "")) {
+ alert('Zone name cannot be empty');
+ return false;
+ }
+ } else {
+ for (key in domains) {
+ if((domains[key].value.length != 0)) {
+ allEmpty = false;
+ }
+ }
+
+ if (true === allEmpty) {
+ alert('Please fill in at least one Zone name');
+ return false;
+ }
+ }
+
+ add_zone_master.submit();
+}

View File

@ -1,29 +0,0 @@
--- inc/record.inc.php.orig 2010-11-30 10:46:51.416703000 +0200
+++ inc/record.inc.php 2011-05-30 12:38:50.523768002 +0300
@@ -1276,14 +1276,15 @@
}
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);
foreach ($templ_records as $r) {
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"]);
@@ -1307,7 +1308,7 @@
$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);
if (PEAR::isError($response)) {

View File

@ -1,25 +0,0 @@
--- inc/templates.inc.php.orig 2010-12-10 23:26:28.839400000 +0200
+++ inc/templates.inc.php 2011-05-30 12:39:13.319768001 +0300
@@ -312,7 +312,7 @@
// 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;
if (!(verify_permission('zone_master_add'))) {
@@ -339,9 +339,12 @@
$content = $db->quote($record['content'], 'text');
}
+ $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 . ","
. $db->quote($record['ttl'], 'integer') . ","