From 3eefe8b50003c858d4930c03cc06d2679a14347c Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 30 Jan 2011 19:38:03 -0800 Subject: [PATCH] more ssl_policy cleanup, allow manual feed update per contact when hub is whacked, log feed parse errors --- boot.php | 10 ++++++---- include/items.php | 4 ++++ include/poller.php | 3 +++ mod/contacts.php | 10 ++++++++++ view/de/contact_edit.tpl | 5 +++-- view/en/contact_edit.tpl | 5 +++-- view/fr/contact_edit.tpl | 5 +++-- view/it/contact_edit.tpl | 5 +++-- view/theme/default/style.css | 3 +++ view/theme/duepuntozero/style.css | 4 ++++ 10 files changed, 42 insertions(+), 12 deletions(-) diff --git a/boot.php b/boot.php index 6b4fa080e0..6cbb4f07c7 100644 --- a/boot.php +++ b/boot.php @@ -283,10 +283,12 @@ class App { $scheme = $this->scheme; - if(($ssl) || ($this->config['ssl_policy'] == SSL_POLICY_FULL)) - $scheme = 'https'; - if(($this->config['ssl_policy'] == SSL_POLICY_SELFSIGN) && (local_user() || x($_POST,'auth-params'))) - $scheme = 'https'; + if(x($this->config,'ssl_policy')) { + if(($ssl) || ($this->config['ssl_policy'] == SSL_POLICY_FULL)) + $scheme = 'https'; + if(($this->config['ssl_policy'] == SSL_POLICY_SELFSIGN) && (local_user() || x($_POST,'auth-params'))) + $scheme = 'https'; + } $this->baseurl = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' ); return $this->baseurl; diff --git a/include/items.php b/include/items.php index e238280fc8..a5991d663b 100644 --- a/include/items.php +++ b/include/items.php @@ -903,6 +903,10 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) { $feed->enable_order_by_date(false); $feed->init(); + if($feed->error()) + logger('consume_feed: Error parsing XML: ' . $feed->error()); + + // Check at the feed level for updated contact name and/or photo $name_updated = ''; diff --git a/include/poller.php b/include/poller.php index 0dbc6f5831..4567a5cfc3 100644 --- a/include/poller.php +++ b/include/poller.php @@ -58,6 +58,9 @@ function poller_run($argv, $argc){ foreach($contacts as $contact) { + if($manual_id) + $contact['last-update'] = '0000-00-00 00:00:00'; + if($contact['priority'] || $contact['subhub']) { $hub_update = true; diff --git a/mod/contacts.php b/mod/contacts.php index 177ca99734..4c627c88f9 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -121,6 +121,15 @@ function contacts_content(&$a) { return; // NOTREACHED } + if($cmd === 'update') { + + // pull feed and consume it, which should subscribe to the hub. + + $php_path = ((x($a->config,'php_path') && strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); + proc_run($php_path,"include/poller.php","$contact_id"); + goaway($a->get_baseurl() . '/contacts/' . $contact_id); + // NOTREACHED + } if($cmd === 'block') { $blocked = (($orig_record[0]['blocked']) ? 0 : 1); @@ -248,6 +257,7 @@ function contacts_content(&$a) { '$last_update' => (($r[0]['last-update'] == '0000-00-00 00:00:00') ? t('Never') : datetime_convert('UTC',date_default_timezone_get(),$r[0]['last-update'],'D, j M Y, g:i A')), + '$udnow' => t('Update now'), '$profile_select' => contact_profile_assign($r[0]['profile-id'],(($r[0]['network'] !== 'dfrn') ? true : false)), '$contact_id' => $r[0]['id'], '$block_text' => (($r[0]['blocked']) ? t('Unblock this contact') : t('Block this contact') ), diff --git a/view/de/contact_edit.tpl b/view/de/contact_edit.tpl index fcd3f2d66f..0b32bdd66b 100644 --- a/view/de/contact_edit.tpl +++ b/view/de/contact_edit.tpl @@ -3,6 +3,8 @@
$name
+
+
@@ -24,13 +26,12 @@
- -
$lastupdtext$last_update
$updpub
$poll_interval +
diff --git a/view/en/contact_edit.tpl b/view/en/contact_edit.tpl index ea546b7842..9aca60188c 100644 --- a/view/en/contact_edit.tpl +++ b/view/en/contact_edit.tpl @@ -3,6 +3,8 @@
$name
+ +
@@ -24,13 +26,12 @@
- -
$lastupdtext$last_update
$updpub
$poll_interval +
diff --git a/view/fr/contact_edit.tpl b/view/fr/contact_edit.tpl index c7d2d59752..9f36ddcc42 100644 --- a/view/fr/contact_edit.tpl +++ b/view/fr/contact_edit.tpl @@ -3,6 +3,8 @@
$name
+ +
@@ -24,14 +26,13 @@
- -
$lastupdtext$last_update
$updpub
$poll_interval +
diff --git a/view/it/contact_edit.tpl b/view/it/contact_edit.tpl index d4217ba8c8..ac0f13a54d 100644 --- a/view/it/contact_edit.tpl +++ b/view/it/contact_edit.tpl @@ -3,6 +3,8 @@
$name
+ +
@@ -24,13 +26,12 @@
- -
$lastupdtext$last_update
$updpub
$poll_interval +
diff --git a/view/theme/default/style.css b/view/theme/default/style.css index 3ef63e2658..ae45a42449 100644 --- a/view/theme/default/style.css +++ b/view/theme/default/style.css @@ -1333,6 +1333,9 @@ input#dfrn-url { #contact-edit-poll-text { margin-bottom: 10px; } +#contact-edit-update-now { + margin-top: 15px; +} #contact-edit-photo-wrapper { margin-bottom: 20px; diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 59a5bf88a5..d6a1744a6b 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -1209,6 +1209,10 @@ input#dfrn-url { margin-bottom: 10px; } +#contact-edit-update-now { + margin-top: 15px; +} + #contact-edit-photo-wrapper { margin-bottom: 20px; }