diff --git a/apps/files_encryption/ajax/adminrecovery.php b/apps/files_encryption/ajax/adminrecovery.php
index eeeaf4c6ed..c3c19943c0 100644
--- a/apps/files_encryption/ajax/adminrecovery.php
+++ b/apps/files_encryption/ajax/adminrecovery.php
@@ -1,5 +1,3 @@
-setValue( $app, $key, $value )
-
@@ -91,4 +89,5 @@ if (
}
-($return) ? OC_JSON::success() : OC_JSON::error();
\ No newline at end of file
+// Return success or failure
+( $return ) ? \OCP\JSON::success() : \OCP\JSON::error();
\ No newline at end of file
diff --git a/apps/files_encryption/ajax/encryptall.php b/apps/files_encryption/ajax/encryptall.php
new file mode 100644
index 0000000000..ce613ca443
--- /dev/null
+++ b/apps/files_encryption/ajax/encryptall.php
@@ -0,0 +1,40 @@
+
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ *
+ * @brief Script to handle manual trigger of \OCA\Encryption\Util{}->encryptAll()
+ */
+
+use OCA\Encryption;
+
+\OCP\JSON::checkAppEnabled( 'files_encryption' );
+\OCP\JSON::callCheck();
+
+$return = false;
+
+if (
+ isset( $_POST['encryptAll'] )
+ && ! empty( $_POST['userPassword'] )
+) {
+
+ $view = new \OC_FilesystemView( '' );
+ $userId = \OCP\User::getUser();
+ $util = new \OCA\Encryption\Util( $view, $userId );
+ $session = new \OCA\Encryption\Session( $view );
+ $publicKey = \OCA\Encryption\Keymanager::getPublicKey( $view, $userId );
+ $path = '/' . $userId . '/' . 'files';
+
+ $util->encryptAll( $publicKey, $path, $session->getLegacyKey(), $_POST['userPassword'] );
+
+ $return = true;
+
+} else {
+
+ $return = false;
+
+}
+
+// Return success or failure
+( $return ) ? \OCP\JSON::success() : \OCP\JSON::error();
\ No newline at end of file
diff --git a/apps/files_encryption/ajax/userrecovery.php b/apps/files_encryption/ajax/userrecovery.php
index f72be3181e..85a799011d 100644
--- a/apps/files_encryption/ajax/userrecovery.php
+++ b/apps/files_encryption/ajax/userrecovery.php
@@ -1,5 +1,3 @@
-setValue( $app, $key, $value )
-
@@ -13,6 +11,7 @@ use OCA\Encryption;
\OCP\JSON::checkLoggedIn();
\OCP\JSON::checkAppEnabled( 'files_encryption' );
+\OCP\JSON::callCheck();
if (
isset( $_POST['userEnableRecovery'] )
@@ -24,16 +23,13 @@ if (
$util = new \OCA\Encryption\Util( $view, $userId );
// Save recovery preference to DB
- $result = $util->setRecoveryForUser( $_POST['userEnableRecovery'] );
+ $return = $util->setRecoveryForUser( $_POST['userEnableRecovery'] );
- if ( $result ) {
+} else {
+
+ $return = false;
- \OCP\JSON::success();
-
- } else {
-
- \OCP\JSON::error();
-
- }
-
-}
\ No newline at end of file
+}
+
+// Return success or failure
+( $return ) ? \OCP\JSON::success() : \OCP\JSON::error();
\ No newline at end of file
diff --git a/apps/files_encryption/css/settings-personal.css b/apps/files_encryption/css/settings-personal.css
new file mode 100644
index 0000000000..4ee0acc976
--- /dev/null
+++ b/apps/files_encryption/css/settings-personal.css
@@ -0,0 +1,10 @@
+/* Copyright (c) 2013, Sam Tuke,
+
+
+ t( "Use this if you suspect that you still have files which are unencrypted, or encrypted using ownCloud 4 or older." ) ); ?>
+
+
+
+
+