<?php
/**
* This is the controller that manages the Admin interface of Mentconnect
*/
class AdminController extends \BaseController
{
public function __construct()
{
$this->beforeFilter('auth');
}
public function home()
{
$users = User::all();
return View::make('admin.index')->with('users', $users);
}
public function manageUsers()
{
$users = User::all();
return View::make('admin.users')->with('users', $users);
}
public function viewUser($id)
{
$user = User::find($id);
return View::make('admin.user')->with('user', $user);
}
public function destroyUser($id)
{
return User::destroy($id);
}
public function restoreUser($id)
{
}
public function viewStats()
{
return View::make('admin.stats')->with('users', User::all());
}
public function showContact($id)
{
$user = User::find($id);
return View::make('admin.contact')->with('email', $user->email);
}
public function contactUser()
{
$email = Input::get('email');
//send email here
return Redirect::to('admin');
}
public function revokeAccess($id)
{
}
public function showMatches()
{
$matches = Match::all();
return View::make('admin.matches')->with('matches', $matches);
}
}