This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/app/Controllers/Settings/FriendsController.php

47 lines
1 KiB
PHP

<?php
/**
* Holds the friends section controller.
* @package Sakura
*/
namespace Sakura\Controllers\Settings;
use Phroute\Phroute\Exception\HttpMethodNotAllowedException;
use Sakura\CurrentSession;
/**
* Friends settings.
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
class FriendsController extends Controller
{
/**
* Gets friends listing
* @throws HttpMethodNotAllowedException
* @return string
*/
public function listing(): string
{
if (!CurrentSession::$user->perms->manageFriends) {
throw new HttpMethodNotAllowedException;
}
return view('settings/friends/listing');
}
/**
* Gets friend requests listing
* @throws HttpMethodNotAllowedException
* @return string
*/
public function requests(): string
{
if (!CurrentSession::$user->perms->manageFriends) {
throw new HttpMethodNotAllowedException;
}
return view('settings/friends/requests');
}
}