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