[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/i18n.inc.php");
require_once("inc/toolkit.inc.php");
include_once("inc/header.inc.php");
$num_all_domains = zone_count(0);
$doms = zone_count(0, LETTERSTART);
?>
<h2><? echo _('List zones'); ?></h2>
<?
echo "<div class=\"showmax\">";
show_pages($doms,ROWAMOUNT);
echo "</div>";
if ($num_all_domains > ROWAMOUNT)
{
echo "<div class=\"showmax\">";
show_letters(LETTERSTART);
echo "</div>";
}
?>
<table>
<tr>
<th> </th>
<th><? echo _('Name'); ?></th>
<th><? echo _('Type'); ?></th>
<th><? echo _('Records'); ?></th>
<th><? echo _('Owner'); ?></th>
</tr>
<tr>
<?
if ($num_all_domains < ROWAMOUNT) {
$doms = get_domains(0,"all",ROWSTART,ROWAMOUNT);
} else {
$doms = get_domains(0,LETTERSTART,ROWSTART,ROWAMOUNT);
$num_show_domains = ($doms == -1) ? 0 : count($doms);
}
// If the user doesnt have any domains print a message saying so
if ($doms < 0)
{
?>
<tr>
<td> </td>
<td colspan="4"><? echo _('There are no zones.'); ?></td>
</tr>
<?
}
// If he has domains, dump them (duh)
else
{
foreach ($doms as $c)
{
?>
<tr>
<td>
<a href="edit.php?id=<? echo $c["id"] ?>"><img src="images/edit.gif" title="<? echo _('Edit zone') . " " . $c['name']; ?>" alt="[ <? echo _('Edit zone') . " " . $c['name']; ?> ]"></a>
<?
if (level(5))
{
?>
<a href="delete_domain.php?id=<? echo $c["id"] ?>"><img src="images/delete.gif" title="<? print _('Delete zone') . " " . $c['name']; ?>" alt="[<? echo _('Delete zone') . " " . $c['name']; ?>]"></a>
<?
}
?>
</td>
<td class="y"><? echo $c["name"] ?></td>
<td class="y"><? echo strtolower(get_domain_type($c["id"])) ?></td>
<td class="y"><? echo $c["numrec"] ?></td>
<?
$zone_owners = get_owners_from_domainid($c["id"]);
if ($zone_owners == "")
{
echo "<td class=\"n\"></td>";
}
else
{
print "<td class=\"y\">".$zone_owners."</td>";
}
print "<tr>\n";
}
}
?>
</table>
<?
if ($num_all_domains < ROWAMOUNT) {
?>
<p><? printf(_('This lists shows all %s zones(s) you have access to.'), $num_all_domains); ?></p>
<?
}
else
{
?>
<p><? printf(_('This lists shows %s out of %s zones you have access to.'), $num_show_domains, $num_all_domains); ?></p>
<?
}
?>
<? // RZ TODO Check next, does it work?
// <small> echo _('You only administer some records of domains marked with an (*).'); </small>
?>
<?
include_once("inc/footer.inc.php");
?>