summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-09 08:55:51 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-10 11:43:04 +0200
commitaa9fbf6639e2ce2fa2e8549d2d82d54a745d5327 (patch)
tree13c7b3f5ef94e4e6196cadf02922f814076a1e90 /lib
parente73292339f018a5938339f0daa45e2eb78e1f879 (diff)
downloadnextcloud-server-aa9fbf6639e2ce2fa2e8549d2d82d54a745d5327.tar.gz
nextcloud-server-aa9fbf6639e2ce2fa2e8549d2d82d54a745d5327.zip
Combine install checks in lib/base.php
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/base.php b/lib/base.php
index 6514a0c0b0c..4fc8cfa2455 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -172,11 +172,25 @@ class OC{
public static function checkInstalled() {
// Redirect to installer if not installed
- if (!OC_Config::getValue('installed', false) && OC::$SUBURI != '/index.php') {
- if(!OC::$CLI){
- $url = 'http://'.$_SERVER['SERVER_NAME'].OC::$WEBROOT.'/index.php';
- header("Location: $url");
+ if (!OC_Config::getValue('installed', false)) {
+ if (OC::$SUBURI != '/index.php') {
+ if(!OC::$CLI){
+ $url = 'http://'.$_SERVER['SERVER_NAME'].OC::$WEBROOT.'/index.php';
+ header("Location: $url");
+ }
+ exit();
}
+ // Check for autosetup:
+ $autosetup_file = OC::$SERVERROOT."/config/autoconfig.php";
+ if( file_exists( $autosetup_file )){
+ OC_Log::write('core','Autoconfig file found, setting up owncloud...', OC_Log::INFO);
+ include( $autosetup_file );
+ $_POST['install'] = 'true';
+ $_POST = array_merge ($_POST, $AUTOCONFIG);
+ unlink($autosetup_file);
+ }
+ OC_Util::addScript('setup');
+ require_once('setup.php');
exit();
}
}
@@ -331,10 +345,10 @@ class OC{
stream_wrapper_register('static', 'OC_StaticStreamWrapper');
stream_wrapper_register('close', 'OC_CloseStreamWrapper');
+ self::initTemplateEngine();
self::checkInstalled();
self::checkSSL();
self::initSession();
- self::initTemplateEngine();
self::checkUpgrade();
$errors=OC_Util::checkServer();
@@ -404,20 +418,6 @@ class OC{
* @return true when the request is handled here
*/
public static function handleRequest() {
- if (!OC_Config::getValue('installed', false)) {
- // Check for autosetup:
- $autosetup_file = OC::$SERVERROOT."/config/autoconfig.php";
- if( file_exists( $autosetup_file )){
- OC_Log::write('core','Autoconfig file found, setting up owncloud...',OC_Log::INFO);
- include( $autosetup_file );
- $_POST['install'] = 'true';
- $_POST = array_merge ($_POST, $AUTOCONFIG);
- unlink($autosetup_file);
- }
- OC_Util::addScript('setup');
- require_once('setup.php');
- exit();
- }
// Handle WebDAV
if($_SERVER['REQUEST_METHOD']=='PROPFIND'){
header('location: '.OC_Helper::linkToRemote('webdav'));