/**
* Fetch the system account
*
- * @return return system account
+ * @return array system account
*/
public static function getSystemAccount()
{
*/
private static function createSystemAccount()
{
- $system_actor_name = DI::config()->get('system', 'actor_name');
+ $system_actor_name = self::getActorName();
if (empty($system_actor_name)) {
- $system_actor_name = self::getActorName();
- if (empty($system_actor_name)) {
- return;
- }
+ return;
}
$keys = Crypto::newKeypair(4096);
*/
public static function getActorName()
{
+ $system_actor_name = DI::config()->get('system', 'actor_name');
+ if (!empty($system_actor_name)) {
+ return $system_actor_name;
+ }
+
// List of possible actor names
$possible_accounts = ['friendica', 'actor', 'system', 'internal'];
foreach ($possible_accounts as $name) {
}
// Add the name of the internal actor to the "forbidden" list
- $actor_name = DI::config()->get('system', 'actor_name');
+ $actor_name = self::getActorName();
if (!empty($actor_name)) {
$forbidden[] = $actor_name;
}
get_temppath();
get_itemcachepath();
- $system_actor_name = DI::config()->get('system', 'actor_name');
- if (empty($system_actor_name)) {
- $system_actor_name = User::getActorName();
- }
-
/* Register policy */
$register_choices = [
Register::CLOSED => DI::l10n()->t('Closed'),
// name, label, value, help string, extra data...
'$sitename' => ['sitename', DI::l10n()->t('Site name'), DI::config()->get('config', 'sitename'), ''],
'$sender_email' => ['sender_email', DI::l10n()->t('Sender Email'), DI::config()->get('config', 'sender_email'), DI::l10n()->t('The email address your server shall use to send notification emails from.'), '', '', 'email'],
- '$system_actor_name' => ['system_actor_name', DI::l10n()->t('Name of the system actor'), $system_actor_name, DI::l10n()->t("Name of the internal system account that is used to perform ActivityPub requests. This must be an unused username. If set, this shouldn't be changed again.")],
+ '$system_actor_name' => ['system_actor_name', DI::l10n()->t('Name of the system actor'), User::getActorName(), DI::l10n()->t("Name of the internal system account that is used to perform ActivityPub requests. This must be an unused username. If set, this shouldn't be changed again.")],
'$banner' => ['banner', DI::l10n()->t('Banner/Logo'), $banner, ''],
'$email_banner' => ['email_banner', DI::l10n()->t('Email Banner/Logo'), $email_banner, ''],
'$shortcut_icon' => ['shortcut_icon', DI::l10n()->t('Shortcut icon'), DI::config()->get('system', 'shortcut_icon'), DI::l10n()->t('Link to an icon that will be used for browsers.')],
$name = substr($local, 0, strpos($local, '@'));
}
- if ($name == DI::config()->get('system', 'actor_name')) {
+ if ($name == User::getActorName()) {
$owner = User::getSystemAccount();
if (empty($owner)) {
throw new \Friendica\Network\HTTPException\NotFoundException();