ensure that every imported channel has a primary hubloc
This commit is contained in:
parent
061725b97a
commit
9f2efb0291
@ -691,6 +691,16 @@ function import_xchan($arr,$ud_flags = 1) {
|
|||||||
dbesc($xchan_hash)
|
dbesc($xchan_hash)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// See if a primary is specified
|
||||||
|
|
||||||
|
$has_primary = false;
|
||||||
|
foreach($arr['locations'] as $location) {
|
||||||
|
if($location['primary']) {
|
||||||
|
$has_primary = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach($arr['locations'] as $location) {
|
foreach($arr['locations'] as $location) {
|
||||||
if(! rsa_verify($location['url'],base64url_decode($location['url_sig']),$arr['key'])) {
|
if(! rsa_verify($location['url'],base64url_decode($location['url_sig']),$arr['key'])) {
|
||||||
logger('import_xchan: Unable to verify site signature for ' . $location['url']);
|
logger('import_xchan: Unable to verify site signature for ' . $location['url']);
|
||||||
@ -698,6 +708,12 @@ function import_xchan($arr,$ud_flags = 1) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure that they have one primary hub
|
||||||
|
|
||||||
|
if(! $has_primary)
|
||||||
|
$location['primary'] = true;
|
||||||
|
|
||||||
|
|
||||||
for($x = 0; $x < count($xisting); $x ++) {
|
for($x = 0; $x < count($xisting); $x ++) {
|
||||||
if(($xisting[$x]['hubloc_url'] === $location['url']) && ($xisting[$x]['hubloc_sitekey'] === $location['sitekey'])) {
|
if(($xisting[$x]['hubloc_url'] === $location['url']) && ($xisting[$x]['hubloc_sitekey'] === $location['sitekey'])) {
|
||||||
$xisting[$x]['updated'] = true;
|
$xisting[$x]['updated'] = true;
|
||||||
|
@ -356,7 +356,7 @@ function red_comment($args) {
|
|||||||
|
|
||||||
$comment['comment_author_email'] = '';
|
$comment['comment_author_email'] = '';
|
||||||
if ( isset($content_struct['author_email']) )
|
if ( isset($content_struct['author_email']) )
|
||||||
$comment['comment_author_email'] = $content_struct['author_email'];
|
$comment['comment_author_email'] = 'zot:' . $content_struct['author_email'];
|
||||||
|
|
||||||
$comment['comment_author_url'] = '';
|
$comment['comment_author_url'] = '';
|
||||||
if ( isset($content_struct['author_url']) )
|
if ( isset($content_struct['author_url']) )
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
.abook-them {
|
.abook-them {
|
||||||
margin-left: 225px;
|
margin-left: 375px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
.abook-me {
|
.abook-me {
|
||||||
|
Reference in New Issue
Block a user