edit.php
author rejo
Mon, 23 Jul 2007 22:05:19 +0000
changeset 38 cf767482333a
parent 37 b785e54690ce
child 41 48f2ac49ec24
permissions -rw-r--r--
[feladat @ 85] The type of zone wasn't show to users with access level 1. If a user with access level 1 did have access to a slave zone the user did not see the IP of the master nameserver of that zone. Now the user will the IP address (readonly and only if one is set). Bugfix. If no master IP for a slave zone is given, a warning is shown regardless of the userlevel. Bugfix. Both the "add record" and "edit record" buttons in the "edit zone" screen is no longer available for users with level 1 for domains of type "slave". Bug report by Antonio Prado. Some PHP and HTML cleanup (removing of empty tags and unnecessary repeatings of calls to a single function).
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");
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    33
	
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    34
$domain_type=get_domain_type($_GET['id']);
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    35
if ($domain_type == "SLAVE" ) { $slave_master=get_domain_slave_master($_GET['id']); };
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    36
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    37
if(!isset($info["ownerid"]) && $domain_type != "SLAVE")
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    38
{
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    39
?>
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    40
    <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
    41
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    42
}
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    43
if ($domain_type == "SLAVE" && $slave_master )
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    44
{
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    45
?>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    46
    <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
    47
<?
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
    48
}
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    49
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    50
    <h2><? echo _('Edit zone'); ?> "<? echo get_domain_name_from_id($_GET["id"]) ?>"</h2>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    51
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    52
if (level(5)) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    53
{ ?>	
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    54
       <div id="meta">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    55
        <div id="meta-left">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    56
	 <table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    57
   	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    58
  	   <th colspan="2"><? echo _('Owner of zone'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    59
  	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    60
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    61
	if(isset($info["ownerid"]))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    62
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    63
		$userRes = get_users_from_domain_id($_GET["id"]);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    64
		foreach($userRes as $user)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    65
		{ ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    66
  	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    67
  	   <form method="post" action="edit.php?id=<? echo $_GET['id']?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    68
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    69
	     <? echo $user["fullname"]?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    70
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    71
            <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    72
  	     <input type="hidden" name="del_user" value="<? echo $user["id"]?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    73
             <input type="submit" class="sbutton" name="co" value="<? echo _('Delete'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    74
  	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    75
           </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    76
  	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    77
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    78
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    79
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    80
	else
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    81
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    82
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    83
	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    84
	   <td><? echo _('No owner set or this zone!'); ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    85
	  </tr>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    86
<?
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    87
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    88
  ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    89
          <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    90
  	   <form method="post" action="edit.php?id=<? echo $_GET['id']?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    91
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    92
  	     <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    93
  	     <select name="newowner">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    94
  			<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    95
  			$users = show_users();
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    96
  			foreach ($users as $u)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    97
  			{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    98
  				unset($add);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    99
  				if ($u["id"] == $info["ownerid"])
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   100
  				{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   101
  					$add = " SELECTED";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   102
  				}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   103
  				?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   104
  				<option<? echo $add ?> value="<? echo $u["id"] ?>"><? echo $u["fullname"] ?></option><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   105
  			}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   106
  			?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   107
  			</select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   108
  	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   109
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   110
     	     <input type="submit" class="sbutton" name="co" value="<? echo _('Add'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   111
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   112
  	   </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   113
  	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   114
         </table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   115
	</div> <? // eo div meta-left ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   116
        <div id="meta-right">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   117
         <table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   118
	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   119
	   <th colspan="2"><? echo _('Type of zone'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   120
	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   121
	  <form action="<? echo $_SERVER['PHP_SELF']?>?id=<? echo $_GET['id']?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   122
	   <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   123
	   <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   124
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   125
	     <select name="newtype">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   126
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   127
	foreach($server_types as $s)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   128
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   129
		unset($add);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   130
		if ($s == $domain_type)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   131
		{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   132
			$add = " SELECTED";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   133
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   134
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   135
              <option<? echo $add ?> value="<? echo $s?>"><? echo $s?></option><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   136
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   137
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   138
             </select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   139
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   140
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   141
	     <input type="submit" class="sbutton" name="type_change" value="<? echo _('Change'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   142
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   143
	   </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   144
	  </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   145
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   146
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   147
	if ($domain_type == "SLAVE" ) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   148
	{ 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   149
		$slave_master=get_domain_slave_master($_GET['id']);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   150
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   151
          <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   152
	   <th colspan="2">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   153
	    <? echo _('IP address of master NS'); ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   154
	   </th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   155
	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   156
	  <form action="<? echo $_SERVER['PHP_SELF']?>?&amp;id=<? echo $_GET['id']?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   157
	   <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   158
	   <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   159
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   160
	     <input type="text" name="slave_master" value="<? echo $slave_master; ?>" class="input">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   161
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   162
            <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   163
	     <input type="submit" class="sbutton" name="change_slave_master" value="<? echo _('Change'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   164
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   165
           </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   166
          </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   167
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   168
	}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   169
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   170
         </table>  
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   171
        </div> <? // eo div meta-right ?>
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   172
       </div> <? // eo div meta 
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   173
}
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   174
else
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   175
{
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   176
?>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   177
       <div id="meta">
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   178
        <div id="meta-right">
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   179
         <table>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   180
 	  <tr>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   181
 	   <th><? echo _('Type of zone'); ?></th><td class="y"><? echo $domain_type; ?></td>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   182
	  </tr>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   183
<?
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   184
	if ($domain_type == "SLAVE" &&  $slave_master )
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   185
	{
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   186
?>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   187
	  <tr>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   188
	   <th><? echo _('IP address of master NS'); ?></th><td class="y"><? echo $slave_master; ?></td>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   189
	  </tr>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   190
<?
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   191
	}
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   192
?>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   193
         </table>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   194
        </div> <? //eo div meta-right ?>
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   195
        </div> <? // eo div meta
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   196
}
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   197
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   198
       <div id="meta">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   199
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   200
	if ($_SESSION[$_GET["id"]."_ispartial"] != 1 && $domain_type != "SLAVE" )
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   201
	{
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   202
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   203
        <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
   204
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   205
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   206
	if (level(5))
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   207
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   208
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   209
	<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
   210
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   211
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   212
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   213
        </div> <? // eo div meta ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   214
       <div class="showmax">
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   215
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   216
show_pages($info["numrec"],ROWAMOUNT,$_GET["id"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   217
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   218
        </div> <? // eo div showmax ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   219
         <form action="<? echo $_SERVER["PHP_SELF"]?>?id=<? echo $_GET["id"]?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   220
          <input type="hidden" name="action" value="record-user">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   221
          <table>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   222
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   223
$countinput=0;
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   224
$rec_result = get_records_from_domain_id($_GET["id"],ROWSTART,ROWAMOUNT);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   225
if($rec_result != -1)
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   226
{
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   227
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   228
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   229
	    <th>&nbsp;</th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   230
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   231
	if (level(10) && $domain_type != "SLAVE") 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   232
	{ 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   233
		echo "<th class=\"n\">" . _('Sub-owners') . "</td>"; 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   234
	} 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   235
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   236
	    <th><? echo _('Name'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   237
	    <th><? echo _('Type'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   238
	    <th><? echo _('Content'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   239
	    <th><? echo _('Priority'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   240
	    <th><? echo _('TTL'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   241
           </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   242
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   243
  	$recs = sort_zone($rec_result);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   244
  	foreach($recs as $r)
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
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   248
	    <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   249
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   250
		if ($domain_type != "SLAVE" )
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   251
		{	
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   252
			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
   253
			{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   254
?>
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   255
			     <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
   256
			     <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
   257
<?
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   258
			}
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
?>
38
cf767482333a [feladat @ 85]
rejo
parents: 37
diff changeset
   263
		     <input type="checkbox" name="rowid[<? echo $countinput++?>]" value="<? echo $r['id']?>" />
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   264
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   265
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   266
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   267
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   268
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   269
		if (level(10) && $domain_type != "SLAVE") 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   270
		{ 
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   271
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   272
            <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   273
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   274
			$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
   275
			echo "<select style=\"width:120px;\">";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   276
			while ($x_r = $x_result->fetchRow()) {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   277
				echo "<option value=\"".$x_r["username"]."\">".$x_r["fullname"]."</option>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   278
			}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   279
			echo "</select>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   280
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   281
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   282
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   283
		} 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   284
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   285
	    <td class="y"><? echo $r['name'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   286
	    <td class="y"><? echo $r['type'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   287
	    <td class="y"><? echo $r['content'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   288
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   289
		if ($r['prio'] != 0) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   290
		{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   291
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   292
            <td class="y"><? echo $r['prio']; ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   293
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   294
		} else {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   295
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   296
            <td class="n"></td><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   297
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   298
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   299
            <td class="y"><? echo $r['ttl'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   300
	   </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   301
<?
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   302
	}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   303
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   304
else
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   305
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   306
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   307
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   308
            <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   309
	     <div class="warning"><? echo _('No records for this zone.'); ?></div>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   310
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   311
           </tr>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   312
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   313
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   314
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   315
          </table>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   316
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   317
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   318
if ($domain_type != "SLAVE")
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   319
{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   320
	if (level(10)) { ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   321
	   <img src="images/arrow.png" alt="arrow" class="edit-assign-to-user">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   322
	   <select name="userid">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   323
		<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   324
		$users = show_users();
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   325
		foreach ($users as $user) {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   326
			echo "<option value=\"".$user[id]."\">".$user[fullname]."</option>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   327
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   328
		?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   329
           </select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   330
	   <input type="submit" class="button" value="<? echo _('Assign to user'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   331
	  </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   332
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   333
	} 
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   334
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   335
include_once("inc/footer.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   336
?>