aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-10-31 13:58:26 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-10-31 13:58:26 -0700
commit04820ba09ef335f11df6be00b11b09a02989e0cf (patch)
tree5a117c9e32153d0995108e11213540e6e6bd801c
parent7a87343c7139c83de9baed8620a846ec45c36e2b (diff)
downloadvolse-hubzilla-04820ba09ef335f11df6be00b11b09a02989e0cf.tar.gz
volse-hubzilla-04820ba09ef335f11df6be00b11b09a02989e0cf.tar.bz2
volse-hubzilla-04820ba09ef335f11df6be00b11b09a02989e0cf.zip
make hubloc repair script a bit more selective
-rw-r--r--mod/fhublocs.php16
-rw-r--r--version.inc2
2 files changed, 14 insertions, 4 deletions
diff --git a/mod/fhublocs.php b/mod/fhublocs.php
index d2f15b728..dce00e383 100644
--- a/mod/fhublocs.php
+++ b/mod/fhublocs.php
@@ -13,14 +13,24 @@ function fhublocs_content(&$a) {
$o = '';
$r = q("select * from channel where channel_removed = 0");
+ $sitekey = get_config('system','pubkey');
if($r) {
foreach($r as $rr) {
+ $found = false;
$primary_address = '';
$x = zot_get_hublocs($rr['channel_hash']);
if($x) {
- $o .= 'Hubloc exists for ' . $rr['channel_name'] . EOL;
- continue;
+ foreach($x as $xx) {
+ if($xx['hubloc_url'] === z_root() && $xx['hubloc_sitekey'] === $sitekey) {
+ $found = true;
+ break;
+ }
+ }
+ if($found) {
+ $o .= 'Hubloc exists for ' . $rr['channel_name'] . EOL;
+ continue;
+ }
}
$y = q("select xchan_addr from xchan where xchan_hash = '%s' limit 1",
dbesc($rr['channel_hash'])
@@ -53,7 +63,7 @@ function fhublocs_content(&$a) {
dbesc(base64url_encode(rsa_sign(z_root(),$rr['channel_prvkey']))),
dbesc(get_app()->get_hostname()),
dbesc(z_root() . '/post'),
- dbesc(get_config('system','pubkey')),
+ dbesc($sitekey),
dbesc('zot')
);
diff --git a/version.inc b/version.inc
index 9b4db518b..76b17ba98 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2015-10-30.1201
+2015-10-31.1202