diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 1218795..dd4e8a3 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -70,9 +70,12 @@ $content['BUILDNUMBER'] = "2.5.9"; $content['TITLE'] = "phpLogCon :: Release " . $content['BUILDNUMBER']; // Default page title $content['BASEPATH'] = $gl_root_path; $content['SHOW_DONATEBUTTON'] = true; // Default = true! + +// PreInit overall user variables $content['EXTRA_METATAGS'] = ""; $content['EXTRA_JAVASCRIPT'] = ""; $content['EXTRA_STYLESHEET'] = ""; +$content['CURRENTURL'] = ""; // --- // --- Check PHP Version! If lower the 5, phplogcon will not work proberly! @@ -798,20 +801,36 @@ function CheckUrlOrIP($ip) function DieWithErrorMsg( $szerrmsg ) { global $gl_root_path, $content; - print("phpLogCon :: Critical Error occured"); - print("

Critical Error occured


"); - print("Errordetails:
" . $szerrmsg); - print("
"); - + echo + "phpLogCon :: Critical Error occured" . + "

" . + "". + "" . + "" . + "
" . + "

Critical Error occured

" . + "
Errordetails:" . + $szerrmsg . + "
" . + ""; exit; } function DieWithFriendlyErrorMsg( $szerrmsg ) { - //TODO: Make with template - print(""); - print("

Error occured


"); - print("Errordetails:
" . $szerrmsg); + global $gl_root_path, $content; + echo + "phpLogCon :: Error occured" . + "

" . + "". + "" . + "" . + "
" . + "

Error occured

" . + "
Errordetails:" . + $szerrmsg . + "
" . + ""; exit; } diff --git a/src/include/functions_db.php b/src/include/functions_db.php index d9e0ce2..97ab4d1 100644 --- a/src/include/functions_db.php +++ b/src/include/functions_db.php @@ -57,10 +57,18 @@ function DB_Connect() if ($userdbconn) return; - //TODO: Check variables first - $userdbconn = mysql_connect( GetConfigSetting("UserDBServer"), GetConfigSetting("UserDBUser"), GetConfigSetting("UserDBPass")); + $userdbconn = @mysql_connect( GetConfigSetting("UserDBServer"), GetConfigSetting("UserDBUser"), GetConfigSetting("UserDBPass")); if (!$userdbconn) - DB_PrintError("Link-ID == false, connect to " . GetConfigSetting("UserDBServer") . " failed", true); + { + // Create Error Msg + $szErrorMsg = "Failed to establish a connection to the configured MYSQL Server.
PhpLogCon is not able to initialize the user system."; + if ( isset($php_errormsg) ) + $szErrorMsg .= "

Extra Error Details:
" . $php_errormsg; + + DieWithErrorMsg( $szErrorMsg ); + } + + //TODO: Check variables first // --- Now, check Mysql DB Version! $strmysqlver = mysql_get_server_info();