summaryrefslogtreecommitdiffstats
path: root/apps/bookmarks
diff options
context:
space:
mode:
authorBart Visscher <bart@thisnet.nl>2011-09-18 21:31:56 +0200
committerBart Visscher <bart@thisnet.nl>2011-09-18 21:31:56 +0200
commite990ef35426b7dde59ec74eb1568a8cfbd69f316 (patch)
tree9b4a276885378540812ce93c3cddcc73a00ba3b0 /apps/bookmarks
parent8966ed5a004a9b830f093355170d381566d58554 (diff)
downloadnextcloud-server-e990ef35426b7dde59ec74eb1568a8cfbd69f316.tar.gz
nextcloud-server-e990ef35426b7dde59ec74eb1568a8cfbd69f316.zip
Move some common code to OC_Util
Created the following function: - checkLoggedIn - checkAdminUser - redirectToDefaultPage
Diffstat (limited to 'apps/bookmarks')
-rw-r--r--apps/bookmarks/addBm.php7
-rw-r--r--apps/bookmarks/index.php7
2 files changed, 4 insertions, 10 deletions
diff --git a/apps/bookmarks/addBm.php b/apps/bookmarks/addBm.php
index 2dab33afb22..b62fcdfbeb0 100644
--- a/apps/bookmarks/addBm.php
+++ b/apps/bookmarks/addBm.php
@@ -24,10 +24,7 @@
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();
require_once('bookmarksHelper.php');
@@ -45,4 +42,4 @@ $tmpl->assign('URL', htmlentities($metadata['url']));
$tmpl->assign('TITLE', htmlentities($metadata['title']));
$tmpl->assign('DESCRIPTION', htmlentities($metadata['description']));
-$tmpl->printPage(); \ No newline at end of file
+$tmpl->printPage();
diff --git a/apps/bookmarks/index.php b/apps/bookmarks/index.php
index ba9f7cc0c61..45c9a52f557 100644
--- a/apps/bookmarks/index.php
+++ b/apps/bookmarks/index.php
@@ -24,10 +24,7 @@
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();
OC_App::setActiveNavigationEntry( 'bookmarks_index' );
@@ -36,4 +33,4 @@ OC_Util::addStyle('bookmarks', 'bookmarks');
$tmpl = new OC_Template( 'bookmarks', 'list', 'user' );
-$tmpl->printPage(); \ No newline at end of file
+$tmpl->printPage();