Skip to content

Commit e5b3535

Browse files
committed
Show warning message someone tries to use root as username for a client database when the database prefixes are removed.
1 parent 2db42a8 commit e5b3535

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

server/plugins-available/mysql_clientdb_plugin.inc.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ function db_insert($event_name,$data) {
123123
$app->log('Unable to open'.ISPC_LIB_PATH.'/mysql_clientdb.conf',LOGLEVEL_ERROR);
124124
return;
125125
}
126+
127+
if($data["new"]["database_user"] == 'root') {
128+
$app->log('User root not allowed for Client databases',LOGLEVEL_WARNING);
129+
return;
130+
}
126131

127132
//* Connect to the database
128133
$link = mysql_connect($clientdb_host, $clientdb_user, $clientdb_password);
@@ -172,6 +177,11 @@ function db_update($event_name,$data) {
172177
return;
173178
}
174179

180+
if($data["new"]["database_user"] == 'root') {
181+
$app->log('User root not allowed for Client databases',LOGLEVEL_WARNING);
182+
return;
183+
}
184+
175185
//* Connect to the database
176186
$link = mysql_connect($clientdb_host, $clientdb_user, $clientdb_password);
177187
if (!$link) {

0 commit comments

Comments
 (0)