edit.php
author rejo
Wed, 02 Jan 2008 22:24:32 +0000
changeset 59 11804f18dfc7
parent 56 6db9adfa86ac
child 65 ce1c4d5e1576
permissions -rw-r--r--
[feladat @ 106] Cleared unmaintained changelog in docs/ and added reference to website.
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");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    23
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    24
// Assigning records to user: Check for records owned by user
45
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    25
$recordOwnerError = '';
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    26
if (isset($_POST["action"]) && $_POST["action"]=="record-user") {
45
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    27
	if (!is_array($_POST['rowid'])) {
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    28
		$recordOwnerError = 'No records where selected to assign an sub-owner.';
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    29
	} else {
56
6db9adfa86ac [feladat @ 103]
rejo
parents: 55
diff changeset
    30
		foreach ($_POST["rowid"] as $x_user => $recordid){
6db9adfa86ac [feladat @ 103]
rejo
parents: 55
diff changeset
    31
			$x_userid = $db->queryOne("SELECT id FROM record_owners WHERE user_id = '".$_POST["userid"]."' AND record_id='".$recordid."'");
45
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    32
			if (empty($x_userid)) {
56
6db9adfa86ac [feladat @ 103]
rejo
parents: 55
diff changeset
    33
				add_record_owner($_GET["id"],$_POST["userid"],$recordid);
45
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    34
			}
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    35
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    36
	}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    37
}
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    38
if(isset($_POST['change_slave_master']) && is_numeric($_POST["domain"]) && level(5))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    39
{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    40
	change_domain_slave_master($_POST['domain'], $_POST['slave_master']);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    41
}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    42
if(isset($_POST['type_change']) && in_array($_POST['newtype'], $server_types))
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    43
{
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    44
	change_domain_type($_POST['newtype'], $_GET['id']);
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    45
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    46
if(isset($_POST["newowner"]) && is_numeric($_POST["domain"]) && is_numeric($_POST["newowner"]))
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    47
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    48
	add_owner($_POST["domain"], $_POST["newowner"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    49
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    50
if(isset($_POST["del_user"]) && is_numeric($_POST["del_user"]) && level(5))
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    51
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    52
	delete_owner($_GET["id"], $_POST["del_user"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    53
}
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    54
$info = get_domain_info_from_id($_GET["id"]);
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    55
include_once("inc/header.inc.php");
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    56
	
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    57
$domain_type=get_domain_type($_GET['id']);
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    58
if ($domain_type == "SLAVE" ) { $slave_master=get_domain_slave_master($_GET['id']); };
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    59
45
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    60
if (strlen($recordOwnerError)) {
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    61
?>
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    62
  <div class="error"><?php echo _('Error'); ?>: <?php echo _($recordOwnerError); ?></div>
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    63
<?php	
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    64
}
eddff78bf57f [feladat @ 92]
rejo
parents: 41
diff changeset
    65
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    66
if(!isset($info["ownerid"]) && $domain_type != "SLAVE")
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    67
{
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    68
?>
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    69
    <div class="error"><? echo _('Error'); ?>: <? echo ('There is no owner for this zone, please assign someone.'); ?></div>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    70
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    71
}
41
48f2ac49ec24 [feladat @ 88]
rejo
parents: 38
diff changeset
    72
if ($domain_type == "SLAVE" && ! $slave_master )
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    73
{
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    74
?>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    75
    <div class="error"><? echo _('Error'); ?>: <? echo _('Type of this zone is "slave", but there is no IP address for it\'s master given.'); ?></div>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    76
<?
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    77
}
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    78
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    79
    <h2><? echo _('Edit zone'); ?> "<? echo get_domain_name_from_id($_GET["id"]) ?>"</h2>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    80
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    81
if (level(5)) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    82
{ ?>	
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    83
       <div id="meta">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    84
        <div id="meta-left">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    85
	 <table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    86
   	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    87
  	   <th colspan="2"><? echo _('Owner of zone'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    88
  	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    89
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    90
	if(isset($info["ownerid"]))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    91
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    92
		$userRes = get_users_from_domain_id($_GET["id"]);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    93
		foreach($userRes as $user)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    94
		{ ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    95
  	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    96
  	   <form method="post" action="edit.php?id=<? echo $_GET['id']?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    97
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    98
	     <? echo $user["fullname"]?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    99
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   100
            <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   101
  	     <input type="hidden" name="del_user" value="<? echo $user["id"]?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   102
             <input type="submit" class="sbutton" name="co" value="<? echo _('Delete'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   103
  	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   104
           </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   105
  	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   106
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   107
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   108
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   109
	else
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   110
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   111
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   112
	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   113
	   <td><? echo _('No owner set or this zone!'); ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   114
	  </tr>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   115
<?
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   116
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   117
  ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   118
          <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   119
  	   <form method="post" action="edit.php?id=<? echo $_GET['id']?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   120
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   121
  	     <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   122
  	     <select name="newowner">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   123
  			<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   124
  			$users = show_users();
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   125
  			foreach ($users as $u)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   126
  			{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   127
  				unset($add);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   128
  				if ($u["id"] == $info["ownerid"])
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   129
  				{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   130
  					$add = " SELECTED";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   131
  				}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   132
  				?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   133
  				<option<? echo $add ?> value="<? echo $u["id"] ?>"><? echo $u["fullname"] ?></option><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   134
  			}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   135
  			?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   136
  			</select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   137
  	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   138
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   139
     	     <input type="submit" class="sbutton" name="co" value="<? echo _('Add'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   140
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   141
  	   </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   142
  	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   143
         </table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   144
	</div> <? // eo div meta-left ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   145
        <div id="meta-right">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   146
         <table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   147
	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   148
	   <th colspan="2"><? echo _('Type of zone'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   149
	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   150
	  <form action="<? echo $_SERVER['PHP_SELF']?>?id=<? echo $_GET['id']?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   151
	   <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   152
	   <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   153
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   154
	     <select name="newtype">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   155
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   156
	foreach($server_types as $s)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   157
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   158
		unset($add);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   159
		if ($s == $domain_type)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   160
		{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   161
			$add = " SELECTED";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   162
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   163
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   164
              <option<? echo $add ?> value="<? echo $s?>"><? echo $s?></option><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   165
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   166
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   167
             </select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   168
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   169
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   170
	     <input type="submit" class="sbutton" name="type_change" value="<? echo _('Change'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   171
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   172
	   </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   173
	  </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   174
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   175
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   176
	if ($domain_type == "SLAVE" ) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   177
	{ 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   178
		$slave_master=get_domain_slave_master($_GET['id']);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   179
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   180
          <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   181
	   <th colspan="2">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   182
	    <? echo _('IP address of master NS'); ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   183
	   </th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   184
	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   185
	  <form action="<? echo $_SERVER['PHP_SELF']?>?&amp;id=<? echo $_GET['id']?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   186
	   <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   187
	   <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   188
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   189
	     <input type="text" name="slave_master" value="<? echo $slave_master; ?>" class="input">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   190
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   191
            <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   192
	     <input type="submit" class="sbutton" name="change_slave_master" value="<? echo _('Change'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   193
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   194
           </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   195
          </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   196
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   197
	}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   198
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   199
         </table>  
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   200
        </div> <? // eo div meta-right ?>
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   201
       </div> <? // eo div meta 
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   202
}
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   203
else
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   204
{
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   205
?>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   206
       <div id="meta">
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   207
        <div id="meta-right">
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   208
         <table>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   209
 	  <tr>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   210
 	   <th><? echo _('Type of zone'); ?></th><td class="y"><? echo $domain_type; ?></td>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   211
	  </tr>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   212
<?
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   213
	if ($domain_type == "SLAVE" &&  $slave_master )
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   214
	{
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   215
?>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   216
	  <tr>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   217
	   <th><? echo _('IP address of master NS'); ?></th><td class="y"><? echo $slave_master; ?></td>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   218
	  </tr>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   219
<?
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   220
	}
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   221
?>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   222
         </table>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   223
        </div> <? //eo div meta-right ?>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   224
        </div> <? // eo div meta
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   225
}
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   226
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   227
       <div id="meta">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   228
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   229
	if ($_SESSION[$_GET["id"]."_ispartial"] != 1 && $domain_type != "SLAVE" )
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   230
	{
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   231
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   232
        <input type="button" class="button" OnClick="location.href='add_record.php?id=<? echo $_GET["id"] ?>'" value="<? echo _('Add record'); ?>">&nbsp;&nbsp;
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   233
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   234
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   235
	if (level(5))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   236
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   237
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   238
	<input type="button" class="button" OnClick="location.href='delete_domain.php?id=<? echo $_GET["id"] ?>'" value="<? echo _('Delete zone'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   239
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   240
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   241
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   242
        </div> <? // eo div meta ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   243
       <div class="showmax">
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   244
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   245
show_pages($info["numrec"],ROWAMOUNT,$_GET["id"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   246
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   247
        </div> <? // eo div showmax ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   248
         <form action="<? echo $_SERVER["PHP_SELF"]?>?id=<? echo $_GET["id"]?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   249
          <input type="hidden" name="action" value="record-user">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   250
          <table>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   251
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   252
$countinput=0;
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   253
$rec_result = get_records_from_domain_id($_GET["id"],ROWSTART,ROWAMOUNT);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   254
if($rec_result != -1)
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   255
{
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   256
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   257
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   258
	    <th>&nbsp;</th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   259
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   260
	if (level(10) && $domain_type != "SLAVE") 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   261
	{ 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   262
		echo "<th class=\"n\">" . _('Sub-owners') . "</td>"; 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   263
	} 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   264
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   265
	    <th><? echo _('Name'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   266
	    <th><? echo _('Type'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   267
	    <th><? echo _('Content'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   268
	    <th><? echo _('Priority'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   269
	    <th><? echo _('TTL'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   270
           </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   271
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   272
  	$recs = sort_zone($rec_result);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   273
  	foreach($recs as $r)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   274
  	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   275
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   276
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   277
	    <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   278
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   279
		if ($domain_type != "SLAVE" )
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   280
		{	
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   281
			if(level(5) || (!($r["type"] == "SOA" && !$GLOBALS["ALLOW_SOA_EDIT"]) && !($r["type"] == "NS" && !$GLOBALS["ALLOW_NS_EDIT"])))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   282
			{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   283
?>
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   284
			     <a href="edit_record.php?id=<? echo $r['id'] ?>&amp;domain=<? echo $_GET["id"] ?>"><img src="images/edit.gif" alt="[ <? echo _('Edit record'); ?> ]"></a>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   285
			     <a href="delete_record.php?id=<? echo $r['id'] ?>&amp;domain=<? echo $_GET["id"] ?>"><img src="images/delete.gif" ALT="[ <? echo _('Delete record'); ?> ]" BORDER="0"></a>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   286
<?
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   287
			}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   288
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   289
		if(level(10) && $domain_type != "SLAVE") 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   290
		{ 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   291
?>
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   292
		     <input type="checkbox" name="rowid[<? echo $countinput++?>]" value="<? echo $r['id']?>" />
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   293
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   294
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   295
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   296
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   297
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   298
		if (level(10) && $domain_type != "SLAVE") 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   299
		{ 
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   300
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   301
            <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   302
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   303
			$x_result = $db->query("SELECT r.user_id,u.username,u.fullname FROM record_owners as r, users as u WHERE r.record_id='".$r['id']."' AND u.id=r.user_id");
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   304
			echo "<select style=\"width:120px;\">";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   305
			while ($x_r = $x_result->fetchRow()) {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   306
				echo "<option value=\"".$x_r["username"]."\">".$x_r["fullname"]."</option>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   307
			}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   308
			echo "</select>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   309
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   310
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   311
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   312
		} 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   313
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   314
	    <td class="y"><? echo $r['name'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   315
	    <td class="y"><? echo $r['type'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   316
	    <td class="y"><? echo $r['content'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   317
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   318
		if ($r['prio'] != 0) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   319
		{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   320
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   321
            <td class="y"><? echo $r['prio']; ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   322
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   323
		} else {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   324
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   325
            <td class="n"></td><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   326
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   327
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   328
            <td class="y"><? echo $r['ttl'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   329
	   </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   330
<?
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   331
	}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   332
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   333
else
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   334
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   335
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   336
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   337
            <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   338
	     <div class="warning"><? echo _('No records for this zone.'); ?></div>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   339
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   340
           </tr>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   341
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   342
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   343
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   344
          </table>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   345
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   346
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   347
if ($domain_type != "SLAVE")
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   348
{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   349
	if (level(10)) { ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   350
	   <img src="images/arrow.png" alt="arrow" class="edit-assign-to-user">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   351
	   <select name="userid">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   352
		<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   353
		$users = show_users();
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   354
		foreach ($users as $user) {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   355
			echo "<option value=\"".$user[id]."\">".$user[fullname]."</option>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   356
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   357
		?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   358
           </select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   359
	   <input type="submit" class="button" value="<? echo _('Assign to user'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   360
	  </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   361
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   362
	} 
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   363
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   364
include_once("inc/footer.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   365
?>