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/libraries/Controllers/Settings/FriendsController.php

53 lines
1.2 KiB
PHP
Raw Normal View History

<?php
/**
* Holds the friends section controller.
*
* @package Sakura
*/
namespace Sakura\Controllers\Settings;
2016-04-03 21:29:46 +00:00
use Sakura\ActiveUser;
2016-04-04 09:11:11 +00:00
use Sakura\Router;
2016-04-03 21:29:46 +00:00
use Sakura\Perms\Site;
2016-04-01 21:44:31 +00:00
use Sakura\Template;
/**
* Friends settings.
*
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
class FriendsController extends Controller
{
public function listing()
{
2016-04-03 21:29:46 +00:00
// Check permission
if (!ActiveUser::$user->permission(Site::MANAGE_FRIENDS)) {
$message = "You aren't allowed to manage friends.";
$redirect = Router::route('settings.general.home');
Template::vars(compact('message', 'redirect'));
return Template::render('global/information');
}
2016-04-01 21:44:31 +00:00
return Template::render('settings/friends/listing');
}
public function requests()
{
2016-04-03 21:29:46 +00:00
// Check permission
if (!ActiveUser::$user->permission(Site::MANAGE_FRIENDS)) {
$message = "You aren't allowed to manage friends.";
$redirect = Router::route('settings.general.home');
Template::vars(compact('message', 'redirect'));
return Template::render('global/information');
}
2016-04-01 21:44:31 +00:00
return Template::render('settings/friends/requests');
}
}