Merge branch 'apull'
This commit is contained in:
commit
d7bd2246c1
|
@ -63,7 +63,6 @@ class StatusNetOAuth extends TwitterOAuth {
|
||||||
$ci = curl_init();
|
$ci = curl_init();
|
||||||
/* Curl settings */
|
/* Curl settings */
|
||||||
$prx = get_config('system','proxy');
|
$prx = get_config('system','proxy');
|
||||||
logger('Proxy SN: '.$prx);
|
|
||||||
if(strlen($prx)) {
|
if(strlen($prx)) {
|
||||||
curl_setopt($ci, CURLOPT_HTTPPROXYTUNNEL, 1);
|
curl_setopt($ci, CURLOPT_HTTPPROXYTUNNEL, 1);
|
||||||
curl_setopt($ci, CURLOPT_PROXY, $prx);
|
curl_setopt($ci, CURLOPT_PROXY, $prx);
|
||||||
|
@ -215,7 +214,6 @@ function statusnet_settings_post ($a,$post) {
|
||||||
} else {
|
} else {
|
||||||
if (isset($_POST['statusnet-pin'])) {
|
if (isset($_POST['statusnet-pin'])) {
|
||||||
// if the user supplied us with a PIN from Twitter, let the magic of OAuth happen
|
// if the user supplied us with a PIN from Twitter, let the magic of OAuth happen
|
||||||
logger('got a StatusNet security code');
|
|
||||||
$api = get_pconfig(local_user(), 'statusnet', 'baseapi');
|
$api = get_pconfig(local_user(), 'statusnet', 'baseapi');
|
||||||
$ckey = get_pconfig(local_user(), 'statusnet', 'consumerkey' );
|
$ckey = get_pconfig(local_user(), 'statusnet', 'consumerkey' );
|
||||||
$csecret = get_pconfig(local_user(), 'statusnet', 'consumersecret' );
|
$csecret = get_pconfig(local_user(), 'statusnet', 'consumersecret' );
|
||||||
|
@ -389,9 +387,6 @@ function statusnet_post_hook(&$a,&$b) {
|
||||||
if(! strstr($b['postopts'],'statusnet'))
|
if(! strstr($b['postopts'],'statusnet'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
logger('StatusNet post invoked');
|
|
||||||
|
|
||||||
|
|
||||||
load_pconfig($b['uid'], 'statusnet');
|
load_pconfig($b['uid'], 'statusnet');
|
||||||
|
|
||||||
$api = get_pconfig($b['uid'], 'statusnet', 'baseapi');
|
$api = get_pconfig($b['uid'], 'statusnet', 'baseapi');
|
||||||
|
@ -408,7 +403,7 @@ function statusnet_post_hook(&$a,&$b) {
|
||||||
$msg = strip_tags(bbcode($b['body']));
|
$msg = strip_tags(bbcode($b['body']));
|
||||||
// quotes not working - let's try this
|
// quotes not working - let's try this
|
||||||
$msg = html_entity_decode($msg);
|
$msg = html_entity_decode($msg);
|
||||||
if ( strlen($msg) > $max_char) {
|
if (( strlen($msg) > $max_char) && $max_char > 0) {
|
||||||
$shortlink = "";
|
$shortlink = "";
|
||||||
require_once('library/slinky.php');
|
require_once('library/slinky.php');
|
||||||
$slinky = new Slinky( $b['plink'] );
|
$slinky = new Slinky( $b['plink'] );
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
* we do not need "Twitter as login". When you've registered the app you get the
|
* we do not need "Twitter as login". When you've registered the app you get the
|
||||||
* OAuth Consumer key and secret pair for your application/site.
|
* OAuth Consumer key and secret pair for your application/site.
|
||||||
*
|
*
|
||||||
* Add this key pair to your global .htconfig.php
|
* Add this key pair to your global .htconfig.php or use the admin panel.
|
||||||
*
|
*
|
||||||
* $a->config['twitter']['consumerkey'] = 'your consumer_key here';
|
* $a->config['twitter']['consumerkey'] = 'your consumer_key here';
|
||||||
* $a->config['twitter']['consumersecret'] = 'your consumer_secret here';
|
* $a->config['twitter']['consumersecret'] = 'your consumer_secret here';
|
||||||
|
@ -91,10 +91,11 @@ function twitter_settings_post ($a,$post) {
|
||||||
/***
|
/***
|
||||||
* if the twitter-disconnect checkbox is set, clear the OAuth key/secret pair
|
* if the twitter-disconnect checkbox is set, clear the OAuth key/secret pair
|
||||||
* from the user configuration
|
* from the user configuration
|
||||||
* TODO can we revoke the access tokens at Twitter and do we need to do so?
|
|
||||||
*/
|
*/
|
||||||
del_pconfig( local_user(), 'twitter', 'consumerkey' );
|
del_pconfig( local_user(), 'twitter', 'consumerkey' );
|
||||||
del_pconfig( local_user(), 'twitter', 'consumersecret' );
|
del_pconfig( local_user(), 'twitter', 'consumersecret' );
|
||||||
|
del_pconfig( local_user(), 'twitter', 'oauthtoken' );
|
||||||
|
del_pconfig( local_user(), 'twitter', 'oauthsecret' );
|
||||||
del_pconfig( local_user(), 'twitter', 'post' );
|
del_pconfig( local_user(), 'twitter', 'post' );
|
||||||
del_pconfig( local_user(), 'twitter', 'post_by_default' );
|
del_pconfig( local_user(), 'twitter', 'post_by_default' );
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue