diff options
Diffstat (limited to 'lib/private/connector/sabre/maintenanceplugin.php')
-rw-r--r-- | lib/private/connector/sabre/maintenanceplugin.php | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/lib/private/connector/sabre/maintenanceplugin.php b/lib/private/connector/sabre/maintenanceplugin.php index 3d4e19ec470..ff55cdceab6 100644 --- a/lib/private/connector/sabre/maintenanceplugin.php +++ b/lib/private/connector/sabre/maintenanceplugin.php @@ -1,25 +1,7 @@ <?php -/** - * @author Bart Visscher <bartv@thisnet.nl> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ -class OC_Connector_Sabre_MaintenancePlugin extends \Sabre\DAV\ServerPlugin +namespace OC\Connector\Sabre; + +class MaintenancePlugin extends \Sabre\DAV\ServerPlugin { /** @@ -43,7 +25,7 @@ class OC_Connector_Sabre_MaintenancePlugin extends \Sabre\DAV\ServerPlugin public function initialize(\Sabre\DAV\Server $server) { $this->server = $server; - $this->server->subscribeEvent('beforeMethod', array($this, 'checkMaintenanceMode'), 10); + $this->server->on('beforeMethod', array($this, 'checkMaintenanceMode'), 10); } /** @@ -55,10 +37,10 @@ class OC_Connector_Sabre_MaintenancePlugin extends \Sabre\DAV\ServerPlugin * @return bool */ public function checkMaintenanceMode() { - if (OC_Config::getValue('maintenance', false)) { + if (\OC_Config::getValue('maintenance', false)) { throw new \Sabre\DAV\Exception\ServiceUnavailable(); } - if (OC::checkUpgrade(false)) { + if (\OC::checkUpgrade(false)) { throw new \Sabre\DAV\Exception\ServiceUnavailable('Upgrade needed'); } |