Nodeinfo::getOrganization() doesn't need configuration object being inserted
when you have DI::config() around.
This commit is contained in:
parent
c29c49797a
commit
94eb426151
|
@ -101,7 +101,7 @@ class Nodeinfo
|
||||||
*
|
*
|
||||||
* @return array with supported services
|
* @return array with supported services
|
||||||
*/
|
*/
|
||||||
public static function getServices()
|
public static function getServices(): array
|
||||||
{
|
{
|
||||||
$services = [
|
$services = [
|
||||||
'inbound' => [],
|
'inbound' => [],
|
||||||
|
@ -156,12 +156,16 @@ class Nodeinfo
|
||||||
return $services;
|
return $services;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getOrganization($config)
|
public static function getOrganization()
|
||||||
{
|
{
|
||||||
$organization = ['name' => null, 'contact' => null, 'account' => null];
|
$organization = [
|
||||||
|
'name' => null,
|
||||||
|
'contact' => null,
|
||||||
|
'account' => null
|
||||||
|
];
|
||||||
|
|
||||||
if (!empty($config->get('config', 'admin_email'))) {
|
if (!empty(DI::config()->get('config', 'admin_email'))) {
|
||||||
$adminList = explode(',', str_replace(' ', '', $config->get('config', 'admin_email')));
|
$adminList = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
|
||||||
$organization['contact'] = $adminList[0];
|
$organization['contact'] = $adminList[0];
|
||||||
$administrator = User::getByEmail($adminList[0], ['username', 'nickname']);
|
$administrator = User::getByEmail($adminList[0], ['username', 'nickname']);
|
||||||
if (!empty($administrator)) {
|
if (!empty($administrator)) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ class NodeInfo210 extends BaseModule
|
||||||
'software' => 'friendica',
|
'software' => 'friendica',
|
||||||
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION,
|
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION,
|
||||||
],
|
],
|
||||||
'organization' => Nodeinfo::getOrganization($this->config),
|
'organization' => Nodeinfo::getOrganization(),
|
||||||
'protocols' => ['dfrn', 'activitypub'],
|
'protocols' => ['dfrn', 'activitypub'],
|
||||||
'services' => [],
|
'services' => [],
|
||||||
'openRegistrations' => intval($this->config->get('config', 'register_policy')) !== Register::CLOSED,
|
'openRegistrations' => intval($this->config->get('config', 'register_policy')) !== Register::CLOSED,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user