fix installation for mariadb-10.5; minor fixes for global search later
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -812,8 +812,26 @@ class FroxlorInstall
|
||||
|
||||
private function _grantDbPrivilegesTo(&$db_root, $database, $username, $password, $access_host)
|
||||
{
|
||||
// mariadb
|
||||
if (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '10.0.0', '>=')) {
|
||||
// create user
|
||||
$stmt = $db_root->prepare("
|
||||
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED BY :password
|
||||
");
|
||||
$stmt->execute(array(
|
||||
"password" => $password
|
||||
));
|
||||
// grant privileges
|
||||
$stmt = $db_root->prepare("
|
||||
GRANT ALL ON `" . $database . "`.* TO :username@:host
|
||||
");
|
||||
$stmt->execute(array(
|
||||
"username" => $username,
|
||||
"host" => $access_host
|
||||
));
|
||||
}
|
||||
// mysql8 compatibility
|
||||
if (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) {
|
||||
elseif (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) {
|
||||
// create user
|
||||
$stmt = $db_root->prepare("
|
||||
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED WITH mysql_native_password BY :password
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace Froxlor\UI\Callbacks;
|
||||
|
||||
use Froxlor\PhpHelper;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\User;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class Collection
|
||||
private array $has = [];
|
||||
private array $params;
|
||||
private array $userinfo;
|
||||
private ?Pagination $pagination;
|
||||
private ?Pagination $pagination = null;
|
||||
|
||||
public function __construct(string $class, array $userInfo, array $params = [])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user