summaryrefslogtreecommitdiffstats
path: root/apps/encryption/tests/Crypto/EncryptionTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-11-22 20:52:10 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-11-22 20:52:10 +0100
commit68748d4f85dd23238aaafb787b1c341f0f2f0419 (patch)
tree7aab3a925dda8dcd6ef4e8c6fe04063abbadd6af /apps/encryption/tests/Crypto/EncryptionTest.php
parent21119633041d5ccae19975a58b0ae50ef5a8e33a (diff)
downloadnextcloud-server-68748d4f85dd23238aaafb787b1c341f0f2f0419.tar.gz
nextcloud-server-68748d4f85dd23238aaafb787b1c341f0f2f0419.zip
Some php-cs fixes
* Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/encryption/tests/Crypto/EncryptionTest.php')
-rw-r--r--apps/encryption/tests/Crypto/EncryptionTest.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/encryption/tests/Crypto/EncryptionTest.php b/apps/encryption/tests/Crypto/EncryptionTest.php
index 3e47b4b0750..1f628ff19c9 100644
--- a/apps/encryption/tests/Crypto/EncryptionTest.php
+++ b/apps/encryption/tests/Crypto/EncryptionTest.php
@@ -29,6 +29,7 @@ namespace OCA\Encryption\Tests\Crypto;
use OCA\Encryption\Crypto\Crypt;
use OCA\Encryption\Crypto\DecryptAll;
use OCA\Encryption\Crypto\EncryptAll;
+use OCA\Encryption\Crypto\Encryption;
use OCA\Encryption\Exceptions\PublicKeyMissingException;
use OCA\Encryption\KeyManager;
use OCA\Encryption\Session;
@@ -39,7 +40,6 @@ use OCP\ILogger;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
-use OCA\Encryption\Crypto\Encryption;
class EncryptionTest extends TestCase {
; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<?php
/**
 * Copyright (c) 2012 Thomas Tanghus <thomas@tanghus.net>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */

OC_JSON::checkAdminUser();

$l = OC_L10N::get('settings');

if(OC_Config::getValue('appstoreenabled', true)==false) {
	OCP\JSON::success(array('type' => 'external', 'data' => array()));
}

$enabledApps=OC_App::getEnabledApps();

if(is_null($enabledApps)) {
	OCP\JSON::error(array('data' => array('message' => $l->t('Unable to load list from App Store'))));
}

$apps=array();

// apps from external repo via OCS
$categoryNames=OC_OCSClient::getCategories();
if(is_array($categoryNames)) {
	$categories=array_keys($categoryNames);
	$page=0;
	$filter='approved';
	$externalApps=OC_OCSClient::getApplications($categories, $page, $filter);
	foreach($externalApps as $app) {
		// show only external apps that aren't enabled yet
		$local=false;
		foreach($enabledApps as $a) {
			if($a == $app['name']) {
				$local=true;
			}
		}

		if(!$local) {
			if($app['preview']=='') {
				$pre=OC_Helper::imagePath('settings', 'trans.png');
			} else {
				$pre=$app['preview'];
			}
			if($app['label']=='recommended') {
				$label='3rd Party';
			} else {
				$label='Recommended';
			}
			$apps[]=array(
				'name'=>$app['name'],
				'id'=>$app['id'],
				'active'=>false,
				'description'=>$app['description'],
				'author'=>$app['personid'],
				'license'=>$app['license'],
				'preview'=>$pre,
				'internal'=>false,
				'internallabel'=>$label,
				'update'=>false,
			);
		}
	}
}

OCP\JSON::success(array('type' => 'external', 'data' => $apps));