Exemple #1
0
function login_user($openid)
{
    require_once 'db/db_functions.php';
    $_SESSION['user_openid'] = $openid;
    $data = retrieve_user_data($openid);
    if ($data != '') {
        $data = unserialize($data['state']);
        $_SESSION['panels'] = $data['panels'];
    }
}
Exemple #2
0
    $panel_id = $_REQUEST['panel'];
    $tw_user = $_SESSION['panels'][$panel_id]->user;
    $tw_pass = $_SESSION['panels'][$panel_id]->pass;
    header("Content-type: text/javascript");
    echo get_shizzow_favorites($tw_user, $tw_pass);
} elseif ($func == "proxy_send_shout") {
    $panel_id = $_REQUEST['panel'];
    $tw_user = $_SESSION['panels'][$panel_id]->user;
    $tw_pass = $_SESSION['panels'][$panel_id]->pass;
    $shout = $_REQUEST['shout_text'];
    $location = $_REQUEST['loc'];
    header("Content-type: text/javascript");
    echo send_shout($tw_user, $tw_pass, $shout, $location);
} elseif ($func == 'load_state') {
    require_once 'db/db_functions.php';
    $data = retrieve_user_data("test_user");
    header("Content-type: text/javascript");
    if ($data == null) {
        echo json_encode('NO_SAVED_STATE');
    } else {
        $data = unserialize($data['state']);
        $_SESSION['panels'] = $data['panels'];
        $_SESSION['panels_data'] = $data['panels_data'];
        echo json_encode("LOADED_SAVED_STATE");
    }
} elseif ($func == 'save_state') {
    //save the session data to the user's openid in the db
    require_once 'db/db_functions.php';
    $_SESSION['panels_data'] = $_REQUEST['panels_data'];
    save_user($_SESSION['user_openid'], serialize($_SESSION));
    //save_user("test_user","test_data");