code cleanup

remotes/origin/stable5
Bjoern Schiessle 13 years ago
parent 5996ea735a
commit 19b3109655
  1. 7
      apps/files_encryption/ajax/changemode.php
  2. 8
      apps/files_encryption/settings-personal.php
  3. 1
      apps/files_encryption/templates/settings-personal.php

@ -1,4 +1,9 @@
<?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( ?, ? )' );

@ -1,4 +1,10 @@
<?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;
?>

@ -1,4 +1,3 @@
<form id="encryption">
<fieldset class="personalblock">

Loading…
Cancel
Save