aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-30 19:57:08 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-30 19:57:08 +0100
commit58deab37cdd97e93ac25aba574a32befe1db2243 (patch)
tree56c618b6dc3620de31917294c69304f61c52f9d6 /app/Controllers
parentba832bef4de4a02df46023b389f752b01d43c98b (diff)
Fix Minz_Error::error() -> use default values
Diffstat (limited to 'app/Controllers')
-rw-r--r--app/Controllers/authController.php3
-rw-r--r--app/Controllers/categoryController.php5
-rwxr-xr-xapp/Controllers/configureController.php5
-rwxr-xr-xapp/Controllers/entryController.php5
-rwxr-xr-xapp/Controllers/feedController.php10
-rw-r--r--app/Controllers/importExportController.php5
-rw-r--r--app/Controllers/statsController.php29
-rw-r--r--app/Controllers/subscriptionController.php10
-rw-r--r--app/Controllers/updateController.php5
-rw-r--r--app/Controllers/userController.php8
10 files changed, 25 insertions, 60 deletions
diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php
index 491be8d8a..44496cd3e 100644
--- a/app/Controllers/authController.php
+++ b/app/Controllers/authController.php
@@ -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') . ' · ');
diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php
index 609284559..50b1d841a 100644
--- a/app/Controllers/categoryController.php
+++ b/app/Controllers/categoryController.php
@@ -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();
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index deb8cc849..1c8ac9111 100755
--- a/app/Controllers/configureController.php
+++ b/app/Controllers/configureController.php
@@ -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);
}
}
diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index d11f3a520..b4beed619 100755
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -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
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 8563b1c0f..9990a852c 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -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);
}
}
diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php
index 8028af8ed..4e2dbd157 100644
--- a/app/Controllers/importExportController.php
+++ b/app/Controllers/importExportController.php
@@ -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');
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php
index 0e3430fcc..18fbca6df 100644
--- a/app/Controllers/statsController.php
+++ b/app/Controllers/statsController.php
@@ -6,6 +6,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.
*
* It displays 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') . ' · ');
- }
-
}
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php
index a89168eb3..67b95eba6 100644
--- a/app/Controllers/subscriptionController.php
+++ b/app/Controllers/subscriptionController.php
@@ -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;
}
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index 4ef5357ea..0896b13ac 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -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();
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index 39db1d879..5050571a9 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -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') . ' · ');