summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/settings-personal.php
blob: 46efb61b0298eb6a0d62d1bd4f0c9139d2256600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
 * Copyright (c) 2013 Sam Tuke <samtuke@owncloud.com>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */

// Add CSS stylesheet
\OC_Util::addStyle( 'files_encryption', 'settings-personal' );
 
$tmpl = new OCP\Template( 'files_encryption', 'settings-personal');

$blackList = explode( ',', \OCP\Config::getAppValue( 'files_encryption', 'type_blacklist', '' ) );

// Add human readable message in case nothing is blacklisted
if ( 
	1 == count( $blackList )
	&& $blackList[0] == ''
) {
	
	// FIXME: Make this string translatable
	$blackList[0] = "(None - all filetypes will be encrypted)";

}

$user = \OCP\USER::getUser();
$view = new \OC_FilesystemView( '/' );
$util = new \OCA\Encryption\Util( $view, $user );

$recoveryAdminEnabled = OC_Appconfig::getValue( 'files_encryption', 'recoveryAdminEnabled' );
$recoveryEnabledForUser = $util->recoveryEnabledForUser();

\OCP\Util::addscript( 'files_encryption', 'settings-personal' );

$tmpl->assign( 'recoveryEnabled', $recoveryAdminEnabled );
$tmpl->assign( 'recoveryEnabledForUser', $recoveryEnabledForUser );
$tmpl->assign( 'blacklist', $blackList );

return $tmpl->fetchPage();

return null;