]> source.dussan.org Git - nextcloud-server.git/commitdiff
Config file is more appropriate here
authorArthur Schiwon <blizzz@owncloud.com>
Wed, 21 Mar 2012 12:05:15 +0000 (13:05 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Wed, 21 Mar 2012 12:05:15 +0000 (13:05 +0100)
adjust default value

files/admin.php
files/templates/index.php
lib/files.php

index b9c26c465f3ebf84e314b9915b4328b51b8d8f70..1fe1ff55a4cf2c78e0b0ae17e08424f665956e7b 100644 (file)
@@ -35,16 +35,16 @@ if($_POST) {
        }
        if(isset($_POST['maxZipInputSize'])) {
                $maxZipInputSize=$_POST['maxZipInputSize'];
-               OC_Preferences::setValue('', 'files', 'maxZipInputSize', OC_Helper::computerFileSize($maxZipInputSize));
+               OC_Config::setValue('maxZipInputSize', OC_Helper::computerFileSize($maxZipInputSize));
        }
-       OC_Preferences::setValue('', 'files', 'allowZipDownload', isset($_POST['allowZipDownload']));
+       OC_Config::setValue('allowZipDownload', isset($_POST['allowZipDownload']));
 }else{
        $upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
        $post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
        $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
-       $allowZipDownload = intval(OC_Preferences::getValue('', 'files', 'allowZipDownload', 1));
-       $maxZipInputSize = OC_Helper::humanfilesize(OC_Preferences::getValue('', 'files', 'maxZipInputSize', OC_Helper::computerFileSize('800 MB')));
+       $maxZipInputSize = OC_Helper::humanfilesize(OC_Config::getValue('maxZipInputSize', OC_Helper::computerFileSize('800 MB')));
 }
+$allowZipDownload = intval(OC_Config::getValue('allowZipDownload', true));
 
 OC_App::setActiveNavigationEntry( "files_administration" );
 
index 497a0f36c0d1ac7b8d11b8f47deacde1a7525366..3302cfa9291d2dcb57a0ffd15f9f6e9037276aac 100644 (file)
@@ -40,7 +40,7 @@
                                <?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" id="select_all" /><?php } ?>
                                <span class='name'><?php echo $l->t( 'Name' ); ?></span>
                                <span class='selectedActions'>
-                               <?php if(OC_Preferences::getValue('', 'files', 'allowZipDownload', 1)) : ?>
+                               <?php if(OC_Config::getValue('allowZipDownload', true)) : ?>
                                        <a href="" title="<?php echo $l->t('Download')?>" class="download"><img class='svg' alt="Download" src="<?php echo image_path("core", "actions/download.svg"); ?>" /></a>
                                <?php endif; ?>
                                <a href="" title="Share" class="share"><img class='svg' alt="Share" src="<?php echo image_path("core", "actions/share.svg"); ?>" /></a>
@@ -70,4 +70,4 @@
 </div>
 
 <!-- config hints for javascript -->
-<input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php echo OC_Preferences::getValue('', 'files', 'allowZipDownload', 1); ?>" />
\ No newline at end of file
+<input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php echo intval(OC_Config::getValue('allowZipDownload', true)); ?>" />
\ No newline at end of file
index 662f0b597241de8fe95fb7e97026a3854aa986d8..57ebb9005ad5dcbe20ed68d0b9cf3fcf8feab177 100644 (file)
@@ -224,7 +224,7 @@ class OC_Files {
        * @param files $files
        */
        static function validateZipDownload($dir, $files) {
-               if(!OC_Preferences::getValue('', 'files', 'allowZipDownload', 1)) {
+               if(!OC_Config::getValue('allowZipDownload', true)) {
                        $l = new OC_L10N('files');
                        header("HTTP/1.0 409 Conflict");
                        $tmpl = new OC_Template( '', 'error', 'user' );
@@ -239,7 +239,7 @@ class OC_Files {
                        exit;
                }
 
-               $zipLimit = OC_Preferences::getValue('', 'files', 'maxZipInputSize', OC_Helper::computerFileSize('800 MB'));
+               $zipLimit = OC_Config::getValue('maxZipInputSize', OC_Helper::computerFileSize('800 MB'));
                if($zipLimit > 0) {
                        $totalsize = 0;
                        if(is_array($files)){