edit.php
author rejo
Wed, 26 Mar 2008 14:48:25 +0000
changeset 90 d7bee09d98fe
parent 82 c255196bc447
child 110 455405c757e1
permissions -rw-r--r--
[feladat @ 190] Changed 'print debug' function a tiny bit.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     1
<?php
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     2
47
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
     3
/*  PowerAdmin, a friendly web-based admin tool for PowerDNS.
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
     4
 *  See <https://rejo.zenger.nl/poweradmin> for more details.
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
     5
 *
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
     6
 *  Copyright 2007, 2008  Rejo Zenger <rejo@zenger.nl>
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
     7
 *
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
     8
 *  This program is free software: you can redistribute it and/or modify
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
     9
 *  it under the terms of the GNU General Public License as published by
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    10
 *  the Free Software Foundation, either version 3 of the License, or
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    11
 *  (at your option) any later version.
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    12
 *
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    13
 *  This program is distributed in the hope that it will be useful,
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    16
 *  GNU General Public License for more details.
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    17
 *
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    18
 *  You should have received a copy of the GNU General Public License
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    20
 */
ae140472d97c [feladat @ 94]
rejo
parents: 45
diff changeset
    21
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    22
require_once("inc/toolkit.inc.php");
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    23
include_once("inc/header.inc.php");
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    24
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    25
$zone_id = "-1";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    26
if (isset($_GET['id']) && v_num($_GET['id'])) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    27
	$zone_id = $_GET['id'];
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    28
}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    29
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    30
if ($zone_id == "-1") {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    31
	error(ERR_INV_INPUT);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    32
	include_once("inc/footer.inc.php");
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    33
	exit;
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    34
}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    35
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    36
if (isset($_POST['commit'])) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    37
	foreach ($_POST['record'] as $record) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    38
		edit_record($record);
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    39
	}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    40
}
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    41
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    42
if (verify_permission(zone_content_view_others)) { $perm_view = "all" ; } 
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    43
elseif (verify_permission(zone_content_view_own)) { $perm_view = "own" ; } 
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    44
else { $perm_view = "none" ; }
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    45
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    46
if (verify_permission(zone_content_edit_others)) { $perm_content_edit = "all" ; } 
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    47
elseif (verify_permission(zone_content_edit_own)) { $perm_content_edit = "own" ; } 
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    48
else { $perm_content_edit = "none" ; }
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    49
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    50
if (verify_permission(zone_meta_edit_others)) { $perm_meta_edit = "all" ; } 
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    51
elseif (verify_permission(zone_meta_edit_own)) { $perm_meta_edit = "own" ; } 
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    52
else { $perm_meta_edit = "none" ; }
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    53
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    54
$user_is_zone_owner = verify_user_is_owner_zoneid($zone_id);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    55
if ( $perm_meta_edit == "all" || ( $perm_meta_edit == "own" && $user_is_zone_owner == "1") ) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    56
	$meta_edit = "1";
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    57
}
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    58
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    59
if(isset($_POST['slave_master_change']) && is_numeric($_POST["domain"]) ) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    60
	change_zone_slave_master($_POST['domain'], $_POST['new_master']);
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    61
}
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    62
if(isset($_POST['type_change']) && in_array($_POST['newtype'], $server_types)) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    63
	change_zone_type($_POST['newtype'], $zone_id);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    64
}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    65
if(isset($_POST["newowner"]) && is_numeric($_POST["domain"]) && is_numeric($_POST["newowner"])) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    66
	add_owner_to_zone($_POST["domain"], $_POST["newowner"]);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    67
}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    68
if(isset($_POST["delete_owner"]) && is_numeric($_POST["delete_owner"]) ) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    69
	delete_owner_from_zone($zone_id, $_POST["delete_owner"]);
45
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    70
}
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    71
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    72
$domain_type=get_domain_type($zone_id);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    73
$record_count=count_zone_records($zone_id);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    74
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    75
echo "   <h2>" . _('Edit zone') . " \"" . get_domain_name_from_id($zone_id) . "\"</h2>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    76
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    77
if ( $perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0" ) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    78
	error(ERR_PERM_VIEW_ZONE);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    79
} else {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    80
	echo "   <div class=\"showmax\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    81
	show_pages($record_count,ROWAMOUNT,$zone_id);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    82
	echo "   </div>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    83
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    84
	$records = get_records_from_domain_id($zone_id,ROWSTART,ROWAMOUNT);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    85
	if ( $records == "-1" ) { 
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    86
		echo " <p>" .  _("This zone does not have any records. Weird.") . "</p>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    87
	} else {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    88
		echo "   <form method=\"post\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    89
		echo "   <table>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    90
		echo "    <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    91
		echo "     <th>&nbsp;</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    92
		echo "     <th>" . _('Name') . "</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    93
		echo "     <th>" . _('Type') . "</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    94
		echo "     <th>" . _('Content') . "</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    95
		echo "     <th>" . _('Priority') . "</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    96
		echo "     <th>" . _('TTL') . "</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    97
		echo "    </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    98
		foreach ($records as $r) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    99
			echo "    <input type=\"hidden\" name=\"record[" . $r['id'] . "][rid]\" value=\"" . $r['id'] . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   100
			echo "    <input type=\"hidden\" name=\"record[" . $r['id'] . "][zid]\" value=\"" . $zone_id . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   101
			echo "    <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   102
			if ( $domain_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0" ) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   103
				echo "     <td class=\"n\">&nbsp;</td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   104
			} else {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   105
				echo "     <td class=\"n\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   106
				echo "      <a href=\"edit_record.php?id=" . $r['id'] . "&amp;domain=" . $zone_id . "\">
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   107
						<img src=\"images/edit.gif\" alt=\"[ ". _('Edit record') . " ]\"></a>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   108
				echo "      <a href=\"delete_record.php?id=" . $r['id'] . "&amp;domain=" . $zone_id . "\">
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   109
						<img src=\"images/delete.gif\" ALT=\"[ " . _('Delete record') . " ]\" BORDER=\"0\"></a>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   110
				echo "     </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   111
			}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   112
			echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][name]\" value=\"" . $r['name'] . "\"></td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   113
			echo "      <td class=\"u\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   114
			echo "       <select name=\"record[" . $r['id'] . "][type]\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   115
			foreach (get_record_types() as $type_available) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   116
				if ($type_available == $r["type"]) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   117
					$add = " SELECTED";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   118
				} else {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   119
					$add = "";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   120
				}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   121
				echo "         <option" . $add . " value=\"" . $type_available . "\" >" . $type_available . "</option>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   122
			}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   123
			echo "       </select>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   124
			echo "      </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   125
			echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][content]\" value=\"" . $r['content'] . "\"></td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   126
			if ($r['type'] == "MX") { 
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   127
				echo "      <td class=\"u\"><input name=\"record[" . $r['id'] . "][prio]\" value=\"" .  $r['prio'] . "\"></td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   128
			} else {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   129
				echo "      <td class=\"n\">&nbsp;</td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   130
			}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   131
			echo "      <td class=\"u\"><input name=\"record[" . $r['id'] . "][ttl]\" value=\"" . $r['ttl'] . "\"></td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   132
			echo "     </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   133
		}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   134
		echo "    </table>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   135
		echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   136
		echo "    </form>";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   137
	}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   138
	
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   139
	if ( $perm_content_edit == "all" || $perm_content_edit == "own" && $user_is_zone_owner == "1" ) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   140
		if ( $domain_type != "SLAVE") {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   141
			echo "    <input type=\"button\" class=\"button\" OnClick=\"location.href='add_record.php?id=" . $zone_id . "'\" value=\"" . _('Add record') . "\">&nbsp;&nbsp\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   142
		}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   143
		echo "    <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_domain.php?id=" . $zone_id . "'\" value=\"" . _('Delete zone') . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   144
	}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   145
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   146
	echo "   <div id=\"meta\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   147
	echo "    <table>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   148
	echo "     <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   149
	echo "      <th colspan=\"2\">" . _('Owner of zone') . "</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   150
	echo "     </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   151
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   152
	$owners = get_users_from_domain_id($zone_id);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   153
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   154
	if ($owners == "-1") {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   155
		echo "      <tr><td>" . _('No owner set or this zone!') . "</td></tr>";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   156
	} else {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   157
		if ($meta_edit) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   158
			foreach ($owners as $owner) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   159
				echo "      <form method=\"post\" action=\"edit.php?id=" . $zone_id . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   160
				echo "       <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   161
				echo "        <td>" . $owner["fullname"] . "</td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   162
				echo "        <td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   163
				echo "         <input type=\"hidden\" name=\"delete_owner\" value=\"" . $owner["id"] . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   164
				echo "         <input type=\"submit\" class=\"sbutton\" name=\"co\" value=\"" . _('Delete') . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   165
				echo "        </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   166
				echo "       </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   167
				echo "      </form>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   168
			}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   169
		} else {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   170
			foreach ($owners as $owner) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   171
				echo "    <tr><td>" . $owner["fullname"] . "</td><td>&nbsp;</td></tr>";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   172
			}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   173
		}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   174
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   175
	}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   176
	if ($meta_edit) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   177
		echo "      <form method=\"post\" action=\"edit.php?id=" . $zone_id . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   178
		echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   179
		echo "       <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   180
		echo "        <td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   181
		echo "         <select name=\"newowner\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   182
		$users = show_users();
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   183
		foreach ($users as $user) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   184
			unset($add);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   185
			if ($user["id"] == $_SESSION["userid"]) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   186
				$add = " SELECTED";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   187
			}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   188
			echo "          <option" . $add . " value=\"" . $user["id"] . "\">" . $user["fullname"] . "</option>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   189
		}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   190
		echo "         </select>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   191
		echo "        </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   192
		echo "        <td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   193
		echo "         <input type=\"submit\" class=\"sbutton\" name=\"co\" value=\"" . _('Add') . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   194
		echo "        </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   195
		echo "       </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   196
		echo "      </form>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   197
	}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   198
	echo "      <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   199
	echo "       <th colspan=\"2\">" . _('Type of zone') . "</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   200
	echo "      </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   201
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   202
	if ($meta_edit) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   203
		echo "      <form action=\"" . $_SERVER['PHP_SELF'] . "?id=" . $zone_id . "\" method=\"post\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   204
		echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   205
		echo "       <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   206
		echo "        <td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   207
		echo "         <select name=\"newtype\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   208
		foreach($server_types as $type) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   209
			unset($add);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   210
			if ($type == $domain_type) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   211
				$add = " SELECTED";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   212
			}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   213
			echo "          <option" .  $add . " value=\"" . $type . "\">" .  strtolower($type) . "</option>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   214
		}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   215
		echo "         </select>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   216
		echo "        </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   217
		echo "        <td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   218
		echo "         <input type=\"submit\" class=\"sbutton\" name=\"type_change\" value=\"" . _('Change') . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   219
		echo "        </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   220
		echo "       </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   221
		echo "      </form>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   222
	} else {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   223
		echo "      <tr><td>" . strtolower($domain_type) . "</td><td>&nbsp;</td></tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   224
	}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   225
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   226
	if ($domain_type == "SLAVE" ) { 
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   227
		$slave_master=get_domain_slave_master($zone_id);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   228
		echo "      <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   229
		echo "       <th colspan=\"2\">" . _('IP address of master NS') . "</th>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   230
		echo "      </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   231
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   232
		if ($meta_edit) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   233
			echo "      <form action=\"" . $_SERVER['PHP_SELF'] . "?id=" . $zone_id . "\" method=\"post\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   234
			echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   235
			echo "       <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   236
			echo "        <td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   237
			echo "         <input type=\"text\" name=\"new_master\" value=\"" . $slave_master . "\" class=\"input\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   238
			echo "        </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   239
			echo "        <td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   240
			echo "         <input type=\"submit\" class=\"sbutton\" name=\"slave_master_change\" value=\"" . _('Change') . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   241
			echo "        </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   242
			echo "       </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   243
			echo "      </form>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   244
		} else {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   245
			echo "      <tr><td>" . $slave_master . "</td><td>&nbsp;</td></tr>\n";
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   246
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   247
	}
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   248
	echo "     </table>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   249
	echo "   </div>\n";	// eo div meta 
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   250
}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   251
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   252
include_once("inc/footer.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   253
?>