summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/settings-personal.php
blob: 014288f2efe7d4dff3f79bf0a9a4775dd4e3ad63 (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
<?php
/**
 * Copyright (c) 2012 Bjoern Schiessle <schiessle@owncloud.com>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */

$sysEncMode = \OC_Appconfig::getValue('files_encryption', 'mode', 'none');

if ($sysEncMode == 'user') {

	$tmpl = new OCP\Template( 'files_encryption', 'settings-personal');

	$query = \OC_DB::prepare( "SELECT mode FROM *PREFIX*encryption WHERE uid = ?" );
	$result = $query->execute(array(\OCP\User::getUser()));
	
	if ($row = $result->fetchRow()){
		$mode = $row['mode'];
	} else {
		$mode = 'none';
	}
	
	OCP\Util::addscript('files_encryption','settings-personal');
	$tmpl->assign('encryption_mode', $mode);
	return $tmpl->fetchPage();
}

return null;