From 4db614ee8c2481228e759ee268d2e21ba9be1d65 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 18 Apr 2014 01:22:37 +0000 Subject: [PATCH] change strlen($key) to isset($_REQUEST["key"] to fix login problem affecting one system --- app/call_block/app_config.php | 1 + resources/check_auth.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/call_block/app_config.php b/app/call_block/app_config.php index 0dc376f611..8c0f8d422e 100644 --- a/app/call_block/app_config.php +++ b/app/call_block/app_config.php @@ -71,6 +71,7 @@ $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign"; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains"; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_uuid"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_caller_uuid"; diff --git a/resources/check_auth.php b/resources/check_auth.php index d7623492a7..d1d27048ad 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -187,7 +187,7 @@ require_once "resources/require.php"; if ($_SESSION["user"]["unique"]["text"] == "global") { //globally unique users $sql = "select * from v_users "; - if (strlen($key) > 0) { + if (isset($_REQUEST["key"])) { $sql .= "where api_key=:key "; //$sql .= "where api_key='".$key."' "; } @@ -201,7 +201,7 @@ require_once "resources/require.php"; else { //unique per domain $sql = "select * from v_users "; - if (strlen($key) > 0) { + if (isset($_REQUEST["key"])) { $sql .= "where api_key=:key "; //$sql .= "and api_key='".$key."' "; } @@ -215,7 +215,7 @@ require_once "resources/require.php"; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->bindParam(':domain_uuid', $domain_uuid); } - if (strlen($key) > 0) { + if (isset($_REQUEST["key"])) { $prep_statement->bindParam(':key', $key); } else { @@ -227,7 +227,7 @@ require_once "resources/require.php"; $auth_failed = true; } else { - if (strlen($key) > 0) { + if (isset($_REQUEST["key"])) { $auth_failed = false; } else {