aboutsummaryrefslogtreecommitdiffstats
path: root/mod/post.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-21 14:42:48 -0800
committerfriendica <info@friendica.com>2013-11-21 14:42:48 -0800
commit8f236771c675ba18fa053182c4d25199e3f98277 (patch)
treea504b991725598c6bad41e5611f7c263e68d28d7 /mod/post.php
parent7f4e4ab688be440a3efae2e0b0af7b9bbc6b7053 (diff)
downloadvolse-hubzilla-8f236771c675ba18fa053182c4d25199e3f98277.tar.gz
volse-hubzilla-8f236771c675ba18fa053182c4d25199e3f98277.tar.bz2
volse-hubzilla-8f236771c675ba18fa053182c4d25199e3f98277.zip
mark hublocs with incorrect sitekeys deleted
Diffstat (limited to 'mod/post.php')
-rw-r--r--mod/post.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/mod/post.php b/mod/post.php
index 64e08e632..0ce58ec9f 100644
--- a/mod/post.php
+++ b/mod/post.php
@@ -265,6 +265,7 @@ function post_post(&$a) {
if((! $forgery) && (! $secret_fail))
break;
}
+
if($forgery) {
$ret['message'] = 'possible site forgery';
logger('mod_zot: pickup: ' . $ret['message']);
@@ -312,6 +313,7 @@ function post_post(&$a) {
);
}
}
+
$encrypted = crypto_encapsulate(json_encode($ret),$sitekey);
json_return_and_die($encrypted);
@@ -355,6 +357,18 @@ function post_post(&$a) {
intval($hub['hubloc_id'])
);
+ /**
+ * This hub has now been proven to be valid.
+ * Any hub with the same URL and a different sitekey cannot be valid.
+ * Get rid of them (mark them deleted). There's a good chance they were re-installs.
+ *
+ */
+
+ q("update hubloc set hubloc_flags = ( hubloc_flags | %d ) where hubloc_url = '%s' and hubloc_sitekey != '%s' ",
+ intval(HUBLOC_FLAGS_DELETED),
+ dbesc($hub['hubloc_url']),
+ dbesc($hub['hubloc_sitekey'])
+ );
// TODO: check which hub is primary and take action if mismatched