edit.php
author rejo
Sun, 10 Jun 2007 17:06:30 +0000
changeset 20 76e20b9d45e6
parent 13 2ff220cfde13
child 37 b785e54690ce
permissions -rw-r--r--
[feladat @ 67] Fixed small layout bug in list_zones.php.
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
  ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    97
          <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    98
  	   <form method="post" action="edit.php?id=<? echo $_GET['id']?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
    99
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   100
  	     <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   101
  	     <select name="newowner">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   102
  			<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   103
  			$users = show_users();
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   104
  			foreach ($users as $u)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   105
  			{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   106
  				unset($add);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   107
  				if ($u["id"] == $info["ownerid"])
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   108
  				{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   109
  					$add = " SELECTED";
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
  				<option<? echo $add ?> value="<? echo $u["id"] ?>"><? echo $u["fullname"] ?></option><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   113
  			}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   114
  			?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   115
  			</select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   116
  	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   117
  	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   118
     	     <input type="submit" class="sbutton" name="co" value="<? echo _('Add'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   119
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   120
  	   </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   121
  	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   122
         </table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   123
	</div> <? // eo div meta-left ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   124
 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   125
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   126
if (level(5))
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   127
{
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   128
	$domain_type=get_domain_type($_GET['id']);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   129
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   130
        <div id="meta-right">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   131
         <table>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   132
	  <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   133
	   <th colspan="2"><? echo _('Type of zone'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   134
	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   135
	  <form action="<? echo $_SERVER['PHP_SELF']?>?id=<? echo $_GET['id']?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   136
	   <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   137
	   <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   138
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   139
	     <select name="newtype">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   140
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   141
	foreach($server_types as $s)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   142
	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   143
		unset($add);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   144
		if ($s == $domain_type)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   145
		{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   146
			$add = " SELECTED";
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
              <option<? echo $add ?> value="<? echo $s?>"><? echo $s?></option><?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   150
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   151
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   152
             </select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   153
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   154
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   155
	     <input type="submit" class="sbutton" name="type_change" value="<? echo _('Change'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   156
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   157
	   </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   158
	  </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   159
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   160
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   161
	if ($domain_type == "SLAVE" ) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   162
	{ 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   163
		$slave_master=get_domain_slave_master($_GET['id']);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   164
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   165
          <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   166
	   <th colspan="2">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   167
	    <? echo _('IP address of master NS'); ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   168
	   </th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   169
	  </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   170
	  <form action="<? echo $_SERVER['PHP_SELF']?>?&amp;id=<? echo $_GET['id']?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   171
	   <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   172
	   <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   173
	    <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   174
	     <input type="text" name="slave_master" value="<? echo $slave_master; ?>" class="input">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   175
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   176
            <td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   177
	     <input type="submit" class="sbutton" name="change_slave_master" value="<? echo _('Change'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   178
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   179
           </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   180
          </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   181
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   182
	}
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   183
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   184
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   185
         </table>  
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   186
        </div> <? // eo div meta-right ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   187
       </div> <? // eo div meta ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   188
       <div id="meta">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   189
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   190
	if ($_SESSION[$_GET["id"]."_ispartial"] != 1 && $domain_type != "SLAVE" )
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   191
	{
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   192
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   193
        <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
   194
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   195
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   196
	if (level(5))
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
	<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
   200
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   201
	}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   202
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   203
        </div> <? // eo div meta ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   204
       <div class="showmax">
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   205
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   206
show_pages($info["numrec"],ROWAMOUNT,$_GET["id"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   207
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   208
        </div> <? // eo div showmax ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   209
         <form action="<? echo $_SERVER["PHP_SELF"]?>?id=<? echo $_GET["id"]?>" method="post">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   210
          <input type="hidden" name="action" value="record-user">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   211
          <table>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   212
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   213
$countinput=0;
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   214
$rec_result = get_records_from_domain_id($_GET["id"],ROWSTART,ROWAMOUNT);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   215
if($rec_result != -1)
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   216
{
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   217
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   218
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   219
	    <th>&nbsp;</th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   220
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   221
	if (level(10) && $domain_type != "SLAVE") 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   222
	{ 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   223
		echo "<th class=\"n\">" . _('Sub-owners') . "</td>"; 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   224
	} 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   225
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   226
	    <th><? echo _('Name'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   227
	    <th><? echo _('Type'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   228
	    <th><? echo _('Content'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   229
	    <th><? echo _('Priority'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   230
	    <th><? echo _('TTL'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   231
           </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   232
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   233
  	$recs = sort_zone($rec_result);
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   234
  	foreach($recs as $r)
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   235
  	{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   236
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   237
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   238
	    <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   239
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   240
		if ($domain_type != "SLAVE" )
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   241
		{	
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   242
			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
   243
			{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   244
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   245
             <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
   246
             <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
   247
<?
13
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
		if(level(10) && $domain_type != "SLAVE") 
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
	     <input type="checkbox" name="rowid[<? echo $countinput++?>]" value="<? echo $r['id']?>" />
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   254
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   255
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   256
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   257
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   258
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   259
		if (level(10) && $domain_type != "SLAVE") 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   260
		{ 
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   261
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   262
            <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   263
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   264
			$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
   265
			echo "<select style=\"width:120px;\">";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   266
			while ($x_r = $x_result->fetchRow()) {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   267
				echo "<option value=\"".$x_r["username"]."\">".$x_r["fullname"]."</option>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   268
			}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   269
			echo "</select>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   270
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   271
            </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   272
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   273
		} 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   274
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   275
	    <td class="y"><? echo $r['name'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   276
	    <td class="y"><? echo $r['type'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   277
	    <td class="y"><? echo $r['content'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   278
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   279
		if ($r['prio'] != 0) 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   280
		{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   281
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   282
            <td class="y"><? echo $r['prio']; ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   283
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   284
		} else {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   285
?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   286
            <td class="n"></td><?
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
            <td class="y"><? echo $r['ttl'] ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   290
	   </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   291
<?
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   292
	}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   293
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   294
else
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   295
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   296
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   297
           <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   298
            <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   299
	     <div class="warning"><? echo _('No records for this zone.'); ?></div>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   300
	    </td>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   301
           </tr>
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
?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   305
          </table>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   306
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   307
<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   308
if ($domain_type != "SLAVE")
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   309
{
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   310
	if (level(10)) { ?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   311
	   <img src="images/arrow.png" alt="arrow" class="edit-assign-to-user">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   312
	   <select name="userid">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   313
		<?
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   314
		$users = show_users();
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   315
		foreach ($users as $user) {
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   316
			echo "<option value=\"".$user[id]."\">".$user[fullname]."</option>";
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   317
		}
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   318
		?>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   319
           </select>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   320
	   <input type="submit" class="button" value="<? echo _('Assign to user'); ?>">
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   321
	  </form>
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   322
<? 
2ff220cfde13 [feladat @ 60]
rejo
parents: 5
diff changeset
   323
	} 
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   324
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   325
include_once("inc/footer.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
   326
?>