Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ISPConfig 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ISPConfig
ISPConfig 3
Commits
506d1d5e
Commit
506d1d5e
authored
8 years ago
by
Florian Schaal
Browse files
Options
Downloads
Plain Diff
Merge branch 'stable-3.1' of
http://git.ispconfig.org/ispconfig/ispconfig3
into stable-3.1
parents
45005c30
41dd8eb9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!536
Stable 3.1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/plugins-available/mysql_clientdb_plugin.inc.php
+20
-2
20 additions, 2 deletions
server/plugins-available/mysql_clientdb_plugin.inc.php
with
20 additions
and
2 deletions
server/plugins-available/mysql_clientdb_plugin.inc.php
+
20
−
2
View file @
506d1d5e
...
...
@@ -686,8 +686,26 @@ class mysql_clientdb_plugin {
}
if
(
$data
[
'new'
][
'database_password'
]
!=
$data
[
'old'
][
'database_password'
]
&&
$data
[
'new'
][
'database_password'
]
!=
''
)
{
$link
->
query
(
"SET PASSWORD FOR '"
.
$link
->
escape_string
(
$data
[
'new'
][
'database_user'
])
.
"'@'
$db_host
' = '"
.
$link
->
escape_string
(
$data
[
'new'
][
'database_password'
])
.
"';"
);
$app
->
log
(
'Changing MySQL user password for: '
.
$data
[
'new'
][
'database_user'
]
.
'@'
.
$db_host
,
LOGLEVEL_DEBUG
);
$result
=
$app
->
db
->
queryOneRecord
(
"SELECT VERSION() as version"
);
$dbversion
=
$result
[
'version'
];
// mariadb or mysql < 5.7
if
(
stripos
(
$dbversion
,
'mariadb'
)
!==
false
||
version_compare
(
$dbversion
,
'5.7'
,
'<'
))
{
$query
=
sprintf
(
"SET PASSWORD FOR '%s'@'%s' = '%s'"
,
$link
->
escape_string
(
$data
[
'new'
][
'database_user'
]),
$db_host
,
$link
->
escape_string
(
$data
[
'new'
][
'database_password'
]));
$link
->
query
(
$query
);
}
// 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'
]),
$db_host
,
$link
->
escape_string
(
$data
[
'new'
][
'database_password'
]));
$link
->
query
(
$query
);
}
$app
->
log
(
'Changing MySQL user password for: '
.
$data
[
'new'
][
'database_user'
]
.
'@'
.
$db_host
,
LOGLEVEL_DEBUG
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment