diff --git a/lib/classes/database/class.db.php b/lib/classes/database/class.db.php index 4cbfed0d..2b866422 100644 --- a/lib/classes/database/class.db.php +++ b/lib/classes/database/class.db.php @@ -307,6 +307,15 @@ class db { @fwrite($sqllog, date('d.m.Y H:i', time())." --- ".$text."\n"); @fclose($sqllog); + if (isset($_SERVER['SHELL']) && $_SERVER['SHELL'] != '') { + // if we're not on the shell, output a nicer error-message + $err_hint = file_get_contents(dirname($sl_dir).'/templates/'.$theme.'/misc/dberrornice.tpl'); + // replace values + $err_hint = str_replace("", $errormsg, $err_hint); + $err_hint = str_replace("", $text, $err_hint); + // show + die($err_hint); + } die("We are sorry, but a MySQL - error occurred. The administrator may find more information in syslog with the ID ".$md5." or in the sql-error.log in the logs/ directory"); } } diff --git a/templates/Froxlor/misc/dberrornice.tpl b/templates/Froxlor/misc/dberrornice.tpl new file mode 100644 index 00000000..33d6d1ec --- /dev/null +++ b/templates/Froxlor/misc/dberrornice.tpl @@ -0,0 +1,47 @@ + + + + + + + + + + + + Froxlor Server Management Panel - Installation + + + +
+ +
+ + + diff --git a/templates/Sparkle/misc/dberrornice.tpl b/templates/Sparkle/misc/dberrornice.tpl new file mode 100644 index 00000000..cf3482e8 --- /dev/null +++ b/templates/Sparkle/misc/dberrornice.tpl @@ -0,0 +1,51 @@ + + + + + + + + + + + + Froxlor Server Management Panel - Database error + + + +
+ + + +
+ + +