diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index b7e22d6acef43fd5d7b817031fce75905583920f..a38e49dd1a62c84d956c21236c99d3351d0a65f9 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -249,7 +249,7 @@ class installer_base { $msg = ''; if(version_compare(phpversion(), '5.4', '<')) $msg .= "PHP Version 5.4 or newer is required. The currently used PHP version is ".phpversion().".\n"; - if(version_compare(phpversion(), '8.0', '>=')) $msg .= "PHP Version 8 is not supported yet. Change PHP version back to the default version of the OS. The currently used PHP version is ".phpversion().".\n"; + if(version_compare(phpversion(), '8.2', '>=')) $msg .= "PHP Version 8.2+ is not supported yet. Change PHP version back to the default version of the OS. The currently used PHP version is ".phpversion().".\n"; if(!function_exists('curl_init')) $msg .= "PHP Curl Module is missing.\n"; if(!function_exists('mysqli_connect')) $msg .= "PHP MySQLi Module is nmissing.\n"; if(!function_exists('mb_detect_encoding')) $msg .= "PHP Multibyte Module (MB) is missing.\n"; diff --git a/install/lib/mysql.lib.php b/install/lib/mysql.lib.php index 1085ed0d5b2c04cd97bcc5968f371afec5e0dc35..4d9e71f44a1a8c62758b70915562287964d95000 100644 --- a/install/lib/mysql.lib.php +++ b/install/lib/mysql.lib.php @@ -64,9 +64,11 @@ class db public function __destruct() { if($this->_iConnId) mysqli_close($this->_iConnId); } - + private function do_connect() { global $conf; + + mysqli_report(MYSQLI_REPORT_OFF); if($this->_iConnId) return true; $this->dbHost = $conf['mysql']['host']; @@ -77,7 +79,7 @@ class db $this->dbCharset = $conf["mysql"]["charset"]; $this->dbNewLink = false; $this->dbClientFlags = null; - + $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, '', (int)$this->dbPort); $try = 0; while((!is_object($this->_iConnId) || mysqli_connect_error()) && $try < 5) { @@ -92,19 +94,19 @@ class db $this->_sqlerror('Zugriff auf Datenbankserver fehlgeschlagen! / Database server not accessible!'); return false; } - + if($this->dbName) $this->setDBName($this->dbName); $this->_setCharset(); } - + public function setDBData($host, $user, $password, $port) { $this->dbHost = $host; $this->dbUser = $user; $this->dbPass = $password; $this->dbPort = $port; } - + public function setDBName($name) { $this->dbName = $name; $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, '', (int)$this->dbPort); @@ -114,7 +116,7 @@ class db return false; } } - + public function close() { if($this->_iConnId) mysqli_close($this->_iConnId); $this->_iConnId = null; @@ -192,7 +194,7 @@ class db } private function _query($sQuery = '') { - + $aArgs = func_get_args(); $this->do_connect(); @@ -284,7 +286,7 @@ class db * @return array result row or NULL if none found */ public function queryOneRecord($sQuery = '') { - + $aArgs = func_get_args(); if(!empty($aArgs)) { $sQuery = array_shift($aArgs); @@ -293,7 +295,7 @@ class db } array_unshift($aArgs, $sQuery); } - + $oResult = call_user_func_array([&$this, 'query'], $aArgs); if(!$oResult) return null; @@ -534,7 +536,7 @@ class db if($debug == 1) echo "mySQL Error Message: ".$this->errorMessage; } } - + /* TODO: rewrite SQL */ function update($tablename, $form, $bedingung, $debug = 0) { @@ -761,14 +763,14 @@ class db break; } } - + /** * Get the database type (mariadb or mysql) * * @access public * @return string 'mariadb' or string 'mysql' */ - + public function getDatabaseType() { $tmp = $this->queryOneRecord('SELECT VERSION() as version'); if(stristr($tmp['version'],'mariadb')) { @@ -777,7 +779,7 @@ class db return 'mysql'; } } - + /** * Get the database version * @@ -785,7 +787,7 @@ class db * @param bool $major_version_only = true will return the major version only, e.g. 8 for MySQL 8 * @return string version number */ - + public function getDatabaseVersion($major_version_only = false) { $tmp = $this->queryOneRecord('SELECT VERSION() as version'); $version = explode('-', $tmp['version']); diff --git a/interface/lib/classes/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php index cd9c333b22040081932c4d8a70902c2809ef1e48..1bfc9102b669077027a2226f3e512387aa1efc1d 100644 --- a/interface/lib/classes/db_mysql.inc.php +++ b/interface/lib/classes/db_mysql.inc.php @@ -82,6 +82,8 @@ class db $this->dbClientFlags = ($flags !== NULL) ? $flags : $conf['db_client_flags']; $this->_iConnId = mysqli_init(); + mysqli_report(MYSQLI_REPORT_OFF); + mysqli_real_connect($this->_iConnId, $this->dbHost, $this->dbUser, $this->dbPass, '', (int)$this->dbPort, NULL, $this->dbClientFlags); for($try=0;(!is_object($this->_iConnId) || mysqli_connect_errno()) && $try < 5;++$try) { sleep($try); diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php index 9b9d43b442898309a91d67c087d447d062353fc7..723360aa839f94a7367966897c57ec1df94b4eea 100644 --- a/server/lib/classes/db_mysql.inc.php +++ b/server/lib/classes/db_mysql.inc.php @@ -82,6 +82,8 @@ class db $this->dbClientFlags = ($flags !== NULL) ? $flags : $conf['db_client_flags']; $this->_iConnId = mysqli_init(); + mysqli_report(MYSQLI_REPORT_OFF); + mysqli_real_connect($this->_iConnId, $this->dbHost, $this->dbUser, $this->dbPass, '', (int)$this->dbPort, NULL, $this->dbClientFlags); for($try=0;(!is_object($this->_iConnId) || mysqli_connect_errno()) && $try < 5;++$try) { sleep($try); diff --git a/server/plugins-available/mysql_clientdb_plugin.inc.php b/server/plugins-available/mysql_clientdb_plugin.inc.php index 4d637ef37f6e58b142d454c5a249d10f0f029d97..9cf750a84db03949bc818d0979618dc8f82c7bca 100644 --- a/server/plugins-available/mysql_clientdb_plugin.inc.php +++ b/server/plugins-available/mysql_clientdb_plugin.inc.php @@ -166,9 +166,9 @@ class mysql_clientdb_plugin { $link->escape_string($database_password)); if(!$link->query($query)) $success = false; } - + $app->log("PASSWORD SET FOR '".$link->escape_string($database_user)."'@'$db_host' success? " . ($success ? 'yes' : 'no'), LOGLEVEL_DEBUG); - + if($success == true){ $link->query("FLUSH PRIVILEGES"); } @@ -261,6 +261,7 @@ class mysql_clientdb_plugin { return; } + mysqli_report(MYSQLI_REPORT_OFF); //* Connect to the database $link = new mysqli($clientdb_host, $clientdb_user, $clientdb_password); if ($link->connect_error) { @@ -324,6 +325,7 @@ class mysql_clientdb_plugin { return; } + mysqli_report(MYSQLI_REPORT_OFF); //* Connect to the database $link = new mysqli($clientdb_host, $clientdb_user, $clientdb_password); if ($link->connect_error) { @@ -654,6 +656,7 @@ class mysql_clientdb_plugin { return; } + mysqli_report(MYSQLI_REPORT_OFF); //* Connect to the database $link = new mysqli($clientdb_host, $clientdb_user, $clientdb_password); if ($link->connect_error) { @@ -709,6 +712,7 @@ class mysql_clientdb_plugin { return; } + mysqli_report(MYSQLI_REPORT_OFF); //* Connect to the database $link = new mysqli($clientdb_host, $clientdb_user, $clientdb_password); if ($link->connect_error) { @@ -782,6 +786,7 @@ class mysql_clientdb_plugin { return; } + mysqli_report(MYSQLI_REPORT_OFF); //* Connect to the database $link = new mysqli($clientdb_host, $clientdb_user, $clientdb_password); if ($link->connect_error) { @@ -807,16 +812,16 @@ class mysql_clientdb_plugin { $link->close(); } - - - - + + + + function getDatabaseType($link) { $result = $link->query('SELECT VERSION() as version'); if($result) { $tmp = $result->fetch_assoc(); $result->free(); - + if(stristr($tmp['version'],'mariadb')) { return 'mariadb'; } else { @@ -832,7 +837,7 @@ class mysql_clientdb_plugin { if($result) { $tmp = $result->fetch_assoc(); $result->free(); - + $version = explode('-', $tmp['version']); if($major_version_only == true) { $version_parts = explode('.', $version[0]);