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