1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Move some common code to OC_Util

Created the following function:
 - checkLoggedIn
 - checkAdminUser
 - redirectToDefaultPage
This commit is contained in:
Bart Visscher 2011-09-18 21:31:56 +02:00
parent 09d599633f
commit ff73f4315f

View File

@ -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());