diff --git a/common.inc.php b/common.inc.php
index cb8150a..d637936 100644
--- a/common.inc.php
+++ b/common.inc.php
@@ -35,13 +35,17 @@ error_reporting(E_ALL ^ E_NOTICE);
define('REQUIREDFIELD','*');
//figure out the directory to prepend to directoroy names, depending on if we are in a subdirectory or not
-if(substr(getcwd(),-6)=="/admin")
+// Dennis Fix so works in windows servers.
+// Windows based servers use '\' in directories. This code works for WIN servers and or *nix servers.
+if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-6)=="\\admin")
$prependdir="../";
-else if(substr(getcwd(),-7)=="/config")
+else if(substr(getcwd(),-6)=="/super" || substr(getcwd(),-6)=="\\super")
$prependdir="../";
-else if(substr(getcwd(),-3)=="/db")
+else if(substr(getcwd(),-7)=="/config" || substr(getcwd(),-7)=="\\config")
$prependdir="../";
-else if(substr(getcwd(),-8)=="/scripts")
+else if(substr(getcwd(),-3)=="/db" || substr(getcwd(),-3)=="\\db")
+ $prependdir="../";
+else if(substr(getcwd(),-8)=="/scripts" || substr(getcwd(),-8)=="\\scripts")
$prependdir="../";
else
$prependdir="";
@@ -49,7 +53,6 @@ else
$sfiabversion=@file($prependdir."version.txt");
$config['version']=trim($sfiabversion[0]);
-
//make sure the data subdirectory is writable, if its not, then we're screwed, so make sure it is!
if(!is_writable($prependdir."data"))
{
diff --git a/db/db_update.php b/db/db_update.php
index 64b3f6e..b6154ca 100644
--- a/db/db_update.php
+++ b/db/db_update.php
@@ -84,7 +84,50 @@ if($dbcodeversion && $dbdbversion)
echo "db.update.$ver.sql detected - running...\n";
readfile("db.update.$ver.sql");
echo "\n";
- system("mysql --default-character-set=latin1 -h$DBHOST -u$DBUSER -p$DBPASS $DBNAME
** db_update USING system('mysql ..) on this server!
";
+ system("mysql --default-character-set=latin1 -h$DBHOST -u$DBUSER -p$DBPASS $DBNAME Error performing query!
'.$templine.'
mysqlerror: '.mysql_error().'
');
+ $error_count += 1;
+ $exit_code = -1; // do we bail out here or keep going? keep going for now, get all errors
+ }
+ // Reset temp variable to empty
+ $templine = '';
+ }
+ }
+ echo "
";
+ }
+ if($exit_code != 0) {
+ /* mysql failed!, what now? */
+ $error_count += 1;
+ echo "
ERROR in db_update: Failed to execute query(s) without error!
";
+ echo "Update scripts bad or system('mysql' .. ) call failed!
";
+ }
}
else
{
diff --git a/install.php b/install.php
index e4f2221..1307c8c 100644
--- a/install.php
+++ b/install.php
@@ -38,8 +38,35 @@ if(file_exists("data/config.inc.php"))
exit;
}
?>
+Warning: Function 'system' is not available in this server! Installation may not work!
";
+}
+if(!function_exists("exec")) {
+ echo "Warning: Function 'exec' is not available in this server! Installation may not work!
";
+}
+else {
+ $status = 99;
+ exec("mysql -q --help", $output, $status);
+ if(!$status == 0){
+ echo "Warning: Functions 'system' and 'exec' are available but 'mysql.exe' is not setup for use in system() calls
Install on this server may not have full funtionality!
";
+ }
+ $status = 99;
+ exec("php -v",$output,$status);
+ if ($status == 0){
+ //echo "Good: php is callable from exec and system!
";
+ }
+ else{
+ echo "Warning: Functions 'system' and 'exec' are available but 'php.exe' is not setup for use in system() calls
Install on this server may not have full funtionality!
";
+ }
+}
+// This check can be eliminated after all pdf reports are converted to tcpdf
+if (!function_exists("pdf_new")){
+echo "Warning: pdflib is not installed on this server! Most pdf reports will fail!
";
+}
-
+?>
$showform=true;
diff --git a/install2.php b/install2.php
index d6eaa00..2e3fc6b 100644
--- a/install2.php
+++ b/install2.php
@@ -36,6 +36,9 @@ if(!function_exists("system")) {
echo "