示例#1
0
$htaccessWorking = getenv('htaccessWorking') == 'true';
$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size));
if ($_POST && OC_Util::isCallRegistered()) {
    if (isset($_POST['maxUploadSize'])) {
        if (($setMaxSize = OC_Files::setUploadLimit(OCP\Util::computerFileSize($_POST['maxUploadSize']))) !== false) {
            $maxUploadFilesize = OCP\Util::humanFileSize($setMaxSize);
        }
    }
    if (isset($_POST['maxZipInputSize'])) {
        $maxZipInputSize = $_POST['maxZipInputSize'];
        OCP\Config::setSystemValue('maxZipInputSize', OCP\Util::computerFileSize($maxZipInputSize));
    }
    if (isset($_POST['submitFilesAdminSettings'])) {
        OCP\Config::setSystemValue('allowZipDownload', isset($_POST['allowZipDownload']));
    }
}
$maxZipInputSizeDefault = OCP\Util::computerFileSize('800 MB');
$maxZipInputSize = OCP\Util::humanFileSize(OCP\Config::getSystemValue('maxZipInputSize', $maxZipInputSizeDefault));
$allowZipDownload = intval(OCP\Config::getSystemValue('allowZipDownload', true));
OCP\App::setActiveNavigationEntry("files_administration");
$htaccessWritable = is_writable(OC::$SERVERROOT . '/.htaccess');
$tmpl = new OCP\Template('files', 'admin');
$tmpl->assign('uploadChangable', $htaccessWorking and $htaccessWritable);
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
// max possible makes only sense on a 32 bit system
$tmpl->assign('displayMaxPossibleUploadSize', PHP_INT_SIZE === 4);
$tmpl->assign('maxPossibleUploadSize', OCP\Util::humanFileSize(PHP_INT_MAX));
$tmpl->assign('allowZipDownload', $allowZipDownload);
$tmpl->assign('maxZipInputSize', $maxZipInputSize);
示例#2
0
文件: install.php 项目: kenwi/core
<?php

/**
 * @author Arthur Schiwon <*****@*****.**>
 * @author Christopher Schäpers <*****@*****.**>
 * @author Joas Schilling <*****@*****.**>
 *
 * @copyright Copyright (c) 2016, ownCloud, Inc.
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */
$state = OCP\Config::getSystemValue('ldapIgnoreNamingRules', 'doSet');
if ($state === 'doSet') {
    OCP\Config::setSystemValue('ldapIgnoreNamingRules', false);
}
OCP\Backgroundjob::registerJob('OCA\\user_ldap\\lib\\Jobs');
OCP\Backgroundjob::registerJob('\\OCA\\User_LDAP\\Jobs\\CleanUp');
示例#3
0
<?php

/**
 * Copyright (c) 2011, Frank Karlitschek <*****@*****.**>
 * Copyright (c) 2012, Florian Hülsmann <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */
OCP\User::checkAdminUser();
OCP\JSON::callCheck();
OCP\Config::setSystemValue('introspectionEndpoint', $_POST['introspectionEndpoint']);
echo 'true';
示例#4
0
<?php

/**
 * Copyright (c) 2011, Frank Karlitschek <*****@*****.**>
 * Copyright (c) 2012, Florian Hülsmann <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */
OCP\User::checkAdminUser();
OCP\JSON::callCheck();
OCP\Config::setSystemValue('tokenInfoEndpoint', $_POST['tokenInfoEndpoint']);
echo 'true';
示例#5
0
<?php

/**
 * Copyright (c) 2011, Frank Karlitschek <*****@*****.**>
 * Copyright (c) 2012, Florian Hülsmann <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */
OCP\User::checkAdminUser();
OCP\JSON::callCheck();
OCP\Config::setSystemValue('somesetting', $_POST['somesetting']);
echo 'true';
示例#6
0
<?php

OCP\JSON::checkAppEnabled('files_versions');
OCP\JSON::checkAdminUser();
OCP\JSON::callCheck();
if (OCP\Config::getSystemValue('versions', 'true') == 'true') {
    OCP\Config::setSystemValue('versions', 'false');
} else {
    OCP\Config::setSystemValue('versions', 'true');
}