edit.php
author rejo
Tue, 10 Jul 2007 21:24:06 +0000
changeset 37 b785e54690ce
parent 13 2ff220cfde13
child 38 cf767482333a
permissions -rw-r--r--
[feladat @ 84] Bugfix. The function zone_count() now also counts zones an owner has only partial access to, not just those zones the owner has full access to. This fixes just the count, the zones a user has partial access to are not (yet!) shown in the "list zones" page. Bugfix. In the zone listing the "edit" button is now show for users with access level 1. Untill now they were presented an overview of the zones they could change, but there was no link for them to actually edit the zone. Bugfix. Some of the buttons in the "edit zone" interface that are of no use to a user with access level 1 have been hidden. Bugfix. Make sure a user with access level 1 with only partial access to a zone cannot add new records to that zone. Only the zone owner should be able to add new record. Bugfix. If a user with access level 1 edits a record in a zone he has only partial access to, an error was shown because of call to a non- existing function in the PEAR:MDB2. This bug was most likely introduced while migrating from PEAR:DB to PEAR:MDB2. Bugfix. A user with access level 1 was able to delete all records of a zone he has only partial access to. Some additional checks have been added. Bugfix. If a user with accees level 1 has partial access to one or more zones starting with a certain character, but did not own at least one entire zone starting with the same character, the character wasn't clickable in the "list zone" page. Interface. If no record or zone id is given for delete_record.php or delete_domain.php, don't just die but echo a nice message. The i18n files have not yet been updated to reflect this change. Interface. If no master IP is given in delete_supermaster.php, don't just die but echo a nice message. The i18n files have not yet been updated to reflect this change. [All fixes by Peter Beernink.]
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
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     3
require_once("inc/toolkit.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     4
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     5
// Assigning records to user: Check for records owned by user
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     6
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     7
if (isset($_POST["action"]) && $_POST["action"]=="record-user") {
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
     8
	foreach ($_POST["rowid"] as $x_user => $x_value){
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
     9
		$x_userid = $db->queryOne("SELECT id FROM record_owners WHERE user_id = '".$_POST["userid"]."' AND record_id='".$x_value."'");
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    10
		if (empty($x_userid)) {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    11
			$db->query("INSERT INTO record_owners SET user_id = '".$_POST["userid"]."',record_id='".$x_value."'");
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    12
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    13
	}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    14
}
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    15
if(isset($_POST['change_slave_master']) && is_numeric($_POST["domain"]) && level(5))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    16
{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    17
	change_domain_slave_master($_POST['domain'], $_POST['slave_master']);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    18
}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    19
if(isset($_POST['type_change']) && in_array($_POST['newtype'], $server_types))
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    20
{
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    21
	change_domain_type($_POST['newtype'], $_GET['id']);
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    22
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    23
if(isset($_POST["newowner"]) && is_numeric($_POST["domain"]) && is_numeric($_POST["newowner"]))
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    24
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    25
	add_owner($_POST["domain"], $_POST["newowner"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    26
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    27
if(isset($_POST["del_user"]) && is_numeric($_POST["del_user"]) && level(5))
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    28
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    29
	delete_owner($_GET["id"], $_POST["del_user"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    30
}
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    31
$info = get_domain_info_from_id($_GET["id"]);
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    32
include_once("inc/header.inc.php");
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    33
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    34
if (level(5))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    35
{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    36
	if(!isset($info["ownerid"]))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    37
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    38
	?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    39
	    <div class="error"><? echo _('Error'); ?>: <? echo ('There is no owner for this zone, please assign someone.'); ?></div>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    40
	<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    41
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    42
	$domain_type=get_domain_type($_GET['id']);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    43
	if ($domain_type == "SLAVE" )
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    44
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    45
		$slave_master=get_domain_slave_master($_GET['id']);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    46
		if ($slave_master == "" )
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    47
		{
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    48
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    49
            <div class="error"><? echo _('Type of this zone is "slave", but there is no IP address for it\'s master given.'); ?></div>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    50
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    51
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    52
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    53
}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    54
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    55
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    56
    <h2><? echo _('Edit zone'); ?> "<? echo get_domain_name_from_id($_GET["id"]) ?>"</h2>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    57
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    58
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    59
if (level(5)) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    60
{ ?>	
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    61
       <div id="meta">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    62
        <div id="meta-left">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    63
	 <table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    64
   	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    65
  	   <th colspan="2"><? echo _('Owner of zone'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    66
  	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    67
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    68
	if(isset($info["ownerid"]))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    69
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    70
		$userRes = get_users_from_domain_id($_GET["id"]);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    71
		foreach($userRes as $user)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    72
		{ ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    73
  	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    74
  	   <form method="post" action="edit.php?id=<? echo $_GET['id']?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    75
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    76
	     <? echo $user["fullname"]?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    77
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    78
            <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    79
  	     <input type="hidden" name="del_user" value="<? echo $user["id"]?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    80
             <input type="submit" class="sbutton" name="co" value="<? echo _('Delete'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    81
  	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    82
           </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    83
  	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    84
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    85
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    86
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    87
	else
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    88
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    89
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    90
	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    91
	   <td><? echo _('No owner set or this zone!'); ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    92
	  </tr>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    93
<?
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    94
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    95
  ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    96
          <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    97
  	   <form method="post" action="edit.php?id=<? echo $_GET['id']?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    98
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    99
  	     <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   100
  	     <select name="newowner">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   101
  			<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   102
  			$users = show_users();
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   103
  			foreach ($users as $u)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   104
  			{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   105
  				unset($add);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   106
  				if ($u["id"] == $info["ownerid"])
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   107
  				{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   108
  					$add = " SELECTED";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   109
  				}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   110
  				?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   111
  				<option<? echo $add ?> value="<? echo $u["id"] ?>"><? echo $u["fullname"] ?></option><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   112
  			}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   113
  			?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   114
  			</select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   115
  	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   116
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   117
     	     <input type="submit" class="sbutton" name="co" value="<? echo _('Add'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   118
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   119
  	   </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   120
  	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   121
         </table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   122
	</div> <? // eo div meta-left ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   123
 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   124
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   125
	$domain_type=get_domain_type($_GET['id']);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   126
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   127
        <div id="meta-right">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   128
         <table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   129
	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   130
	   <th colspan="2"><? echo _('Type of zone'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   131
	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   132
	  <form action="<? echo $_SERVER['PHP_SELF']?>?id=<? echo $_GET['id']?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   133
	   <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   134
	   <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   135
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   136
	     <select name="newtype">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   137
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   138
	foreach($server_types as $s)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   139
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   140
		unset($add);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   141
		if ($s == $domain_type)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   142
		{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   143
			$add = " SELECTED";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   144
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   145
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   146
              <option<? echo $add ?> value="<? echo $s?>"><? echo $s?></option><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   147
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   148
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   149
             </select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   150
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   151
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   152
	     <input type="submit" class="sbutton" name="type_change" value="<? echo _('Change'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   153
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   154
	   </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   155
	  </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   156
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   157
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   158
	if ($domain_type == "SLAVE" ) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   159
	{ 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   160
		$slave_master=get_domain_slave_master($_GET['id']);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   161
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   162
          <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   163
	   <th colspan="2">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   164
	    <? echo _('IP address of master NS'); ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   165
	   </th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   166
	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   167
	  <form action="<? echo $_SERVER['PHP_SELF']?>?&amp;id=<? echo $_GET['id']?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   168
	   <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   169
	   <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   170
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   171
	     <input type="text" name="slave_master" value="<? echo $slave_master; ?>" class="input">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   172
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   173
            <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   174
	     <input type="submit" class="sbutton" name="change_slave_master" value="<? echo _('Change'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   175
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   176
           </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   177
          </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   178
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   179
	}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   180
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   181
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   182
         </table>  
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   183
        </div> <? // eo div meta-right ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   184
       </div> <? // eo div meta ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   185
       <div id="meta">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   186
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   187
	if ($_SESSION[$_GET["id"]."_ispartial"] != 1 && $domain_type != "SLAVE" )
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   188
	{
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   189
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   190
        <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
   191
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   192
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   193
	if (level(5))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   194
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   195
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   196
	<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
   197
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   198
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   199
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   200
        </div> <? // eo div meta ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   201
       <div class="showmax">
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   202
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   203
show_pages($info["numrec"],ROWAMOUNT,$_GET["id"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   204
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   205
        </div> <? // eo div showmax ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   206
         <form action="<? echo $_SERVER["PHP_SELF"]?>?id=<? echo $_GET["id"]?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   207
          <input type="hidden" name="action" value="record-user">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   208
          <table>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   209
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   210
$countinput=0;
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   211
$rec_result = get_records_from_domain_id($_GET["id"],ROWSTART,ROWAMOUNT);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   212
if($rec_result != -1)
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   213
{
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   214
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   215
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   216
	    <th>&nbsp;</th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   217
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   218
	if (level(10) && $domain_type != "SLAVE") 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   219
	{ 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   220
		echo "<th class=\"n\">" . _('Sub-owners') . "</td>"; 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   221
	} 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   222
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   223
	    <th><? echo _('Name'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   224
	    <th><? echo _('Type'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   225
	    <th><? echo _('Content'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   226
	    <th><? echo _('Priority'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   227
	    <th><? echo _('TTL'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   228
           </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   229
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   230
  	$recs = sort_zone($rec_result);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   231
  	foreach($recs as $r)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   232
  	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   233
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   234
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   235
	    <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   236
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   237
		if ($domain_type != "SLAVE" )
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   238
		{	
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   239
			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
   240
			{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   241
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   242
             <a href="edit_record.php?id=<? echo $r['id'] ?>&amp;domain=<? echo $_GET["id"] ?>"><img src="images/edit.gif" alt="[ <? echo _('Edit record'); ?> ]"></a>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   243
             <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
   244
<?
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   245
			}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   246
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   247
		if(level(10) && $domain_type != "SLAVE") 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   248
		{ 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   249
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   250
	     <input type="checkbox" name="rowid[<? echo $countinput++?>]" value="<? echo $r['id']?>" />
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   251
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   252
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   253
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   254
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   255
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   256
		if (level(10) && $domain_type != "SLAVE") 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   257
		{ 
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   258
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   259
            <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   260
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   261
			$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
   262
			echo "<select style=\"width:120px;\">";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   263
			while ($x_r = $x_result->fetchRow()) {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   264
				echo "<option value=\"".$x_r["username"]."\">".$x_r["fullname"]."</option>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   265
			}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   266
			echo "</select>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   267
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   268
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   269
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   270
		} 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   271
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   272
	    <td class="y"><? echo $r['name'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   273
	    <td class="y"><? echo $r['type'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   274
	    <td class="y"><? echo $r['content'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   275
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   276
		if ($r['prio'] != 0) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   277
		{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   278
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   279
            <td class="y"><? echo $r['prio']; ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   280
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   281
		} else {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   282
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   283
            <td class="n"></td><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   284
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   285
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   286
            <td class="y"><? echo $r['ttl'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   287
	   </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   288
<?
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   289
	}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   290
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   291
else
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   292
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   293
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   294
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   295
            <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   296
	     <div class="warning"><? echo _('No records for this zone.'); ?></div>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   297
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   298
           </tr>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   299
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   300
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   301
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   302
          </table>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   303
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   304
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   305
if ($domain_type != "SLAVE")
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   306
{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   307
	if (level(10)) { ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   308
	   <img src="images/arrow.png" alt="arrow" class="edit-assign-to-user">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   309
	   <select name="userid">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   310
		<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   311
		$users = show_users();
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   312
		foreach ($users as $user) {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   313
			echo "<option value=\"".$user[id]."\">".$user[fullname]."</option>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   314
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   315
		?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   316
           </select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   317
	   <input type="submit" class="button" value="<? echo _('Assign to user'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   318
	  </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   319
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   320
	} 
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   321
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   322
include_once("inc/footer.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   323
?>