]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix singe user mode on public.php - take two
authorThomas Müller <thomas.mueller@tmit.eu>
Fri, 10 Apr 2015 09:17:33 +0000 (11:17 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Wed, 6 May 2015 10:14:34 +0000 (12:14 +0200)
lib/base.php
public.php

index 14e2b4fe1ff2c5e1a569d7ebc1d7be50544d424c..1714bd1e5eff329c11f684264241735e34e4f503 100644 (file)
@@ -260,7 +260,7 @@ class OC {
                }
        }
 
-       public static function checkSingleUserMode() {
+       public static function checkSingleUserMode($lockIfNoUserLoggedIn = false) {
                if (!\OCP\Config::getSystemValue('singleuser', false)) {
                        return;
                }
@@ -270,6 +270,10 @@ class OC {
                        if ($group->inGroup($user)) {
                                return;
                        }
+               } else {
+                       if(!$lockIfNoUserLoggedIn) {
+                               return;
+                       }
                }
                // send http status 503
                header('HTTP/1.1 503 Service Temporarily Unavailable');
index 0e04db66da79c6ada33e45b12f58363afb3e3082..ab6331a377a3d7ccea307150a8df909b3befc18b 100644 (file)
@@ -12,7 +12,7 @@ try {
        }
 
        OC::checkMaintenanceMode();
-       OC::checkSingleUserMode();
+       OC::checkSingleUserMode(true);
        $pathInfo = OC_Request::getPathInfo();
        if (!$pathInfo && !isset($_GET['service'])) {
                header('HTTP/1.0 404 Not Found');