mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 09:34:26 +02:00
Fix for profile limitation / configurable list of limited servers
This commit is contained in:
parent
a0f6f2e73e
commit
e38a699324
3 changed files with 16 additions and 2 deletions
|
@ -24,6 +24,7 @@ namespace Friendica\Protocol;
|
|||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\APContact;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\User;
|
||||
|
@ -305,6 +306,15 @@ class ActivityPub
|
|||
return false;
|
||||
}
|
||||
|
||||
$limited = DI::config()->get('system', 'limited_servers');
|
||||
if (!empty($limited)) {
|
||||
$servers = explode(',', str_replace(' ', '', $limited));
|
||||
$host = parse_url($contact['baseurl'], PHP_URL_HOST);
|
||||
if (!empty($host) && in_array($host, $servers)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// @todo Look for user blocked domains
|
||||
|
||||
Logger::debug('Server is an accepted requester', ['uid' => $uid, 'id' => $apcontact['gsid'], 'url' => $apcontact['baseurl'], 'signer' => $signer, 'called_by' => $called_by]);
|
||||
|
|
|
@ -373,9 +373,9 @@ class Transmitter
|
|||
}
|
||||
|
||||
$data['preferredUsername'] = $owner['nick'];
|
||||
$data['name'] = $owner['name'];
|
||||
$data['name'] = $full ? $owner['name'] : $owner['nick'];
|
||||
|
||||
if (!$full && !empty($owner['country-name'] . $owner['region'] . $owner['locality'])) {
|
||||
if ($full && !empty($owner['country-name'] . $owner['region'] . $owner['locality'])) {
|
||||
$data['vcard:hasAddress'] = ['@type' => 'vcard:Home', 'vcard:country-name' => $owner['country-name'],
|
||||
'vcard:region' => $owner['region'], 'vcard:locality' => $owner['locality']];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue