nextcloud/apps/files_encryption/settings-personal.php

44 lines
1.3 KiB
PHP
Raw Normal View History

2012-08-02 12:39:30 +04:00
<?php
2012-08-02 15:55:23 +04:00
/**
* Copyright (c) 2013 Sam Tuke <samtuke@owncloud.com>
2012-08-02 15:55:23 +04:00
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
2012-08-02 12:39:30 +04:00
// Add CSS stylesheet
\OC_Util::addStyle( 'files_encryption', 'settings-personal' );
$tmpl = new OCP\Template( 'files_encryption', 'settings-personal');
2012-08-02 12:39:30 +04:00
$blackList = explode( ',', \OCP\Config::getAppValue( 'files_encryption', 'type_blacklist', '' ) );
2012-08-02 12:39:30 +04:00
// 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' );
\OCP\Util::addScript( 'settings', 'personal' );
$tmpl->assign( 'recoveryEnabled', $recoveryAdminEnabled );
$tmpl->assign( 'recoveryEnabledForUser', $recoveryEnabledForUser );
$tmpl->assign( 'blacklist', $blackList );
2012-08-02 12:39:30 +04:00
return $tmpl->fetchPage();
2012-08-02 12:39:30 +04:00
return null;