Fix #346 Uneccesary OTHire engine logic separation

There is no need to create a separate configs for OTHIRE when establishing an SQL connection,
and is confusing for new users who are configurating their webserver.
This commit is contained in:
Znote 2019-03-17 19:43:41 +01:00
parent 44839d9cdb
commit 63357290a0
2 changed files with 2 additions and 22 deletions

View File

@ -29,9 +29,6 @@
// MYSQL CONNECTION DETAILS \\
// ------------------------ \\
if ($config['ServerEngine'] !== 'OTHIRE') {
// TFS DATABASE CONFIGS
// phpmyadmin username for OT server: (DONT USE "root" if ur hosting to public.).
$config['sqlUser'] = 'tfs13';
@ -43,21 +40,6 @@
// Hostname is usually localhost or 127.0.0.1.
$config['sqlHost'] = '127.0.0.1';
} else {
// OTHIRE DATABASE CONFIG
// phpmyadmin username for OT server: (DONT USE "root" if ur hosting to public.).
$config['sql_user'] = 'tfs13';
// phpmyadmin password for OT server:
$config['sql_pass'] = 'tfs13';
// The database name to connect to. (This is usually same as username).
$config['sql_db'] = 'tfs13';
// Hostname is usually localhost or 127.0.0.1.
$config['sql_host'] = '127.0.0.1';
}
// QR code authenticator Only works with TFS 1.2+
$config['twoFactorAuthenticator'] = false;

View File

@ -289,10 +289,8 @@ INSERT INTO `znote_forum` (`name`, `access`, `closed`, `hidden`, `guild_id`) VAL
</li>
</ol>
";
if ($config['ServerEngine'] !== 'OTHIRE')
$connect = new mysqli($config['sqlHost'], $config['sqlUser'], $config['sqlPassword'], $config['sqlDatabase']);
else
$connect = new mysqli($config['sql_host'], $config['sql_user'], $config['sql_pass'], $config['sql_db']);
if ($connect->connect_errno) {
die("Failed to connect to MySQL: (" . $connect->connect_errno . ") " . $connect->connect_error . $install);