Exemplo n.º 1
0
function lookup($num_processo)
{
    // include library simple HTML DOM
    include 'simple_html_dom.php';
    //enconding in UTF-8 so carachters with accent are shown correctly
    header('Content-Type: text/html; charset=utf-8');
    //Establishing the correct url to be called
    $url = call_url($num_processo);
    // Create DOM from URL or file
    $html = file_get_html($url);
    //creating array with desired info
    $dados = call_dados($html, $num_processo);
    // exiting Simple HTML DOM PHP
    $html->clear();
    unset($html);
    // return dados
    return $dados;
}
Exemplo n.º 2
0
/**
 * checks email/ip for spammer status
 * 
 * @param type $register_email
 * @param type $register_ip
 * @param type $checkemail
 * @return boolean
 */
function check_spammer($register_email, $register_ip, $checkemail = true)
{
    $spammer = false;
    if ($checkemail) {
        $email_whitelisted = is_email_whitelisted($register_email);
    } else {
        $email_whitelisted = true;
    }
    $ip_whitelisted = is_ip_whitelisted($register_ip);
    if ($email_whitelisted && $ip_whitelisted) {
        // short circuit
        return true;
    }
    //Mail domain blacklist
    if (elgg_get_plugin_setting('use_mail_domain_blacklist', PLUGIN_ID) == "yes" && !$email_whitelisted) {
        $blacklistedMailDomains = preg_split('/\\s+/', strip_spaces(strip_tags(elgg_get_plugin_setting('blacklisted_mail_domains', PLUGIN_ID))), -1, PREG_SPLIT_NO_EMPTY);
        $mailDomain = explode("@", $register_email);
        foreach ($blacklistedMailDomains as $domain) {
            if ($mailDomain[1] == $domain) {
                register_error(elgg_echo('spam_login_filter:access_denied_domain_blacklist'));
                notify_admin($register_email, $register_ip, "Internal domain blacklist");
                $spammer = true;
                break;
            }
        }
    }
    if (!$spammer) {
        //Mail blacklist
        if (elgg_get_plugin_setting('use_mail_blacklist', PLUGIN_ID) == "yes" && !$email_whitelisted) {
            $blacklistedMails = preg_split('/\\s+/', strip_spaces(strip_tags(elgg_get_plugin_setting('blacklisted_mails', PLUGIN_ID))), -1, PREG_SPLIT_NO_EMPTY);
            foreach ($blacklistedMails as $blacklistedMail) {
                if ($blacklistedMail == $register_email) {
                    register_error(elgg_echo('spam_login_filter:access_denied_mail_blacklist'));
                    notify_admin($register_email, $register_ip, "Internal e-mail blacklist");
                    $spammer = true;
                    break;
                }
            }
        }
    }
    if (!$spammer) {
        //StopForumSpam
        if (elgg_get_plugin_setting('use_stopforumspam', PLUGIN_ID) == "yes") {
            //check the e-mail adress
            $url = "http://www.stopforumspam.com/api?email=" . $register_email . "&f=json";
            $return = call_url($url);
            if ($return != false) {
                $data = json_decode($return);
                $email_frequency = $data->email->frequency;
                if ($email_frequency != '0' && !$email_whitelisted) {
                    register_error(elgg_echo('spam_login_filter:access_denied_mail_blacklist'));
                    notify_admin($register_email, $register_ip, "Stopforumspam e-mail blacklist");
                    $spammer = true;
                }
            }
            if (!$spammer && !$ip_whitelisted) {
                //e-mail not found in the database, now check the ip
                $url = "http://www.stopforumspam.com/api?ip=" . $register_ip . "&f=json";
                $return = call_url($url);
                if ($return != false) {
                    $data = json_decode($return);
                    $ip_frequency = $data->ip->frequency;
                    if ($ip_frequency != '0') {
                        register_error(elgg_echo('spam_login_filter:access_denied_ip_blacklist'));
                        notify_admin($register_email, $register_ip, "Stopforumspam IP blacklist");
                        $spammer = true;
                    }
                }
            }
        }
    }
    return $spammer ? false : true;
}
Exemplo n.º 3
0
/**
 * checks email/ip for spammer status
 * 
 * @param type $register_email
 * @param type $register_ip
 * @param type $checkemail
 * @return boolean
 */
function check_spammer($register_email, $register_ip, $checkemail = true)
{
    if ($checkemail) {
        $email_whitelisted = is_email_whitelisted($register_email);
        if ($email_whitelisted) {
            return true;
            // not a spammer, no need for any further checks
        }
    }
    $ip_whitelisted = is_ip_whitelisted($register_ip);
    if ($ip_whitelisted) {
        // not a spammer, no need for any further checks
        return true;
    }
    // check ip cache
    $blacklisted = elgg_get_annotations(array('guid' => elgg_get_site_entity()->guid, 'annotation_names' => array('spam_login_filter_ip'), 'annotation_values' => array($register_ip)));
    if ($blacklisted) {
        register_error(elgg_echo('spam_login_filter:access_denied_ip_blacklist'));
        notify_admin($register_email, $register_ip, "Internal IP blacklist");
        return false;
    }
    //Mail domain blacklist
    if (elgg_get_plugin_setting('use_mail_domain_blacklist', PLUGIN_ID) == "yes") {
        $blacklistedMailDomains = preg_split('/\\s+/', strip_spaces(strip_tags(elgg_get_plugin_setting('blacklisted_mail_domains', PLUGIN_ID))), -1, PREG_SPLIT_NO_EMPTY);
        $mailDomain = explode("@", $register_email);
        foreach ($blacklistedMailDomains as $domain) {
            if ($mailDomain[1] == $domain) {
                register_error(elgg_echo('spam_login_filter:access_denied_domain_blacklist'));
                notify_admin($register_email, $register_ip, "Internal domain blacklist");
                return false;
                break;
            }
        }
    }
    //Mail blacklist
    if (elgg_get_plugin_setting('use_mail_blacklist', PLUGIN_ID) == "yes") {
        $blacklistedMails = preg_split('/\\s+/', strip_spaces(strip_tags(elgg_get_plugin_setting('blacklisted_mails', PLUGIN_ID))), -1, PREG_SPLIT_NO_EMPTY);
        foreach ($blacklistedMails as $blacklistedMail) {
            if ($blacklistedMail == $register_email) {
                register_error(elgg_echo('spam_login_filter:access_denied_mail_blacklist'));
                notify_admin($register_email, $register_ip, "Internal e-mail blacklist");
                return false;
                break;
            }
        }
    }
    //StopForumSpam
    if (elgg_get_plugin_setting('use_stopforumspam', PLUGIN_ID) == "yes") {
        //check the e-mail adress
        $url = "http://www.stopforumspam.com/api?email=" . $register_email . "&f=json";
        $return = call_url($url);
        if ($return != false) {
            $data = json_decode($return);
            $email_frequency = $data->email->frequency;
            if ($email_frequency != '0') {
                register_error(elgg_echo('spam_login_filter:access_denied_mail_blacklist'));
                notify_admin($register_email, $register_ip, "Stopforumspam e-mail blacklist");
                return false;
            }
        }
        //e-mail not found in the database, now check the ip
        $url = "http://www.stopforumspam.com/api?ip=" . $register_ip . "&f=json";
        $return = call_url($url);
        if ($return != false) {
            $data = json_decode($return);
            $ip_frequency = $data->ip->frequency;
            if ($ip_frequency != '0') {
                register_error(elgg_echo('spam_login_filter:access_denied_ip_blacklist'));
                notify_admin($register_email, $register_ip, "Stopforumspam IP blacklist");
                // cache this ip
                elgg_get_site_entity()->annotate('spam_login_filter_ip', $register_ip, ACCESS_PUBLIC);
                return false;
            }
        }
    }
    // passed all the tests
    return true;
}
Exemplo n.º 4
0
        }
        $url = Bootstrap::$main->getConfig('protocol') . '://' . $_SERVER['HTTP_HOST'] . $root . 'user/' . $_GET['_login'];
        $url .= '?redirect=' . $redirect;
        $referer = ['u' => 1, 's' => $_GET['_referer']];
        if (isset($_SERVER['SERVER_SOFTWARE']) && strstr(strtolower($_SERVER['SERVER_SOFTWARE']), 'engine')) {
            require_once 'google/appengine/api/users/User.php';
            require_once 'google/appengine/api/users/UserService.php';
            $mail = UserService::getCurrentUser()->getNickname();
            $user = new userModel();
            $u = $user->find_one_by_email(strtolower($mail));
            if (isset($u['id'])) {
                $referer['u'] = $u['id'];
            }
        }
        $url .= '&referer=' . urlencode(base64_encode(json_encode($referer)));
        call_url($url);
    }
}
?>
<form method="GET" style="margin:3em">
    <input type="radio" name="_login" <?php 
if (!isset($_GET['_login']) || $_GET['_login'] == 'facebook') {
    echo 'checked';
}
?>
 value="facebook"/> Login Facebook
    &nbsp; | &nbsp;
    <input type="radio" name="_login" <?php 
if (isset($_GET['_login']) && $_GET['_login'] == 'google') {
    echo 'checked';
}
Exemplo n.º 5
0
Arquivo: tj4.php Projeto: nailton/TJ
<?php

// require common code
require_once "Comon/common.php";
// include library simple HTML DOM
include 'simple_html_dom.php';
//enconding in UTF-8 so carachters with accent are shown correctly
header('Content-Type: text/html; charset=utf-8');
// calling function to fetch information from process
$num_processo = $_GET["id"];
//Establishing the correct url to be called
$url = call_url($num_processo);
// Create DOM from URL or file
$html = file_get_html($url);
//quando ha mais de um processo com o mesmo numero
//classe do segundo processo
$dados[7] = $html->find('#classeProcessual_1_1_2', 0)->value;
if ($dados[7] != NULL) {
    //classe do primeiro processo
    $dados[5] = $html->find('#classeProcessual_1_1_1', 0)->value;
    //numero do primeiro processo
    $dados[6] = $html->find('#processo_1_1_1', 0)->value;
    //numero do segundo processo
    $dados[8] = $html->find('#processo_1_1_2', 0)->value;
} else {
    //Nome do reu do primeiro processo
    $dados[5] = $html->find('#autor_1_1_1', 0)->value;
    //numero do primeiro processo
    $dados[6] = $html->find('#processo_1_1_1', 0)->value;
    //Nome da reu do segundo processo
    $dados[7] = $html->find('#autor_1_2_1', 0)->value;