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