. /** * @package WebFingerPlugin * @author James Walker * @author Mikael Nordfeldth * @copyright 2010 StatusNet, Inc. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ defined('GNUSOCIAL') || die(); class OwnerxrdAction extends WebfingerAction { protected $defaultformat = 'xml'; protected function prepare(array $args=array()) { $user = User::siteOwner(); $nick = common_canonical_nickname($user->nickname); $args['resource'] = 'acct:' . $nick . '@' . common_config('site', 'server'); // We have now set $args['resource'] to the configured value, since // only this local site configuration knows who the owner is! parent::prepare($args); return true; } protected function setXRD() { parent::setXRD(); // Check to see if a $config['webfinger']['owner'] has been set // and then make sure 'subject' is set to that primary identity. if (!empty($owner = common_config('webfinger', 'owner'))) { $this->xrd->aliases[] = $this->xrd->subject; $this->xrd->subject = Discovery::normalize($owner); } else { $this->xrd->subject = $this->resource; } } }