-
-
Save vespakoen/2593919 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function __construct() | |
{ | |
parent::__construct(); | |
$this->filter('before', 'auth'); | |
} | |
// Get Single news item | |
public function get_single($id, $slug = null) | |
{ | |
// Get single news item | |
$news = News::first($id); | |
// Check if the news is protected and if the user is logged | |
if ($news->secure == 1) | |
{ | |
// News is protected and user is not logged in | |
return Redirect::to('gebruiker/inloggen'); | |
} | |
// News is protected and user is logged in, continue to news item | |
return View::make('front/news/single')->with('news', $news); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment