protected function passFromDb($macHash, $hash, $time)
    {
        $database = DatabaseProvider::getDb();
        $where = "where oxid = " . $database->quote($macHash) . " and oxhash = " . $database->quote($hash);
        $query = "select 1 from oecaptcha " . $where;
        $pass = (bool) $database->getOne($query, false, false);

        if ($pass) {
            // cleanup
            $query = "delete from oecaptcha " . $where;
            $database->execute($query);
        }

        // garbage cleanup
        $query = "delete from oecaptcha where oxtime < $time";
        $database->execute($query);

        return $pass;
    }
protected function passFromDb($macHash, $hash, $time)
    {
        $database = DatabaseProvider::getDb();
        $where = "where oxid = " . $database->quote($macHash) . " and oxhash = " . $database->quote($hash);
        $query = "select 1 from oecaptcha " . $where;
        $pass = (bool) $database->getOne($query, false, false);

        if ($pass) {
            // cleanup
            $query = "delete from oecaptcha " . $where;
            $database->execute($query);
        }

        // garbage cleanup
        $query = "delete from oecaptcha where oxtime < $time";
        $database->execute($query);

        return $pass;
    }
protected function passFromDb ( $ macHash , $ hash , $ time ) { $ database = DatabaseProvider :: getDb ( ) ; $ where = "where oxid = " . $ database -> quote ( $ macHash ) . " and oxhash = " . $ database -> quote ( $ hash ) ; $ query = "select 1 from oecaptcha " . $ where ; $ pass = ( bool ) $ database -> getOne ( $ query , false , false ) ; if ( $ pass ) { // cleanup $ query = "delete from oecaptcha " . $ where ; $ database -> execute ( $ query ) ; } // garbage cleanup $ query = "delete from oecaptcha where oxtime < $time" ; $ database -> execute ( $ query ) ; return $ pass ; }
Checks for DB captcha hash validity

@param int    $macHash hash key
@param string $hash    captcha hash
@param int    $time    check time

@return bool
Checks for DB captcha hash validity