Merge pull request #153 from annando/master
small changes to pumpio, libertree, blogger and statusnet
This commit is contained in:
commit
f96d9473c1
|
@ -21,4 +21,4 @@ report/
|
|||
/nbproject/private/
|
||||
|
||||
#ignore smarty cache
|
||||
/view/smarty3/compiled/
|
||||
/view/smarty3/compiled/
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
|
||||
#blogger-enable-label, #blogger-username-label, #blogger-password-label, #blogger-bydefault-label {
|
||||
#blogger-enable-label, #blogger-username-label, #blogger-password-label, #blogger-bydefault-label, #blogger-blog-label {
|
||||
float: left;
|
||||
width: 200px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#blogger-checkbox, #blogger-username, #blogger-password, #blogger-bydefault {
|
||||
#blogger-checkbox, #blogger-username, #blogger-password, #blogger-bydefault, #blogger-blog {
|
||||
float: left;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
|
|
@ -153,8 +153,11 @@ function libertree_send(&$a,&$b) {
|
|||
$ltree_api_token = get_pconfig($b['uid'],'libertree','libertree_api_token');
|
||||
$ltree_url = get_pconfig($b['uid'],'libertree','libertree_url');
|
||||
$ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token";
|
||||
$ltree_source = "Friendica";
|
||||
//$ltree_source = "[".$a->config['sitename']."](".$a->get_baseurl().")";
|
||||
if (isset($a->config['sitename']) AND ($a->config['sitename'] != ""))
|
||||
$ltree_source = $a->config['sitename'];
|
||||
else
|
||||
$ltree_source = "Friendica";
|
||||
|
||||
if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) {
|
||||
|
||||
require_once('include/bb2diaspora.php');
|
||||
|
|
|
@ -77,6 +77,8 @@ function pumpio_registerclient(&$a, $host) {
|
|||
$params["logo_url"] = $a->get_baseurl()."/images/friendica-256.png";
|
||||
$params["redirect_uris"] = $a->get_baseurl()."/pumpio/connect";
|
||||
|
||||
logger("pumpio_registerclient: ".$url." parameters ".print_r($params, true), LOGGER_DEBUG);
|
||||
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
|
||||
|
@ -89,9 +91,12 @@ function pumpio_registerclient(&$a, $host) {
|
|||
|
||||
if ($curl_info["http_code"] == "200") {
|
||||
$values = json_decode($s);
|
||||
logger("pumpio_registerclient: success ".print_r($values, true), LOGGER_DEBUG);
|
||||
return($values);
|
||||
}
|
||||
logger("pumpio_registerclient: failed: ".print_r($curl_info, true), LOGGER_DEBUG);
|
||||
return(false);
|
||||
|
||||
}
|
||||
|
||||
function pumpio_connect(&$a) {
|
||||
|
@ -112,7 +117,7 @@ function pumpio_connect(&$a) {
|
|||
$consumer_key = get_pconfig(local_user(), 'pumpio','consumer_key');
|
||||
$consumer_secret = get_pconfig(local_user(), 'pumpio','consumer_secret');
|
||||
|
||||
logger("pumpio_connect: ckey: ".$consumer_key." csecrect: ".$consumer_secret);
|
||||
logger("pumpio_connect: ckey: ".$consumer_key." csecrect: ".$consumer_secret, LOGGER_DEBUG);
|
||||
}
|
||||
|
||||
if (($consumer_key == "") OR ($consumer_secret == "")) {
|
||||
|
@ -146,7 +151,7 @@ function pumpio_connect(&$a) {
|
|||
if (($success = $client->Initialize())) {
|
||||
if (($success = $client->Process())) {
|
||||
if (strlen($client->access_token)) {
|
||||
logger("pumpio_connect: otoken: ".$client->access_token." osecrect: ".$client->access_token_secret);
|
||||
logger("pumpio_connect: otoken: ".$client->access_token." osecrect: ".$client->access_token_secret, LOGGER_DEBUG);
|
||||
set_pconfig(local_user(), "pumpio", "oauth_token", $client->access_token);
|
||||
set_pconfig(local_user(), "pumpio", "oauth_token_secret", $client->access_token_secret);
|
||||
}
|
||||
|
@ -157,10 +162,13 @@ function pumpio_connect(&$a) {
|
|||
$o = 'Could not connect to pumpio. Refresh the page or try again later.';
|
||||
|
||||
if($success) {
|
||||
logger("pumpio_connect: authenticated");
|
||||
$o .= t("You are now authenticated to pumpio.");
|
||||
$o .= '<br /><a href="'.$a->get_baseurl().'/settings/connectors">'.t("return to the connector page").'</a>';
|
||||
} else
|
||||
$o = 'Could not connect to pumpio. Refresh the page or try again later.';
|
||||
} else {
|
||||
logger("pumpio_connect: could not connect");
|
||||
$o = 'Could not connect to pumpio. Refresh the page or try again later.';
|
||||
}
|
||||
|
||||
return($o);
|
||||
}
|
||||
|
@ -308,6 +316,8 @@ function pumpio_settings_post(&$a,&$b) {
|
|||
set_pconfig(local_user(),'pumpio','public',$_POST['pumpio_public']);
|
||||
set_pconfig(local_user(),'pumpio','mirror',$_POST['pumpio_mirror']);
|
||||
set_pconfig(local_user(),'pumpio','post_by_default',intval($_POST['pumpio_bydefault']));
|
||||
|
||||
header("Location: ".$a->get_baseurl()."/pumpio/connect");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -343,7 +353,7 @@ function pumpio_send(&$a,&$b) {
|
|||
return;
|
||||
}
|
||||
|
||||
logger("pumpio_send: parameter ".print_r($b, true));
|
||||
logger("pumpio_send: parameter ".print_r($b, true), LOGGER_DATA);
|
||||
|
||||
if($b['parent'] != $b['id']) {
|
||||
// Looking if its a reply to a pumpio post
|
||||
|
|
|
@ -313,11 +313,12 @@ function statusnet_settings(&$a,&$s) {
|
|||
$s .= '<div class="clear"></div>';
|
||||
$s .= '<label id="statusnet-baseapi-label" for="statusnet-baseapi">'. t("Base API Path \x28remember the trailing /\x29") .'</label>';
|
||||
$s .= '<input id="statusnet-baseapi" type="text" name="statusnet-baseapi" size="35" /><br />';
|
||||
$s .= '<p></p><div class="clear"></div></div>';
|
||||
$s .= '<div class="clear"></div>';
|
||||
$s .= '<label id="statusnet-applicationname-label" for="statusnet-applicationname">'.t('StatusNet application name').'</label>';
|
||||
$s .= '<input id="statusnet-applicationname" type="text" name="statusnet-applicationname" size="35" /><br />';
|
||||
$s .= '<p></p><div class="clear"></div></div>';
|
||||
$s .= '<p></p><div class="clear"></div>';
|
||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="statusnet-submit" class="settings-submit" value="' . t('Submit') . '" /></div>';
|
||||
$s .= '</div>';
|
||||
} else {
|
||||
/***
|
||||
* ok we have a consumer key pair now look into the OAuth stuff
|
||||
|
|
Loading…
Reference in New Issue
Block a user