list_zones.php
author rejo
Mon, 02 Jul 2007 23:01:18 +0000
changeset 36 4ec5ab29f634
parent 34 a2826b0ebcff
child 37 b785e54690ce
permissions -rw-r--r--
[feladat @ 83] Bugfix: the list_zones.php wasn't listing zones correctly if a zone didn't have an owner. Bugfix: the list_supermasters.php never listed more then one supermaster, even if there were more. Both bugs were reported by Jasper van Erven Dorens.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     1
<?php
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     2
require_once("inc/i18n.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     3
require_once("inc/toolkit.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     4
include_once("inc/header.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     5
29
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
     6
$num_all_domains = zone_count(0);
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
     7
$doms = zone_count(0, LETTERSTART);
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     8
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     9
   <h2><? echo _('List zones'); ?></h2>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    10
<?
29
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    11
        echo "<div class=\"showmax\">";
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    12
        show_pages($doms,ROWAMOUNT);
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    13
        echo "</div>";
20
76e20b9d45e6 [feladat @ 67]
rejo
parents: 15
diff changeset
    14
29
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    15
if ($num_all_domains > ROWAMOUNT)
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    16
{
29
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    17
        echo "<div class=\"showmax\">";
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    18
        show_letters(LETTERSTART);
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    19
        echo "</div>";
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    20
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    21
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    22
   <table>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    23
    <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    24
     <th>&nbsp;</th>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    25
     <th><? echo _('Name'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    26
     <th><? echo _('Type'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    27
     <th><? echo _('Records'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    28
     <th><? echo _('Owner'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    29
    </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    30
    <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    31
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    32
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    33
if ($num_all_domains < ROWAMOUNT) {
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    34
   $doms = get_domains(0,"all",ROWSTART,ROWAMOUNT);
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    35
} else {
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    36
   $doms = get_domains(0,LETTERSTART,ROWSTART,ROWAMOUNT);
34
a2826b0ebcff [feladat @ 81]
rejo
parents: 29
diff changeset
    37
   $num_show_domains = ($doms == -1) ? 0 : count($doms);
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    38
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    39
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    40
// If the user doesnt have any domains print a message saying so
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    41
if ($doms < 0)
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    42
{
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    43
	?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    44
    <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    45
     <td>&nbsp;</td>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    46
     <td colspan="4"><? echo _('There are no zones.'); ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    47
    </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    48
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    49
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    50
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    51
// If he has domains, dump them (duh)
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    52
else
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    53
{
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    54
	foreach ($doms as $c)
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    55
	{
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    56
		?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    57
		
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    58
    <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    59
<?
36
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    60
		if (level(5))
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    61
		{
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    62
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    63
     <td>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    64
      <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>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    65
      <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>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    66
     </td>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    67
<?
36
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    68
		}
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    69
		else
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    70
		{
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    71
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    72
     <td class="n">
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    73
      &nbsp;
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    74
     </td>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    75
<?
36
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    76
		}
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    77
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    78
     <td class="y"><? echo $c["name"] ?></td>
26
5d63f1e71d6e [feladat @ 73]
rejo
parents: 20
diff changeset
    79
     <td class="y"><? echo strtolower(get_domain_type($c["id"])) ?></td>
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    80
     <td class="y"><? echo $c["numrec"] ?></td>
36
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    81
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    82
<?
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    83
		$zone_owners = get_owners_from_domainid($c["id"]);
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    84
		if ($zone_owners == "")
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    85
		{
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    86
			echo "<td class=\"n\"></td>";
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    87
		}
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    88
		else
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    89
		{
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    90
			print "<td class=\"y\">".$zone_owners."</td>";
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    91
		}
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    92
		print "<tr>\n";
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    93
	}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    94
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    95
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    96
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    97
   </table>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    98
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    99
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   100
if ($num_all_domains < ROWAMOUNT) {
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   101
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   102
   <p><? printf(_('This lists shows all %s zones(s) you have access to.'), $num_all_domains); ?></p>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   103
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   104
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   105
else
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   106
{
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   107
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   108
   <p><? printf(_('This lists shows %s out of %s zones you have access to.'), $num_show_domains, $num_all_domains); ?></p>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   109
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   110
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   111
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   112
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   113
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   114
<? // RZ TODO Check next, does it work? 
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   115
//  <small> echo _('You only administer some records of domains marked with an (*).'); </small>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   116
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   117
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   118
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   119
include_once("inc/footer.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   120
?>