Beispiel #1
0
 /**
  * 获取分享弹出框html,同时需要读取用户相互关注粉丝
  */
 function ajax_share_content()
 {
     $id = @$GLOBALS['G']['url_args'][0];
     if (empty($id)) {
         exit;
     }
     $_SESSION['share_id'] = $id;
     if (@$_SESSION['islogined']) {
         $token = ck::get('token');
         $c = new SaeTClientV2(Sconfig::$weibo['APPKEY'], Sconfig::$weibo['APPSECRET'], $token['access_token']);
         //TODO: 获取用户互相关注用户列表
         $friends = $c->bilateral($token['uid'], 1, 100);
         $this->friends = $friends['users'];
         $ext_info = gClass('ExtStorage')->find_one($id);
         $detailpicArr = json_decode($ext_info['descpic'], true);
         $ext_info['detailpic'] = $detailpicArr[0];
         $this->ext_info = $ext_info;
         //授权用户详细信息
         $userinfo = $c->show_user_by_id($token['uid']);
         //取得微博发布内容
         require SITE_PATH . 'include/weibo_content.php';
         $this->weibo_content = rand_content($cfg_content, $this->ext_info);
         $nick = !empty($userinfo['screen_name']) ? $userinfo['screen_name'] : $userinfo['name'];
         exit(json_encode(array('status' => 'success', 'html' => $this->display('extensions/share.html', false), 'nick' => $nick)));
     }
     exit(json_encode(array('status' => 'error', 'msg' => '未登录')));
 }
Beispiel #2
0
        //Ninja Mode
    //Ninja Mode
    case 2:
        header("HTTP/1.1 404 Not Found");
        echo 'HTTP/1.1 404 Not Found';
        break;
        //HTTP Tarpit
    //HTTP Tarpit
    case 3:
        $rand_num = rand(0, 3);
        if (3 == $rand_num) {
            //Ask for unneccessary authentication
            header("HTTP/1.1 401 Not Authorized");
            header('WWW-Authenticate: realm="My Realm"');
            echo 'HTTP/1.1 401 Not Authorized' . "\n";
            rand_content();
            break;
        }
        //Reply with random keep conection open status code.
        if (!$debug) {
            header("HTTP/1.1 10{$rand_num}");
            if (1 == $rand_num) {
                header("Upgrade: HTTP/2.0");
            }
            //Ask client to request the page again.
        } else {
            echo "HTTP/1.1 10{$rand_num}";
        }
        break;
}
die;