diff --git a/resources/classes/database.php b/resources/classes/database.php index 4cc1891059..0a7bbdf281 100644 --- a/resources/classes/database.php +++ b/resources/classes/database.php @@ -316,6 +316,14 @@ if (isset($params['domain_uuid'])) { $this->domain_uuid = $params['domain_uuid']; } + + //allow passed user_uuid in the constructor to override the session user_uuid + if (isset($params['user_uuid'])) { + $this->user_uuid = $params['user_uuid']; + } else { + //try to determine the current user_uuid using the session + $this->user_uuid = (!empty($_SESSION['user_uuid']) ? $_SESSION['user_uuid'] : null); + } } /**