From ff73f4315f5a18f24e7f53f090bb881a9643784e Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sun, 18 Sep 2011 21:31:56 +0200 Subject: [PATCH] Move some common code to OC_Util Created the following function: - checkLoggedIn - checkAdminUser - redirectToDefaultPage --- index.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/index.php b/index.php index 8013f19d..c9cf348d 100644 --- a/index.php +++ b/index.php @@ -28,10 +28,7 @@ function contacts_namesort($a,$b){ require_once('../../lib/base.php'); // Check if we are a user -if( !OC_User::isLoggedIn()){ - header( 'Location: '.OC_Helper::linkTo( '', 'index.php' )); - exit(); -} +OC_Util::checkLoggedIn(); // Check if the user has an addressbook $addressbooks = OC_Contacts_Addressbook::all(OC_User::getUser());