diff -r 2cd8c1649ba9 -r 58094faf794d test_setup.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test_setup.php Tue Apr 10 22:40:43 2007 +0000 @@ -0,0 +1,85 @@ + trancer nl> | +// | Sjeemz sjeemz nl> | +// +--------------------------------------------------------------------+ + +// Filename: test_setup.php +// Description: tests your PowerAdmin install. +// Adding tables? Increase the total count to (2^numberoftables)-1 +// Substract its binary value and put it in the last failure close. +// Yes this is binary, why? Because thats cool! Squeeky geeky stuff! +// +// $Id: test_setup.php,v 1.4 2003/01/08 00:40:08 azurazu Exp $ +// + +include_once("inc/header.inc.php"); +require_once("inc/config.inc.php"); +require_once("inc/database.inc.php"); + +// Initialize variables +global $db; +$bad_array = array(); +$check_tables = array('zones', 'users', 'records', 'domains'); + +function error() +{ + return true; +} + +PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'error'); + +foreach($check_tables as $table) +{ + if(DB::isError($db->query("select * from $table"))) + { + $bad_array[] = $table; + } +} + +$bad = (count($bad_array) == 0) ? false : true; + +// Start error or message output + +echo "

"; + +if($bad) +{ + ?>

Not all tables are ok!

Successful!

+
+ +Sorry, but there are error(s) found in the following table(s):.

Please fix these errors and run the script again.

+

+