Disallow installing Rhymix with the DB root account

This commit is contained in:
Kijin Sung 2020-12-16 00:04:39 +09:00
parent 9ba8c9159e
commit 2de3bbcea7
3 changed files with 8 additions and 0 deletions

View file

@ -32,6 +32,12 @@ class installController extends install
// Get DB config variables.
$config = Context::gets('db_type', 'db_host', 'db_port', 'db_user', 'db_pass', 'db_database', 'db_prefix');
// Disallow installation using the root account.
if (trim($config->db_user) === 'root')
{
return new BaseObject(-1, 'msg_dbroot_disallowed');
}
// Create a temporary setting object.
Rhymix\Framework\Config::set('db.master', array(
'type' => $config->db_type,

View file

@ -87,6 +87,7 @@ $lang->msg_db_checking = 'Checking...';
$lang->msg_installing = 'Installing...';
$lang->msg_cannot_proc = 'Installation environment is not proper to proceed.';
$lang->msg_already_installed = 'Rhymix is already installed.';
$lang->msg_dbroot_disallowed = 'Installing with the DB root account is not permitted. Please create a non-root account and use it.';
$lang->msg_dbconnect_failed = 'An error has occurred while connecting to DB. Please check DB information again.';
$lang->msg_table_is_exists = 'Table is already created in the DB. Config file is recreated.';
$lang->msg_install_completed = 'Installation has been completed. Thank you for choosing Rhymix.';

View file

@ -86,6 +86,7 @@ $lang->success_installed = '설치가 되었습니다.';
$lang->msg_cannot_proc = '설치 환경이 갖춰지지 않아 요청을 실행할 수가 없습니다.';
$lang->msg_db_checking = '확인 중입니다...';
$lang->msg_installing = '설치 중입니다...';
$lang->msg_dbroot_disallowed = 'DB root 계정으로 설치하는 것은 허용되지 않습니다. root가 아닌 일반 DB 계정을 생성하여 사용하시기 바랍니다.';
$lang->msg_already_installed = '이미 설치가 되어 있습니다.';
$lang->msg_dbconnect_failed = 'DB접속 오류가 발생하였습니다. DB정보를 다시 확인해주세요.';
$lang->msg_table_is_exists = '이미 DB에 테이블이 생성되어 있습니다. config 파일을 재생성하였습니다.';