$DropboxInfo = $api->getRowById(390 , intval($_GET['dboxid']));

include_once $_SERVER['DOCUMENT_ROOT'].'/classes/StorageDropbox/src/Dropbox/autoload.php';

$oauth = new Dropbox_OAuth_PEAR($DropboxInfo['Collection_390_3'],$DropboxInfo['Collection_390_4']);
print_r($_SESSION);
$dropbox = new Dropbox_API($oauth);

$oauth->setToken($_SESSION['oauth_tokens']);

$tokens = $oauth->getAccessToken();

$q = "UPDATE Collection_390 SET Collection_390_6 = '".addslashes($tokens['token'])."' WHERE Collection_390_ID = '".intval($_GET['dboxid'])."'";
$dbh->query($q);

$q = "UPDATE Collection_390 SET Collection_390_7 = '".addslashes($tokens['token_secret'])."' WHERE Collection_390_ID = '".intval($_GET['dboxid'])."'";
$dbh->query($q);

header('Location: /'.ADMIN_APP_DIR.'/admin.php?module_id=1&action=update&id=390&&eid='.intval($_GET['dboxid']));
die();