[feladat @ 73]
authorrejo
Mon, 25 Jun 2007 21:32:29 +0000
changeset 26 5d63f1e71d6e
parent 25 576034a80ea8
child 27 782f142d096d
[feladat @ 73] All owners (not sub-owners though) of the zone are now shown when listing a zone. Added a new function to retrieve owners of zone by id without fetching all other zone details, which should improve perfomance. Both fixes by Peter Beernink.
credits.php
inc/footer.inc.php
inc/users.inc.php
list_zones.php
--- a/credits.php	Mon Jun 25 20:57:22 2007 +0000
+++ b/credits.php	Mon Jun 25 21:32:29 2007 +0000
@@ -6,7 +6,7 @@
 
     <p><a href="https://rejo.zenger.nl/poweradmin/">This version</a> is an adaption of the original <a href="http://www.poweradmin.org">Poweradmin</a>, version 1.2.7-patched. Poweradmin was written by <a href="http://sjeemz.nl/">Sjeemz</a> and <a href="http://www.trancer.nl/">Trancer</a>. The Poweradmin code includes patches by <a href="http://mostrey.be/">Wim Mostrey</a> and Dennis Roos. <a href="https://rejo.zenger.nl/poweradmin/">This version</a> has been patched by <a href="http://rejo.zenger.nl">Rejo Zenger</a> and includes many additional features like multi-language support, an update of the database abstraction layer, support for slave zones, support for supermasters, basic support for skins and a number of bug fixes.</p>
 
-    <p>Thanks to Koert Buijzer (ideas on sql performance improvements) and Balazs Petrikovics (for bugreports and patches).</p>
+    <p>Thanks to Koert Buijzer, Peter Beernink and Balazs Petrikovics for bug reports, patches and good ideas.</p>
 
 <?
 include_once("inc/footer.inc.php");
--- a/inc/footer.inc.php	Mon Jun 25 20:57:22 2007 +0000
+++ b/inc/footer.inc.php	Mon Jun 25 21:32:29 2007 +0000
@@ -5,7 +5,7 @@
 	 $db->disconnect();
 }
 
- $svn_rev = '$LastChangedRevision: 71 $ $Date: 2006-07-22 21:42:37 -0700 (Sat, 22 Jul 2006) $ $Author: rejo $';
+ $svn_rev = '$LastChangedRevision: 73 $ $LastChangedDate: 2007-06-25 23:32:29 +0200 (Mon, 25 Jun 2007) $ $Author: rejo $';
  $svn_rev = preg_split("/[\s,]+/", $svn_rev);
  $revision = "revision $svn_rev[1] (commited at $svn_rev[4] by $svn_rev[13])";
 
--- a/inc/users.inc.php	Mon Jun 25 20:57:22 2007 +0000
+++ b/inc/users.inc.php	Mon Jun 25 21:32:29 2007 +0000
@@ -364,4 +364,32 @@
 	}
 	error(ERR_INV_ARG);
 }
+
+/**
+ * get_owners_from_domainid
+ *
+ * @todo also fetch the subowners
+ * @param $id integer the id of the domain
+ * @return String the list of owners for this domain
+ */
+function get_owners_from_domainid($id) {
+      
+      global $db;
+      if (is_numeric($id))
+      {
+              $result = $db->query("SELECT users.id, users.fullname FROM users, zones WHERE zones.domain_id=$id AND zones.owner=users.id ORDER by fullname");
+              if ($result->numRows() == 0)
+              {
+                      error(ERR_USER_NOT_EXIST);
+              } else {
+                      $names = array();
+                      while ($r = $result->fetchRow()) {
+                              $names[] = $r['fullname'];
+                      }
+                      return implode(', ', $names);
+              }
+      }
+      error(ERR_INV_ARG);
+}
+
 ?>
--- a/list_zones.php	Mon Jun 25 20:57:22 2007 +0000
+++ b/list_zones.php	Mon Jun 25 21:32:29 2007 +0000
@@ -77,9 +77,9 @@
 }
 ?>
      <td class="y"><? echo $c["name"] ?></td>
-     <td class="y"><? echo strtolower(get_domain_type( $c["id"])) ?></td>
+     <td class="y"><? echo strtolower(get_domain_type($c["id"])) ?></td>
      <td class="y"><? echo $c["numrec"] ?></td>
-     <td class="y"><? echo get_owner_from_id($c["owner"]) ?></td>
+     <td class="y"><? echo get_owners_from_domainid($c["id"]) ?></td>
     </tr><?
 		print "\n";
 	}