Beispiel #1
0
function oauth_process($url, $post_data = false)
{
    if ($post_data === true) {
        $post_data = array();
    }
    user_oauth_sign($url, $post_data);
    $ch = curl_init($url);
    if ($post_data !== false) {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 0);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_USERAGENT, 'zlbnc');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    $response = curl_exec($ch);
    $response_info = curl_getinfo($ch);
    curl_close($ch);
    if (intval($response_info['http_code']) == 200) {
        $json = json_decode($response);
        if ($json) {
            return $json;
        }
        return $response;
    } else {
        delCookie('bOauth');
        header('location: index.php?ln=error');
    }
}
Beispiel #2
0
function resetStyle()
{
    delCookie("headerBg");
    delCookie("bodyBg");
    delCookie("linkColor");
    delCookie("linkHColor");
    delCookie("wordColor");
}
Beispiel #3
0
function actLogout()
{
    $time = time() - 300;
    delCookie('bOauth');
    delCookie('twitterID');
    delCookie('twitterPW');
    delCookie('friends_count');
    delCookie('statuses_count');
    delCookie('followers_count');
    delCookie('imgurl');
    delCookie('name');
    header('location: ../index.php');
}
Beispiel #4
0
<?php

include 'lib/twitese.php';
$time = time() - 300;
delCookie('twitese_name');
delCookie('twitese_pw');
delCookie('friends_count');
delCookie('statuses_count');
delCookie('followers_count');
delCookie('imgurl');
delCookie('name');
delCookie('oauth_token');
delCookie('oauth_token_secret');
delCookie('user_id');
delCookie('screen_name');
session_destroy();
header('location: login.php');
Beispiel #5
0
		<?php 
            $apiUrl = '';
            $rtStyle = 0;
            $showImg = 1;
            if (isset($_POST['apiurl_input'])) {
                $time = time() + 3600 * 24 * 30;
                $showImg = isset($_POST['show_img']) && $_POST['show_img'] == "on" ? 1 : 0;
                setcookie("rt_style", $_POST['rt_style'], $time);
                setcookie("show_img", $showImg, $time);
                if (preg_match("/^http:\\/\\/[A-Za-z0-9]+\\.[A-Za-z0-9]+[\\/=\\?%\\-&_~`@[\\]\\':+!]*([^<>\"])*\$/", $_POST['apiurl_input'])) {
                    $time = time() + 3600 * 24 * 30;
                    setcookie("apiurl", $_POST['apiurl_input'], $time);
                    echo "<div id=\"sentTip\">修改配置成功</div>";
                } else {
                    if (trim($_POST['apiurl_input']) == '') {
                        delCookie('apiurl');
                        $apiUrl = '';
                        echo "<div id=\"sentTip\">修改配置成功</div>";
                    } else {
                        echo "<div id=\"sentTip\">修改配置失败,API URL不合法</div>";
                    }
                }
            }
            if (isset($_COOKIE['apiurl'])) {
                $apiUrl = $_COOKIE['apiurl'];
            }
            if (isset($_COOKIE['rt_style']) && $_COOKIE['rt_style'] == 1) {
                $rtStyle = 1;
            }
            if (isset($_COOKIE['show_img']) && $_COOKIE['show_img'] == 0) {
                $showImg = 0;
Beispiel #6
0
<?php

include 'lib/twitese.php';
delCookie('oauth_token');
delCookie('oauth_token_secret');
delCookie('user_id');
delCookie('friends_count');
delCookie('statuses_count');
delCookie('followers_count');
delCookie('imgurl');
delCookie('name');
delCookie('listed_count');
delCookie('recover');
delCookie('homeInterval');
delCookie('updatesInterval');
session_destroy();
ob_start();
if (!isset($_SESSION)) {
    session_start();
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<meta name="keywords" content="embr, open source, php, twitter, oauth" />
<meta name="description" content="Vivid Interface for Twitter" />
<meta name="author" content="Contributors" />
<title>Embr / Sign In</title>
<style>
*{list-style:none outside none;margin:0;padding:0;}
Beispiel #7
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
include '../lib/twitese.php';
if (trim(SECURE_KEY) == "") {
    echo 'unsecured';
} else {
    //header('location: ../pr.php?pr='.urlencode(print_r($_POST,true)));
    if (isset($_POST)) {
        if ($_POST['reset'] == 'true') {
            delCookie('Tip_Title');
            delCookie('Tip_Content');
            delCookie('Tip_More');
            echo 'reset';
            exit;
        }
        $time = $_SERVER['REQUEST_TIME'] + 3600 * 24 * 365;
        setEncryptCookie('Tip_Title', $_POST['Tip_Title'], $time);
        setEncryptCookie('Tip_Content', $_POST['Tip_Content'], $time);
        setEncryptCookie('Tip_More', $_POST['Tip_More'], $time);
        echo 'success';
    } else {
        echo 'error';
    }
}