mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Update the constructor and $db connection handling in the groups and switch_settings classes.
This commit is contained in:
@@ -16,9 +16,13 @@ class switch_settings {
|
||||
* Called when the object is created
|
||||
*/
|
||||
public function __construct() {
|
||||
//set the database connection
|
||||
global $db;
|
||||
$this->db = $db;
|
||||
//connect to the database if not connected
|
||||
if (!$this->db) {
|
||||
require_once "resources/classes/database.php";
|
||||
$database = new database;
|
||||
$database->connect();
|
||||
$this->db = $database->db;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user