Sfoglia il codice sorgente

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

Marien Fressinaud 11 anni fa
parent
commit
58deab37cd

+ 1 - 2
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') . ' · ');

+ 1 - 4
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();

+ 1 - 4
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);
 		}
 	}
 

+ 1 - 4
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

+ 2 - 8
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);
 		}
 	}
 

+ 1 - 4
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');

+ 13 - 16
app/Controllers/statsController.php

@@ -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') . ' · ');
-	}
-
 }

+ 2 - 8
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;
 		}
 

+ 1 - 4
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();

+ 2 - 6
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') . ' · ');