FusionPBX 6 жил өмнө
parent
commit
6c1f1e912b

+ 6 - 6
core/authentication/resources/classes/plugins/database.php

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