Fix Minz_Error::error() -> use default values

This commit is contained in:
Marien Fressinaud
2014-10-30 19:57:08 +01:00
parent ba832bef4d
commit 58deab37cd
10 changed files with 25 additions and 60 deletions

View File

@@ -19,8 +19,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
*/
public function indexAction() {
if (!FreshRSS_Auth::hasAccess('admin')) {
Minz_Error::error(403,
array('error' => array(_t('access_denied'))));
Minz_Error::error(403);
}
Minz_View::prependTitle(_t('gen.title.authentication') . ' · ');

View File

@@ -13,10 +13,7 @@ class FreshRSS_category_Controller extends Minz_ActionController {
*/
public function firstAction() {
if (!FreshRSS_Auth::hasAccess()) {
Minz_Error::error(
403,
array('error' => array(_t('access_denied')))
);
Minz_Error::error(403);
}
$catDAO = new FreshRSS_CategoryDAO();

View File

@@ -11,10 +11,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
*/
public function firstAction() {
if (!FreshRSS_Auth::hasAccess()) {
Minz_Error::error(
403,
array('error' => array(_t('access_denied')))
);
Minz_Error::error(403);
}
}

View File

@@ -11,10 +11,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
*/
public function firstAction() {
if (!FreshRSS_Auth::hasAccess()) {
Minz_Error::error(
403,
array('error' => array(_t('access_denied')))
);
Minz_Error::error(403);
}
// If ajax request, we do not print layout

View File

@@ -20,10 +20,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$action = Minz_Request::actionName();
if ($action !== 'actualize' ||
!(Minz_Configuration::allowAnonymousRefresh() || $token_is_ok)) {
Minz_Error::error(
403,
array('error' => array(_t('access_denied')))
);
Minz_Error::error(403);
}
}
}
@@ -442,10 +439,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
} else {
Minz_Log::warning('Cannot move feed `' . $feed_id . '` ' .
'in the category `' . $cat_id . '`');
Minz_Error::error(
404,
array('error' => array(_t('error_occurred')))
);
Minz_Error::error(404);
}
}

View File

@@ -11,10 +11,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
*/
public function firstAction() {
if (!FreshRSS_Auth::hasAccess()) {
Minz_Error::error(
403,
array('error' => array(_t('access_denied')))
);
Minz_Error::error(403);
}
require_once(LIB_PATH . '/lib_opml.php');

View File

@@ -5,6 +5,19 @@
*/
class FreshRSS_stats_Controller extends Minz_ActionController {
/**
* This action is called before every other action in that class. It is
* the common boiler plate for every action. It is triggered by the
* underlying framework.
*/
public function firstAction() {
if (!FreshRSS_Auth::hasAccess()) {
Minz_Error::error(403);
}
Minz_View::prependTitle(_t('stats') . ' · ');
}
/**
* This action handles the statistic main page.
*
@@ -111,20 +124,4 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$this->view->repartitionMonth = $statsDAO->calculateEntryRepartitionPerFeedPerMonth($id);
$this->view->averageMonth = $statsDAO->calculateEntryAveragePerFeedPerMonth($id);
}
/**
* This action is called before every other action in that class. It is
* the common boiler plate for every action. It is triggered by the
* underlying framework.
*/
public function firstAction() {
if (!FreshRSS_Auth::hasAccess()) {
Minz_Error::error(
403, array('error' => array(_t('access_denied')))
);
}
Minz_View::prependTitle(_t('stats') . ' · ');
}
}

View File

@@ -11,10 +11,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {
*/
public function firstAction() {
if (!FreshRSS_Auth::hasAccess()) {
Minz_Error::error(
403,
array('error' => array(_t('access_denied')))
);
Minz_Error::error(403);
}
$catDAO = new FreshRSS_CategoryDAO();
@@ -71,10 +68,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {
$id = Minz_Request::param('id');
if ($id === false || !isset($this->view->feeds[$id])) {
Minz_Error::error(
404,
array('error' => array(_t('page_not_found')))
);
Minz_Error::error(404);
return;
}

View File

@@ -4,10 +4,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
public function firstAction() {
$current_user = Minz_Session::param('currentUser', '');
if (!FreshRSS_Auth::hasAccess('admin')) {
Minz_Error::error(
403,
array('error' => array(_t('access_denied')))
);
Minz_Error::error(403);
}
invalidateHttpCache();

View File

@@ -15,10 +15,7 @@ class FreshRSS_user_Controller extends Minz_ActionController {
*/
public function firstAction() {
if (!FreshRSS_Auth::hasAccess()) {
Minz_Error::error(
403,
array('error' => array(_t('access_denied')))
);
Minz_Error::error(403);
}
}
@@ -88,8 +85,7 @@ class FreshRSS_user_Controller extends Minz_ActionController {
*/
public function manageAction() {
if (!FreshRSS_Auth::hasAccess('admin')) {
Minz_Error::error(403,
array('error' => array(_t('access_denied'))));
Minz_Error::error(403);
}
Minz_View::prependTitle(_t('gen.title.user_management') . ' · ');