[feladat @ 74]
authorrejo
Mon, 25 Jun 2007 21:55:33 +0000
changeset 27 782f142d096d
parent 26 5d63f1e71d6e
child 28 a73ac0ba0401
[feladat @ 74] Added missing record_owners SQL table creation during install. Fix by John Morris.
credits.php
install.php
--- a/credits.php	Mon Jun 25 21:32:29 2007 +0000
+++ b/credits.php	Mon Jun 25 21:55:33 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, Peter Beernink and Balazs Petrikovics for bug reports, patches and good ideas.</p>
+    <p>Thanks to Koert Buijzer, Peter Beernink, John Morris and Balazs Petrikovics for bug reports, patches and good ideas.</p>
 
 <?
 include_once("inc/footer.inc.php");
--- a/install.php	Mon Jun 25 21:32:29 2007 +0000
+++ b/install.php	Mon Jun 25 21:55:33 2007 +0000
@@ -1,26 +1,5 @@
 <?php
 
-// +--------------------------------------------------------------------+
-// | PowerAdmin								|
-// +--------------------------------------------------------------------+
-// | Copyright (c) 1997-2002 The PowerAdmin Team			|
-// +--------------------------------------------------------------------+
-// | This source file is subject to the license carried by the overal	|
-// | program PowerAdmin as found on http://poweradmin.sf.net		|
-// | The PowerAdmin program falls under the QPL License:		|
-// | http://www.trolltech.com/developer/licensing/qpl.html		|
-// +--------------------------------------------------------------------+
-// | Authors: Roeland Nieuwenhuis <trancer <AT> trancer <DOT> nl>	|
-// |          Sjeemz <sjeemz <AT> sjeemz <DOT> nl>			|
-// | Add-ons: Wim Mostrey <wim <AT> mostrey <DOT> be>                   |
-// +--------------------------------------------------------------------+
-
-// Filename: install.php
-// Description: installs your PowerAdmin
-//
-// $Id: install.php,v 1.12 2003/01/07 23:29:24 lyon Exp $
-//
-
 // addslashes to vars if magic_quotes_gpc is off
 function slash_input_data(&$data)
 {
@@ -97,6 +76,12 @@
 				  comment text,
 				  PRIMARY KEY  (id)
 				) TYPE=InnoDB";
+                $sqlrecowns =   "CREATE TABLE record_owners (
+                                  id int(11) NOT NULL auto_increment,
+                                  user_id int(11) NOT NULL default '0',
+                                  record_id int(11) NOT NULL default '0',
+                                  PRIMARY KEY  (id)
+                                ) TYPE=InnoDB";
 	}
 
 	// PGSQL Is trivial still, the relations are different.
@@ -118,6 +103,11 @@
 				owner smallint NOT NULL,
 				comment text NULL
 				)";
+                $sqlrecowns =   "CREATE TABLE record_owners (
+                                id SERIAL PRIMARY KEY,
+                                user_id smallint NOT NULL,
+                                record_id smallint NOT NULL
+                                )";
 	}
 
 	if(!empty($_POST['login']) && !empty($_POST['password']) && !empty($_POST['fullname']) && !empty($_POST['email']))
@@ -141,7 +131,13 @@
 		{
 			error("Can not create zones table in $dbdatabase");
 		}
+                $reszones = $db->query($sqlrecowns);
 
+                if($db->isError($reszones))
+                {
+                        error("Can not create record_owners table in $dbdatabase");
+                }
+		
 		$sqlinsert =	"INSERT INTO 
 					users 
 					(username, password, fullname, email, description, level, active)