summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-03-13 11:18:39 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-03-13 11:18:39 +0100
commit40b28897857cf81bafb23223a7a34fd19de02b13 (patch)
treec63ea583b79df8e9cedbf2c75a3b1da94ef608fe /lib
parentc546f0bf46a51dc297be15aa1acbca5ed9a84de9 (diff)
downloadnextcloud-server-40b28897857cf81bafb23223a7a34fd19de02b13.tar.gz
nextcloud-server-40b28897857cf81bafb23223a7a34fd19de02b13.zip
shipped apps are now defined in core/shipped.json - the shipped tag in info.xml is ignored from now on - never trust an app :speak_no_evil:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/app.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index 9ae4ae30d74..29bcf153464 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -42,6 +42,7 @@ class OC_App {
static private $appTypes = array();
static private $loadedApps = array();
static private $altLogin = array();
+ private static $shippedApps = null;
/**
* clean the appId
@@ -182,12 +183,18 @@ class OC_App {
* Check if an app that is installed is a shipped app or installed from the appstore.
*/
public static function isShipped($appId) {
- $info = self::getAppInfo($appId);
- if (isset($info['shipped']) && $info['shipped'] == 'true') {
- return true;
- } else {
- return false;
+ if (is_null(self::$shippedApps)) {
+ $shippedJson = \OC::$SERVERROOT . '/core/shipped.json';
+ if (file_exists($shippedJson)) {
+ self::$shippedApps = json_decode(file_get_contents($shippedJson), true);
+ self::$shippedApps = self::$shippedApps['shippedApps'];
+ } else {
+ self::$shippedApps = ['files', 'files_encryption', 'files_external',
+ 'files_sharing', 'files_trashbin', 'files_versions', 'provisioning_api',
+ 'user_ldap', 'user_webdavauth'];
+ }
}
+ return in_array($appId, self::$shippedApps);
}
/**