aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/ajax
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-02-09 18:01:38 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2013-02-09 18:01:38 +0100
commit7f58e2749537e000344dd886df5e103e06eefe91 (patch)
tree10a532583f9eaefd88e1edb6befd71bbb40fa3d5 /apps/files_encryption/ajax
parentb95bc663af4135eff12a6a0c97afe37859f35094 (diff)
downloadnextcloud-server-7f58e2749537e000344dd886df5e103e06eefe91.tar.gz
nextcloud-server-7f58e2749537e000344dd886df5e103e06eefe91.zip
cleanup - more to come after
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