summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-15 17:39:00 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-15 17:39:00 +0200
commit63af75586b53391670c2ccfb48d19f4b6950cab0 (patch)
treefa5a16539431673c9f51e54bb313ed69a30c60b6 /lib/base.php
parent4954e46bb2ba36c749b638111dc90500e12cedf7 (diff)
parentdd3208fe6fadff3ad831df2fa5220e2184738b21 (diff)
downloadnextcloud-server-63af75586b53391670c2ccfb48d19f4b6950cab0.tar.gz
nextcloud-server-63af75586b53391670c2ccfb48d19f4b6950cab0.zip
Merge branch 'master' into routing
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php39
1 files changed, 20 insertions, 19 deletions
diff --git a/lib/base.php b/lib/base.php
index 3abfdb35668..fb49e9e6706 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -180,25 +180,11 @@ class OC{
public static function checkInstalled() {
// Redirect to installer if not installed
- 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);
+ 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");
}
- OC_Util::addScript('setup');
- require_once('setup.php');
exit();
}
}
@@ -344,10 +330,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();
@@ -378,6 +364,7 @@ class OC{
// Check for blacklisted files
OC_Hook::connect('OC_Filesystem','write','OC_Filesystem','isBlacklisted');
+ OC_Hook::connect('OC_Filesystem', 'rename', 'OC_Filesystem', 'isBlacklisted');
//make sure temporary files are cleaned up
register_shutdown_function(array('OC_Helper','cleanTmp'));
@@ -416,6 +403,20 @@ class OC{
* @brief Handle the request
*/
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'));