Deprecate getEditionString()

This commit is contained in:
Joas Schilling 2016-09-06 14:11:30 +02:00
parent 836c938583
commit 7c0951244a
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
15 changed files with 17 additions and 71 deletions

View File

@ -43,13 +43,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
<div class="header-appname-container"> <div class="header-appname-container">
<h1 class="header-appname"> <h1 class="header-appname">
<?php <?php p($theme->getName()); ?>
if(OC_Util::getEditionString() === '') {
p($theme->getName());
} else {
print_unescaped($theme->getHTMLName());
}
?>
</h1> </h1>
</div> </div>

View File

@ -38,13 +38,11 @@ class Status extends Base {
} }
protected function execute(InputInterface $input, OutputInterface $output) { protected function execute(InputInterface $input, OutputInterface $output) {
$installed = (bool) \OC::$server->getConfig()->getSystemValue('installed', false);
$values = array( $values = array(
'installed' => $installed, 'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false),
'version' => implode('.', \OCP\Util::getVersion()), 'version' => implode('.', \OCP\Util::getVersion()),
'versionstring' => \OC_Util::getVersionString(), 'versionstring' => \OC_Util::getVersionString(),
'edition' => $installed ? \OC_Util::getEditionString() : '', 'edition' => '',
); );
$this->writeArrayInOutputFormat($input, $output, $values); $this->writeArrayInOutputFormat($input, $output, $values);

View File

@ -81,7 +81,7 @@ class OCSController extends \OCP\AppFramework\OCSController {
'minor' => $minor, 'minor' => $minor,
'micro' => $micro, 'micro' => $micro,
'string' => \OC_Util::getVersionString(), 'string' => \OC_Util::getVersionString(),
'edition' => \OC_Util::getEditionString(), 'edition' => '',
); );
$result['capabilities'] = $this->capabilitiesManager->getCapabilities(); $result['capabilities'] = $this->capabilitiesManager->getCapabilities();

View File

@ -48,13 +48,7 @@
<a href="#" class="header-appname-container menutoggle" tabindex="2"> <a href="#" class="header-appname-container menutoggle" tabindex="2">
<h1 class="header-appname"> <h1 class="header-appname">
<?php <?php p(!empty($_['application'])?$_['application']: $l->t('Apps')); ?>
if(OC_Util::getEditionString() === '') {
p(!empty($_['application'])?$_['application']: $l->t('Apps'));
} else {
print_unescaped($theme->getHTMLName());
}
?>
</h1> </h1>
<div class="icon-caret"></div> <div class="icon-caret"></div>
</a> </a>

View File

@ -70,13 +70,7 @@ class OCSClient {
* @return bool * @return bool
*/ */
public function isAppStoreEnabled() { public function isAppStoreEnabled() {
// For a regular edition default to true, all others default to false return $this->config->getSystemValue('appstoreenabled', true) === true;
$default = false;
if (\OC_Util::getEditionString() === '') {
$default = true;
}
return $this->config->getSystemValue('appstoreenabled', $default) === true;
} }
/** /**

View File

@ -71,7 +71,7 @@ class VersionCheck {
$version['installed'] = $this->config->getAppValue('core', 'installedat'); $version['installed'] = $this->config->getAppValue('core', 'installedat');
$version['updated'] = $this->config->getAppValue('core', 'lastupdatedat'); $version['updated'] = $this->config->getAppValue('core', 'lastupdatedat');
$version['updatechannel'] = \OC_Util::getChannel(); $version['updatechannel'] = \OC_Util::getChannel();
$version['edition'] = \OC_Util::getEditionString(); $version['edition'] = '';
$version['build'] = \OC_Util::getBuild(); $version['build'] = \OC_Util::getBuild();
$versionString = implode('x', $version); $versionString = implode('x', $version);

View File

@ -437,9 +437,7 @@ class OC_App {
$settings = array(); $settings = array();
// by default, settings only contain the help menu // by default, settings only contain the help menu
if (OC_Util::getEditionString() === '' && if (\OC::$server->getSystemConfig()->getValue('knowledgebaseenabled', true)) {
\OC::$server->getSystemConfig()->getValue('knowledgebaseenabled', true) == true
) {
$settings = array( $settings = array(
array( array(
"id" => "help", "id" => "help",

View File

@ -382,18 +382,11 @@ class OC_Util {
} }
/** /**
* @description get the current installed edition of ownCloud. There is the community * @deprecated the value is of no use anymore
* edition that just returns an empty string and the enterprise edition
* that returns "Enterprise".
* @return string * @return string
*/ */
public static function getEditionString() { public static function getEditionString() {
if (OC_App::isEnabled('enterprise_key')) { return '';
return "Enterprise";
} else {
return "";
}
} }
/** /**

View File

@ -174,19 +174,13 @@ class CheckSetupController extends Controller {
* @return string * @return string
*/ */
private function isUsedTlsLibOutdated() { private function isUsedTlsLibOutdated() {
// Appstore is disabled by default in EE
$appStoreDefault = false;
if (\OC_Util::getEditionString() === '') {
$appStoreDefault = true;
}
// Don't run check when: // Don't run check when:
// 1. Server has `has_internet_connection` set to false // 1. Server has `has_internet_connection` set to false
// 2. AppStore AND S2S is disabled // 2. AppStore AND S2S is disabled
if(!$this->config->getSystemValue('has_internet_connection', true)) { if(!$this->config->getSystemValue('has_internet_connection', true)) {
return ''; return '';
} }
if(!$this->config->getSystemValue('appstoreenabled', $appStoreDefault) if(!$this->config->getSystemValue('appstoreenabled', true)
&& $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no' && $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no'
&& $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') { && $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') {
return ''; return '';
@ -200,7 +194,7 @@ class CheckSetupController extends Controller {
} }
$features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); $features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing');
if(!$this->config->getSystemValue('appstoreenabled', $appStoreDefault)) { if(!$this->config->getSystemValue('appstoreenabled', true)) {
$features = (string)$this->l10n->t('Federated Cloud Sharing'); $features = (string)$this->l10n->t('Federated Cloud Sharing');
} }

View File

@ -157,12 +157,10 @@ if($_['passwordChangeSupported']) {
</option> </option>
<?php endforeach;?> <?php endforeach;?>
</select> </select>
<?php if (OC_Util::getEditionString() === ''): ?>
<a href="https://www.transifex.com/nextcloud/nextcloud/" <a href="https://www.transifex.com/nextcloud/nextcloud/"
target="_blank" rel="noreferrer"> target="_blank" rel="noreferrer">
<em><?php p($l->t('Help translate'));?></em> <em><?php p($l->t('Help translate'));?></em>
</a> </a>
<?php endif; ?>
</form> </form>
@ -181,7 +179,6 @@ if($_['passwordChangeSupported']) {
alt="<?php p($l->t('iOS app'));?>" /> alt="<?php p($l->t('iOS app'));?>" />
</a> </a>
<?php if (OC_Util::getEditionString() === ''): ?>
<p> <p>
<?php print_unescaped($l->t('If you want to support the project <?php print_unescaped($l->t('If you want to support the project
<a href="https://nextcloud.com/contribute" <a href="https://nextcloud.com/contribute"
@ -190,7 +187,6 @@ if($_['passwordChangeSupported']) {
<a href="https://nextcloud.com/contribute" <a href="https://nextcloud.com/contribute"
target="_blank" rel="noreferrer">spread the word</a>!'));?> target="_blank" rel="noreferrer">spread the word</a>!'));?>
</p> </p>
<?php endif; ?>
<?php if(OC_APP::isEnabled('firstrunwizard')) {?> <?php if(OC_APP::isEnabled('firstrunwizard')) {?>
<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p> <p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>

View File

@ -1,4 +1,3 @@
<?php if (OC_Util::getEditionString() === ''): ?>
<p> <p>
<?php print_unescaped(str_replace( <?php print_unescaped(str_replace(
[ [
@ -63,5 +62,3 @@
{newsletteropen}<img width="50" src="{mailimage}" title="{mailtext}" alt="{mailtext}">{linkclose}' {newsletteropen}<img width="50" src="{mailimage}" title="{mailtext}" alt="{mailtext}">{linkclose}'
)); ?> )); ?>
</p> </p>
<?php endif; ?>

View File

@ -43,7 +43,7 @@ try {
'maintenance' => $maintenance, 'maintenance' => $maintenance,
'version'=>implode('.', \OCP\Util::getVersion()), 'version'=>implode('.', \OCP\Util::getVersion()),
'versionstring'=>OC_Util::getVersionString(), 'versionstring'=>OC_Util::getVersionString(),
'edition'=> $installed ? OC_Util::getEditionString() : '', 'edition'=> '',
'productname'=>$defaults->getName()); 'productname'=>$defaults->getName());
if (OC::$CLI) { if (OC::$CLI) {
print_r($values); print_r($values);

View File

@ -508,12 +508,6 @@ class CheckSetupControllerTest extends TestCase {
} }
public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingEnabled() { public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingEnabled() {
// Appstore is disabled by default in EE
$appStoreDefault = false;
if (\OC_Util::getEditionString() === '') {
$appStoreDefault = true;
}
$this->config $this->config
->expects($this->at(0)) ->expects($this->at(0))
->method('getSystemValue') ->method('getSystemValue')
@ -522,7 +516,7 @@ class CheckSetupControllerTest extends TestCase {
$this->config $this->config
->expects($this->at(1)) ->expects($this->at(1))
->method('getSystemValue') ->method('getSystemValue')
->with('appstoreenabled', $appStoreDefault) ->with('appstoreenabled', true)
->will($this->returnValue(false)); ->will($this->returnValue(false));
$this->config $this->config
->expects($this->at(2)) ->expects($this->at(2))
@ -543,12 +537,6 @@ class CheckSetupControllerTest extends TestCase {
} }
public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingDisabled() { public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingDisabled() {
// Appstore is disabled by default in EE
$appStoreDefault = false;
if (\OC_Util::getEditionString() === '') {
$appStoreDefault = true;
}
$this->config $this->config
->expects($this->at(0)) ->expects($this->at(0))
->method('getSystemValue') ->method('getSystemValue')
@ -557,7 +545,7 @@ class CheckSetupControllerTest extends TestCase {
$this->config $this->config
->expects($this->at(1)) ->expects($this->at(1))
->method('getSystemValue') ->method('getSystemValue')
->with('appstoreenabled', $appStoreDefault) ->with('appstoreenabled', true)
->will($this->returnValue(false)); ->will($this->returnValue(false));
$this->config $this->config
->expects($this->at(2)) ->expects($this->at(2))

View File

@ -50,7 +50,7 @@ class VersionCheckTest extends \Test\TestCase {
* @return string * @return string
*/ */
private function buildUpdateUrl($baseUrl) { private function buildUpdateUrl($baseUrl) {
return $baseUrl . '?version='.implode('x', Util::getVersion()).'xinstalledatxlastupdatedatx'.\OC_Util::getChannel().'x'.\OC_Util::getEditionString().'x'; return $baseUrl . '?version='.implode('x', Util::getVersion()).'xinstalledatxlastupdatedatx'.\OC_Util::getChannel().'xx';
} }
public function testCheckInCache() { public function testCheckInCache() {

View File

@ -61,7 +61,7 @@ class UpdaterTest extends \Test\TestCase {
* @return string * @return string
*/ */
private function buildUpdateUrl($baseUrl) { private function buildUpdateUrl($baseUrl) {
return $baseUrl . '?version='.implode('x', \OCP\Util::getVersion()).'xinstalledatxlastupdatedatx'.\OC_Util::getChannel().'x'.\OC_Util::getEditionString().'x'; return $baseUrl . '?version='.implode('x', \OCP\Util::getVersion()).'xinstalledatxlastupdatedatx'.\OC_Util::getChannel().'xx';
} }
/** /**