Skip to content

Commit 967cd65

Browse files
committed
database username and database name shall not be empty.
1 parent 0af0e9e commit 967cd65

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

interface/web/sites/database_edit.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ function onBeforeUpdate() {
237237
if($old_record["database_charset"] != $this->dataRecord["database_charset"]) {
238238
$app->tform->errorMessage .= $app->tform->wordbook["database_charset_change_txt"].'<br />';
239239
}
240+
241+
//* Database username and database name shall not be empty
242+
if($this->dataRecord['database_name'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_name_error_empty"];
243+
if($this->dataRecord['database_user'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_user_error_empty"];
240244

241245
//* Check if the server has been changed
242246
// We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
@@ -261,6 +265,10 @@ function onBeforeUpdate() {
261265

262266
function onBeforeInsert() {
263267
global $app, $conf, $interfaceConf;
268+
269+
//* Database username and database name shall not be empty
270+
if($this->dataRecord['database_name'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_name_error_empty"];
271+
if($this->dataRecord['database_user'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_user_error_empty"];
264272

265273
//* Get the database name and database user prefix
266274
$app->uses('getconf');

0 commit comments

Comments
 (0)