-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from WibbenZ/gesior/TFS-1.0
Rework encryptionTypes, disable serverlist, update load.database.php
- Loading branch information
Showing
5 changed files
with
70 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,49 @@ | ||
<?php | ||
if(!defined('INITIALIZED')) | ||
exit; | ||
if (!defined('INITIALIZED')) { | ||
exit; | ||
} | ||
|
||
if(Website::getServerConfig()->isSetKey('mysqlHost')) | ||
{ | ||
define('SERVERCONFIG_SQL_HOST', 'mysqlHost'); | ||
define('SERVERCONFIG_SQL_PORT', 'mysqlPort'); | ||
define('SERVERCONFIG_SQL_USER', 'mysqlUser'); | ||
define('SERVERCONFIG_SQL_PASS', 'mysqlPass'); | ||
define('SERVERCONFIG_SQL_DATABASE', 'mysqlDatabase'); | ||
define('SERVERCONFIG_SQLITE_FILE', 'sqlFile'); | ||
} | ||
else | ||
new Error_Critic('#E-3', 'There is no key <b>mysqlHost</b> in server config', array(new Error('INFO', 'use server config cache: <b>' . (Website::getWebsiteConfig()->getValue('useServerConfigCache') ? 'true' : 'false') . '</b>'))); | ||
Website::setDatabaseDriver(Database::DB_MYSQL); | ||
if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_HOST)) | ||
Website::getDBHandle()->setDatabaseHost(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_HOST)); | ||
else | ||
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_HOST . '</b> in server config file.'); | ||
if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PORT)) | ||
Website::getDBHandle()->setDatabasePort(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PORT)); | ||
else | ||
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PORT . '</b> in server config file.'); | ||
if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_DATABASE)) | ||
Website::getDBHandle()->setDatabaseName(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_DATABASE)); | ||
else | ||
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_DATABASE . '</b> in server config file.'); | ||
if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_USER)) | ||
Website::getDBHandle()->setDatabaseUsername(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_USER)); | ||
else | ||
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_USER . '</b> in server config file.'); | ||
if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PASS)) | ||
Website::getDBHandle()->setDatabasePassword(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PASS)); | ||
else | ||
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PASS . '</b> in server config file.'); | ||
if (Website::getServerConfig()->isSetKey('mysqlHost')) { | ||
define('SERVERCONFIG_SQL_HOST', 'mysqlHost'); | ||
define('SERVERCONFIG_SQL_PORT', 'mysqlPort'); | ||
define('SERVERCONFIG_SQL_USER', 'mysqlUser'); | ||
define('SERVERCONFIG_SQL_PASS', 'mysqlPass'); | ||
define('SERVERCONFIG_SQL_DATABASE', 'mysqlDatabase'); | ||
define('SERVERCONFIG_SQLITE_FILE', 'sqlFile'); | ||
} else { | ||
new Error_Critic('#E-3', 'There is no key <b>mysqlHost</b> in server config', array(new Error('INFO', 'use server config cache: <b>' . (Website::getWebsiteConfig()->getValue('useServerConfigCache') ? 'true' : 'false') . '</b>'))); | ||
} | ||
|
||
Website::setPasswordsEncryption(Website::getServerConfig()->getValue('passwordType')); | ||
$SQL = Website::getDBHandle(); | ||
Website::setDatabaseDriver(Database::DB_MYSQL); | ||
if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_HOST)) { | ||
Website::getDBHandle()->setDatabaseHost(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_HOST)); | ||
} else { | ||
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_HOST . '</b> in server config file.'); | ||
} | ||
|
||
if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PORT)) { | ||
Website::getDBHandle()->setDatabasePort(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PORT)); | ||
} else { | ||
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PORT . '</b> in server config file.'); | ||
} | ||
|
||
if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_DATABASE)) { | ||
Website::getDBHandle()->setDatabaseName(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_DATABASE)); | ||
} else { | ||
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_DATABASE . '</b> in server config file.'); | ||
} | ||
|
||
if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_USER)) { | ||
Website::getDBHandle()->setDatabaseUsername(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_USER)); | ||
} else { | ||
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_USER . '</b> in server config file.'); | ||
} | ||
|
||
if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PASS)) { | ||
Website::getDBHandle()->setDatabasePassword(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PASS)); | ||
} else { | ||
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PASS . '</b> in server config file.'); | ||
} | ||
|
||
Website::updatePasswordEncryption(); | ||
$SQL = Website::getDBHandle(); |