From f4782a76907cf010faf9f4cd7deb3a67a2d02de9 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Fri, 30 Sep 2011 23:05:10 +0200 Subject: Check if the application is actually enabled --- lib/util.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/util.php') diff --git a/lib/util.php b/lib/util.php index c17f346c2be..26d718da944 100644 --- a/lib/util.php +++ b/lib/util.php @@ -276,6 +276,16 @@ class OC_Util { } + /** + * Check if the app is enabled, send json error msg if not + */ + public static function checkAppEnabled($app){ + if( !OC_App::isEnabled($app)){ + header( 'Location: '.OC_Helper::linkTo( '', 'index.php' , true)); + exit(); + } + } + /** * Check if the user is logged in, redirects to home if not */ -- cgit v1.2.3