aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--INSTALL.txt17
-rw-r--r--boot.php23
-rw-r--r--include/acl_selectors.php17
-rw-r--r--include/items.php4
-rw-r--r--include/main.js14
-rw-r--r--include/notifier.php2
-rw-r--r--include/poller.php5
-rw-r--r--index.php2
-rw-r--r--mod/contacts.php10
-rw-r--r--mod/dfrn_poll.php1
-rw-r--r--mod/follow.php9
-rw-r--r--mod/item.php1
-rw-r--r--view/de/contact_edit.tpl5
-rw-r--r--view/en/contact_edit.tpl5
-rw-r--r--view/fr/contact_edit.tpl5
-rw-r--r--view/it/contact_edit.tpl5
-rw-r--r--view/theme/default/style.css3
-rw-r--r--view/theme/duepuntozero/style.css4
18 files changed, 102 insertions, 30 deletions
diff --git a/INSTALL.txt b/INSTALL.txt
index 70e4f24ef..12dca9c5b 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -29,7 +29,7 @@ php.ini file
- Mysql 5.x
- ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks
-(Windows)
+(Windows) [Note: other options are presented in Section 7 of this document]
- Installation into a top-level domain or sub-domain (without a
directory/path component in the URL) is preferred. Directory paths will
@@ -89,3 +89,18 @@ You can generally find the location of PHP by executing "which php". If you
have troubles with this section please contact your hosting provider for
assistance. Friendika will not work correctly if you cannot perform this step.
+Alternative: You may be able to use the 'poormancron' plugin to perform this
+step if you are using a recent Friendika release. To do this, edit the file
+".htconfig.php" and look for a line describing your plugins. On a fresh
+installation, it will look like
+
+$a->config['system']['addon'] = 'js_upload';
+
+This indicates the "js_upload" addon module is enabled. You may add additional
+addons/plugins using this same line in the configuration file. Change it to
+read
+
+$a->config['system']['addon'] = 'js_upload,poormancron';
+
+and save your changes.
+
diff --git a/boot.php b/boot.php
index 223c9416d..6cbb4f07c 100644
--- a/boot.php
+++ b/boot.php
@@ -10,6 +10,16 @@ define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
define ( 'DOWN_ARROW', '&#x21e9;' );
+
+/**
+ * SSL redirection policies
+ */
+
+define ( 'SSL_POLICY_NONE', 0 );
+define ( 'SSL_POLICY_FULL', 1 );
+define ( 'SSL_POLICY_SELFSIGN', 2 );
+
+
/**
* log levels
*/
@@ -270,10 +280,17 @@ class App {
}
function get_baseurl($ssl = false) {
- if(strlen($this->baseurl))
- return $this->baseurl;
- $this->baseurl = (($ssl) ? 'https' : $this->scheme) . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' );
+ $scheme = $this->scheme;
+
+ 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/acl_selectors.php b/include/acl_selectors.php
index d0952421e..554782a82 100644
--- a/include/acl_selectors.php
+++ b/include/acl_selectors.php
@@ -30,7 +30,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) {
-function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false) {
+function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false) {
$o = '';
@@ -43,6 +43,10 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
$sql_extra .= sprintf(" AND `rel` = %d ", intval(REL_BUD));
}
+ if($privmail || $privatenet) {
+ $sql_extra .= " AND `network` IN ( 'dfrn' ) ";
+ }
+
if($privmail)
$o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" >\r\n";
else
@@ -61,11 +65,8 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
$selected = " selected=\"selected\" ";
else
$selected = '';
- if(($privmail) && ($rr['network'] === 'stat'))
- $disabled = ' disabled="true" ' ;
- else
- $disabled = '';
- $o .= "<option value=\"{$rr['id']}\" $selected $disabled title=\"{$rr['url']}\" >{$rr['name']}</option>\r\n";
+
+ $o .= "<option value=\"{$rr['id']}\" $selected title=\"{$rr['url']}\" >{$rr['name']}</option>\r\n";
}
}
@@ -110,7 +111,7 @@ function populate_acl($user = null,$celeb = false) {
$o .= '</div>';
$o .= '<div id="contact_allow_wrapper">';
$o .= '<label id="acl-allow-contact-label" for="contact_allow" >' . t('Contacts') . '</label>';
- $o .= contact_select('contact_allow','contact_allow',$allow_cid,4,false,$celeb);
+ $o .= contact_select('contact_allow','contact_allow',$allow_cid,4,false,$celeb,true);
$o .= '</div>';
$o .= '</div>' . "\r\n";
$o .= '<div id="acl-allow-end"></div>' . "\r\n";
@@ -125,7 +126,7 @@ function populate_acl($user = null,$celeb = false) {
$o .= '</div>';
$o .= '<div id="contact_deny_wrapper" >';
$o .= '<label id="acl-deny-contact-label" for="contact_deny" >' . t('Contacts') . '</label>';
- $o .= contact_select('contact_deny','contact_deny', $deny_cid,4,false, $celeb);
+ $o .= contact_select('contact_deny','contact_deny', $deny_cid,4,false, $celeb,true);
$o .= '</div>';
$o .= '</div>' . "\r\n";
$o .= '<div id="acl-deny-end"></div>' . "\r\n";
diff --git a/include/items.php b/include/items.php
index e238280fc..a5991d663 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/main.js b/include/main.js
index fcd1d6fee..63b34bd21 100644
--- a/include/main.js
+++ b/include/main.js
@@ -44,12 +44,14 @@
$('#pause').html('');
}
}
- if(event.keyCode == '36' && event.shiftKey == true) {
- if(homebase !== undefined) {
- event.preventDefault();
- document.location = homebase;
- }
- }
+// this is shift-home on FF, but $ on IE, disabling until I figure out why the diff.
+// update: incompatible usage of onKeyDown vs onKeyPress
+// if(event.keyCode == '36' && event.shiftKey == true) {
+// if(homebase !== undefined) {
+// event.preventDefault();
+// document.location = homebase;
+// }
+// }
});
});
diff --git a/include/notifier.php b/include/notifier.php
index dd5d55ed0..59e29d7d1 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -363,7 +363,7 @@ function notifier_run($argv, $argc){
continue;
$params = 'hub.mode=publish&hub.url=' . urlencode($a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
post_url($h,$params);
- logger('pubsub: publish: ' . $h . ' returned ' . $a->get_curl_code());
+ logger('pubsub: publish: ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code());
if(count($hubs) > 1)
sleep(7); // try and avoid multiple hubs responding at precisely the same time
}
diff --git a/include/poller.php b/include/poller.php
index 1003b2f08..4567a5cfc 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;
@@ -76,7 +79,7 @@ function poller_run($argv, $argc){
$contact['priority'] = (($interval !== false) ? intval($interval) : 3);
$hub_update = false;
- if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day"))
+ if((datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day")) || $force)
$hub_update = true;
}
diff --git a/index.php b/index.php
index ae6a578cb..685a76a13 100644
--- a/index.php
+++ b/index.php
@@ -140,7 +140,7 @@ if(strlen($a->module)) {
}
else {
if((x($_SERVER,'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
- logger('index.php: dreamhost_error_hack invoked');
+ logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']);
goaway($a->get_baseurl() . $_SERVER['REQUEST_URI']);
}
diff --git a/mod/contacts.php b/mod/contacts.php
index 177ca9973..4c627c88f 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/mod/dfrn_poll.php b/mod/dfrn_poll.php
index 1061cdb89..85e7fc0af 100644
--- a/mod/dfrn_poll.php
+++ b/mod/dfrn_poll.php
@@ -26,6 +26,7 @@ function dfrn_poll_init(&$a) {
}
if(($dfrn_id === '') && (! x($_POST,'dfrn_id')) && ($a->argc > 1)) {
+ logger('dfrn_poll: public feed request from ' . $_SERVER['REMOTE_ADDR'] );
header("Content-type: application/atom+xml");
$o = get_feed_for($a, '*', $a->argv[1],$last_update);
echo $o;
diff --git a/mod/follow.php b/mod/follow.php
index a90ae3f51..62ba2585c 100644
--- a/mod/follow.php
+++ b/mod/follow.php
@@ -10,7 +10,9 @@ function follow_post(&$a) {
// NOTREACHED
}
- $url = notags(trim($_POST['url']));
+ $url = $orig_url = notags(trim($_POST['url']));
+
+ $email_conversant = false;
if($url) {
$links = lrdd($url);
@@ -29,6 +31,11 @@ function follow_post(&$a) {
}
}
+ else {
+ if((strpos($orig_url,'@')) && validate_email($orig_url)) {
+ $email_conversant = true;
+ }
+ }
}
// If we find a DFRN site, send our subscriber to the other person's
diff --git a/mod/item.php b/mod/item.php
index 11e79a7ab..cc1886c17 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -71,6 +71,7 @@ function item_post(&$a) {
$location = notags(trim($_POST['location']));
$coord = notags(trim($_POST['coord']));
$verb = notags(trim($_POST['verb']));
+ $emailcc = notags(trim($_POST['emailcc']));
if(! strlen($body)) {
notice( t('Empty post discarded.') . EOL );
diff --git a/view/de/contact_edit.tpl b/view/de/contact_edit.tpl
index fcd3f2d66..0b32bdd66 100644
--- a/view/de/contact_edit.tpl
+++ b/view/de/contact_edit.tpl
@@ -3,6 +3,8 @@
<div id="contact-edit-banner-name">$name</div>
+<form action="contacts/$contact_id" method="post" >
+<input type="hidden" name="contact_id" value="$contact_id">
<div id="contact-edit-wrapper" >
@@ -24,13 +26,12 @@
</div>
<div id="contact-edit-nav-end"></div>
-<form action="contacts/$contact_id" method="post" >
-<input type="hidden" name="contact_id" value="$contact_id">
<div id="contact-edit-poll-wrapper">
<div id="contact-edit-last-update-text">$lastupdtext<span id="contact-edit-last-updated">$last_update</span</div>
<div id="contact-edit-poll-text">$updpub</div>
$poll_interval
+ <div id="contact-edit-update-now"><a href="contacts/$contact_id/update">$udnow</a></div>
</div>
</div>
<div id="contact-edit-end" ></div>
diff --git a/view/en/contact_edit.tpl b/view/en/contact_edit.tpl
index ea546b784..9aca60188 100644
--- a/view/en/contact_edit.tpl
+++ b/view/en/contact_edit.tpl
@@ -3,6 +3,8 @@
<div id="contact-edit-banner-name">$name</div>
+<form action="contacts/$contact_id" method="post" >
+<input type="hidden" name="contact_id" value="$contact_id">
<div id="contact-edit-wrapper" >
@@ -24,13 +26,12 @@
</div>
<div id="contact-edit-nav-end"></div>
-<form action="contacts/$contact_id" method="post" >
-<input type="hidden" name="contact_id" value="$contact_id">
<div id="contact-edit-poll-wrapper">
<div id="contact-edit-last-update-text">$lastupdtext<span id="contact-edit-last-updated">$last_update</span</div>
<div id="contact-edit-poll-text">$updpub</div>
$poll_interval
+ <div id="contact-edit-update-now"><a href="contacts/$contact_id/update">$udnow</a></div>
</div>
</div>
<div id="contact-edit-end" ></div>
diff --git a/view/fr/contact_edit.tpl b/view/fr/contact_edit.tpl
index c7d2d5975..9f36ddcc4 100644
--- a/view/fr/contact_edit.tpl
+++ b/view/fr/contact_edit.tpl
@@ -3,6 +3,8 @@
<div id="contact-edit-banner-name">$name</div>
+<form action="contacts/$contact_id" method="post" >
+<input type="hidden" name="contact_id" value="$contact_id">
<div id="contact-edit-wrapper" >
@@ -24,14 +26,13 @@
</div>
<div id="contact-edit-nav-end"></div>
-<form action="contacts/$contact_id" method="post" >
-<input type="hidden" name="contact_id" value="$contact_id">
<div id="contact-edit-poll-wrapper">
<div id="contact-edit-last-update-text">$lastupdtext<span id="contact-edit-last-updated">$last_update</span</div>
<div id="contact-edit-poll-text">$updpub</div>
$poll_interval
+ <div id="contact-edit-update-now"><a href="contacts/$contact_id/update">$udnow</a></div>
</div>
</div>
<div id="contact-edit-end" ></div>
diff --git a/view/it/contact_edit.tpl b/view/it/contact_edit.tpl
index d4217ba8c..ac0f13a54 100644
--- a/view/it/contact_edit.tpl
+++ b/view/it/contact_edit.tpl
@@ -3,6 +3,8 @@
<div id="contact-edit-banner-name">$name</div>
+<form action="contacts/$contact_id" method="post" >
+<input type="hidden" name="contact_id" value="$contact_id">
<div id="contact-edit-wrapper" >
@@ -24,13 +26,12 @@
</div>
<div id="contact-edit-nav-end"></div>
-<form action="contacts/$contact_id" method="post" >
-<input type="hidden" name="contact_id" value="$contact_id">
<div id="contact-edit-poll-wrapper">
<div id="contact-edit-last-update-text">$lastupdtext<span id="contact-edit-last-updated">$last_update</span</div>
<div id="contact-edit-poll-text">$updpub</div>
$poll_interval
+ <div id="contact-edit-update-now"><a href="contacts/$contact_id/update">$udnow</a></div>
</div>
</div>
<div id="contact-edit-end" ></div>
diff --git a/view/theme/default/style.css b/view/theme/default/style.css
index 3ef63e265..ae45a4244 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 59a5bf88a..d6a1744a6 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;
}