From 5e86fb1b9ec4136af3dc60f7a315557734981f5e Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 29 Aug 2018 17:09:19 +0000 Subject: [PATCH 1/3] Pumpio does connect now again. --- pumpio/pumpio.php | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 862a75b5..60d1807b 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -139,7 +139,8 @@ function pumpio_registerclient(App $a, $host) function pumpio_connect(App $a) { // Start a session. This is necessary to hold on to a few keys the callback script will also need - session_start(); + // Currently disabled, since a session is already running + //session_start(); // Define the needed keys $consumer_key = PConfig::get(local_user(), 'pumpio', 'consumer_key'); @@ -174,7 +175,7 @@ function pumpio_connect(App $a) // Create a new instance of the oauth_client_class library. For this step, all we need to give the library is our // Consumer Key and Consumer Secret $client = new oauth_client_class; - $client->debug = 1; + $client->debug = 0; $client->server = ''; $client->oauth_version = '1.0a'; $client->request_token_url = 'https://'.$hostname.'/oauth/request_token'; @@ -202,7 +203,7 @@ function pumpio_connect(App $a) if ($success) { logger("pumpio_connect: authenticated"); - $o .= L10n::t("You are now authenticated to pumpio."); + $o = L10n::t("You are now authenticated to pumpio."); $o .= '
'.L10n::t("return to the connector page").''; } else { logger("pumpio_connect: could not connect"); @@ -361,20 +362,17 @@ function pumpio_settings_post(App $a, array &$b) $host = trim($host); $host = str_replace(["https://", "http://"], ["", ""], $host); - if (isset($_POST['pumpio'])) { - PConfig::set(local_user(), 'pumpio', 'post' , intval($_POST['pumpio'])); - PConfig::set(local_user(), 'pumpio', 'import' , $_POST['pumpio_import']); - PConfig::set(local_user(), 'pumpio', 'host' , $host); - PConfig::set(local_user(), 'pumpio', 'user' , $user); - PConfig::set(local_user(), 'pumpio', 'public' , $_POST['pumpio_public']); - PConfig::set(local_user(), 'pumpio', 'mirror' , $_POST['pumpio_mirror']); - PConfig::set(local_user(), 'pumpio', 'post_by_default', intval($_POST['pumpio_bydefault'])); + PConfig::set(local_user(), 'pumpio', 'post' , defaults($_POST, 'pumpio', false)); + PConfig::set(local_user(), 'pumpio', 'import' , defaults($_POST, 'pumpio_import', false)); + PConfig::set(local_user(), 'pumpio', 'host' , $host); + PConfig::set(local_user(), 'pumpio', 'user' , $user); + PConfig::set(local_user(), 'pumpio', 'public' , defaults($_POST, 'pumpio_public', false)); + PConfig::set(local_user(), 'pumpio', 'mirror' , defaults($_POST, 'pumpio_mirror', false)); + PConfig::set(local_user(), 'pumpio', 'post_by_default', defaults($_POST, 'pumpio_bydefault', false)); - if (!$_POST['pumpio_mirror']) { - PConfig::delete(local_user(), 'pumpio', 'lastdate'); - } + if (!empty($_POST['pumpio_mirror'])) { + PConfig::delete(local_user(), 'pumpio', 'lastdate'); } - //header("Location: ".$a->get_baseurl()."/pumpio/connect"); } } } From 2db9b497bd7047a601413fe585984e77b45f75f2 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 29 Aug 2018 17:55:36 +0000 Subject: [PATCH 2/3] removed code --- pumpio/pumpio.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 60d1807b..9960ec56 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -138,10 +138,6 @@ function pumpio_registerclient(App $a, $host) function pumpio_connect(App $a) { - // Start a session. This is necessary to hold on to a few keys the callback script will also need - // Currently disabled, since a session is already running - //session_start(); - // Define the needed keys $consumer_key = PConfig::get(local_user(), 'pumpio', 'consumer_key'); $consumer_secret = PConfig::get(local_user(), 'pumpio', 'consumer_secret'); From 19abd1a17e68e24dd4ddf78ed1292190288623e8 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 29 Aug 2018 18:04:03 +0000 Subject: [PATCH 3/3] Some removed notices --- ifttt/ifttt.php | 2 +- xmpp/xmpp.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 55f46091..ddd64394 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -180,7 +180,7 @@ function ifttt_message($uid, $item) //$_REQUEST['date'] = $item['date']; //$_REQUEST['uri'] = $item['url']; - if (strstr($item['url'], 'facebook.com')) { + if (!empty($item['url']) && strstr($item['url'], 'facebook.com')) { $hash = hash('ripemd128', $item['url']); $_REQUEST['extid'] = Protocol::FACEBOOK; $_REQUEST['message_id'] = Item::newURI($uid, Protocol::FACEBOOK . ':' . $hash); diff --git a/xmpp/xmpp.php b/xmpp/xmpp.php index 41b02f06..e589f922 100644 --- a/xmpp/xmpp.php +++ b/xmpp/xmpp.php @@ -34,9 +34,9 @@ function xmpp_addon_settings_post() return; } - PConfig::set(local_user(), 'xmpp', 'enabled', intval($_POST['xmpp_enabled'])); - PConfig::set(local_user(), 'xmpp', 'individual', intval($_POST['xmpp_individual'])); - PConfig::set(local_user(), 'xmpp', 'bosh_proxy', $_POST['xmpp_bosh_proxy']); + PConfig::set(local_user(), 'xmpp', 'enabled', defaults($_POST, 'xmpp_enabled', false)); + PConfig::set(local_user(), 'xmpp', 'individual', defaults($_POST, 'xmpp_individual', false)); + PConfig::set(local_user(), 'xmpp', 'bosh_proxy', defaults($_POST, 'xmpp_bosh_proxy', '')); info(L10n::t('XMPP settings updated.') . EOL); }