From e917f3d26b8385ebe9064e6832b2795238b0acc6 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 29 Sep 2013 09:33:24 +0200 Subject: [PATCH] pumpio: Added some more logging information. --- pumpio/pumpio.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index f697b227c..4824df1f7 100755 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.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 .= '
'.t("return to the connector page").''; - } 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); }