Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ISPConfig 3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dominik
ISPConfig 3
Commits
21b1c30c
Commit
21b1c30c
authored
Oct 08, 2020
by
Till Brehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update mysql_clientdb_plugin.inc.php
parent
6322f58c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
server/plugins-available/mysql_clientdb_plugin.inc.php
server/plugins-available/mysql_clientdb_plugin.inc.php
+8
-8
No files found.
server/plugins-available/mysql_clientdb_plugin.inc.php
View file @
21b1c30c
...
...
@@ -153,17 +153,17 @@ class mysql_clientdb_plugin {
// mariadb or mysql < 5.7
if
(
$this
->
getDatabaseType
(
$link
)
==
'mariadb'
||
version_compare
(
$this
->
getDatabaseVersion
(
$link
),
'5.7'
,
'<'
))
{
$query
=
sprintf
(
"SET PASSWORD FOR '%s'@'%s' = '%s'"
,
$link
->
escape_string
(
$data
[
'new'
][
'database_user'
]
),
$link
->
escape_string
(
$data
base_user
),
$db_host
,
$link
->
escape_string
(
$data
[
'new'
][
'database_password'
]
));
$link
->
escape_string
(
$data
base_password
));
if
(
!
$link
->
query
(
$query
))
$success
=
false
;
}
// mysql >= 5.7
else
{
$query
=
sprintf
(
"ALTER USER IF EXISTS '%s'@'%s' IDENTIFIED WITH mysql_native_password AS '%s'"
,
$link
->
escape_string
(
$data
[
'new'
][
'database_user'
]
),
$link
->
escape_string
(
$data
base_user
),
$db_host
,
$link
->
escape_string
(
$data
[
'new'
][
'database_password'
]
));
$link
->
escape_string
(
$data
base_password
));
if
(
!
$link
->
query
(
$query
))
$success
=
false
;
}
...
...
@@ -190,17 +190,17 @@ class mysql_clientdb_plugin {
// mariadb or mysql < 5.7
if
(
$this
->
getDatabaseType
(
$link
)
==
'mariadb'
||
version_compare
(
$this
->
getDatabaseVersion
(
$link
),
'5.7'
,
'<'
))
{
$query
=
sprintf
(
"SET PASSWORD FOR '%s'@'%s' = '%s'"
,
$link
->
escape_string
(
$data
[
'new'
][
'database_user'
]
),
$link
->
escape_string
(
$data
base_user
),
$db_host
,
$link
->
escape_string
(
$data
[
'new'
][
'database_password'
]
));
$link
->
escape_string
(
$data
base_password
));
if
(
!
$link
->
query
(
$query
))
$success
=
false
;
}
// mysql >= 5.7
else
{
$query
=
sprintf
(
"ALTER USER IF EXISTS '%s'@'%s' IDENTIFIED WITH mysql_native_password AS '%s'"
,
$link
->
escape_string
(
$data
[
'new'
][
'database_user'
]
),
$link
->
escape_string
(
$data
base_user
),
$db_host
,
$link
->
escape_string
(
$data
[
'new'
][
'database_password'
]
));
$link
->
escape_string
(
$data
base_password
));
if
(
!
$link
->
query
(
$query
))
$success
=
false
;
}
if
(
$success
==
true
)
$link
->
query
(
"FLUSH PRIVILEGES"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment