Exemple #1
0
 function wp_login_failed_notify()
 {
     date_default_timezone_set('PRC');
     $admin_email = get_bloginfo('admin_email');
     $to = $admin_email;
     $subject = '您的博客 ' . get_option("blogname") . ' 出现异常登录!异常时间:' . date("Y-m-d H:i:s");
     $message = '<p>您好!你的博客(' . get_option("blogname") . ')有登录错误!' . '请确定是您自己的登录失误,以防别人攻击!登录信息如下:</p>' . '<p>登录名:' . $_POST['log'] . '</p><p>' . '登录密码:' . $_POST['pwd'] . '</p><p>' . '登录时间:' . date("Y-m-d H:i:s") . '</p><p>' . '登录IP:' . bymt_getIP('Ip') . '(' . bymt_getIP('Isp') . ')</p><p>登录地址:' . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
     $wp_email = 'no-reply@' . preg_replace('#^www\\.#', '', strtolower($_SERVER['SERVER_NAME']));
     $from = "From: \"" . get_option('blogname') . "\" <{$wp_email}>";
     $headers = "{$from}\nContent-Type: text/html; charset=" . get_option('blog_charset') . "\n";
     wp_mail($to, $subject, $message, $headers);
 }
Exemple #2
0
function bymt_fuckspam($comment)
{
    if (is_user_logged_in()) {
        return $comment;
    }
    if (!isset($comment['comment_author_IP'])) {
        $comment['comment_author_IP'] = bymt_getIP('Ip');
    }
    if (!isset($comment['comment_agent'])) {
        $comment['comment_agent'] = $_SERVER['HTTP_USER_AGENT'];
    }
    if (wp_blacklist_check($comment['comment_author'], $comment['comment_author_email'], $comment['comment_author_url'], $comment['comment_content'], $comment['comment_author_IP'], $comment['comment_agent'])) {
        err(__('草你麻痹垃圾评论滚粗!'));
    } else {
        return $comment;
    }
}
Exemple #3
0
function add_votes_options()
{
    if (isset($_POST['action']) && $_POST['action'] == 'vote_comm') {
        $comm_id = (int) $_POST['commid'];
        if (!$comm_id) {
            echo 'e';
            die(0);
        }
        if (isset($_COOKIE["bymt_voted_" . $comm_id])) {
            echo 'h';
            die(0);
        }
        $c_rating = $_POST['rating'];
        if ($c_rating != 'up') {
            $c_rating == 'down';
        }
        if (is_user_logged_in()) {
            global $current_user;
            get_currentuserinfo();
            $cc_user = $current_user->user_login;
            $c_user = $cc_user . "[注册用户]";
            $c_email = $current_user->user_email;
            $cc_url = $current_user->user_url;
            $c_url = empty($cc_url) ? "#注册用户" : $cc_url;
        } else {
            $COOKIEHASH = md5("http://" . $_SERVER['HTTP_HOST']);
            if (isset($_COOKIE['comment_author_' . $COOKIEHASH]) && isset($_COOKIE['comment_author_email_' . $COOKIEHASH])) {
                $c_user = $_COOKIE['comment_author_' . $COOKIEHASH];
                $c_email = $_COOKIE['comment_author_email_' . $COOKIEHASH];
                if (isset($_COOKIE['comment_author_url_' . $COOKIEHASH])) {
                    $c_url = $_COOKIE['comment_author_url_' . $COOKIEHASH];
                } else {
                    $c_url = "nourl";
                }
            } else {
                $c_user = "******";
                $c_email = "noemail";
                $c_url = "#nourl";
            }
        }
        $c_ip = bymt_getIP('Ip');
        date_default_timezone_set('PRC');
        $c_time = date("Y-m-d H:i:s ", time());
        $add_vote = add_vote($comm_id, $c_user, $c_email, $c_url, $c_rating, $c_ip, $c_time);
        if ($add_vote == 'y') {
            setcookie("bymt_voted_" . $comm_id, $c_rating, time() + 86400, '/');
            echo 'y';
            die(0);
        }
        if ($add_vote == 'h') {
            setcookie("bymt_voted_" . $comm_id, $c_rating, time() + 86400, '/');
            echo 'h';
            die(0);
        }
        if ($add_vote == 'e') {
            echo 'n';
            die(0);
        }
    } else {
        echo 'e';
    }
    die(0);
}