. */ /** * @package WebFingerPlugin * @author James Walker * @author Mikael Nordfeldth */ if (!defined('GNUSOCIAL')) { exit(1); } 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 ($owner = common_config('webfinger', 'owner')) { $this->xrd->aliases[] = $this->xrd->subject; $this->xrd->subject = Discovery::normalize($owner); } else { $this->xrd->subject = $this->resource; } } }