2011-09-28 13:52:26 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2016-07-21 17:07:57 +02:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2015-03-26 11:44:34 +01:00
|
|
|
* @author Andreas Fischer <bantu@owncloud.com>
|
|
|
|
* @author Christopher Schäpers <kondou@ts.unde.re>
|
2016-05-26 19:56:05 +02:00
|
|
|
* @author Frank Karlitschek <frank@karlitschek.de>
|
2016-07-21 17:07:57 +02:00
|
|
|
* @author Joas Schilling <coding@schilljs.com>
|
2015-03-26 11:44:34 +01:00
|
|
|
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
|
2017-11-06 15:56:42 +01:00
|
|
|
* @author Kristof Provost <github@sigsegv.be>
|
2016-05-26 19:56:05 +02:00
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch>
|
2017-11-06 15:56:42 +01:00
|
|
|
* @author martin.mattel@diemattels.at <martin.mattel@diemattels.at>
|
2015-03-26 11:44:34 +01:00
|
|
|
* @author Masaki Kawabata Neto <masaki.kawabata@gmail.com>
|
|
|
|
* @author Morris Jobke <hey@morrisjobke.de>
|
|
|
|
*
|
|
|
|
* @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/>
|
|
|
|
*
|
|
|
|
*/
|
2015-02-26 11:37:37 +01:00
|
|
|
|
2017-10-13 21:30:29 +02:00
|
|
|
require_once __DIR__ . '/lib/versioncheck.php';
|
|
|
|
|
2013-06-10 13:45:19 +02:00
|
|
|
try {
|
2011-09-28 13:52:26 +02:00
|
|
|
|
2016-10-06 12:13:02 +02:00
|
|
|
require_once __DIR__ . '/lib/base.php';
|
2011-09-28 13:52:26 +02:00
|
|
|
|
2014-12-04 16:48:07 +01:00
|
|
|
$systemConfig = \OC::$server->getSystemConfig();
|
|
|
|
|
2016-05-23 10:09:36 +02:00
|
|
|
$installed = (bool) $systemConfig->getValue('installed', false);
|
|
|
|
$maintenance = (bool) $systemConfig->getValue('maintenance', false);
|
2016-08-17 08:41:49 +02:00
|
|
|
# see core/lib/private/legacy/defaults.php and core/themes/example/defaults.php
|
|
|
|
# for description and defaults
|
2016-08-17 11:59:53 +02:00
|
|
|
$defaults = new \OCP\Defaults();
|
2013-06-10 13:45:19 +02:00
|
|
|
$values=array(
|
|
|
|
'installed'=>$installed,
|
2013-07-04 14:28:12 +02:00
|
|
|
'maintenance' => $maintenance,
|
2016-09-29 17:14:00 +02:00
|
|
|
'needsDbUpgrade' => \OCP\Util::needUpgrade(),
|
2015-12-18 15:26:54 +01:00
|
|
|
'version'=>implode('.', \OCP\Util::getVersion()),
|
2013-06-10 13:45:19 +02:00
|
|
|
'versionstring'=>OC_Util::getVersionString(),
|
2016-09-06 14:11:30 +02:00
|
|
|
'edition'=> '',
|
2016-08-17 08:41:49 +02:00
|
|
|
'productname'=>$defaults->getName());
|
2013-08-29 15:03:58 +02:00
|
|
|
if (OC::$CLI) {
|
2013-08-29 20:03:16 +02:00
|
|
|
print_r($values);
|
2013-08-29 15:03:58 +02:00
|
|
|
} else {
|
2015-08-22 14:44:02 +02:00
|
|
|
header('Access-Control-Allow-Origin: *');
|
2015-04-08 18:02:00 +02:00
|
|
|
header('Content-Type: application/json');
|
2014-04-26 14:50:34 +02:00
|
|
|
echo json_encode($values);
|
2013-08-29 15:03:58 +02:00
|
|
|
}
|
2013-06-10 13:45:19 +02:00
|
|
|
|
|
|
|
} catch (Exception $ex) {
|
2018-06-26 10:32:50 +02:00
|
|
|
http_response_code(500);
|
2017-07-19 15:37:03 +02:00
|
|
|
\OC::$server->getLogger()->logException($ex, ['app' => 'remote']);
|
2013-08-18 11:02:08 +02:00
|
|
|
}
|