예제 #1
0
파일: ajax.php 프로젝트: jnpdx/combotweet
    $panel_user = $_REQUEST['user'];
    $panel_pass = $_REQUEST['pass'];
    $new_panel = new Panel();
    $new_panel->user = $panel_user;
    $new_panel->pass = $panel_pass;
    $new_panel->id = $panel_id;
    $new_panel->panel_type = 'shizzow_panel';
    $_SESSION['panels'][$panel_id] = $new_panel;
    echo "REG_SHIZZOW_PANEL";
} elseif ($func == 'check_login') {
    header("Content-type: text/javascript");
    echo check_twitter_user($_REQUEST['user'], $_REQUEST['pass']);
} elseif ($func == 'get_twitter_user_info') {
    $user = $_REQUEST['user'];
    header("Content-type: text/javascript");
    echo get_twitter_user_info($user);
} elseif ($func == 'get_search_panel') {
    $panel_id = $_REQUEST['panel_id'];
    $panel_user = $_REQUEST['search_term'];
    $panel_pass = '******';
    $new_panel = new Panel();
    $new_panel->user = $panel_user;
    $new_panel->pass = $panel_pass;
    $new_panel->id = $panel_id;
    $new_panel->panel_type = 'search';
    $_SESSION['panels'][$panel_id] = $new_panel;
    display_search_panel($new_panel);
} elseif ($func == 'get_tweets') {
    $panel_id = $_REQUEST['panel'];
    $page = $_REQUEST['page'];
    $location = $_REQUEST['location'];
예제 #2
0
            $tok = $to->getAccessToken();
            /* Save the access tokens. Normally these would be saved in a database for future use. */
            $_SESSION['oauth']['oauth_access_token'] = $tok['oauth_token'];
            $_SESSION['oauth']['oauth_access_token_secret'] = $tok['oauth_token_secret'];
        }
        //echo "whoa - it got returned!";
        $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION['oauth']['oauth_access_token'], $_SESSION['oauth']['oauth_access_token_secret']);
        /* Run request on twitter API as user. */
        $content = json_decode($to->OAuthRequest('https://twitter.com/account/verify_credentials.json', array(), 'GET'));
        //var_dump( $content );
        //register the panel in the normal way
        require_once dirname(__FILE__) . "/../structs.php";
        require_once dirname(__FILE__) . "/../twitter_tools.php";
        $panel_id = $content->screen_name;
        $panel_user = $content->screen_name;
        $panel_pass = '******';
        $new_panel = new Panel();
        $new_panel->user = $panel_user;
        $new_panel->pass = $panel_pass;
        $new_panel->id = $panel_id;
        $new_panel->oauth = $to;
        $new_panel->gen_info = json_decode(get_twitter_user_info($panel_user));
        //need to check user credentials
        //$legit_user = check_twitter_user($panel_user,$panel_pass);
        $_SESSION['panels'][$panel_id] = $new_panel;
        //var_dump($new_panel);
        //display_panel($new_panel);
        //echo $content;
        header('Location: ' . $_SESSION['client_url']);
        break;
}