From 0757c79271a653471e3a8b546bf93d60e211662a Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 6 May 2023 14:40:21 -0600 Subject: [PATCH] Allow login with user email. --- .../resources/classes/authentication.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/core/authentication/resources/classes/authentication.php b/core/authentication/resources/classes/authentication.php index 1e4fad7a9e..7793a6ced0 100644 --- a/core/authentication/resources/classes/authentication.php +++ b/core/authentication/resources/classes/authentication.php @@ -128,6 +128,7 @@ class authentication { $_SESSION['authentication']['plugin'][$name]['domain_uuid'] = $_SESSION['domain_uuid']; $_SESSION['authentication']['plugin'][$name]['username'] = $_SESSION['username']; $_SESSION['authentication']['plugin'][$name]['user_uuid'] = $_SESSION['user_uuid']; + $_SESSION['authentication']['plugin'][$name]['user_email'] = $_SESSION['user_email']; $_SESSION['authentication']['plugin'][$name]['authorized'] = 0; } } @@ -165,17 +166,17 @@ class authentication { $result["authorized"] = $authorized; //add user logs - if ($result["authorized"]) { - user_logs::add($result); - } + user_logs::add($result); //debug information - //if ($row["authorized"]) { - // echo "authorized: true\n"; - //} - //else { - // echo "authorized: false\n"; - //} + if ($debug) { + if ($row["authorized"]) { + echo "authorized: true\n"; + } + else { + echo "authorized: false\n"; + } + } //user is authorized - get user settings, check user cidr if ($authorized) {