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
2016-08-02 22:35:12 +02:00

45 lines
1.1 KiB
PHP

<?php
/**
* Holds the friends section controller.
*
* @package Sakura
*/
namespace Sakura\Controllers\Settings;
use Sakura\ActiveUser;
use Sakura\Perms\Site;
/**
* Friends settings.
*
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
class FriendsController extends Controller
{
public function listing()
{
// Check permission
if (!ActiveUser::$user->permission(Site::MANAGE_FRIENDS)) {
$message = "You aren't allowed to manage friends.";
$redirect = route('settings.index');
return view('global/information', compact('message', 'redirect'));
}
return view('settings/friends/listing');
}
public function requests()
{
// Check permission
if (!ActiveUser::$user->permission(Site::MANAGE_FRIENDS)) {
$message = "You aren't allowed to manage friends.";
$redirect = route('settings.index');
return view('global/information', compact('message', 'redirect'));
}
return view('settings/friends/requests');
}
}