Update database.php

This commit is contained in:
FusionPBX 2019-05-14 11:08:01 -06:00 committed by GitHub
parent ca856f99c7
commit 2b24e693dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -36,20 +36,20 @@ class plugin_database {
//check the username and password if they don't match then redirect to the login //check the username and password if they don't match then redirect to the login
$sql = "select * from v_users "; $sql = "select * from v_users ";
if (strlen($this->key) > 30) { if (strlen($this->key) > 30) {
$sql .= "where api_key=:key "; $sql .= "where api_key = :key ";
//$sql .= "where api_key='".$this->key."' "; //$sql .= "where api_key = '".$this->key."' ";
} }
else { else {
$sql .= "where username=:username "; $sql .= "where lower(username) = lower(:username) ";
//$sql .= "where username='".$this->username."' "; //$sql .= "where username = '".$this->username."' ";
} }
if ($_SESSION["user"]["unique"]["text"] == "global") { if ($_SESSION["user"]["unique"]["text"] == "global") {
//unique username - global (example: email address) //unique username - global (example: email address)
} }
else { else {
//unique username - per domain //unique username - per domain
$sql .= "and domain_uuid=:domain_uuid "; $sql .= "and domain_uuid = :domain_uuid ";
//$sql .= "and domain_uuid='".$this->domain_uuid."' "; //$sql .= "and domain_uuid = '".$this->domain_uuid."' ";
} }
$sql .= "and (user_enabled = 'true' or user_enabled is null) "; $sql .= "and (user_enabled = 'true' or user_enabled is null) ";
//echo $sql."<br />\n"; //echo $sql."<br />\n";