. * * @category Plugin * @package GNUsocial * @author Daniel Supernault * @author Diogo Cordeiro * @copyright 2018 Free Software Foundation http://fsf.org * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link https://www.gnu.org/software/social/ */ if (!defined ('GNUSOCIAL')) { exit (1); } /** * Actor's profile (Local users only) * * @category Plugin * @package GNUsocial * @author Daniel Supernault * @author Diogo Cordeiro * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://www.gnu.org/software/social/ */ class apActorProfileAction extends ManagedAction { protected $needLogin = false; protected $canPost = true; /** * Handle the Actor Profile request * * @author Daniel Supernault * @return void */ protected function handle() { $nickname = $this->trimmed ('nickname'); try { $user = User::getByNickname ($nickname); $profile = $user->getProfile (); } catch (Exception $e) { ActivityPubReturn::error ('Invalid username.', 404); } $res = Activitypub_profile::profile_to_array ($profile); ActivityPubReturn::answer ($res); } }