diff --git a/server/functions.php b/server/functions.php index 4202fa8..fea5be1 100755 --- a/server/functions.php +++ b/server/functions.php @@ -215,28 +215,29 @@ function delete_entry($user, $login, $access_token) return false; } - $db_ac = $db->querySingle("SELECT access_token FROM gpass WHERE login='" . $login . "'"); - if (strlen($db_ac) != 0 && strcmp($db_ac, $access_token)) + if ($USE_SHADOW_LOGINS) { - $db->close(); - echo "Bad access token"; + $db_ac = $db->querySingle("SELECT access_token FROM gpass WHERE login='" . $login . "'"); + if (strlen($db_ac) != 0 && strcmp($db_ac, $access_token)) + { + $db->close(); + echo "Bad access token"; + return false; + } + } + + $result = $db->query("DELETE FROM gpass WHERE login='" . $login . "'"); + $db->close(); + + if ($result == FALSE) + { + echo "Error " . $db->lastErrorMsg(); return false; } else { - $result = $db->query("DELETE FROM gpass WHERE login='" . $login . "'"); - $db->close(); - - if ($result == FALSE) - { - echo "Error " . $db->lastErrorMsg(); - return false; - } - else - { - echo "OK"; - return true; - } + echo "OK"; + return true; } }