Esempio n. 1
0
$tmpl->assign('certs', $certificateManager->listCertificates());
$tmpl->assign('showCertificates', $enableCertImport);
$tmpl->assign('urlGenerator', $urlGenerator);
// Get array of group ids for this user
$groups = \OC::$server->getGroupManager()->getUserIdGroups(OC_User::getUser());
$groups2 = array_map(function ($group) {
    return $group->getGID();
}, $groups);
sort($groups2);
$tmpl->assign('groups', $groups2);
// add hardcoded forms from the template
$l = \OC::$server->getL10N('settings');
$formsAndMore = [];
$formsAndMore[] = ['anchor' => 'avatar', 'section-name' => $l->t('Personal info')];
$formsAndMore[] = ['anchor' => 'clientsbox', 'section-name' => $l->t('Sync clients')];
$forms = OC_App::getForms('personal');
// add bottom hardcoded forms from the template
if ($enableCertImport) {
    $certificatesTemplate = new OC_Template('settings', 'certificates');
    $certificatesTemplate->assign('type', 'personal');
    $certificatesTemplate->assign('uploadRoute', 'settings.Certificate.addPersonalRootCertificate');
    $certificatesTemplate->assign('certs', $certificateManager->listCertificates());
    $certificatesTemplate->assign('urlGenerator', $urlGenerator);
    $forms[] = $certificatesTemplate->fetchPage();
}
$formsMap = array_map(function ($form) {
    if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) {
        $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]);
        $sectionName = str_replace('</h2>', '', $sectionName);
        $anchor = strtolower($sectionName);
        $anchor = str_replace(' ', '-', $anchor);
$path = getenv('PATH');
$template->assign('getenvServerNotWorking', empty($path));
// warn if Windows is used
$template->assign('WindowsWarning', OC_Util::runningOnWindows());
// warn if outdated version of a memcache module is used
$caches = ['apcu' => ['name' => $l->t('APCu'), 'version' => '4.0.6'], 'redis' => ['name' => $l->t('Redis'), 'version' => '2.2.5']];
$outdatedCaches = [];
foreach ($caches as $php_module => $data) {
    $isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<');
    if ($isOutdated) {
        $outdatedCaches[$php_module] = $data;
    }
}
$template->assign('OutdatedCacheWarning', $outdatedCaches);
// add hardcoded forms from the template
$forms = OC_App::getForms('admin');
$formsAndMore = array();
if ($request->getServerProtocol() !== 'https' || !OC_Util::isAnnotationsWorking() || $suggestedOverwriteCliUrl || !OC_Util::isSetLocaleWorking() || !OC_Util::fileInfoLoaded() || $databaseOverload) {
    $formsAndMore[] = array('anchor' => 'security-warning', 'section-name' => $l->t('Security & setup warnings'));
}
$formsAndMore[] = array('anchor' => 'shareAPI', 'section-name' => $l->t('Sharing'));
$formsAndMore[] = ['anchor' => 'encryptionAPI', 'section-name' => $l->t('Server-side encryption')];
// Prioritize fileSharingSettings and files_external and move updater to the version
$fileSharingSettings = $filesExternal = $updaterAppPanel = $ocDefaultEncryptionModulePanel = '';
foreach ($forms as $index => $form) {
    if (strpos($form, 'id="fileSharingSettings"')) {
        $fileSharingSettings = $form;
        unset($forms[$index]);
        continue;
    }
    if (strpos($form, 'id="files_external"')) {
<?php

/**
 * Copyright (c) 2011, Robin Appelman <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */
require_once '../lib/base.php';
OC_Util::checkLoggedIn();
OC_Util::addStyle('settings', 'settings');
OC_App::setActiveNavigationEntry('settings');
$tmpl = new OC_Template('settings', 'settings', 'user');
$forms = OC_App::getForms('settings');
$tmpl->assign('forms', array());
foreach ($forms as $form) {
    $tmpl->append('forms', $form);
}
$tmpl->printPage();