summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/ajax
diff options
context:
space:
mode:
authorSam Tuke <samtuke@owncloud.com>2013-03-28 18:39:12 +0100
committerSam Tuke <samtuke@owncloud.com>2013-03-28 18:39:12 +0100
commitff6f52d5ec24a9c940f3e8b0dd2f731b1a42104e (patch)
treedfe4d38b0df8c91b9fd9a5189098590d102d1557 /apps/files_encryption/ajax
parent9ecfd07f23e7fe2924bee6103792c00c6ec3cb0a (diff)
parentdf31ee5a903efb288dcb217dc13591a4efd46572 (diff)
downloadnextcloud-server-ff6f52d5ec24a9c940f3e8b0dd2f731b1a42104e.tar.gz
nextcloud-server-ff6f52d5ec24a9c940f3e8b0dd2f731b1a42104e.zip
Merge branch 'master' into files_encryption
Conflicts: apps/files_encryption/hooks/hooks.php apps/files_encryption/lib/crypt.php apps/files_encryption/lib/keymanager.php
Diffstat (limited to 'apps/files_encryption/ajax')
-rw-r--r--apps/files_encryption/ajax/mode.php38
1 files changed, 0 insertions, 38 deletions
diff --git a/apps/files_encryption/ajax/mode.php b/apps/files_encryption/ajax/mode.php
deleted file mode 100644
index 64c5be94401..00000000000
--- a/apps/files_encryption/ajax/mode.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/**
- * Copyright (c) 2012, Bjoern Schiessle <schiessle@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or later.
- * See the COPYING-README file.
- */
-
-use OCA\Encryption\Keymanager;
-
-OCP\JSON::checkAppEnabled('files_encryption');
-OCP\JSON::checkLoggedIn();
-OCP\JSON::callCheck();
-
-$mode = $_POST['mode'];
-$changePasswd = false;
-$passwdChanged = false;
-
-if ( isset($_POST['newpasswd']) && isset($_POST['oldpasswd']) ) {
- $oldpasswd = $_POST['oldpasswd'];
- $newpasswd = $_POST['newpasswd'];
- $changePasswd = true;
- $passwdChanged = Keymanager::changePasswd($oldpasswd, $newpasswd);
-}
-
-$query = \OC_DB::prepare( "SELECT mode FROM *PREFIX*encryption WHERE uid = ?" );
-$result = $query->execute(array(\OCP\User::getUser()));
-
-if ($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( ?, ? )' );
-}
-
-if ( (!$changePasswd || $passwdChanged) && $query->execute(array($mode, \OCP\User::getUser())) ) {
- OCP\JSON::success();
-} else {
- OCP\JSON::error();
-} \ No newline at end of file