2011-09-28 11:52:26 +00:00
|
|
|
<?php
|
2015-02-26 10:37:37 +00:00
|
|
|
|
2011-09-28 11:52:26 +00:00
|
|
|
/**
|
2015-02-26 10:37:37 +00:00
|
|
|
* ownCloud status page. Useful if you want to check from the outside if an ownCloud installation exists
|
|
|
|
*
|
|
|
|
* @author Frank Karlitschek
|
|
|
|
* @copyright 2012 Frank Karlitschek frank@owncloud.org
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 3 of the License, or any later version.
|
|
|
|
*
|
|
|
|
* This library 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 along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-06-10 11:45:19 +00:00
|
|
|
try {
|
2011-09-28 11:52:26 +00:00
|
|
|
|
2013-06-10 11:45:19 +00:00
|
|
|
require_once 'lib/base.php';
|
2011-09-28 11:52:26 +00:00
|
|
|
|
2014-12-04 15:48:07 +00:00
|
|
|
$systemConfig = \OC::$server->getSystemConfig();
|
|
|
|
|
|
|
|
$installed = $systemConfig->getValue('installed') == 1;
|
|
|
|
$maintenance = $systemConfig->getValue('maintenance', false);
|
2013-06-10 11:45:19 +00:00
|
|
|
$values=array(
|
|
|
|
'installed'=>$installed,
|
2013-07-04 12:28:12 +00:00
|
|
|
'maintenance' => $maintenance,
|
2013-06-10 11:45:19 +00:00
|
|
|
'version'=>implode('.', OC_Util::getVersion()),
|
|
|
|
'versionstring'=>OC_Util::getVersionString(),
|
|
|
|
'edition'=>OC_Util::getEditionString());
|
2013-08-29 13:03:58 +00:00
|
|
|
if (OC::$CLI) {
|
2013-08-29 18:03:16 +00:00
|
|
|
print_r($values);
|
2013-08-29 13:03:58 +00:00
|
|
|
} else {
|
2014-04-26 12:50:34 +00:00
|
|
|
echo json_encode($values);
|
2013-08-29 13:03:58 +00:00
|
|
|
}
|
2013-06-10 11:45:19 +00:00
|
|
|
|
|
|
|
} catch (Exception $ex) {
|
|
|
|
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
|
|
|
|
\OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL);
|
2013-08-18 09:02:08 +00:00
|
|
|
}
|