import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
25
modules/news/controllers/ViewController.php
Normal file
25
modules/news/controllers/ViewController.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkey Ltd
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class News_ViewController extends CommunityID_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$news = new News_Model_News();
|
||||
$this->view->article = $news->getRowInstance($this->_getParam('id'));
|
||||
|
||||
if ($this->view->article->date > date('Y-m-d H:i:s') && $this->user->role != Users_Model_User::ROLE_ADMIN) {
|
||||
throw new Monkeys_AccessDeniedException();
|
||||
}
|
||||
|
||||
$this->_helper->actionStack('index', 'login', 'users');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user