aboutsummaryrefslogtreecommitdiffstats
path: root/search/index.php
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 /search/index.php
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 'search/index.php')
-rw-r--r--search/index.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/search/index.php b/search/index.php
index c781c31f549..518695c56d2 100644
--- a/search/index.php
+++ b/search/index.php
@@ -26,10 +26,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();
// Load the files we need
OC_Util::addStyle( 'search', 'search' );
@@ -38,8 +35,7 @@ $query=(isset($_POST['query']))?$_POST['query']:'';
if($query){
$results=OC_Search::search($query);
}else{
- header("Location: ".OC::$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
- exit();
+ OC_Util::redirectToDefaultPage();
}
$resultTypes=array();