edit.php
author rejo
Sat, 07 Jun 2008 10:51:11 +0000
changeset 179 5a2d4418385d
parent 141 1ede5203910d
child 200 6bdfaba077cb
permissions -rw-r--r--
[feladat @ 287] Changed default zone type when adding new master zones (from master to native).
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
119
f74e4f88b680 [feladat @ 222]
rejo
parents: 111
diff changeset
     3
/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
47
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
126
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    42
if (verify_permission('zone_content_view_others')) { $perm_view = "all" ; } 
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    43
elseif (verify_permission('zone_content_view_own')) { $perm_view = "own" ; } 
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    44
else { $perm_view = "none" ; }
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    45
126
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    46
if (verify_permission('zone_content_edit_others')) { $perm_content_edit = "all" ; } 
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    47
elseif (verify_permission('zone_content_edit_own')) { $perm_content_edit = "own" ; } 
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    48
else { $perm_content_edit = "none" ; }
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    49
126
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    50
if (verify_permission('zone_meta_edit_others')) { $perm_meta_edit = "all" ; } 
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    51
elseif (verify_permission('zone_meta_edit_own')) { $perm_meta_edit = "own" ; } 
82
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
if ( $perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0" ) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    73
	error(ERR_PERM_VIEW_ZONE);
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    74
} else {
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    75
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    76
	if (zone_id_exists($zone_id) == "0") {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    77
		error(ERR_ZONE_NOT_EXIST);
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    78
	} else  {	
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    79
		$domain_type=get_domain_type($zone_id);
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    80
		$record_count=count_zone_records($zone_id);
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    81
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    82
		echo "   <h2>" . _('Edit zone') . " \"" . get_zone_name_from_id($zone_id) . "\"</h2>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    83
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    84
		echo "   <div class=\"showmax\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    85
		show_pages($record_count,$iface_rowamount,$zone_id);
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    86
		echo "   </div>\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    87
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    88
		$records = get_records_from_domain_id($zone_id,ROWSTART,$iface_rowamount);
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    89
		if ( $records == "-1" ) { 
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    90
			echo " <p>" .  _("This zone does not have any records. Weird.") . "</p>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    91
		} else {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    92
			echo "   <form method=\"post\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    93
			echo "   <table>\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
    94
			echo "    <tr>\n";
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    95
			echo "     <th>&nbsp;</th>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    96
			echo "     <th>" . _('Name') . "</th>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    97
			echo "     <th>" . _('Type') . "</th>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    98
			echo "     <th>" . _('Content') . "</th>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
    99
			echo "     <th>" . _('Priority') . "</th>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   100
			echo "     <th>" . _('TTL') . "</th>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   101
			echo "    </tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   102
			foreach ($records as $r) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   103
				echo "    <input type=\"hidden\" name=\"record[" . $r['id'] . "][rid]\" value=\"" . $r['id'] . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   104
				echo "    <input type=\"hidden\" name=\"record[" . $r['id'] . "][zid]\" value=\"" . $zone_id . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   105
				echo "    <tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   106
				if ( $domain_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0" ) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   107
					echo "     <td class=\"n\">&nbsp;</td>\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   108
				} else {
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   109
					echo "     <td class=\"n\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   110
					echo "      <a href=\"edit_record.php?id=" . $r['id'] . "&amp;domain=" . $zone_id . "\">
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   111
							<img src=\"images/edit.gif\" alt=\"[ ". _('Edit record') . " ]\"></a>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   112
					echo "      <a href=\"delete_record.php?id=" . $r['id'] . "&amp;domain=" . $zone_id . "\">
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   113
							<img src=\"images/delete.gif\" ALT=\"[ " . _('Delete record') . " ]\" BORDER=\"0\"></a>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   114
					echo "     </td>\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   115
				}
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   116
				echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][name]\" value=\"" . $r['name'] . "\"></td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   117
				echo "      <td class=\"u\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   118
				echo "       <select name=\"record[" . $r['id'] . "][type]\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   119
				foreach (get_record_types() as $type_available) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   120
					if ($type_available == $r['type']) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   121
						$add = " SELECTED";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   122
					} else {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   123
						$add = "";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   124
					}
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   125
					echo "         <option" . $add . " value=\"" . $type_available . "\" >" . $type_available . "</option>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   126
				}
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   127
				echo "       </select>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   128
				echo "      </td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   129
				echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][content]\" value=\"" . $r['content'] . "\"></td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   130
				if ($r['type'] == "MX") { 
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   131
					echo "      <td class=\"u\"><input name=\"record[" . $r['id'] . "][prio]\" value=\"" .  $r['prio'] . "\"></td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   132
				} else {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   133
					echo "      <td class=\"n\">&nbsp;</td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   134
				}
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   135
				echo "      <td class=\"u\"><input name=\"record[" . $r['id'] . "][ttl]\" value=\"" . $r['ttl'] . "\"></td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   136
				echo "     </tr>\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   137
			}
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   138
			echo "    </table>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   139
			echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   140
			echo "    </form>";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   141
		}
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   142
		
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   143
		if ( $perm_content_edit == "all" || $perm_content_edit == "own" && $user_is_zone_owner == "1" ) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   144
			if ( $domain_type != "SLAVE") {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   145
				echo "    <input type=\"button\" class=\"button\" OnClick=\"location.href='add_record.php?id=" . $zone_id . "'\" value=\"" . _('Add record') . "\">&nbsp;&nbsp\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   146
			}
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   147
			echo "    <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_domain.php?id=" . $zone_id . "'\" value=\"" . _('Delete zone') . "\">\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   148
		}
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   149
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   150
		echo "   <div id=\"meta\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   151
		echo "    <table>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   152
		echo "     <tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   153
		echo "      <th colspan=\"2\">" . _('Owner of zone') . "</th>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   154
		echo "     </tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   155
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   156
		$owners = get_users_from_domain_id($zone_id);
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   157
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   158
		if ($owners == "-1") {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   159
			echo "      <tr><td>" . _('No owner set for this zone.') . "</td></tr>";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   160
		} else {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   161
			if ($meta_edit) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   162
				foreach ($owners as $owner) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   163
					echo "      <form method=\"post\" action=\"edit.php?id=" . $zone_id . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   164
					echo "       <tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   165
					echo "        <td>" . $owner["fullname"] . "</td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   166
					echo "        <td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   167
					echo "         <input type=\"hidden\" name=\"delete_owner\" value=\"" . $owner["id"] . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   168
					echo "         <input type=\"submit\" class=\"sbutton\" name=\"co\" value=\"" . _('Delete') . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   169
					echo "        </td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   170
					echo "       </tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   171
					echo "      </form>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   172
				}
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   173
			} else {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   174
				foreach ($owners as $owner) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   175
					echo "    <tr><td>" . $owner["fullname"] . "</td><td>&nbsp;</td></tr>";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   176
				}
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   177
			}
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   178
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   179
		}
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   180
		if ($meta_edit) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   181
			echo "      <form method=\"post\" action=\"edit.php?id=" . $zone_id . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   182
			echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   183
			echo "       <tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   184
			echo "        <td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   185
			echo "         <select name=\"newowner\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   186
			$users = show_users();
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   187
			foreach ($users as $user) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   188
				$add = '';
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   189
				if ($user["id"] == $_SESSION["userid"]) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   190
					$add = " SELECTED";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   191
				}
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   192
				echo "          <option" . $add . " value=\"" . $user["id"] . "\">" . $user["fullname"] . "</option>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   193
			}
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   194
			echo "         </select>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   195
			echo "        </td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   196
			echo "        <td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   197
			echo "         <input type=\"submit\" class=\"sbutton\" name=\"co\" value=\"" . _('Add') . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   198
			echo "        </td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   199
			echo "       </tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   200
			echo "      </form>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   201
		}
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   202
		echo "      <tr>\n";
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   203
		echo "       <th colspan=\"2\">" . _('Type') . "</th>\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   204
		echo "      </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   205
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   206
		if ($meta_edit) {
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   207
			echo "      <form action=\"" . $_SERVER['PHP_SELF'] . "?id=" . $zone_id . "\" method=\"post\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   208
			echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   209
			echo "       <tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   210
			echo "        <td>\n";
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   211
			echo "         <select name=\"newtype\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   212
			foreach($server_types as $type) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   213
				$add = '';
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   214
				if ($type == $domain_type) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   215
					$add = " SELECTED";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   216
				}
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   217
				echo "          <option" .  $add . " value=\"" . $type . "\">" .  strtolower($type) . "</option>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   218
			}
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   219
			echo "         </select>\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   220
			echo "        </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   221
			echo "        <td>\n";
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   222
			echo "         <input type=\"submit\" class=\"sbutton\" name=\"type_change\" value=\"" . _('Change') . "\">\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   223
			echo "        </td>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   224
			echo "       </tr>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   225
			echo "      </form>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 79
diff changeset
   226
		} else {
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   227
			echo "      <tr><td>" . strtolower($domain_type) . "</td><td>&nbsp;</td></tr>\n";
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   228
		}
141
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   229
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   230
		if ($domain_type == "SLAVE" ) { 
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   231
			$slave_master=get_domain_slave_master($zone_id);
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   232
			echo "      <tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   233
			echo "       <th colspan=\"2\">" . _('IP address of master NS') . "</th>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   234
			echo "      </tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   235
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   236
			if ($meta_edit) {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   237
				echo "      <form action=\"" . $_SERVER['PHP_SELF'] . "?id=" . $zone_id . "\" method=\"post\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   238
				echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   239
				echo "       <tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   240
				echo "        <td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   241
				echo "         <input type=\"text\" name=\"new_master\" value=\"" . $slave_master . "\" class=\"input\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   242
				echo "        </td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   243
				echo "        <td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   244
				echo "         <input type=\"submit\" class=\"sbutton\" name=\"slave_master_change\" value=\"" . _('Change') . "\">\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   245
				echo "        </td>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   246
				echo "       </tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   247
				echo "      </form>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   248
			} else {
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   249
				echo "      <tr><td>" . $slave_master . "</td><td>&nbsp;</td></tr>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   250
			}
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   251
		}
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   252
		echo "     </table>\n";
1ede5203910d [feladat @ 247]
rejo
parents: 140
diff changeset
   253
		echo "   </div>\n";	// eo div meta 
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   254
	}
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   255
}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   256
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   257
include_once("inc/footer.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   258
?>