Important $w Array Update
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000048956
As of November 1, 2018, several configuration values previously available in the $w array were moved to the brilliantDirectories::getDatabaseConfiguration() static method to improve security.
Any custom code that references these configuration values should be updated to use the new method.
Affected Configuration Keys
The following keys are no longer available through the $w array:
website_userwebsite_passdatabase_userdatabase_passdatabase_hostdatabasedatabase_directory_userdatabase_directory_passwhmcs_database_hostwhmcs_database_userwhmcs_database_passwordwhmcs_database_namewhmcs_api_passwordwhmcs_api_hostwhmcs_api_username
Updating Existing Code
The brilliantDirectories::getDatabaseConfiguration() method accepts the configuration key as its only parameter and returns the corresponding value.
Replace references to configuration values in the $w array with calls to the new static method.
Example 1
Replace either of the following:
$w['website_user']
or
$w[website_user]
with:
brilliantDirectories::getDatabaseConfiguration('website_user')
Example 2
Original code:
$membersQuery = mysql($w['database'], "SELECT * FROM `users_data`");
Updated code:
$membersQuery = mysql( brilliantDirectories::getDatabaseConfiguration('database'), "SELECT * FROM `users_data`" );
Summary
Whenever custom code needs access to one of the affected configuration values, replace the corresponding $w array reference with a call to (where configuration_key is the name of the desired configuration value)
brilliantDirectories::getDatabaseConfiguration('configuration_key')
