public static function getCapabilities() { $result = array(); list($major, $minor, $micro) = OC_Util::getVersion(); $result['version'] = array('major' => $major, 'minor' => $minor, 'micro' => $micro, 'string' => OC_Util::getVersionString(), 'edition' => OC_Util::getEditionString()); $result['capabilities'] = \OC::$server->getCapabilitiesManager()->getCapabilities(); return new OC_OCS_Result($result); }
public static function getCapabilities($parameters) { $result = array(); list($major, $minor, $micro) = OC_Util::getVersion(); $result['version'] = array('major' => $major, 'minor' => $minor, 'micro' => $micro, 'string' => OC_Util::getVersionString(), 'edition' => OC_Util::getEditionString()); $result['capabilities'] = array('core' => array('pollinterval' => OC_Config::getValue('pollinterval', 60))); return new OC_OCS_Result($result); }
/** * @param IConfig $config * @param EventDispatcherInterface $dispatcher * @param IRequest $request */ public function __construct(IConfig $config, EventDispatcherInterface $dispatcher, IRequest $request) { $defaults = new OC_Defaults(); $this->config = $config; $this->application = new SymfonyApplication($defaults->getName(), \OC_Util::getVersionString()); $this->dispatcher = $dispatcher; $this->request = $request; }
public static function checkVersion($newVersionArray, $newVersionString) { $currentVersionArray = \OC_Util::getVersion(); $currentVersion = \OC_Util::getVersionString(); $difference = intval($newVersionArray[0]) - intval($currentVersionArray[0]); if ($difference > 1 || $difference < 0 || version_compare($currentVersion, $newVersionString) > 0) { $message = (string) App::$l10n->t('Not possible to update %s to %s. Downgrading or skipping major releases is not supported.', array($currentVersion, implode('.', $newVersionArray))); App::log($message); throw new \Exception($message); } }
public static function checkVersion($newVersionArray, $newVersionString) { $l10n = \OC::$server->getL10N('updater'); $currentVersionArray = \OCP\Util::getVersion(); $currentVersion = \OC_Util::getVersionString(); $difference = intval($newVersionArray[0]) - intval($currentVersionArray[0]); if ($difference > 1 || $difference < 0 || version_compare($currentVersion, $newVersionString) > 0) { $message = (string) $l10n->t('Not possible to update %s to %s. Downgrading or skipping major releases is not supported.', [$currentVersion, implode('.', $newVersionArray)]); \OC::$server->getLogger()->error($message, ['app' => 'updater']); throw new \Exception($message); } }
public static function checkVersion($newVersionArray, $newVersionString) { $l10n = \OC::$server->getL10N('updater'); $currentVersionArray = \OCP\Util::getVersion(); $currentVersion = \OC_Util::getVersionString(); // https://github.com/owncloud/core/issues/18880 // Always positive for versions >= 100.0.0.0 if (version_compare($newVersionString, '100.0.0.0', '>=')) { return; } $difference = intval($newVersionArray[0]) - intval($currentVersionArray[0]); if ($difference > 1 || $difference < 0 || version_compare($currentVersion, $newVersionString) > 0) { $message = (string) $l10n->t('Not possible to update %s to %s. Downgrading or skipping major releases is not supported.', [$currentVersion, implode('.', $newVersionArray)]); \OC::$server->getLogger()->error($message, ['app' => 'updater']); throw new \Exception($message); } }
/** * @param IConfig $config */ public function __construct(IConfig $config) { $defaults = new OC_Defaults(); $this->config = $config; $this->application = new SymfonyApplication($defaults->getName(), \OC_Util::getVersionString()); }
/** * Checks if the version requires an update and shows * @param bool $showTemplate Whether an update screen should get shown * @return bool|void */ public static function checkUpgrade($showTemplate = true) { if (\OCP\Util::needUpgrade()) { $systemConfig = \OC::$server->getSystemConfig(); if ($showTemplate && !$systemConfig->getValue('maintenance', false)) { $version = OC_Util::getVersion(); $oldTheme = $systemConfig->getValue('theme'); $systemConfig->setValue('theme', ''); OC_Util::addScript('config'); // needed for web root OC_Util::addScript('update'); $tmpl = new OC_Template('', 'update.admin', 'guest'); $tmpl->assign('version', OC_Util::getVersionString()); // get third party apps $apps = OC_App::getEnabledApps(); $incompatibleApps = array(); foreach ($apps as $appId) { $info = OC_App::getAppInfo($appId); if (!OC_App::isAppCompatible($version, $info)) { $incompatibleApps[] = $info; } } $tmpl->assign('appList', $incompatibleApps); $tmpl->assign('productName', 'ownCloud'); // for now $tmpl->assign('oldTheme', $oldTheme); $tmpl->printPage(); exit; } else { return true; } } return false; }
protected function execute(InputInterface $input, OutputInterface $output) { $values = array('installed' => \OC_Config::getValue('installed') ? 'true' : 'false', 'version' => implode('.', \OC_Util::getVersion()), 'versionstring' => \OC_Util::getVersionString(), 'edition' => \OC_Util::getEditionString()); print_r($values); }
public static function checkUpgrade($showTemplate = true) { if (OC_Config::getValue('installed', false)) { $installedVersion = OC_Config::getValue('version', '0.0.0'); $currentVersion = implode('.', OC_Util::getVersion()); if (version_compare($currentVersion, $installedVersion, '>')) { if ($showTemplate && !OC_Config::getValue('maintenance', false)) { OC_Config::setValue('theme', ''); $minimizerCSS = new OC_Minimizer_CSS(); $minimizerCSS->clearCache(); $minimizerJS = new OC_Minimizer_JS(); $minimizerJS->clearCache(); OC_Util::addscript('update'); $tmpl = new OC_Template('', 'update', 'guest'); $tmpl->assign('version', OC_Util::getVersionString()); $tmpl->printPage(); exit; } else { return true; } } return false; } }
/** * Copyright (c) 2013 Bart Visscher <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ use Symfony\Component\Console\Application; $RUNTIME_NOAPPS = true; require_once 'lib/base.php'; // set to run indefinitely if needed set_time_limit(0); // Don't do anything if ownCloud has not been installed yet if (!OC_Config::getValue('installed', false)) { echo "Console can only be used once ownCloud has been installed" . PHP_EOL; exit(0); } if (!OC::$CLI) { echo "This script can be run from the command line only" . PHP_EOL; exit(0); } $defaults = new OC_Defaults(); $application = new Application($defaults->getName(), \OC_Util::getVersionString()); require_once 'core/register_command.php'; foreach (OC_App::getAllApps() as $app) { $file = OC_App::getAppPath($app) . '/appinfo/register_command.php'; if (file_exists($file)) { require $file; } } $application->run();
<?php } ?> </fieldset> <fieldset class="personalblock"> <legend><strong><?php p($l->t('Version')); ?> </strong></legend> <strong><?php p($defaults->getName()); ?> </strong> <?php p(OC_Util::getVersionString()); if (OC_Util::getEditionString() === '') { ?> (<?php print_unescaped(OC_Updater::ShowUpdatingHint()); ?> )<br/> <?php print_unescaped($l->t('Developed by the <a href="http://ownCloud.org/contact" target="_blank">ownCloud community</a>, the <a href="https://github.com/owncloud" target="_blank">source code</a> is licensed under the <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank"><abbr title="Affero General Public License">AGPL</abbr></a>.')); } ?> </fieldset> <fieldset class="personalblock credits-footer"> <p> <?php print_unescaped($defaults->getShortFooter());
public function testGetVersionString() { $version = \OC_Util::getVersionString(); $this->assertTrue(is_string($version)); }
/** * A human readable string is generated based on version, channel and build number * * @return string */ public static function getHumanVersion() { $version = OC_Util::getVersionString() . ' (' . OC_Util::getChannel() . ')'; $build = OC_Util::getBuild(); if (!empty($build) and OC_Util::getChannel() === 'daily') { $version .= ' Build:' . $build; } return $version; }
/** * Prints the upgrade page */ private static function printUpgradePage() { $systemConfig = \OC::$server->getSystemConfig(); $oldTheme = $systemConfig->getValue('theme'); $systemConfig->setValue('theme', ''); \OCP\Util::addScript('config'); // needed for web root \OCP\Util::addScript('update'); // check whether this is a core update or apps update $installedVersion = $systemConfig->getValue('version', '0.0.0'); $currentVersion = implode('.', OC_Util::getVersion()); $appManager = \OC::$server->getAppManager(); $tmpl = new OC_Template('', 'update.admin', 'guest'); $tmpl->assign('version', OC_Util::getVersionString()); // if not a core upgrade, then it's apps upgrade if (version_compare($currentVersion, $installedVersion, '=')) { $tmpl->assign('isAppsOnlyUpgrade', true); } else { $tmpl->assign('isAppsOnlyUpgrade', false); } // get third party apps $ocVersion = OC_Util::getVersion(); $tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion)); $tmpl->assign('incompatibleAppsList', $appManager->getIncompatibleApps($ocVersion)); $tmpl->assign('productName', 'ownCloud'); // for now $tmpl->assign('oldTheme', $oldTheme); $tmpl->printPage(); }
?> </code><br /> <em><?php echo $l->t('use this address to connect to your ownCloud in your file manager'); ?> </em> </p> <?php foreach ($_['forms'] as $form) { echo $form; } ?> <p class="personalblock"> <strong>ownCloud</strong> <?php echo OC_Util::getVersionString(); ?> <?php echo OC_Util::getEditionString(); ?> (<?php echo OC_Updater::ShowUpdatingHint(); ?> )<br /> Developed by the <a href="http://ownCloud.org/contact" target="_blank">ownCloud community</a>, the <a href="http://gitorious.org/owncloud" target="_blank">source code</a> is freely licensed under the <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank"><abbr title="Affero General Public License">AGPL</abbr></a>. </p>
* @brief ownCloud Games Integration * * @author Pierre Fauconnier * @copyright 2014 Pierre Fauconnier * @license CeCILL v2.1 - http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt * @site http://oc-apps2.sourceforge.net/ */ // Fired by main.php \OCP\Util::addStyle(K_APP_NAME, 'styles'); \OCP\Util::addScript(K_APP_NAME, 'go'); ?> <div id="apps2_games"> <div id="controls"> <div id="apps2_games_versions"> <?php echo 'Apps2 - Games'.'<br>v'.\OC_Appconfig::getValue(K_APP_NAME,'installed_version').' / '.\OC_Util::getVersionString(); ?> </div> <div id="apps2_games_back" class="button"><span>List of games</span></div> </div> <div id="apps2_games_list" class="hascontrols"> <ul class="apps2_games_grid"> <?php $myPath = \OC_App::getAppWebPath(K_APP_NAME); foreach ( $_['mainList'] as $myItem ) { echo<<<EOG <li class="apps2_games_item"> <a href="$myPath/{$myItem->js}" class="apps2_games_href"> <div class="apps2_games_item_icon"> <img src="$myPath/{$myItem->ico}"> </div>
public static function checkUpgrade($showTemplate = true) { if (self::needUpgrade()) { if ($showTemplate && !OC_Config::getValue('maintenance', false)) { OC_Config::setValue('theme', ''); $minimizerCSS = new OC_Minimizer_CSS(); $minimizerCSS->clearCache(); $minimizerJS = new OC_Minimizer_JS(); $minimizerJS->clearCache(); OC_Util::addScript('config'); // needed for web root OC_Util::addScript('update'); $tmpl = new OC_Template('', 'update.admin', 'guest'); $tmpl->assign('version', OC_Util::getVersionString()); $tmpl->printPage(); exit; } else { return true; } } return false; }
/** * ownCloud status page. usefull if you want to check from the outside if an owncloud installation exists * * @author Frank Karlitschek * @copyright 2010 Frank Karlitschek karlitschek@kde.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/>. * */ $RUNTIME_NOAPPS = TRUE; //no apps, yet require_once 'lib/base.php'; if (OC_Config::getValue('installed') == 1) { $installed = 'true'; } else { $installed = 'false'; } $values = array('installed' => $installed, 'version' => implode('.', OC_Util::getVersion()), 'versionstring' => OC_Util::getVersionString()); echo json_encode($values);
<?php try { require_once 'lib/base.php'; $systemConfig = \OC::$server->getSystemConfig(); $installed = $systemConfig->getValue('installed') == 1; $maintenance = $systemConfig->getValue('maintenance', false); $values = array('installed' => $installed, 'maintenance' => $maintenance, 'version' => implode('.', OC_Util::getVersion()), 'versionstring' => OC_Util::getVersionString(), 'edition' => OC_Util::getEditionString()); if (OC::$CLI) { print_r($values); } else { header('Access-Control-Allow-Origin: *'); header('Content-Type: application/json'); echo json_encode($values); } } catch (Exception $ex) { OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); }
* 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/> * */ try { require_once 'lib/base.php'; $systemConfig = \OC::$server->getSystemConfig(); $installed = $systemConfig->getValue('installed') == 1; $maintenance = $systemConfig->getValue('maintenance', false); $values=array( 'installed'=>$installed, 'maintenance' => $maintenance, 'version'=>implode('.', OC_Util::getVersion()), 'versionstring'=>OC_Util::getVersionString(), 'edition'=>OC_Util::getEditionString()); if (OC::$CLI) { print_r($values); } else { header('Content-Type: application/json'); echo json_encode($values); } } catch (Exception $ex) { OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); }
// Set the content type to Javascript header("Content-type: text/javascript"); // Disallow caching header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Enable l10n support $l = \OC::$server->getL10N('core'); // Enable OC_Defaults support $defaults = new OC_Defaults(); // Get the config $apps_paths = array(); foreach (OC_App::getEnabledApps() as $app) { $apps_paths[$app] = OC_App::getAppWebPath($app); } $config = \OC::$server->getConfig(); $value = $config->getAppValue('core', 'shareapi_default_expire_date', 'no'); $defaultExpireDateEnabled = $value === 'yes' ? true : false; $defaultExpireDate = $enforceDefaultExpireDate = null; if ($defaultExpireDateEnabled) { $defaultExpireDate = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); $value = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'); $enforceDefaultExpireDate = $value === 'yes' ? true : false; } $outgoingServer2serverShareEnabled = $config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes'; $array = array("oc_debug" => defined('DEBUG') && DEBUG ? 'true' : 'false', "oc_isadmin" => OC_User::isAdminUser(OC_User::getUser()) ? 'true' : 'false', "oc_webroot" => "\"" . OC::$WEBROOT . "\"", "oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), "datepickerFormatDate" => json_encode($l->getDateFormat()), "dayNames" => json_encode(array((string) $l->t('Sunday'), (string) $l->t('Monday'), (string) $l->t('Tuesday'), (string) $l->t('Wednesday'), (string) $l->t('Thursday'), (string) $l->t('Friday'), (string) $l->t('Saturday'))), "monthNames" => json_encode(array((string) $l->t('January'), (string) $l->t('February'), (string) $l->t('March'), (string) $l->t('April'), (string) $l->t('May'), (string) $l->t('June'), (string) $l->t('July'), (string) $l->t('August'), (string) $l->t('September'), (string) $l->t('October'), (string) $l->t('November'), (string) $l->t('December'))), "firstDay" => json_encode($l->getFirstWeekDay()), "oc_config" => json_encode(array('session_lifetime' => min(\OCP\Config::getSystemValue('session_lifetime', ini_get('session.gc_maxlifetime')), ini_get('session.gc_maxlifetime')), 'session_keepalive' => \OCP\Config::getSystemValue('session_keepalive', true), 'version' => implode('.', OC_Util::getVersion()), 'versionstring' => OC_Util::getVersionString(), 'enable_avatars' => \OC::$server->getConfig()->getSystemValue('enable_avatars', true))), "oc_appconfig" => json_encode(array("core" => array('defaultExpireDateEnabled' => $defaultExpireDateEnabled, 'defaultExpireDate' => $defaultExpireDate, 'defaultExpireDateEnforced' => $enforceDefaultExpireDate, 'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(), 'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(), 'resharingAllowed' => \OCP\Share::isResharingAllowed(), 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, 'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated')))), "oc_defaults" => json_encode(array('entity' => $defaults->getEntity(), 'name' => $defaults->getName(), 'title' => $defaults->getTitle(), 'baseUrl' => $defaults->getBaseUrl(), 'syncClientUrl' => $defaults->getSyncClientUrl(), 'docBaseUrl' => $defaults->getDocBaseUrl(), 'slogan' => $defaults->getSlogan(), 'logoClaim' => $defaults->getLogoClaim(), 'shortFooter' => $defaults->getShortFooter(), 'longFooter' => $defaults->getLongFooter()))); // Allow hooks to modify the output values OC_Hook::emit('\\OCP\\Config', 'js', array('array' => &$array)); // Echo it foreach ($array as $setting => $value) { echo "var " . $setting . "=" . $value . ";\n"; }
// Set the content type to Javascript header("Content-type: text/javascript"); // Disallow caching header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Enable l10n support $l = \OC::$server->getL10N('core'); // Enable OC_Defaults support $defaults = new OC_Defaults(); // Get the config $apps_paths = array(); foreach (OC_App::getEnabledApps() as $app) { $apps_paths[$app] = OC_App::getAppWebPath($app); } $config = \OC::$server->getConfig(); $value = $config->getAppValue('core', 'shareapi_default_expire_date', 'no'); $defaultExpireDateEnabled = $value === 'yes' ? true : false; $defaultExpireDate = $enforceDefaultExpireDate = null; if ($defaultExpireDateEnabled) { $defaultExpireDate = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); $value = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'); $enforceDefaultExpireDate = $value === 'yes' ? true : false; } $outgoingServer2serverShareEnabled = $config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes'; $array = array("oc_debug" => $config->getSystemValue('debug', false) ? 'true' : 'false', "oc_isadmin" => OC_User::isAdminUser(OC_User::getUser()) ? 'true' : 'false', "oc_webroot" => "\"" . OC::$WEBROOT . "\"", "oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), "datepickerFormatDate" => json_encode($l->l('jsdate', null)), "dayNames" => json_encode(array((string) $l->t('Sunday'), (string) $l->t('Monday'), (string) $l->t('Tuesday'), (string) $l->t('Wednesday'), (string) $l->t('Thursday'), (string) $l->t('Friday'), (string) $l->t('Saturday'))), "dayNamesShort" => json_encode(array((string) $l->t('Sun.'), (string) $l->t('Mon.'), (string) $l->t('Tue.'), (string) $l->t('Wed.'), (string) $l->t('Thu.'), (string) $l->t('Fri.'), (string) $l->t('Sat.'))), "dayNamesMin" => json_encode(array((string) $l->t('Su'), (string) $l->t('Mo'), (string) $l->t('Tu'), (string) $l->t('We'), (string) $l->t('Th'), (string) $l->t('Fr'), (string) $l->t('Sa'))), "monthNames" => json_encode(array((string) $l->t('January'), (string) $l->t('February'), (string) $l->t('March'), (string) $l->t('April'), (string) $l->t('May'), (string) $l->t('June'), (string) $l->t('July'), (string) $l->t('August'), (string) $l->t('September'), (string) $l->t('October'), (string) $l->t('November'), (string) $l->t('December'))), "monthNamesShort" => json_encode(array((string) $l->t('Jan.'), (string) $l->t('Feb.'), (string) $l->t('Mar.'), (string) $l->t('Apr.'), (string) $l->t('May.'), (string) $l->t('Jun.'), (string) $l->t('Jul.'), (string) $l->t('Aug.'), (string) $l->t('Sep.'), (string) $l->t('Oct.'), (string) $l->t('Nov.'), (string) $l->t('Dec.'))), "firstDay" => json_encode($l->l('firstday', null)), "oc_config" => json_encode(array('session_lifetime' => min(\OCP\Config::getSystemValue('session_lifetime', OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')), OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')), 'session_keepalive' => \OCP\Config::getSystemValue('session_keepalive', true), 'version' => implode('.', \OCP\Util::getVersion()), 'versionstring' => OC_Util::getVersionString(), 'enable_avatars' => \OC::$server->getConfig()->getSystemValue('enable_avatars', true), 'lost_password_link' => \OC::$server->getConfig()->getSystemValue('lost_password_link', null), 'modRewriteWorking' => getenv('front_controller_active') === 'true')), "oc_appconfig" => json_encode(array("core" => array('defaultExpireDateEnabled' => $defaultExpireDateEnabled, 'defaultExpireDate' => $defaultExpireDate, 'defaultExpireDateEnforced' => $enforceDefaultExpireDate, 'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(), 'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(), 'resharingAllowed' => \OCP\Share::isResharingAllowed(), 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, 'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated')))), "oc_defaults" => json_encode(array('entity' => $defaults->getEntity(), 'name' => $defaults->getName(), 'title' => $defaults->getTitle(), 'baseUrl' => $defaults->getBaseUrl(), 'syncClientUrl' => $defaults->getSyncClientUrl(), 'docBaseUrl' => $defaults->getDocBaseUrl(), 'docPlaceholderUrl' => $defaults->buildDocLinkToKey('PLACEHOLDER'), 'slogan' => $defaults->getSlogan(), 'logoClaim' => $defaults->getLogoClaim(), 'shortFooter' => $defaults->getShortFooter(), 'longFooter' => $defaults->getLongFooter(), 'folder' => OC_Util::getTheme()))); // Allow hooks to modify the output values OC_Hook::emit('\\OCP\\Config', 'js', array('array' => &$array)); // Echo it foreach ($array as $setting => $value) { echo "var " . $setting . "=" . $value . ";\n"; }
protected function execute(InputInterface $input, OutputInterface $output) { $values = array('installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false), 'version' => implode('.', \OCP\Util::getVersion()), 'versionstring' => \OC_Util::getVersionString(), 'edition' => \OC_Util::getEditionString()); $this->writeArrayInOutputFormat($input, $output, $values); }
/** * Prints the upgrade page */ private static function printUpgradePage() { $systemConfig = \OC::$server->getSystemConfig(); $disableWebUpdater = $systemConfig->getValue('upgrade.disable-web', false); $tooBig = false; if (!$disableWebUpdater) { $apps = \OC::$server->getAppManager(); $tooBig = $apps->isInstalled('user_ldap') || $apps->isInstalled('user_shibboleth'); if (!$tooBig) { // count users $stats = \OC::$server->getUserManager()->countUsers(); $totalUsers = array_sum($stats); $tooBig = $totalUsers > 50; } } if ($disableWebUpdater || $tooBig) { // send http status 503 header('HTTP/1.1 503 Service Temporarily Unavailable'); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 120'); // render error page $template = new OC_Template('', 'update.use-cli', 'guest'); $template->assign('productName', 'ownCloud'); // for now $template->assign('version', OC_Util::getVersionString()); $template->assign('tooBig', $tooBig); $template->printPage(); die; } // check whether this is a core update or apps update $installedVersion = $systemConfig->getValue('version', '0.0.0'); $currentVersion = implode('.', \OCP\Util::getVersion()); // if not a core upgrade, then it's apps upgrade $isAppsOnlyUpgrade = version_compare($currentVersion, $installedVersion, '='); $oldTheme = $systemConfig->getValue('theme'); $systemConfig->setValue('theme', ''); \OCP\Util::addScript('config'); // needed for web root \OCP\Util::addScript('update'); \OCP\Util::addStyle('update'); $appManager = \OC::$server->getAppManager(); $tmpl = new OC_Template('', 'update.admin', 'guest'); $tmpl->assign('version', OC_Util::getVersionString()); $tmpl->assign('isAppsOnlyUpgrade', $isAppsOnlyUpgrade); // get third party apps $ocVersion = \OCP\Util::getVersion(); $tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion)); $tmpl->assign('incompatibleAppsList', $appManager->getIncompatibleApps($ocVersion)); $tmpl->assign('productName', 'ownCloud'); // for now $tmpl->assign('oldTheme', $oldTheme); $tmpl->printPage(); }