mark hublocs with incorrect sitekeys deleted

This commit is contained in:
friendica 2013-11-21 14:42:48 -08:00
parent 7f4e4ab688
commit 8f236771c6
2 changed files with 15 additions and 1 deletions

View File

@ -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

View File

@ -1 +1 @@
2013-11-20.503
2013-11-21.504