aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-13 22:01:23 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-13 22:01:23 -0700
commitd96ae0f9f59711112801d478abba7f7120ec0ad3 (patch)
tree1d5699498fc52c205f6b858e3acc2e916b2a5ad3
parentbf77043b5137dcfe2d59a49d300e01be3e6e3674 (diff)
downloadvolse-hubzilla-d96ae0f9f59711112801d478abba7f7120ec0ad3.tar.gz
volse-hubzilla-d96ae0f9f59711112801d478abba7f7120ec0ad3.tar.bz2
volse-hubzilla-d96ae0f9f59711112801d478abba7f7120ec0ad3.zip
can no longer avoid recording the curl response code
-rw-r--r--boot.php16
-rw-r--r--include/notifier.php3
-rw-r--r--mod/photos.php9
3 files changed, 23 insertions, 5 deletions
diff --git a/boot.php b/boot.php
index 5016db820..296ae13c3 100644
--- a/boot.php
+++ b/boot.php
@@ -100,6 +100,8 @@ class App {
private $baseurl;
private $db;
+ private $curl_code;
+
function __construct() {
$this->config = array();
@@ -185,6 +187,14 @@ class App {
));
}
+ function set_curl_code($code) {
+ $this->curl_code = $code;
+ }
+
+ function get_curl_code() {
+ return $this->curl_code;
+ }
+
}}
// retrieve the App structure
@@ -347,6 +357,9 @@ function fetch_url($url,$binary = false) {
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
$s = curl_exec($ch);
+ $info = curl_getinfo($ch);
+ $a = get_app();
+ $a->set_curl_code($info['http_code']);
curl_close($ch);
return($s);
}}
@@ -376,6 +389,9 @@ function post_url($url,$params) {
}
$s = curl_exec($ch);
+ $info = curl_getinfo($ch);
+ $a = get_app();
+ $a->set_curl_code($info['http_code']);
curl_close($ch);
return($s);
}}
diff --git a/include/notifier.php b/include/notifier.php
index ce4e5fed4..9866c0232 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -316,6 +316,9 @@
if((strlen($hub)) && ($notify_hub)) {
$params = 'hub.mode=publish&hub.url=' . urlencode($a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
post_url($hub,$params);
+ if($debugging) {
+ file_put_contents('pubsub.out', "\n\n" . "Pinged hub at " . datetime_convert() . "\n" . "Hub returned " . $a->get_curl_code() . "\n\n" , FILE_APPEND);
+ }
}
killme();
diff --git a/mod/photos.php b/mod/photos.php
index 052f3c185..35b03845d 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -46,11 +46,10 @@ function photos_init(&$a) {
function photos_post(&$a) {
- if(! local_user()) {
- notice( t('Permission denied.') . EOL );
- killme();
- }
-
+ if(! local_user()) {
+ notice( t('Permission denied.') . EOL );
+ killme();
+ }
$r = q("SELECT `contact`.* `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`