. */ if (!defined('STATUSNET')) { exit(1); } /** * @package OStatusPlugin * @maintainer James Walker */ class UserxrdAction extends XrdAction { function prepare($args) { parent::prepare($args); $this->uri = $this->trimmed('uri'); $this->uri = Discovery::normalize($this->uri); if (Discovery::isWebfinger($this->uri)) { $parts = explode('@', substr(urldecode($this->uri), 5)); if (count($parts) == 2) { list($nick, $domain) = $parts; // @fixme confirm the domain too // @fixme if domain checking is added, ensure that it will not // cause problems with sites that have changed domains! $nick = common_canonical_nickname($nick); $this->user = User::staticGet('nickname', $nick); } } else { $this->user = User::staticGet('uri', $this->uri); } if (!$this->user) { $this->clientError(_m('No such user.'), 404); return false; } return true; } }