<?php

//============================================================================
// (c) 2009-2010, Eolya - All Rights Reserved.
// This source code is the property of Eolya.
// The license applying to this source code is available at :
// http://www.crawl-anywhere.com/licenses/
//============================================================================
require_once "../../../init_gpc.inc.php";
require_once "../../../init.inc.php";
$action = POSTGET("action");
if ($action == "dropboxlinkstep1") {
    $callback = $config->get("dropbox.callbackurl");
    $url = $config->get("crawlerws.rooturl");
    $url .= "/?action=" . $action;
    $url .= "&callback=" . $callback;
    $xmlstr = readurl($url);
    try {
        $xml = new SimpleXMLElement($xmlstr);
    } catch (Exception $e) {
        $cLog->log("Error - sources_dropbox.ajax;inc.php - action = " . $action . " - invalid xml - " . $url . " - " . $xmlstr);
    }
    if ($xml->errno == '0') {
        $arr = array('status' => 'success', 'info_url' => (string) $xml->info_url, 'timestamp' => (string) $xml->timestamp);
    } else {
        $arr = array('status' => 'error');
    }
    echo json_encode($arr);
    exit;
}
if ($action == "dropboxlinkstep2") {
Exemplo n.º 2
0
        if ($debug) {
            print "</br>" . $debug_msg;
        }
        exit;
    }
    $ret = "<?xml version=\"1.0\" encoding=\"utf-8\"?><result>";
    $ret .= "<status>ok</status>";
    $ret .= "<id>" . $id . "</id></result>";
    echo $ret;
    exit;
}
//TODO: V4
if ($action == "delete_account") {
    $id = POSTGET("account_id");
    $full_delete = false;
    if (POSTGET("full") == "1") {
        $full_delete = true;
    }
    $debug_msg = "";
    $db = db_connect($config, "", "", "");
    if ($db) {
        $stmt = new db_stmt_update("accounts");
        $stmt->addColumnValue("deleted", "1");
        $stmt->addColumnValue("deletedtime", "", NOW);
        $stmt->setWhereClause("id = '" . $id . "'");
        $s = $stmt->getStatement();
        $rs = $db->Execute($s);
        if (!$rs) {
            $ret = "<?xml version=\"1.0\" encoding=\"utf-8\"?><result>";
            $ret .= "<status>ko</status></result>";
            echo $ret;
Exemplo n.º 3
0
<?php

require_once "../init_gpc.inc.php";
require_once "../init.inc.php";
require_once "themes/theme.class.inc.php";
require_once "themes/" . $theme_name . "/theme_" . $theme_name . ".class.inc.php";
$theme = new Theme($config, $user, $id_account_current, $db);
$uid = POSTGET("uid");
$oauth_token = POSTGET("oauth_token");
$not_approved = POSTGET("not_approved");
echo $theme->generateHtmlStart();
?>

<script type="text/javascript">
<!--

// onLoad
$(document).ready(function(){ 
<?php 
if ($not_approved == 'true') {
    ?>
	$( '#token_uid', window.opener.document ).val('not_approved');	
	$( '#status_dropbox_step1_status', window.opener.document).html("<img src='images/error_12.png'>&nbsp;<span class='help'>Access to Dropbox was denied !</span>");
<?php 
} else {
    ?>
	$( '#token_uid', window.opener.document ).val('<?php 
    echo $uid;
    ?>
');	
	$( '#dropbox_continue', window.opener.document ).removeAttr("disabled");