[bug fix] get the domain from the username (#6691)

* [bug fix] get the domain from the username

When the URL domain doesn't match the user's domain

Authentication can use domain from the username.

username:
user@domain
This commit is contained in:
FusionPBX
2023-05-11 18:58:22 -06:00
committed by GitHub
parent 733b206664
commit ffd9a2c4b5
2 changed files with 44 additions and 28 deletions

View File

@@ -3,8 +3,7 @@
/**
* plugin_database
*
* @method validate uses authentication plugins to check if a user is authorized to login
* @method get_domain used to get the domain name from the URL or username and then sets both domain_name and domain_uuid
* @method plugin_database validates the authentication using information from the database
*/
class plugin_database {
@@ -138,6 +137,13 @@ class plugin_database {
$this->key = $_REQUEST["key"];
}
//get the domain name
$auth = new authentication;
$auth->get_domain();
$this->domain_uuid = $_SESSION['domain_uuid'];
$this->domain_name = $_SESSION['domain_name'];
$this->username = $_SESSION['username'];
//set the default status
$user_authorized = false;