diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2012-08-02 10:39:30 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2012-08-02 10:40:32 +0200 |
commit | 6b058cd3594d80a27097b04507355b219f4726e4 (patch) | |
tree | 9ed88fd5c66e67ba253becbf555e29c4d315270e /apps/files_encryption/ajax | |
parent | c4d1ad1b7d4507e387a5833622b4831044eb9e09 (diff) | |
download | nextcloud-server-6b058cd3594d80a27097b04507355b219f4726e4.tar.gz nextcloud-server-6b058cd3594d80a27097b04507355b219f4726e4.zip |
allow user to choose encryption mode
Diffstat (limited to 'apps/files_encryption/ajax')
-rw-r--r-- | apps/files_encryption/ajax/changemode.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/files_encryption/ajax/changemode.php b/apps/files_encryption/ajax/changemode.php new file mode 100644 index 00000000000..0e6678e4bba --- /dev/null +++ b/apps/files_encryption/ajax/changemode.php @@ -0,0 +1,17 @@ +<?php +
+OCP\JSON::checkAppEnabled('files_encryption');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::callCheck();
+ +$mode = $_POST['mode']; + +$query = \OC_DB::prepare( "SELECT mode FROM *PREFIX*encryption WHERE uid = ?" );
+$result = $query->execute(array(\OCP\User::getUser()));
+ +if ($row = $result->fetchRow()){ + $query = OC_DB::prepare( 'UPDATE *PREFIX*encryption SET mode = ? WHERE uid = ?' ); +} else { + $query = OC_DB::prepare( 'INSERT INTO *PREFIX*encryption ( mode, uid ) VALUES( ?, ? )' ); +} +$query->execute(array($mode, \OCP\User::getUser()));
\ No newline at end of file |