예제 #1
0
function fyy_assistant_delus()
{
    $key = option::xget('fyy_assistant', 'key');
    foreach ($_POST['user'] as $uid) {
        $usname = $m->once_fetch_array("SELECT `name` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `id` = '{$uid}'");
        $post = new wcurl("{$murl}?pub_plugin=fyy_massistant&delus&key={$key}&stname=" . SYSTEM_NAME . "&usname={$usname}");
        $a = $post->exec();
    }
}
예제 #2
0
function cron_mok_zdwk()
{
    //如果今天签到过了直接返回日志
    if (option::get('mok_zdwk_run') == date('d')) {
        return option::get('mok_zdwk_log');
    }
    global $m;
    $prefix = DB_PREFIX;
    //选出用户的options和bduss
    $res = $m->query("SELECT {$prefix}users_options.`name` , {$prefix}users_options.`value` , {$prefix}baiduid.`bduss` \nFROM {$prefix}baiduid\nINNER JOIN {$prefix}users_options ON {$prefix}users_options.uid = {$prefix}baiduid.uid\nWHERE {$prefix}users_options.`name` =  'mok_zdwk_wk'\nOR {$prefix}users_options.`name` =  'mok_zdwk_zd'");
    $wk = $zd = 0;
    $bduss = array();
    if ($m->num_rows($res) != 0) {
        while ($row = $res->fetch_array()) {
            //判断该选项是否开启
            if ($row['value'] == 'on') {
                //记录bduss(数量),如果bduss数组内没有该bduss,则加入数组
                if (!in_array($row['bduss'], $bduss)) {
                    $bduss[] = $row['bduss'];
                }
                if ($row['name'] === 'mok_zdwk_wk') {
                    $wk++;
                    $head = array('Accept:*/*', 'Accept-Encoding:gzip, deflate, sdch', 'Accept-Language:zh-CN,zh;q=0.8', 'Connection:keep-alive', 'Host:wenku.baidu.com', 'Referer:http://wenku.baidu.com/task/browse/daily', 'User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36', 'X-Requested-With:XMLHttpRequest');
                    $c = new wcurl('http://wenku.baidu.com/task/submit/signin', $head);
                    $c->addCookie('BDUSS=' . $row['bduss']);
                    $c->exec();
                    $c->close();
                } else {
                    if ($row['name'] === 'mok_zdwk_zd') {
                        $zd++;
                        $c = new wcurl('http://zhidao.baidu.com/');
                        $c->addCookie('BDUSS=' . $row["bduss"]);
                        $stoken = $c->get();
                        $c->close();
                        $stoken = textMiddle($stoken, '"stoken":"', '",');
                        if ($stoken != "") {
                            $c = new wcurl('http://zhidao.baidu.com/submit/user');
                            $c->addCookie('BDUSS=' . $row["bduss"]);
                            $c->post(array('cm' => '100509', 'utdata' => '90,90,102,96,107,101,99,97,96,90,98,103,103,99,127,106,99,99,14138554765830', 'stoken' => $stoken));
                            $c->close();
                        }
                    }
                }
            }
        }
    }
    $log = "知道、文库签到完毕<br/>" . date("Y-m-d H:i:s") . "<br/>共计百度账号: " . count($bduss) . " 个<br/>知道签到: {$zd} 个<br/>文库签到: {$wk} 个";
    option::set('mok_zdwk_run', date('d'));
    option::set('mok_zdwk_log', $log);
    return $log;
}
예제 #3
0
function verifyTiezi_gettie($tid, $ck)
{
    $c = new wcurl('http://tieba.baidu.com/mo/m?kz=' . $tid, array('User-Agent: Chinese F*****g Phone'));
    $c->addcookie('BDUSS=' . $ck);
    $t = $c->exec();
    preg_match('/<form action=\\"(.*?)\\" method=\\"post\\">/', $t, $formurl);
    preg_match('/<input type=\\"hidden\\" name=\\"ti\\" value=\\"(.*?)\\"\\/>/', $t, $ti);
    preg_match('/<input type=\\"hidden\\" name=\\"src\\" value=\\"(.*?)\\"\\/>/', $t, $src);
    preg_match('/<input type=\\"hidden\\" name=\\"word\\" value=\\"(.*?)\\"\\/>/', $t, $word);
    preg_match('/<input type=\\"hidden\\" name=\\"tbs\\" value=\\"(.*?)\\"\\/>/', $t, $tbs);
    preg_match('/<input type=\\"hidden\\" name=\\"fid\\" value=\\"(.*?)\\"\\/>/', $t, $fid);
    preg_match('/<input type=\\"hidden\\" name=\\"z\\" value=\\"(.*?)\\"\\/>/', $t, $z);
    preg_match('/<input type=\\"hidden\\" name=\\"floor\\" value=\\"(.*?)\\"\\/>/', $t, $floor);
    return array('__formurl' => $formurl[1], 'co' => '', 'ti' => $ti[1], 'src' => $src[1], 'word' => $word[1], 'tbs' => $tbs[1], 'ifpost' => '1', 'ifposta' => '0', 'post_info' => '0', 'tn' => 'baiduWiseSubmit', 'fid' => $fid[1], 'verify' => '', 'verify_2' => '', 'pinf' => '1_2_0', 'pic_info' => '', 'z' => $z[1], 'last' => '0', 'pn' => '0', 'r' => '0', 'see_lz' => '0', 'no_post_pic' => '0', 'floor' => $floor[1], 'sub1' => '回贴');
}
예제 #4
0
     }
     if (file_exists($floderName . '/app.conf')) {
         unlink($floderName . '/app.conf');
     }
     if (file_exists($floderName . '/config.yaml')) {
         unlink($floderName . '/config.yaml');
     }
     //覆盖文件
     if (CopyAll($floderName, SYSTEM_ROOT) !== true) {
         DeleteFile(UPDATE_CACHE);
         msg('错误 - 更新失败:<br/><br/>无法更新文件');
     }
     DeleteFile(UPDATE_CACHE);
     //获取最新的版本号
     $c = new wcurl('http://kenvix.oschina.io/tieba-cloud-sign/');
     $data = json_decode($c->exec(), true);
     $c->close();
     //修改版本号
     option::set('vid', $data['vid']);
     //暂不支持更新脚本
     msg('恭喜您,更新成功!', SYSTEM_URL . 'index.php?mod=admin:update&ok');
     break;
 case 'admin:update:changeServer':
     if (isset($_GET['server'])) {
         option::set('update_server', $_GET['server']);
     }
     break;
 case 'baiduid:getverify':
     global $m;
     if (option::get('bduss_num') == '-1' && ROLE != 'admin') {
         msg('本站禁止绑定新账号');
 /**
  * 扫描指定PID的所有贴吧
  * @param $pid PID
  */
 public static function scanTiebaByPid($pid)
 {
     global $i;
     global $m;
     $cma = $m->once_fetch_array("SELECT * FROM `" . DB_PREFIX . "baiduid` WHERE `id` = '{$pid}';");
     $uid = $cma['uid'];
     $ubduss = $cma['bduss'];
     $isvip = self::isvip($uid);
     $pid = $cma['id'];
     $table = self::getTable($uid);
     $n3 = 1;
     $n = 0;
     $n2 = 0;
     $addnum = 0;
     $list = array();
     $o = option::get('tb_max');
     while (true) {
         $url = 'http://tieba.baidu.com/f/like/mylike?&pn=' . $n3;
         $n3++;
         $addnum = 0;
         $c = new wcurl($url, array('User-Agent: Phone XXX'));
         $c->addcookie("BDUSS=" . $ubduss);
         $ch = $c->exec();
         $c->close();
         preg_match_all('/\\<td\\>(.*?)\\<a href=\\"\\/f\\?kw=(.*?)\\" title=\\"(.*?)\\">(.*?)\\<\\/a\\>\\<\\/td\\>/', $ch, $list);
         foreach ($list[3] as $v) {
             $n++;
             if (!empty($o) && $isvip == false && $n > $o) {
                 break 2;
             }
             $v = addslashes(htmlspecialchars(mb_convert_encoding($v, "UTF-8", "GBK")));
             $osq = $m->once_fetch_array("SELECT COUNT(*) AS `C` FROM `" . DB_NAME . "`.`" . DB_PREFIX . $table . "` WHERE `uid` = " . $uid . " AND `pid` = '{$pid}' AND `tieba` = '{$v}';");
             if ($osq['C'] == '0') {
                 $m->query("INSERT INTO `" . DB_NAME . "`.`" . DB_PREFIX . $table . "` (`id`, `pid`, `uid`, `tieba`, `no`, `latest`) VALUES (NULL, {$pid}, " . $uid . ", '{$v}', 0, 0);");
             }
             $addnum++;
         }
         if ($n3 > 100) {
             break;
             //100页后重复
         }
         if (!isset($list[3][0])) {
             break;
             //完成
         } elseif ($o != 0 && $n2 >= $o && $isvip == false) {
             break;
             //超限
         }
         $n2 = $n2 + $addnum;
     }
 }
예제 #6
0
/**
 * 执行一个网络请求而不等待返回结果
 * @param string $url URL
 * @param string $post post数据包,留空为get
 * @param string $cookie cookies
 * @return bool fsockopen是否成功
 */
function sendRequest($url, $post = '', $cookie = '')
{
    if (function_exists('fsockopen')) {
        $matches = parse_url($url);
        $host = $matches['host'];
        if (substr($url, 0, 8) == 'https://') {
            $host = 'ssl://' . $host;
        }
        $path = $matches['path'] ? $matches['path'] . ($matches['query'] ? '?' . $matches['query'] : '') : '/';
        $port = !empty($matches['port']) ? $matches['port'] : 80;
        if (!empty($post)) {
            $out = "POST {$path} HTTP/1.1\r\n";
            $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
            $out .= "Host: {$host}\r\n";
            $out .= "Connection: Close\r\n\r\n";
            $out .= $post;
        } else {
            $out = "GET {$path} HTTP/1.1\r\n";
            $out .= "Host: {$host}\r\n";
            $out .= "Connection: Close\r\n\r\n";
        }
        $fp = fsockopen($host, $port);
        if (!$fp) {
            return false;
        } else {
            stream_set_blocking($fp, 0);
            stream_set_timeout($fp, 0);
            fwrite($fp, $out);
            fclose($fp);
            return true;
        }
    } else {
        $x = new wcurl($url);
        $x->set(CURLOPT_CONNECTTIMEOUT, 1);
        $x->set(CURLOPT_TIMEOUT, 1);
        $x->addcookie($cookie);
        if (empty($post)) {
            $x->post($post);
        } else {
            $x->exec();
        }
        return true;
    }
}
예제 #7
0
                    if (option::get('same_pid') == '2') {
                        echo '{"error":"-11","msg":"你已经绑定了这个百度账号或者该账号已被其他人绑定,若要重新绑定,请先解绑"}';
                    } elseif (option::get('same_pid') == '1' && $checkSame['uid'] == UID) {
                        echo '{"error":"-10","msg":"你已经绑定了这个百度账号,若要重新绑定,请先解绑"}';
                    }
                    die;
                }
            }
            $m->query("INSERT INTO `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` (`uid`,`bduss`,`name`) VALUES  (" . UID . ", '{$loginResult[1]}', '{$loginResult[2]}')");
            echo '{"error":"0","msg":"获取BDUSS成功","bduss":"' . $loginResult[1] . '","name":"' . $loginResult[2] . '"}';
        } else {
            echo '{"error":"' . $loginResult[0] . '","msg":"' . $loginResult[1] . '"}';
        }
        break;
    case 'admin:c_update:check':
        global $i;
        $c = new wcurl(SUPPORT_URL . 'getplug.php?m=ver&pname=' . $_GET['plug']);
        $cloud = json_decode($c->exec(), true);
        $c->close();
        if (empty($cloud['version'])) {
            die('未找到该产品信息');
        }
        echo '最新版本:' . $cloud['version'];
        if ($cloud['version'] > $i['plugins']['desc'][$_GET['plug']]['plugin']['version']) {
            echo '//' . $i['plugins']['desc'][$_GET['plug']]['plugin']['name'] . ' - 发现新版本//最新版本:' . $cloud['version'] . '<br/>版本描述:' . $cloud['whatsnew'] . '<br/>' . '本次更新需要支付 ' . $cloud['updateXB'] . ' XB。<a href="setting.php?mod=admin:cloud&upd=' . $_GET['plug'] . '">立即更新</a>';
        }
        break;
    default:
        msg('未定义操作');
        break;
}
예제 #8
0
        Redirect('index.php?mod=set&ok');
        break;
    case 'admin:testmail':
        global $i;
        $x = misc::mail($i['user']['email'], SYSTEM_FN . ' V' . SYSTEM_VER . ' - 邮件发送测试', '这是一封关于 ' . SYSTEM_FN . ' 的测试邮件,如果你收到了此邮件,表示邮件系统可以正常工作<br/><br/>站点地址:' . SYSTEM_URL, array('测试附件.txt' => '这是一个测试附件'));
        if ($x === true) {
            Redirect('index.php?mod=admin:set&mailtestok');
        } else {
            msg('邮件发送失败,发件日志:<br/>' . $x);
        }
        break;
    case 'admin:testbbs':
        global $i;
        $ch_url = SUPPORT_URL . 'getplug.php?m=check&user='******'bbs_us') . '&pw=' . option::get('bbs_pw');
        $c = new wcurl($ch_url);
        $x = $c->exec();
        $c->close();
        if ($x == 'RIGHT') {
            Redirect('index.php?mod=admin:set&bbstestok');
        } else {
            if (empty($x)) {
                $x = '错误 - 与产品中心连接失败';
            }
            msg('错误 - ' . $x);
        }
        break;
}
if (ROLE == 'admin' && $i['mode'][0] == 'plugin') {
    option::pset($i['mode'][1], $_POST);
    Redirect("index.php?mod=admin:setplug&plug={$i['mode'][1]}&ok");
} elseif (ROLE == 'admin' && $i['mode'][0] == 'setplugin') {
예제 #9
0
			<th style="width:20%">功能 / 举例</th>
			<th style="width:15%">需求</th>
			<th style="width:15%">当前</th>
			<th style="width:50%">用途</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>连接百度服务器</td>
			<td>必须</td>
			<td>
				<?php 
if (function_exists('curl_exec')) {
    require_once SYSTEM_ROOT . '/lib/class.wcurl.php';
    $x = new wcurl('http://wappass.baidu.com/passport/', array('User-Agent: Phone' . mt_rand()));
    $result = $x->exec();
    $result = strpos($result, '登录百度帐号');
    if (!empty($result)) {
        echo '<font color="green">可用</font>';
    } else {
        echo '<font color="red">无法连接到百度服务器。请询问您的主机商。</font>';
    }
} else {
    echo '<font color="red">请先联系您的主机商开启cURL功能。</font>';
}
?>
			</td>
			<td>执行签到等</td>
		</tr>
</tbody>
</table>
        $allrow = $result->num_rows;
        $die = 0;
        $onrow = 0;
        while ($onrow < $allrow) {
            $thresult = $m->fetch_array($result);
            $bduss = $thresult['bduss'];
            $bdid = getBaiduId($bduss);
            sleep($sleep);
            if (empty($bdid)) {
                $stname = $m->once_fetch_array("SELECT `stname` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "allinfo` WHERE `bduss`='{$bduss}'");
                $stname = $stname['stname'];
                $sturl = $m->once_fetch_array("SELECT `sturl` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "fyy_massistant_url` WHERE `stname`='{$stname}'");
                $sturl = $sturl['sturl'];
                $bdname = $thresult['bdname'];
                $post = new wcurl("{$sturl}?pub_plugin=fyy_assistant&del&key={$key}&bdname={$bdname}");
                $a = $post->exec();
                $die++;
                $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "allinfo` WHERE `bduss` = '{$bduss}'");
                sleep($sleep);
            }
            $onrow++;
        }
        echo '</br><div class="alert alert-success">为您检测了' . "{$allrow}条绑定信息,其中有{$die}条失效,已经删除</div>";
    }
    ?>
	<h3>删除用户</h3></br>
	1.<font color="red">严禁</font>使用非本页提供的方式删除用户</br>
	2.您可以先使用<a href="<?php 
    echo SYSTEM_URL;
    ?>
index.php?pub_plugin=fyy_assistant">忘记站点</a>功能来查找用户</br></br>
     $uid = $one['uid'];
     $t = $m->once_fetch_array("SELECT `t` FROM  `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE  `id` = '{$uid}'");
     if (empty($t)) {
         $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `bduss` = '{$bduss}'");
     } else {
         $t = $t['t'];
         $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . $t . "` WHERE `pid` = '{$pid}'");
     }
 } else {
     $bduss = $one['bduss'];
     $uid = $one['uid'];
     $info = $m->once_fetch_array("SELECT `name`,`email` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `id` = '{$uid}'");
     $usname = $info['name'];
     $email = $info['email'];
     $post2 = new wcurl("{$murl}?pub_plugin=fyy_massistant&bind&key={$key}&stname=" . SYSTEM_NAME . "&usname={$usname}&bduss={$bduss}&bdname={$bdname}&email={$email}");
     $a2 = $post2->exec();
     sleep(0.015);
     if ($a2 == 'found') {
         /*重复绑定*/
         $pid = $one['id'];
         $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `id` = '{$pid}'");
         /* AND `bduss` = '{$bduss}'*/
         $uid = $one['uid'];
         $t = $m->once_fetch_array("SELECT `t` FROM  `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE  `id` = '{$uid}'");
         if (empty($t)) {
             $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `bduss` = '{$bduss}'");
         } else {
             $t = $t['t'];
             $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . $t . "` WHERE `pid` = '{$pid}'");
         }
     }
예제 #12
0
 /**
  * 网页签到
  */
 public static function DoSign_Default($uid, $kw, $id, $pid, $fid, $ck)
 {
     global $m, $today;
     $cookie = array('BDUSS' => $ck, 'BAIDUID' => strtoupper(md5(time())));
     $ch = new wcurl('http://tieba.baidu.com/mo/m?kw=' . urlencode($kw) . '&fid=' . $fid, array('User-Agent: f**k phone', 'Referer: http://wapp.baidu.com/', 'Content-Type: application/x-www-form-urlencoded'));
     $ch->addcookie($cookie);
     $s = $ch->exec();
     $ch->close();
     preg_match('/\\<td style=\\"text-align:right;\\"\\>\\<a href=\\"(.*)\\"\\>签到\\<\\/a\\>\\<\\/td\\>\\<\\/tr\\>/', $s, $s);
     if (isset($s[1])) {
         $ch = new wcurl('http://tieba.baidu.com' . $s[1], array('Accept: text/html, application/xhtml+xml, */*', 'Accept-Language: zh-Hans-CN,zh-Hans;q=0.8,en-US;q=0.5,en;q=0.3', 'User-Agent: F*****g Phone'));
         $ch->addcookie($cookie);
         $ch->exec();
         $ch->close();
         //临时判断解决方案
         $ch = new wcurl('http://tieba.baidu.com/mo/m?kw=' . urlencode($kw) . '&fid=' . $fid, array('User-Agent: f**k phone', 'Referer: http://wapp.baidu.com/', 'Content-Type: application/x-www-form-urlencoded'));
         $ch->addcookie($cookie);
         $s = $ch->exec();
         $ch->close();
         //如果找不到这段html则表示没有签到则stripos()返回false,同时is_bool()返回true,最终返回false
         return !is_bool(stripos($s, '<td style="text-align:right;"><span >已签到</span></td>'));
     } else {
         return true;
     }
 }