fix for previous workaround

This commit is contained in:
Florin Peter 2013-05-15 14:32:50 +02:00
parent 5b160edebb
commit 1fbdc3ce8f
1 changed files with 20 additions and 19 deletions

View File

@ -26,26 +26,27 @@ OCA\Encryption\Helper::registerFilesystemHooks();
stream_wrapper_register( 'crypt', 'OCA\Encryption\Stream' ); stream_wrapper_register( 'crypt', 'OCA\Encryption\Stream' );
$view = new OC_FilesystemView( '/' ); // check if we are logged in
if (OCP\User::isLoggedIn()) {
$view = new OC_FilesystemView('/');
$session = new \OCA\Encryption\Session($view);
//$session = new \OCA\Encryption\Session( $view ); // check if user has a private key
// if (
//if ( !$session->getPrivateKey(\OCP\USER::getUser())
// ! $session->getPrivateKey( \OCP\USER::getUser() ) && OCA\Encryption\Crypt::mode() === 'server'
// && OCP\User::isLoggedIn() ) {
// && OCA\Encryption\Crypt::mode() == 'server'
//) { // Force the user to log-in again if the encryption key isn't unlocked
// // (happens when a user is logged in before the encryption app is
// // Force the user to log-in again if the encryption key isn't unlocked // enabled)
// // (happens when a user is logged in before the encryption app is OCP\User::logout();
// // enabled)
// OCP\User::logout(); header("Location: " . OC::$WEBROOT . '/');
//
// header( "Location: " . OC::$WEBROOT.'/' ); exit();
// }
// exit(); }
//
//}
// Register settings scripts // Register settings scripts
OCP\App::registerAdmin( 'files_encryption', 'settings-admin' ); OCP\App::registerAdmin( 'files_encryption', 'settings-admin' );