<?php
/*********************************************
Desciption: Verificação de conta de e-mail
File: /gestao/clientes/gerir/v.email/index.php
Project: Kompras.net
Developers: João Vieira	
Start Date: 2009/05/02
*********************************************/

if ( !isset($connectDb) ) require_once($_SERVER['DOCUMENT_ROOT'] . "/bsk/includes/configuracao.default.php");

require_once($_SERVER['DOCUMENT_ROOT'] . "/bsk/includes/funcoes.default.php");

formAntiInjection($authHosts);

$identificador  = 0;
$resposta       = trim(strtolower($_REQUEST['bxEmail']));

if (isset($_GET['id'])) $identificador  = (int)$_GET['id'];

$devolve = 'true';

$sqlStmt    = "SELECT id FROM utilizadores WHERE email LIKE '" . $resposta . "' ";
if ( $identificador > 0 ) $sqlStmt .= " AND id <> '" . $identificador . "'";

$resultDb   = $connectDb->pedido($sqlStmt);
if ( !isset($_GET['inverso']) ) {
    if ($resultDb->rowCount() > 0) $devolve = 'false';
}else {
    if ($resultDb->rowCount() < 1) $devolve = 'false';
}
print $devolve;
?> 
