[feladat @ 84]
Bugfix. The function zone_count() now also counts zones an owner has
only partial access to, not just those zones the owner has full access
to. This fixes just the count, the zones a user has partial access to
are not (yet!) shown in the "list zones" page.
Bugfix. In the zone listing the "edit" button is now show for users
with access level 1. Untill now they were presented an overview of the
zones they could change, but there was no link for them to actually
edit the zone.
Bugfix. Some of the buttons in the "edit zone" interface that are of
no use to a user with access level 1 have been hidden.
Bugfix. Make sure a user with access level 1 with only partial access
to a zone cannot add new records to that zone. Only the zone owner
should be able to add new record.
Bugfix. If a user with access level 1 edits a record in a zone he has
only partial access to, an error was shown because of call to a non-
existing function in the PEAR:MDB2. This bug was most likely
introduced while migrating from PEAR:DB to PEAR:MDB2.
Bugfix. A user with access level 1 was able to delete all records of a
zone he has only partial access to. Some additional checks have been
added.
Bugfix. If a user with accees level 1 has partial access to one or
more zones starting with a certain character, but did not own at least
one entire zone starting with the same character, the character wasn't
clickable in the "list zone" page.
Interface. If no record or zone id is given for delete_record.php or
delete_domain.php, don't just die but echo a nice message. The i18n
files have not yet been updated to reflect this change.
Interface. If no master IP is given in delete_supermaster.php, don't
just die but echo a nice message. The i18n files have not yet been
updated to reflect this change.
[All fixes by Peter Beernink.]
<?php
require_once("inc/toolkit.inc.php");
$xsid = (isset($_GET['id'])) ? $_GET['id'] : $_POST['zoneid'];
if ((!level(5)) && ((!xs($xsid) || ($_SESSION[$xsid.'_ispartial'])))) {
error(ERR_RECORD_ACCESS_DENIED);
}
if ($_POST["commit"]) {
$ret = add_record($_POST["zoneid"], $_POST["name"], $_POST["type"], $_POST["content"], $_POST["ttl"], $_POST["prio"]);
if ($ret != '1') {
die("$ret");
}
clean_page("edit.php?id=".$_POST["zoneid"]);
}
include_once("inc/header.inc.php");
?>
<h2><? echo _('Add record to zone'); ?> "<? echo get_domain_name_from_id($_GET["id"]) ?>"</H2>
<form method="post">
<input type="hidden" name="zoneid" value="<? echo $_GET["id"] ?>">
<table border="0" cellspacing="4">
<tr>
<td class="n"><? echo _('Name'); ?></td>
<td class="n"> </td>
<td class="n"><? echo _('Type'); ?></td>
<td class="n"><? echo _('Priority'); ?></td>
<td class="n"><? echo _('Content'); ?></td>
<td class="n"><? echo _('TTL'); ?></td>
</tr>
<tr>
<td class="n"><input type="text" name="name" class="input">.<? echo get_domain_name_from_id($_GET["id"]) ?></td>
<td class="n">IN</td>
<td class="n">
<select name="type">
<?
$dname = get_domain_name_from_id($_GET["id"]);
foreach (get_record_types() as $c) {
if (eregi('in-addr.arpa', $dname) && strtoupper($c) == 'PTR') {
$add = " SELECTED";
} elseif (strtoupper($c) == 'A') {
$add = " SELECTED";
} else {
unset($add);
}
?><option<? echo $add ?> value="<? echo $c ?>"><? echo $c ?></option><?
}
?>
</select>
</td>
<td class="n"><input type="text" name="prio" class="sinput"></td>
<td class="n"><input type="text" name="content" class="input"></td>
<td class="n"><input type="text" name="ttl" class="sinput" value="<? echo $DEFAULT_TTL?>"></td>
</tr>
</table>
<br>
<input type="submit" name="commit" value="<? echo _('Add record'); ?>" class="button">
</form>
<? include_once("inc/footer.inc.php"); ?>