From 6929652e141352f44c2ad63673d8aebeceee262b Mon Sep 17 00:00:00 2001
From: Michael Gapczynski <GapczynskiM@gmail.com>
Date: Sat, 11 Feb 2012 17:37:35 -0500
Subject: [PATCH] Redirect to installer if not installed

---
 lib/base.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/base.php b/lib/base.php
index 5b8eeb746b..31133b7262 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -142,6 +142,13 @@ class OC{
 		// set the right include path
 		set_include_path(OC::$SERVERROOT.'/lib'.PATH_SEPARATOR.OC::$SERVERROOT.'/config'.PATH_SEPARATOR.OC::$SERVERROOT.'/3rdparty'.PATH_SEPARATOR.get_include_path().PATH_SEPARATOR.OC::$SERVERROOT);
 
+		// Redirect to installer if not installed
+		if (!OC_Config::getValue('installed', false) && OC::$SUBURI != '/index.php') {
+			$url = 'http://'.$_SERVER['SERVER_NAME'].OC::$WEBROOT.'/index.php';
+			header("Location: $url");
+			exit();
+		}
+
 		// redirect to https site if configured
 		if( OC_Config::getValue( "forcessl", false )){
 			ini_set("session.cookie_secure", "on");
-- 
GitLab