set defaultEnabled in shipped.jsontags/v25.0.0beta7
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Arthur Schiwon</author> | <author>Arthur Schiwon</author> | ||||
<author>Vincent Petry</author> | <author>Vincent Petry</author> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<logging/> | <logging/> | ||||
</types> | </types> |
<types> | <types> | ||||
<dav/> | <dav/> | ||||
</types> | </types> | ||||
<default_enable/> | |||||
<category>integration</category> | <category>integration</category> | ||||
<category>social</category> | <category>social</category> | ||||
<bugs>https://github.com/nextcloud/server/issues</bugs> | <bugs>https://github.com/nextcloud/server/issues</bugs> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Julius Härtl</author> | <author>Julius Härtl</author> | ||||
<namespace>Dashboard</namespace> | <namespace>Dashboard</namespace> | ||||
<default_enable/> | |||||
<category>customization</category> | <category>customization</category> | ||||
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>owncloud.org</author> | <author>owncloud.org</author> | ||||
<namespace>DAV</namespace> | <namespace>DAV</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<filesystem/> | <filesystem/> | ||||
</types> | </types> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Bjoern Schiessle</author> | <author>Bjoern Schiessle</author> | ||||
<namespace>Federation</namespace> | <namespace>Federation</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<authentication/> | <authentication/> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Robin Appelman</author> | <author>Robin Appelman</author> | ||||
<author>Vincent Petry</author> | <author>Vincent Petry</author> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<filesystem/> | <filesystem/> | ||||
</types> | </types> |
<author>Michael Gapczynski</author> | <author>Michael Gapczynski</author> | ||||
<author>Bjoern Schiessle</author> | <author>Bjoern Schiessle</author> | ||||
<namespace>Files_Sharing</namespace> | <namespace>Files_Sharing</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<filesystem/> | <filesystem/> | ||||
</types> | </types> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Bjoern Schiessle</author> | <author>Bjoern Schiessle</author> | ||||
<namespace>Files_Trashbin</namespace> | <namespace>Files_Trashbin</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<filesystem/> | <filesystem/> | ||||
<dav/> | <dav/> |
<author>Frank Karlitschek</author> | <author>Frank Karlitschek</author> | ||||
<author>Bjoern Schiessle</author> | <author>Bjoern Schiessle</author> | ||||
<namespace>Files_Versions</namespace> | <namespace>Files_Versions</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<filesystem/> | <filesystem/> | ||||
<dav/> | <dav/> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Bjoern Schiessle</author> | <author>Bjoern Schiessle</author> | ||||
<namespace>LookupServerConnector</namespace> | <namespace>LookupServerConnector</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<authentication/> | <authentication/> | ||||
</types> | </types> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Lukas Reschke</author> | <author>Lukas Reschke</author> | ||||
<namespace>OAuth2</namespace> | <namespace>OAuth2</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<authentication/> | <authentication/> | ||||
</types> | </types> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Tom Needham</author> | <author>Tom Needham</author> | ||||
<namespace>Provisioning_API</namespace> | <namespace>Provisioning_API</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<prevent_group_restriction/> | <prevent_group_restriction/> | ||||
</types> | </types> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Nextcloud</author> | <author>Nextcloud</author> | ||||
<namespace>Settings</namespace> | <namespace>Settings</namespace> | ||||
<default_enable/> | |||||
<category>customization</category> | <category>customization</category> | ||||
<bugs>https://github.com/nextcloud/server/issues</bugs> | <bugs>https://github.com/nextcloud/server/issues</bugs> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Bjoern Schiessle</author> | <author>Bjoern Schiessle</author> | ||||
<namespace>ShareByMail</namespace> | <namespace>ShareByMail</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<filesystem/> | <filesystem/> |
<author>Vincent Petry</author> | <author>Vincent Petry</author> | ||||
<author>Joas Schilling</author> | <author>Joas Schilling</author> | ||||
<namespace>SystemTags</namespace> | <namespace>SystemTags</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<logging/> | <logging/> | ||||
</types> | </types> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Nextcloud</author> | <author>Nextcloud</author> | ||||
<namespace>Theming</namespace> | <namespace>Theming</namespace> | ||||
<default_enable/> | |||||
<types> | <types> | ||||
<logging/> | <logging/> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author>Lukas Reschke</author> | <author>Lukas Reschke</author> | ||||
<namespace>UpdateNotification</namespace> | <namespace>UpdateNotification</namespace> | ||||
<default_enable/> | |||||
<category>monitoring</category> | <category>monitoring</category> | ||||
<bugs>https://github.com/nextcloud/server/issues</bugs> | <bugs>https://github.com/nextcloud/server/issues</bugs> | ||||
<dependencies> | <dependencies> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author mail="oc.list@georgehrke.com" >Georg Ehrke</author> | <author mail="oc.list@georgehrke.com" >Georg Ehrke</author> | ||||
<namespace>UserStatus</namespace> | <namespace>UserStatus</namespace> | ||||
<default_enable/> | |||||
<category>social</category> | <category>social</category> | ||||
<bugs>https://github.com/nextcloud/server</bugs> | <bugs>https://github.com/nextcloud/server</bugs> | ||||
<navigations> | <navigations> |
<licence>agpl</licence> | <licence>agpl</licence> | ||||
<author mail="eneiluj@posteo.net">Julien Veyssier</author> | <author mail="eneiluj@posteo.net">Julien Veyssier</author> | ||||
<namespace>WeatherStatus</namespace> | <namespace>WeatherStatus</namespace> | ||||
<default_enable/> | |||||
<category>integration</category> | <category>integration</category> | ||||
<category>dashboard</category> | <category>dashboard</category> | ||||
<bugs>https://github.com/nextcloud/server</bugs> | <bugs>https://github.com/nextcloud/server</bugs> |
"weather_status", | "weather_status", | ||||
"workflowengine" | "workflowengine" | ||||
], | ], | ||||
"defaultEnabled": [ | |||||
"activity", | |||||
"circles", | |||||
"comments", | |||||
"contactsinteraction", | |||||
"dashboard", | |||||
"dav", | |||||
"federation", | |||||
"files", | |||||
"files_pdfviewer", | |||||
"files_rightclick", | |||||
"files_sharing", | |||||
"files_trashbin", | |||||
"files_versions", | |||||
"files_videoplayer", | |||||
"firstrunwizard", | |||||
"logreader", | |||||
"lookup_server_connector", | |||||
"nextcloud_announcements", | |||||
"notifications", | |||||
"oauth2", | |||||
"password_policy", | |||||
"photos", | |||||
"privacy", | |||||
"provisioning_api", | |||||
"recommendations", | |||||
"related_resources", | |||||
"serverinfo", | |||||
"settings", | |||||
"sharebymail", | |||||
"support", | |||||
"survey_client", | |||||
"systemtags", | |||||
"text", | |||||
"theming", | |||||
"updatenotification", | |||||
"user_status", | |||||
"viewer", | |||||
"weather_status" | |||||
], | |||||
"alwaysEnabled": [ | "alwaysEnabled": [ | ||||
"files", | "files", | ||||
"cloud_federation_api", | "cloud_federation_api", |
* @author Julius Haertl <jus@bitgrid.net> | * @author Julius Haertl <jus@bitgrid.net> | ||||
* @author Julius Härtl <jus@bitgrid.net> | * @author Julius Härtl <jus@bitgrid.net> | ||||
* @author Lukas Reschke <lukas@statuscode.ch> | * @author Lukas Reschke <lukas@statuscode.ch> | ||||
* @author Maxence Lange <maxence@artificial-owl.com> | |||||
* @author Morris Jobke <hey@morrisjobke.de> | * @author Morris Jobke <hey@morrisjobke.de> | ||||
* @author Robin Appelman <robin@icewind.nl> | * @author Robin Appelman <robin@icewind.nl> | ||||
* @author Roeland Jago Douma <roeland@famdouma.nl> | * @author Roeland Jago Douma <roeland@famdouma.nl> | ||||
/** @var string[] */ | /** @var string[] */ | ||||
private $shippedApps; | private $shippedApps; | ||||
/** @var string[] */ | |||||
private $alwaysEnabled; | |||||
private array $alwaysEnabled = []; | |||||
private array $defaultEnabled = []; | |||||
/** @var array */ | /** @var array */ | ||||
private $appInfos = []; | private $appInfos = []; | ||||
$content = json_decode(file_get_contents($shippedJson), true); | $content = json_decode(file_get_contents($shippedJson), true); | ||||
$this->shippedApps = $content['shippedApps']; | $this->shippedApps = $content['shippedApps']; | ||||
$this->alwaysEnabled = $content['alwaysEnabled']; | $this->alwaysEnabled = $content['alwaysEnabled']; | ||||
$this->defaultEnabled = $content['defaultEnabled']; | |||||
} | } | ||||
} | } | ||||
$this->loadShippedJson(); | $this->loadShippedJson(); | ||||
return $this->alwaysEnabled; | return $this->alwaysEnabled; | ||||
} | } | ||||
/** | |||||
* @inheritdoc | |||||
*/ | |||||
public function isDefaultEnabled(string $appId): bool { | |||||
return (in_array($appId, $this->getDefaultEnabledApps())); | |||||
} | |||||
/** | |||||
* @inheritdoc | |||||
*/ | |||||
public function getDefaultEnabledApps():array { | |||||
$this->loadShippedJson(); | |||||
return $this->defaultEnabled; | |||||
} | |||||
} | } |
if ($filename[0] !== '.' and is_dir($app_dir['path']."/$filename")) { | if ($filename[0] !== '.' and is_dir($app_dir['path']."/$filename")) { | ||||
if (file_exists($app_dir['path']."/$filename/appinfo/info.xml")) { | if (file_exists($app_dir['path']."/$filename/appinfo/info.xml")) { | ||||
if ($config->getAppValue($filename, "installed_version", null) === null) { | if ($config->getAppValue($filename, "installed_version", null) === null) { | ||||
$info = OC_App::getAppInfo($filename); | |||||
$enabled = isset($info['default_enable']); | |||||
$enabled = $appManager->isDefaultEnabled($filename); | |||||
if (($enabled || in_array($filename, $appManager->getAlwaysEnabledApps())) | if (($enabled || in_array($filename, $appManager->getAlwaysEnabledApps())) | ||||
&& $config->getAppValue($filename, 'enabled') !== 'no') { | && $config->getAppValue($filename, 'enabled') !== 'no') { | ||||
if ($softErrors) { | if ($softErrors) { |
*/ | */ | ||||
public function isInstalled($appId); | public function isInstalled($appId); | ||||
/** | |||||
* Check if an app should be enabled by default | |||||
* | |||||
* Notice: This actually checks if the app should be enabled by default | |||||
* and not if currently installed/enabled | |||||
* | |||||
* @param string $appId ID of the app | |||||
* @since 25.0.0 | |||||
*/ | |||||
public function isDefaultEnabled(string $appId):bool; | |||||
/** | /** | ||||
* Enable an app for every user | * Enable an app for every user | ||||
* | * | ||||
*/ | */ | ||||
public function getAlwaysEnabledApps(); | public function getAlwaysEnabledApps(); | ||||
/** | |||||
* @return string[] app IDs | |||||
* @since 25.0.0 | |||||
*/ | |||||
public function getDefaultEnabledApps(): array; | |||||
/** | /** | ||||
* @param \OCP\IGroup $group | * @param \OCP\IGroup $group | ||||
* @return String[] | * @return String[] |
*/ | */ | ||||
public function iSeeTheAppBundles() { | public function iSeeTheAppBundles() { | ||||
Assert::assertTrue( | Assert::assertTrue( | ||||
$this->actor->find(self::rowForApp('Auditing / Logging'), 2)->isVisible() | |||||
$this->actor->find(self::rowForApp('Auditing / Logging'), 10)->isVisible() | |||||
); | ); | ||||
Assert::assertTrue( | Assert::assertTrue( | ||||
$this->actor->find(self::rowForApp('LDAP user and group backend'), 2)->isVisible() | $this->actor->find(self::rowForApp('LDAP user and group backend'), 2)->isVisible() |