Skip to content
Snippets Groups Projects
Commit 19b31096 authored by Björn Schießle's avatar Björn Schießle
Browse files

code cleanup

parent 5996ea73
No related branches found
No related tags found
No related merge requests found
<?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.
*/
OCP\JSON::checkAppEnabled('files_encryption');
OCP\JSON::checkLoggedIn();
......@@ -9,7 +14,7 @@ $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()){
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( ?, ? )' );
......
<?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.
*/
$sysEncMode = \OC_Appconfig::getValue('files_encryption', 'mode', 'none');
......@@ -21,5 +27,3 @@ if ($sysEncMode == 'user') {
}
return null;
?>
\ No newline at end of file
<form id="encryption">
<fieldset class="personalblock">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment