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
Raw Permalink Normal View History

<?php
/**
* Holds the friends section controller.
* @package Sakura
*/
namespace Sakura\Controllers\Settings;
use Phroute\Phroute\Exception\HttpMethodNotAllowedException;
2016-08-07 14:10:27 +00:00
use Sakura\CurrentSession;
2016-04-01 21:44:31 +00:00
/**
* Friends settings.
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
class FriendsController extends Controller
{
2016-08-05 02:35:37 +00:00
/**
* Gets friends listing
2016-12-04 16:33:52 +00:00
* @throws HttpMethodNotAllowedException
2016-08-05 02:35:37 +00:00
* @return string
*/
2016-12-04 16:33:52 +00:00
public function listing(): string
{
if (!CurrentSession::$user->perms->manageFriends) {
2016-12-04 16:33:52 +00:00
throw new HttpMethodNotAllowedException;
2016-04-03 21:29:46 +00:00
}
2016-08-02 20:35:12 +00:00
return view('settings/friends/listing');
}
2016-08-05 02:35:37 +00:00
/**
* Gets friend requests listing
2016-12-04 16:33:52 +00:00
* @throws HttpMethodNotAllowedException
2016-08-05 02:35:37 +00:00
* @return string
*/
2016-12-04 16:33:52 +00:00
public function requests(): string
{
if (!CurrentSession::$user->perms->manageFriends) {
2016-12-04 16:33:52 +00:00
throw new HttpMethodNotAllowedException;
2016-04-03 21:29:46 +00:00
}
2016-08-02 20:35:12 +00:00
return view('settings/friends/requests');
}
}