summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/appinfo/app.php
blob: 2a30d0beb67af5316678d70e5c0e852b2c13a4f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

OC::$CLASSPATH['OC_Crypt'] = 'apps/files_encryption/lib/crypt.php';
OC::$CLASSPATH['OC_CryptStream'] = 'apps/files_encryption/lib/cryptstream.php';
OC::$CLASSPATH['OC_FileProxy_Encryption'] = 'apps/files_encryption/lib/proxy.php';

OC_FileProxy::register(new OC_FileProxy_Encryption());

OCP\Util::connectHook('OC_User', 'post_login', 'OC_Crypt', 'loginListener');

stream_wrapper_register('crypt', 'OC_CryptStream');

// force the user to re-loggin if the encryption key isn't unlocked
// (happens when a user is logged in before the encryption app is enabled)
if ( ! isset($_SESSION['enckey']) and OCP\User::isLoggedIn()) {
	OCP\User::logout();
	header("Location: ".OC::$WEBROOT.'/');
	exit();
}

OCP\App::registerAdmin('files_encryption', 'settings');