summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/appinfo/app.php
blob: 12920aa82917ac3e6e056e484fe5b2a5b00d0b4a (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

OC::$CLASSPATH['OCA\Encryption\Crypt'] = 'apps/files_encryption/lib/crypt.php';
OC::$CLASSPATH['OCA\Encryption\Hooks'] = 'apps/files_encryption/hooks/hooks.php';
OC::$CLASSPATH['OCA\Encryption\Util'] = 'apps/files_encryption/lib/util.php';
OC::$CLASSPATH['OCA\Encryption\Keymanager'] = 'apps/files_encryption/lib/keymanager.php';
OC::$CLASSPATH['OCA\Encryption\Stream'] = 'apps/files_encryption/lib/stream.php';
OC::$CLASSPATH['OCA\Encryption\Proxy'] = 'apps/files_encryption/lib/proxy.php';

OC_FileProxy::register(new OCA\Encryption\Proxy());

OCP\Util::connectHook('OC_User','post_login','OCA\Encryption\Hooks','login');
OCP\Util::connectHook('OC_Webdav_Properties', 'update', 'OCA\Encryption\Hooks', 'updateKeyfile');

stream_wrapper_register( 'crypt', 'OCA\Encryption\Stream');

if(  !isset( $_SESSION['enckey'] ) && OCP\User::isLoggedIn() && OCA\Encryption\Crypt::mode() == 'server' ) {

	// Force the user to re-log in if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled)
	OCP\User::logout();
	
	header("Location: ".OC::$WEBROOT.'/');
	
	exit();

}

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